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
3 changes: 3 additions & 0 deletions sound/soc/intel/boards/bytcht_cx2072x.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ static int snd_byt_cht_cx2072x_probe(struct platform_device *pdev)
static struct platform_driver snd_byt_cht_cx2072x_driver = {
.driver = {
.name = "bytcht_cx2072x",
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
.pm = &snd_soc_pm_ops,
#endif
},
.probe = snd_byt_cht_cx2072x_probe,
};
Expand Down
3 changes: 3 additions & 0 deletions sound/soc/intel/boards/bytcht_da7213.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ static int bytcht_da7213_probe(struct platform_device *pdev)
static struct platform_driver bytcht_da7213_driver = {
.driver = {
.name = "bytcht_da7213",
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
.pm = &snd_soc_pm_ops,
#endif
},
.probe = bytcht_da7213_probe,
};
Expand Down
3 changes: 3 additions & 0 deletions sound/soc/intel/boards/bytcht_es8316.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,9 @@ static int snd_byt_cht_es8316_mc_remove(struct platform_device *pdev)
static struct platform_driver snd_byt_cht_es8316_mc_driver = {
.driver = {
.name = "bytcht_es8316",
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
.pm = &snd_soc_pm_ops,
#endif
},
.probe = snd_byt_cht_es8316_mc_probe,
.remove = snd_byt_cht_es8316_mc_remove,
Expand Down
7 changes: 3 additions & 4 deletions sound/soc/intel/boards/bytcr_rt5640.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,9 +898,6 @@ static int byt_rt5640_init(struct snd_soc_pcm_runtime *runtime)
if (ret)
return ret;

snd_soc_dapm_ignore_suspend(&card->dapm, "Headphone");
snd_soc_dapm_ignore_suspend(&card->dapm, "Speaker");

if (byt_rt5640_quirk & BYT_RT5640_MCLK_EN) {
/*
* The firmware might enable the clock at
Expand Down Expand Up @@ -1053,7 +1050,6 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBS_CFS,
.be_hw_params_fixup = byt_rt5640_codec_fixup,
.ignore_suspend = 1,
.nonatomic = true,
.dpcm_playback = 1,
.dpcm_capture = 1,
Expand Down Expand Up @@ -1311,6 +1307,9 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
static struct platform_driver snd_byt_rt5640_mc_driver = {
.driver = {
.name = "bytcr_rt5640",
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
.pm = &snd_soc_pm_ops,
#endif
},
.probe = snd_byt_rt5640_mc_probe,
};
Expand Down
6 changes: 3 additions & 3 deletions sound/soc/intel/boards/bytcr_rt5651.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,6 @@ static int byt_rt5651_init(struct snd_soc_pcm_runtime *runtime)
dev_err(card->dev, "unable to add card controls\n");
return ret;
}
snd_soc_dapm_ignore_suspend(&card->dapm, "Headphone");
snd_soc_dapm_ignore_suspend(&card->dapm, "Speaker");

if (byt_rt5651_quirk & BYT_RT5651_MCLK_EN) {
/*
Expand Down Expand Up @@ -775,7 +773,6 @@ static struct snd_soc_dai_link byt_rt5651_dais[] = {
.dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF
| SND_SOC_DAIFMT_CBS_CFS,
.be_hw_params_fixup = byt_rt5651_codec_fixup,
.ignore_suspend = 1,
.nonatomic = true,
.dpcm_playback = 1,
.dpcm_capture = 1,
Expand Down Expand Up @@ -1100,6 +1097,9 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev)
static struct platform_driver snd_byt_rt5651_mc_driver = {
.driver = {
.name = "bytcr_rt5651",
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
.pm = &snd_soc_pm_ops,
#endif
},
.probe = snd_byt_rt5651_mc_probe,
};
Expand Down
3 changes: 3 additions & 0 deletions sound/soc/intel/boards/cht_bsw_max98090_ti.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,9 @@ static int snd_cht_mc_remove(struct platform_device *pdev)
static struct platform_driver snd_cht_mc_driver = {
.driver = {
.name = "cht-bsw-max98090",
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
.pm = &snd_soc_pm_ops,
#endif
},
.probe = snd_cht_mc_probe,
.remove = snd_cht_mc_remove,
Expand Down
3 changes: 3 additions & 0 deletions sound/soc/intel/boards/cht_bsw_nau8824.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
static struct platform_driver snd_cht_mc_driver = {
.driver = {
.name = "cht-bsw-nau8824",
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
.pm = &snd_soc_pm_ops,
#endif
},
.probe = snd_cht_mc_probe,
};
Expand Down
3 changes: 3 additions & 0 deletions sound/soc/intel/boards/cht_bsw_rt5645.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,9 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
static struct platform_driver snd_cht_mc_driver = {
.driver = {
.name = "cht-bsw-rt5645",
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
.pm = &snd_soc_pm_ops,
#endif
},
.probe = snd_cht_mc_probe,
};
Expand Down
3 changes: 3 additions & 0 deletions sound/soc/intel/boards/cht_bsw_rt5672.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,9 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
static struct platform_driver snd_cht_mc_driver = {
.driver = {
.name = "cht-bsw-rt5672",
#if IS_ENABLED(CONFIG_SND_SOC_SOF_BAYTRAIL)
.pm = &snd_soc_pm_ops,
#endif
},
.probe = snd_cht_mc_probe,
};
Expand Down
36 changes: 36 additions & 0 deletions sound/soc/sof/intel/byt.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,34 @@ static void byt_set_mach_params(const struct snd_soc_acpi_mach *mach,
mach_params->platform = dev_name(dev);
}

static void byt_reset_dsp_disable_int(struct snd_sof_dev *sdev)
{
/* Disable Interrupt from both sides */
snd_sof_dsp_update_bits64(sdev, BYT_DSP_BAR, SHIM_IMRX, 0x3, 0x3);
snd_sof_dsp_update_bits64(sdev, BYT_DSP_BAR, SHIM_IMRD, 0x3, 0x3);

/* Put DSP into reset, set reset vector */
snd_sof_dsp_update_bits64(sdev, BYT_DSP_BAR, SHIM_CSR,
SHIM_BYT_CSR_RST | SHIM_BYT_CSR_VECTOR_SEL,
SHIM_BYT_CSR_RST | SHIM_BYT_CSR_VECTOR_SEL);
}

static int byt_suspend(struct snd_sof_dev *sdev, u32 target_state)
{
byt_reset_dsp_disable_int(sdev);

return 0;
}

static int byt_resume(struct snd_sof_dev *sdev)
{
/* Enable Interrupt from both sides */
snd_sof_dsp_update_bits64(sdev, BYT_DSP_BAR, SHIM_IMRX, 0x3, 0x0);
snd_sof_dsp_update_bits64(sdev, BYT_DSP_BAR, SHIM_IMRD, 0x3, 0x0);

return 0;
}

/* Baytrail DAIs */
static struct snd_soc_dai_driver byt_dai[] = {
{
Expand Down Expand Up @@ -832,6 +860,10 @@ const struct snd_sof_dsp_ops sof_byt_ops = {
/*Firmware loading */
.load_firmware = snd_sof_load_firmware_memcpy,

/* PM */
.suspend = byt_suspend,
.resume = byt_resume,

/* DAI drivers */
.drv = byt_dai,
.num_drv = 3, /* we have only 3 SSPs on byt*/
Expand Down Expand Up @@ -906,6 +938,10 @@ const struct snd_sof_dsp_ops sof_cht_ops = {
/*Firmware loading */
.load_firmware = snd_sof_load_firmware_memcpy,

/* PM */
.suspend = byt_suspend,
.resume = byt_resume,

/* DAI drivers */
.drv = byt_dai,
/* all 6 SSPs may be available for cherrytrail */
Expand Down
8 changes: 6 additions & 2 deletions sound/soc/sof/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,12 @@ static int sof_resume(struct device *dev, bool runtime_resume)
return ret;
}

/* Nothing further to do if resuming from a low-power D0 substate */
if (!runtime_resume && old_state == SOF_DSP_PM_D0)
/*
* Nothing further to be done for platforms that support the low power
* D0 substate.
*/
if (!runtime_resume && sof_ops(sdev)->set_power_state &&
old_state == SOF_DSP_PM_D0)
return 0;

sdev->fw_state = SOF_FW_BOOT_PREPARE;
Expand Down