Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sound/soc/codecs/hdac_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2119,6 +2119,7 @@ static int hdac_hdmi_runtime_suspend(struct device *dev)
return -EIO;
}

snd_hdac_codec_link_down(hdev);
snd_hdac_ext_bus_link_put(bus, hlink);

snd_hdac_display_power(bus, hdev->addr, false);
Expand All @@ -2145,6 +2146,7 @@ static int hdac_hdmi_runtime_resume(struct device *dev)
}

snd_hdac_ext_bus_link_get(bus, hlink);
snd_hdac_codec_link_up(hdev);

snd_hdac_display_power(bus, hdev->addr, true);

Expand Down
1 change: 1 addition & 0 deletions sound/soc/sof/intel/apl.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const struct snd_sof_dsp_ops sof_apl_ops = {
.resume = hda_dsp_resume,
.runtime_suspend = hda_dsp_runtime_suspend,
.runtime_resume = hda_dsp_runtime_resume,
.runtime_idle = hda_dsp_runtime_idle,
.set_hw_params_upon_resume = hda_dsp_set_hw_params_upon_resume,
};
EXPORT_SYMBOL(sof_apl_ops);
Expand Down
1 change: 1 addition & 0 deletions sound/soc/sof/intel/cnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ const struct snd_sof_dsp_ops sof_cnl_ops = {
.resume = hda_dsp_resume,
.runtime_suspend = hda_dsp_runtime_suspend,
.runtime_resume = hda_dsp_runtime_resume,
.runtime_idle = hda_dsp_runtime_idle,
.set_hw_params_upon_resume = hda_dsp_set_hw_params_upon_resume,
};
EXPORT_SYMBOL(sof_cnl_ops);
Expand Down
13 changes: 13 additions & 0 deletions sound/soc/sof/intel/hda-dsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,19 @@ int hda_dsp_runtime_resume(struct snd_sof_dev *sdev)
return hda_resume(sdev, true);
}

int hda_dsp_runtime_idle(struct snd_sof_dev *sdev)
{
struct hdac_bus *hbus = sof_to_bus(sdev);

if (hbus->codec_powered) {
dev_dbg(sdev->dev, "some codecs still powered (%08X), not idle\n",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here please change %08X to %lX for I got warning with your patch

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RanderWang Thanks! The cast should avoid the warning, but agreed better to solve this without any cast. I'll upload an updated version.

(unsigned int)hbus->codec_powered);
return -EBUSY;
}

return 0;
}

int hda_dsp_runtime_suspend(struct snd_sof_dev *sdev)
{
/* stop hda controller and power dsp off */
Expand Down
1 change: 1 addition & 0 deletions sound/soc/sof/intel/hda.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ int hda_dsp_suspend(struct snd_sof_dev *sdev);
int hda_dsp_resume(struct snd_sof_dev *sdev);
int hda_dsp_runtime_suspend(struct snd_sof_dev *sdev);
int hda_dsp_runtime_resume(struct snd_sof_dev *sdev);
int hda_dsp_runtime_idle(struct snd_sof_dev *sdev);
int hda_dsp_set_hw_params_upon_resume(struct snd_sof_dev *sdev);
void hda_dsp_dump_skl(struct snd_sof_dev *sdev, u32 flags);
void hda_dsp_dump(struct snd_sof_dev *sdev, u32 flags);
Expand Down
8 changes: 8 additions & 0 deletions sound/soc/sof/ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ static inline int snd_sof_dsp_runtime_suspend(struct snd_sof_dev *sdev)
return 0;
}

static inline int snd_sof_dsp_runtime_idle(struct snd_sof_dev *sdev)
{
if (sof_ops(sdev)->runtime_idle)
return sof_ops(sdev)->runtime_idle(sdev);

return 0;
}

static inline int snd_sof_dsp_hw_params_upon_resume(struct snd_sof_dev *sdev)
{
if (sof_ops(sdev)->set_hw_params_upon_resume)
Expand Down
8 changes: 8 additions & 0 deletions sound/soc/sof/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,14 @@ int snd_sof_runtime_suspend(struct device *dev)
}
EXPORT_SYMBOL(snd_sof_runtime_suspend);

int snd_sof_runtime_idle(struct device *dev)
{
struct snd_sof_dev *sdev = dev_get_drvdata(dev);

return snd_sof_dsp_runtime_idle(sdev);
}
EXPORT_SYMBOL(snd_sof_runtime_idle);

int snd_sof_runtime_resume(struct device *dev)
{
return sof_resume(dev, true);
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sof/sof-acpi-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static const struct sof_dev_desc sof_acpi_cherrytrail_desc = {
static const struct dev_pm_ops sof_acpi_pm = {
SET_SYSTEM_SLEEP_PM_OPS(snd_sof_suspend, snd_sof_resume)
SET_RUNTIME_PM_OPS(snd_sof_runtime_suspend, snd_sof_runtime_resume,
NULL)
snd_sof_runtime_idle)
};

static void sof_acpi_probe_complete(struct device *dev)
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sof/sof-pci-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static const struct sof_dev_desc kbl_desc = {
static const struct dev_pm_ops sof_pci_pm = {
SET_SYSTEM_SLEEP_PM_OPS(snd_sof_suspend, snd_sof_resume)
SET_RUNTIME_PM_OPS(snd_sof_runtime_suspend, snd_sof_runtime_resume,
NULL)
snd_sof_runtime_idle)
};

static void sof_pci_probe_complete(struct device *dev)
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/sof/sof-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ struct snd_sof_dsp_ops {
int (*resume)(struct snd_sof_dev *sof_dev); /* optional */
int (*runtime_suspend)(struct snd_sof_dev *sof_dev); /* optional */
int (*runtime_resume)(struct snd_sof_dev *sof_dev); /* optional */
int (*runtime_idle)(struct snd_sof_dev *sof_dev); /* optional */
int (*set_hw_params_upon_resume)(struct snd_sof_dev *sdev); /* optional */

/* DSP clocking */
Expand Down Expand Up @@ -446,6 +447,7 @@ int snd_sof_device_remove(struct device *dev);

int snd_sof_runtime_suspend(struct device *dev);
int snd_sof_runtime_resume(struct device *dev);
int snd_sof_runtime_idle(struct device *dev);
int snd_sof_resume(struct device *dev);
int snd_sof_suspend(struct device *dev);

Expand Down