ASoC: Intel: Update Bxt machine and pm support
Subsystems (3)
cover ASoC: Intel: Update Bxt machine and pm support
This series first adds constraints and other updates on Bxt-rt298 machine for various scenarios.
Then it updates platform driver for PM support to enable firmware reload on suspend and fixes dma id for purge request, updates stall bits on stall/unstall commands and finally adds PM support in machine.
Jayachandran B (2):
ASoC: Intel: Skylake: Enable firmware reload in suspend
ASoC: Intel: Skylake: Update DSP stall bits
Jeeja KP (1):
ASoC: Intel: Add support for PM ops in bxt-rt298
Senthilnathan Veppur (4):
ASoC: Intel: Add DMIC 4 channel support for bxt machine
ASoC: Intel: Add FE rate & channel constraints for bxt-rt298
ASoC: Intel: Update ignore suspend for bxt-rt298
ASoC: Intel: Skylake: Update FW purge for Broxton
sound/soc/intel/boards/bxt_rt298.c | 140 ++++++++++++++++++++++++++++++++++ sound/soc/intel/skylake/bxt-sst.c | 25 +++++- sound/soc/intel/skylake/skl-sst-dsp.c | 15 ++-- sound/soc/intel/skylake/skl-sst-dsp.h | 2 + sound/soc/intel/skylake/skl-sst-ipc.h | 3 + sound/soc/intel/skylake/skl-sst.c | 1 + sound/soc/intel/skylake/skl.c | 1 + 7 files changed, 176 insertions(+), 11 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/7 ASoC: Intel: Add DMIC 4 channel support for bxt machine
From: Senthilnathan Veppur <[email protected]>
Like Skylake, we can support 4 channel for DMIC, so add hw_params and constraints in the bxt-rt298 machine
While at it, also add codec1 pipe for speaker playback.
--- sound/soc/intel/boards/bxt_rt298.c | 66 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+)
sound/soc/intel/boards/bxt_rt298.c +66 -0
@@ -33,6 +33,7 @@ enum {BXT_DPCM_AUDIO_PB =0 ,BXT_DPCM_AUDIO_CP ,BXT_DPCM_AUDIO_REF_CP , +BXT_DPCM_AUDIO_DMIC_CP ,BXT_DPCM_AUDIO_HDMI1_PB ,BXT_DPCM_AUDIO_HDMI2_PB , BXT_DPCM_AUDIO_HDMI3_PB,
@@ -88,6 +89,7 @@ static const struct snd_soc_dapm_route broxton_rt298_map[] = {/* CODEC BE connections */ { "AIF1 Playback", NULL, "ssp5 Tx"}, { "ssp5 Tx", NULL, "codec0_out"}, + { "ssp5 Tx", NULL, "codec1_out"}, { "codec0_in", NULL, "ssp5 Rx" }, { "ssp5 Rx", NULL, "AIF1 Capture" },
@@ -169,6 +171,55 @@ static struct snd_soc_ops broxton_rt298_ops = { .hw_params = broxton_rt298_hw_params, }; +static unsigned int rates[] = { +48000 , +}; + +static struct snd_pcm_hw_constraint_list constraints_rates = { + .count =ARRAY_SIZE (rates), + .list = rates, + .mask =0 , +}; + +static int broxton_dmic_fixup (struct snd_soc_pcm_runtime *rtd, +struct snd_pcm_hw_params *params) +{ +struct snd_interval *channels =hw_param_interval (params, +SNDRV_PCM_HW_PARAM_CHANNELS ); +if (params_channels (params) ==2 ) + channels->min = channels->max =2 ; +else + channels->min = channels->max =4 ; + +return 0 ; +} + +static unsigned int channels_dmic[] = { +2 ,4 , +}; + +static struct snd_pcm_hw_constraint_list constraints_dmic_channels = { + .count =ARRAY_SIZE (channels_dmic), + .list = channels_dmic, + .mask =0 , +}; + +static int broxton_dmic_startup (struct snd_pcm_substream *substream) +{ +struct snd_pcm_runtime *runtime = substream->runtime; + + runtime->hw.channels_max =4 ; +snd_pcm_hw_constraint_list (runtime,0 ,SNDRV_PCM_HW_PARAM_CHANNELS , + &constraints_dmic_channels); + +return snd_pcm_hw_constraint_list (substream->runtime,0 , +SNDRV_PCM_HW_PARAM_RATE , &constraints_rates); +} + +static struct snd_soc_ops broxton_dmic_ops = { + .startup = broxton_dmic_startup, +}; +/* broxton digital audio interface glue - connects codec <--> CPU */ static struct snd_soc_dai_link broxton_rt298_dais[] = {/* Front End DAI links */
@@ -211,6 +262,20 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { .nonatomic = 1, .dynamic = 1, }, + [BXT_DPCM_AUDIO_DMIC_CP ] + { + .name = "Bxt Audio DMIC cap", + .stream_name = "dmiccap", + .cpu_dai_name = "DMIC Pin", + .codec_name = "snd-soc-dummy", + .codec_dai_name = "snd-soc-dummy-dai", + .platform_name = "0000:00:0e.0", + .init = NULL, + .dpcm_capture = 1, + .nonatomic = 1, + .dynamic = 1, + .ops = &broxton_dmic_ops, + }, [BXT_DPCM_AUDIO_HDMI1_PB ] { .name = "Bxt HDMI Port1",
@@ -276,6 +341,7 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { .codec_name = "dmic-codec", .codec_dai_name = "dmic-hifi", .platform_name = "0000:00:0e.0", + .be_hw_params_fixup = broxton_dmic_fixup, .ignore_suspend = 1, .dpcm_capture = 1, .no_pcm = 1,
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Add DMIC 4 channel support for bxt machine" to the asoc tree
The patch
ASoC: Intel: Add DMIC 4 channel support for bxt machine
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
bfcdc6d19008c0f11cba30c2cff1b63ec4e7a744Mon Sep 17 00:00:00 2001
From: Senthilnathan Veppur <[email protected]>
Date: Mon, 13 Jun 2016 17:58:58 +0530
Subject: [PATCH] ASoC: Intel: Add DMIC 4 channel support for bxt machine
Like Skylake, we can support 4 channel for DMIC, so add hw_params and constraints in the bxt-rt298 machine
While at it, also add codec1 pipe for speaker playback.
--- sound/soc/intel/boards/bxt_rt298.c | 66 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+)
sound/soc/intel/boards/bxt_rt298.c +66 -0
@@ -33,6 +33,7 @@ enum {BXT_DPCM_AUDIO_PB =0 ,BXT_DPCM_AUDIO_CP ,BXT_DPCM_AUDIO_REF_CP , +BXT_DPCM_AUDIO_DMIC_CP ,BXT_DPCM_AUDIO_HDMI1_PB ,BXT_DPCM_AUDIO_HDMI2_PB , BXT_DPCM_AUDIO_HDMI3_PB,
@@ -88,6 +89,7 @@ static const struct snd_soc_dapm_route broxton_rt298_map[] = {/* CODEC BE connections */ { "AIF1 Playback", NULL, "ssp5 Tx"}, { "ssp5 Tx", NULL, "codec0_out"}, + { "ssp5 Tx", NULL, "codec1_out"}, { "codec0_in", NULL, "ssp5 Rx" }, { "ssp5 Rx", NULL, "AIF1 Capture" },
@@ -169,6 +171,55 @@ static struct snd_soc_ops broxton_rt298_ops = { .hw_params = broxton_rt298_hw_params, }; +static unsigned int rates[] = { +48000 , +}; + +static struct snd_pcm_hw_constraint_list constraints_rates = { + .count =ARRAY_SIZE (rates), + .list = rates, + .mask =0 , +}; + +static int broxton_dmic_fixup (struct snd_soc_pcm_runtime *rtd, +struct snd_pcm_hw_params *params) +{ +struct snd_interval *channels =hw_param_interval (params, +SNDRV_PCM_HW_PARAM_CHANNELS ); +if (params_channels (params) ==2 ) + channels->min = channels->max =2 ; +else + channels->min = channels->max =4 ; + +return 0 ; +} + +static unsigned int channels_dmic[] = { +2 ,4 , +}; + +static struct snd_pcm_hw_constraint_list constraints_dmic_channels = { + .count =ARRAY_SIZE (channels_dmic), + .list = channels_dmic, + .mask =0 , +}; + +static int broxton_dmic_startup (struct snd_pcm_substream *substream) +{ +struct snd_pcm_runtime *runtime = substream->runtime; + + runtime->hw.channels_max =4 ; +snd_pcm_hw_constraint_list (runtime,0 ,SNDRV_PCM_HW_PARAM_CHANNELS , + &constraints_dmic_channels); + +return snd_pcm_hw_constraint_list (substream->runtime,0 , +SNDRV_PCM_HW_PARAM_RATE , &constraints_rates); +} + +static struct snd_soc_ops broxton_dmic_ops = { + .startup = broxton_dmic_startup, +}; +/* broxton digital audio interface glue - connects codec <--> CPU */ static struct snd_soc_dai_link broxton_rt298_dais[] = {/* Front End DAI links */
@@ -211,6 +262,20 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { .nonatomic = 1, .dynamic = 1, }, + [BXT_DPCM_AUDIO_DMIC_CP ] + { + .name = "Bxt Audio DMIC cap", + .stream_name = "dmiccap", + .cpu_dai_name = "DMIC Pin", + .codec_name = "snd-soc-dummy", + .codec_dai_name = "snd-soc-dummy-dai", + .platform_name = "0000:00:0e.0", + .init = NULL, + .dpcm_capture = 1, + .nonatomic = 1, + .dynamic = 1, + .ops = &broxton_dmic_ops, + }, [BXT_DPCM_AUDIO_HDMI1_PB ] { .name = "Bxt HDMI Port1",
@@ -276,6 +341,7 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { .codec_name = "dmic-codec", .codec_dai_name = "dmic-hifi", .platform_name = "0000:00:0e.0", + .be_hw_params_fixup = broxton_dmic_fixup, .ignore_suspend = 1, .dpcm_capture = 1, .no_pcm = 1,
Signature · 1 line
2.8.1
PATCH 2/7 ASoC: Intel: Add FE rate & channel constraints for bxt-rt298
In reply to Vinod KoulFrom: Senthilnathan Veppur <[email protected]>
We support stereo 48Khz audio, so add these as constraints for this card
--- sound/soc/intel/boards/bxt_rt298.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+)
sound/soc/intel/boards/bxt_rt298.c +36 -0
@@ -220,6 +220,40 @@ static struct snd_soc_ops broxton_dmic_ops = { .startup = broxton_dmic_startup, }; +static unsigned int channels[] = { +2 , +}; + +static struct snd_pcm_hw_constraint_list constraints_channels = { + .count =ARRAY_SIZE (channels), + .list = channels, + .mask =0 , +}; + +static int bxt_fe_startup (struct snd_pcm_substream *substream) +{ +struct snd_pcm_runtime *runtime = substream->runtime; + +/* +* on this platform for PCM device we support: +* 48Khz +* stereo +*/ + + runtime->hw.channels_max =2 ; +snd_pcm_hw_constraint_list (runtime,0 ,SNDRV_PCM_HW_PARAM_CHANNELS , + &constraints_channels); + +snd_pcm_hw_constraint_list (runtime,0 , +SNDRV_PCM_HW_PARAM_RATE , &constraints_rates); + +return 0 ; +} + +static const struct snd_soc_ops broxton_rt286_fe_ops = { + .startup = bxt_fe_startup, +}; +/* broxton digital audio interface glue - connects codec <--> CPU */ static struct snd_soc_dai_link broxton_rt298_dais[] = {/* Front End DAI links */
@@ -235,6 +269,7 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { .codec_dai_name = "snd-soc-dummy-dai", .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, .dpcm_playback = 1, + .ops = &broxton_rt286_fe_ops, }, [BXT_DPCM_AUDIO_CP ] {
@@ -248,6 +283,7 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { .codec_dai_name = "snd-soc-dummy-dai", .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, .dpcm_capture = 1, + .ops = &broxton_rt286_fe_ops, }, [BXT_DPCM_AUDIO_REF_CP ] {
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Add FE rate & channel constraints for bxt-rt298" to the asoc tree
The patch
ASoC: Intel: Add FE rate & channel constraints for bxt-rt298
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
4cdf33feb2c67ef1ff45bc5160b261b8c1fd2428Mon Sep 17 00:00:00 2001
From: Senthilnathan Veppur <[email protected]>
Date: Mon, 13 Jun 2016 17:58:59 +0530
Subject: [PATCH] ASoC: Intel: Add FE rate & channel constraints for bxt-rt298
We support stereo 48Khz audio, so add these as constraints for this card
--- sound/soc/intel/boards/bxt_rt298.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+)
sound/soc/intel/boards/bxt_rt298.c +36 -0
@@ -220,6 +220,40 @@ static struct snd_soc_ops broxton_dmic_ops = { .startup = broxton_dmic_startup, }; +static unsigned int channels[] = { +2 , +}; + +static struct snd_pcm_hw_constraint_list constraints_channels = { + .count =ARRAY_SIZE (channels), + .list = channels, + .mask =0 , +}; + +static int bxt_fe_startup (struct snd_pcm_substream *substream) +{ +struct snd_pcm_runtime *runtime = substream->runtime; + +/* +* on this platform for PCM device we support: +* 48Khz +* stereo +*/ + + runtime->hw.channels_max =2 ; +snd_pcm_hw_constraint_list (runtime,0 ,SNDRV_PCM_HW_PARAM_CHANNELS , + &constraints_channels); + +snd_pcm_hw_constraint_list (runtime,0 , +SNDRV_PCM_HW_PARAM_RATE , &constraints_rates); + +return 0 ; +} + +static const struct snd_soc_ops broxton_rt286_fe_ops = { + .startup = bxt_fe_startup, +}; +/* broxton digital audio interface glue - connects codec <--> CPU */ static struct snd_soc_dai_link broxton_rt298_dais[] = {/* Front End DAI links */
@@ -235,6 +269,7 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { .codec_dai_name = "snd-soc-dummy-dai", .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, .dpcm_playback = 1, + .ops = &broxton_rt286_fe_ops, }, [BXT_DPCM_AUDIO_CP ] {
@@ -248,6 +283,7 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { .codec_dai_name = "snd-soc-dummy-dai", .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, .dpcm_capture = 1, + .ops = &broxton_rt286_fe_ops, }, [BXT_DPCM_AUDIO_REF_CP ] {
Signature · 1 line
2.8.1
PATCH 3/7 ASoC: Intel: Update ignore suspend for bxt-rt298
In reply to Vinod KoulFrom: Senthilnathan Veppur <[email protected]>
Capture from DMIC requires that we ignore the suspend, so mark these as ignore_suspend in bxt-rt298 machine.
--- sound/soc/intel/boards/bxt_rt298.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
sound/soc/intel/boards/bxt_rt298.c +15 -0
@@ -106,6 +106,17 @@ static const struct snd_soc_dapm_route broxton_rt298_map[] = { }; +static int broxton_rt298_fe_init (struct snd_soc_pcm_runtime *rtd) +{ +struct snd_soc_dapm_context *dapm; +struct snd_soc_component *component = rtd->cpu_dai->component; + + dapm =snd_soc_component_get_dapm (component); +snd_soc_dapm_ignore_suspend (dapm,"Reference Capture" ); + +return 0 ; +} +static int broxton_rt298_codec_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec;
@@ -120,6 +131,9 @@ static int broxton_rt298_codec_init(struct snd_soc_pcm_runtime *rtd)return ret;rt298_mic_detect (codec, &broxton_headset); + +snd_soc_dapm_ignore_suspend (&rtd->card->dapm,"SoC DMIC" ); +return 0 ; }
@@ -267,6 +281,7 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { .dynamic = 1, .codec_name = "snd-soc-dummy", .codec_dai_name = "snd-soc-dummy-dai", + .init = broxton_rt298_fe_init, .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, .dpcm_playback = 1, .ops = &broxton_rt286_fe_ops,
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Update ignore suspend for bxt-rt298" to the asoc tree
The patch
ASoC: Intel: Update ignore suspend for bxt-rt298
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
316f135a4ec6fba2a53930f843a0c1c5d4ae1ea2Mon Sep 17 00:00:00 2001
From: Senthilnathan Veppur <[email protected]>
Date: Mon, 13 Jun 2016 17:59:00 +0530
Subject: [PATCH] ASoC: Intel: Update ignore suspend for bxt-rt298
Capture from DMIC requires that we ignore the suspend, so mark these as ignore_suspend in bxt-rt298 machine.
--- sound/soc/intel/boards/bxt_rt298.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
sound/soc/intel/boards/bxt_rt298.c +15 -0
@@ -106,6 +106,17 @@ static const struct snd_soc_dapm_route broxton_rt298_map[] = { }; +static int broxton_rt298_fe_init (struct snd_soc_pcm_runtime *rtd) +{ +struct snd_soc_dapm_context *dapm; +struct snd_soc_component *component = rtd->cpu_dai->component; + + dapm =snd_soc_component_get_dapm (component); +snd_soc_dapm_ignore_suspend (dapm,"Reference Capture" ); + +return 0 ; +} +static int broxton_rt298_codec_init (struct snd_soc_pcm_runtime *rtd) {struct snd_soc_codec *codec = rtd->codec;
@@ -120,6 +131,9 @@ static int broxton_rt298_codec_init(struct snd_soc_pcm_runtime *rtd)return ret;rt298_mic_detect (codec, &broxton_headset); + +snd_soc_dapm_ignore_suspend (&rtd->card->dapm,"SoC DMIC" ); +return 0 ; }
@@ -267,6 +281,7 @@ static struct snd_soc_dai_link broxton_rt298_dais[] = { .dynamic = 1, .codec_name = "snd-soc-dummy", .codec_dai_name = "snd-soc-dummy-dai", + .init = broxton_rt298_fe_init, .trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST}, .dpcm_playback = 1, .ops = &broxton_rt286_fe_ops,
Signature · 1 line
2.8.1
PATCH 4/7 ASoC: Intel: Skylake: Enable firmware reload in suspend
In reply to Vinod KoulFrom: Jayachandran B <[email protected]>
Broxton DSP needs retains code loaded during runtime_pm cycles. But it looses that on suspend cycle, so on resume we need to download the firmware again.
This is done by adding a new flag and based on flag status, we download the firmware.
--- sound/soc/intel/skylake/bxt-sst.c | 9 +++++++++ sound/soc/intel/skylake/skl-sst-ipc.h | 3 +++ sound/soc/intel/skylake/skl-sst.c | 1 + sound/soc/intel/skylake/skl.c | 1 + 4 files changed, 14 insertions(+)
sound/soc/intel/skylake/bxt-sst.c +9 -0
@@ -185,6 +185,7 @@ static int bxt_load_base_firmware(struct sst_dsp *ctx) }else {skl_dsp_set_state_locked (ctx,SKL_DSP_RUNNING ); ret =0 ; + skl->fw_loaded = true; } }
@@ -200,6 +201,14 @@ static int bxt_set_dsp_D0(struct sst_dsp *ctx) skl->boot_complete = false; +if (skl->fw_loaded == false) { +dev_dbg (ctx->dev,"Re-loading fw\n" ); + ret =bxt_load_base_firmware (ctx); +if (ret <0 ) +dev_err (ctx->dev,"reload fw failed: %d\n" , ret); +return ret; + } + ret =skl_dsp_enable_core (ctx);if (ret <0 ) {dev_err (ctx->dev,"enable dsp core failed ret: %d\n" , ret);
sound/soc/intel/skylake/skl-sst-ipc.h +3 -0
@@ -63,6 +63,9 @@ struct skl_sst {/* Populate module information */ struct list_head uuid_list; + +/* Is firmware loaded */ +bool fw_loaded; };struct skl_ipc_init_instance_msg {
sound/soc/intel/skylake/skl-sst.c +1 -0
@@ -153,6 +153,7 @@ static int skl_load_base_firmware(struct sst_dsp *ctx)dev_dbg (ctx->dev,"Download firmware successful%d\n" , ret);skl_dsp_set_state_locked (ctx,SKL_DSP_RUNNING ); + skl->fw_loaded = true; }return 0 ; transfer_firmware_failed:
sound/soc/intel/skylake/skl.c +1 -0
@@ -248,6 +248,7 @@ static int skl_suspend(struct device *dev) ret =_skl_suspend (ebus);if (ret <0 )return ret; + skl->skl_sst->fw_loaded = false; }if (IS_ENABLED (CONFIG_SND_SOC_HDAC_HDMI )) {
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Enable firmware reload in suspend" to the asoc tree
The patch
ASoC: Intel: Skylake: Enable firmware reload in suspend
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
1665c177abf40338e7b5f1ae465d3aaabe5af9d0Mon Sep 17 00:00:00 2001
From: Jayachandran B <[email protected]>
Date: Mon, 13 Jun 2016 17:59:01 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Enable firmware reload in suspend
Broxton DSP needs retains code loaded during runtime_pm cycles. But it looses that on suspend cycle, so on resume we need to download the firmware again.
This is done by adding a new flag and based on flag status, we download the firmware.
--- sound/soc/intel/skylake/bxt-sst.c | 9 +++++++++ sound/soc/intel/skylake/skl-sst-ipc.h | 3 +++ sound/soc/intel/skylake/skl-sst.c | 1 + sound/soc/intel/skylake/skl.c | 1 + 4 files changed, 14 insertions(+)
sound/soc/intel/skylake/bxt-sst.c +9 -0
@@ -185,6 +185,7 @@ static int bxt_load_base_firmware(struct sst_dsp *ctx) }else {skl_dsp_set_state_locked (ctx,SKL_DSP_RUNNING ); ret =0 ; + skl->fw_loaded = true; } }
@@ -200,6 +201,14 @@ static int bxt_set_dsp_D0(struct sst_dsp *ctx) skl->boot_complete = false; +if (skl->fw_loaded == false) { +dev_dbg (ctx->dev,"Re-loading fw\n" ); + ret =bxt_load_base_firmware (ctx); +if (ret <0 ) +dev_err (ctx->dev,"reload fw failed: %d\n" , ret); +return ret; + } + ret =skl_dsp_enable_core (ctx);if (ret <0 ) {dev_err (ctx->dev,"enable dsp core failed ret: %d\n" , ret);
sound/soc/intel/skylake/skl-sst-ipc.h +3 -0
@@ -63,6 +63,9 @@ struct skl_sst {/* Populate module information */ struct list_head uuid_list; + +/* Is firmware loaded */ +bool fw_loaded; };struct skl_ipc_init_instance_msg {
sound/soc/intel/skylake/skl-sst.c +1 -0
@@ -153,6 +153,7 @@ static int skl_load_base_firmware(struct sst_dsp *ctx)dev_dbg (ctx->dev,"Download firmware successful%d\n" , ret);skl_dsp_set_state_locked (ctx,SKL_DSP_RUNNING ); + skl->fw_loaded = true; }return 0 ; transfer_firmware_failed:
sound/soc/intel/skylake/skl.c +1 -0
@@ -248,6 +248,7 @@ static int skl_suspend(struct device *dev) ret =_skl_suspend (ebus);if (ret <0 )return ret; + skl->skl_sst->fw_loaded = false; }if (IS_ENABLED (CONFIG_SND_SOC_HDAC_HDMI )) {
Signature · 1 line
2.8.1
PATCH 5/7 ASoC: Intel: Skylake: Update FW purge for Broxton
In reply to Vinod KoulFrom: Senthilnathan Veppur <[email protected]>
Broxton needs to send Purge firmware IPC to DSP before downloading the firmware. The DMA id needs to be updated for that.
While at it also update Broxton boot sequence to send purge request after power up and before yanking off reset.
--- sound/soc/intel/skylake/bxt-sst.c | 16 +++++++++++++--- sound/soc/intel/skylake/skl-sst-dsp.c | 4 ++-- sound/soc/intel/skylake/skl-sst-dsp.h | 2 ++ 3 files changed, 17 insertions(+), 5 deletions(-)
sound/soc/intel/skylake/bxt-sst.c +13 -3
@@ -58,13 +58,19 @@ static int sst_bxt_prepare_fw(struct sst_dsp *ctx, ctx->dsp_ops.stream_tag = stream_tag;memcpy (ctx->dmab.area, fwdata, fwsize); + ret =skl_dsp_core_power_up (ctx); +if (ret <0 ) { +dev_err (ctx->dev,"Boot dsp core failed ret: %d\n" , ret); + goto base_fw_load_failed; + } +/* Purge FW request */ sst_dsp_shim_write (ctx,SKL_ADSP_REG_HIPCI ,SKL_ADSP_REG_HIPCI_BUSY | -BXT_IPC_PURGE_FW | (stream_tag -1 )); + (BXT_IPC_PURGE_FW | ((stream_tag -1 ) <<9 ))); - ret =skl_dsp_enable_core (ctx); + ret =skl_dsp_start_core (ctx);if (ret <0 ) { -dev_err (ctx->dev,"Boot dsp core failed ret: %d\n" , ret); +dev_err (ctx->dev,"Start dsp core failed ret: %d\n" , ret); ret = -EIO ; goto base_fw_load_failed; }
@@ -161,6 +167,10 @@ static int bxt_load_base_firmware(struct sst_dsp *ctx)if (ret <0 ) { ret =sst_bxt_prepare_fw (ctx, stripped_fw.data, stripped_fw.size);if (ret <0 ) { +dev_err (ctx->dev,"Error code=0x%x: FW status=0x%x\n" , +sst_dsp_shim_read (ctx,BXT_ADSP_ERROR_CODE ), +sst_dsp_shim_read (ctx,BXT_ADSP_FW_STATUS )); +dev_err (ctx->dev,"Core En/ROM load fail:%d\n" , ret); goto sst_load_base_firmware_failed; }
sound/soc/intel/skylake/skl-sst-dsp.c +2 -2
@@ -114,7 +114,7 @@ static int skl_dsp_reset_core(struct sst_dsp *ctx)return skl_dsp_core_set_reset_state (ctx); } -static int skl_dsp_start_core (struct sst_dsp *ctx) +int skl_dsp_start_core (struct sst_dsp *ctx) {int ret;
@@ -140,7 +140,7 @@ static int skl_dsp_start_core(struct sst_dsp *ctx)return ret; } -static int skl_dsp_core_power_up (struct sst_dsp *ctx) +int skl_dsp_core_power_up (struct sst_dsp *ctx) {int ret;
sound/soc/intel/skylake/skl-sst-dsp.h +2 -0
@@ -182,5 +182,7 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, unsigned int offset);void skl_freeup_uuid_list (struct skl_sst *ctx);int skl_dsp_strip_extended_manifest (struct firmware *fw); +int skl_dsp_start_core (struct sst_dsp *ctx); +int skl_dsp_core_power_up (struct sst_dsp *ctx);#endif /*__SKL_SST_DSP_H__*/
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Update FW purge for Broxton" to the asoc tree
The patch
ASoC: Intel: Skylake: Update FW purge for Broxton
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
2023576dd74c9afdb25692f7e9ac9a837e8cf3bdMon Sep 17 00:00:00 2001
From: Senthilnathan Veppur <[email protected]>
Date: Mon, 13 Jun 2016 17:59:02 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Update FW purge for Broxton
Broxton needs to send Purge firmware IPC to DSP before downloading the firmware. The DMA id needs to be updated for that.
While at it also update Broxton boot sequence to send purge request after power up and before yanking off reset.
--- sound/soc/intel/skylake/bxt-sst.c | 16 +++++++++++++--- sound/soc/intel/skylake/skl-sst-dsp.c | 4 ++-- sound/soc/intel/skylake/skl-sst-dsp.h | 2 ++ 3 files changed, 17 insertions(+), 5 deletions(-)
sound/soc/intel/skylake/bxt-sst.c +13 -3
@@ -58,13 +58,19 @@ static int sst_bxt_prepare_fw(struct sst_dsp *ctx, ctx->dsp_ops.stream_tag = stream_tag;memcpy (ctx->dmab.area, fwdata, fwsize); + ret =skl_dsp_core_power_up (ctx); +if (ret <0 ) { +dev_err (ctx->dev,"Boot dsp core failed ret: %d\n" , ret); + goto base_fw_load_failed; + } +/* Purge FW request */ sst_dsp_shim_write (ctx,SKL_ADSP_REG_HIPCI ,SKL_ADSP_REG_HIPCI_BUSY | -BXT_IPC_PURGE_FW | (stream_tag -1 )); + (BXT_IPC_PURGE_FW | ((stream_tag -1 ) <<9 ))); - ret =skl_dsp_enable_core (ctx); + ret =skl_dsp_start_core (ctx);if (ret <0 ) { -dev_err (ctx->dev,"Boot dsp core failed ret: %d\n" , ret); +dev_err (ctx->dev,"Start dsp core failed ret: %d\n" , ret); ret = -EIO ; goto base_fw_load_failed; }
@@ -161,6 +167,10 @@ static int bxt_load_base_firmware(struct sst_dsp *ctx)if (ret <0 ) { ret =sst_bxt_prepare_fw (ctx, stripped_fw.data, stripped_fw.size);if (ret <0 ) { +dev_err (ctx->dev,"Error code=0x%x: FW status=0x%x\n" , +sst_dsp_shim_read (ctx,BXT_ADSP_ERROR_CODE ), +sst_dsp_shim_read (ctx,BXT_ADSP_FW_STATUS )); +dev_err (ctx->dev,"Core En/ROM load fail:%d\n" , ret); goto sst_load_base_firmware_failed; }
sound/soc/intel/skylake/skl-sst-dsp.c +2 -2
@@ -114,7 +114,7 @@ static int skl_dsp_reset_core(struct sst_dsp *ctx)return skl_dsp_core_set_reset_state (ctx); } -static int skl_dsp_start_core (struct sst_dsp *ctx) +int skl_dsp_start_core (struct sst_dsp *ctx) {int ret;
@@ -140,7 +140,7 @@ static int skl_dsp_start_core(struct sst_dsp *ctx)return ret; } -static int skl_dsp_core_power_up (struct sst_dsp *ctx) +int skl_dsp_core_power_up (struct sst_dsp *ctx) {int ret;
sound/soc/intel/skylake/skl-sst-dsp.h +2 -0
@@ -182,5 +182,7 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, unsigned int offset);void skl_freeup_uuid_list (struct skl_sst *ctx);int skl_dsp_strip_extended_manifest (struct firmware *fw); +int skl_dsp_start_core (struct sst_dsp *ctx); +int skl_dsp_core_power_up (struct sst_dsp *ctx);#endif /*__SKL_SST_DSP_H__*/
Signature · 1 line
2.8.1
PATCH 6/7 ASoC: Intel: Skylake: Update DSP stall bits
In reply to Vinod KoulFrom: Jayachandran B <[email protected]>
The stall bits needs to comprehend the number of DSP cores running, so update the stall and unstall register writes to comprehend SKL_DSP_CORES_MASK values as well.
--- sound/soc/intel/skylake/skl-sst-dsp.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
sound/soc/intel/skylake/skl-sst-dsp.c +5 -6
@@ -106,9 +106,9 @@ static bool is_skl_dsp_core_enable(struct sst_dsp *ctx)static int skl_dsp_reset_core (struct sst_dsp *ctx) {/* stall core */ -sst_dsp_shim_write_unlocked (ctx,SKL_ADSP_REG_ADSPCS , -sst_dsp_shim_read_unlocked (ctx,SKL_ADSP_REG_ADSPCS ) & -SKL_ADSPCS_CSTALL (SKL_DSP_CORES_MASK )); +sst_dsp_shim_update_bits_unlocked (ctx,SKL_ADSP_REG_ADSPCS , +SKL_ADSPCS_CSTALL_MASK , +SKL_ADSPCS_CSTALL (SKL_DSP_CORES_MASK ));/* set reset state */ return skl_dsp_core_set_reset_state (ctx);
@@ -127,9 +127,8 @@ int skl_dsp_start_core(struct sst_dsp *ctx)/* run core */ dev_dbg (ctx->dev,"run core...\n" ); -sst_dsp_shim_write_unlocked (ctx,SKL_ADSP_REG_ADSPCS , -sst_dsp_shim_read_unlocked (ctx,SKL_ADSP_REG_ADSPCS ) & - ~SKL_ADSPCS_CSTALL (SKL_DSP_CORES_MASK )); +sst_dsp_shim_update_bits_unlocked (ctx,SKL_ADSP_REG_ADSPCS , +SKL_ADSPCS_CSTALL_MASK ,0 );if (!is_skl_dsp_core_enable (ctx)) {skl_dsp_reset_core (ctx);
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Update DSP stall bits" to the asoc tree
The patch
ASoC: Intel: Skylake: Update DSP stall bits
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
2f74053bead3f47ddee219f521562db941ce0ae1Mon Sep 17 00:00:00 2001
From: Jayachandran B <[email protected]>
Date: Mon, 13 Jun 2016 17:59:03 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Update DSP stall bits
The stall bits needs to comprehend the number of DSP cores running, so update the stall and unstall register writes to comprehend SKL_DSP_CORES_MASK values as well.
--- sound/soc/intel/skylake/skl-sst-dsp.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
sound/soc/intel/skylake/skl-sst-dsp.c +5 -6
@@ -106,9 +106,9 @@ static bool is_skl_dsp_core_enable(struct sst_dsp *ctx)static int skl_dsp_reset_core (struct sst_dsp *ctx) {/* stall core */ -sst_dsp_shim_write_unlocked (ctx,SKL_ADSP_REG_ADSPCS , -sst_dsp_shim_read_unlocked (ctx,SKL_ADSP_REG_ADSPCS ) & -SKL_ADSPCS_CSTALL (SKL_DSP_CORES_MASK )); +sst_dsp_shim_update_bits_unlocked (ctx,SKL_ADSP_REG_ADSPCS , +SKL_ADSPCS_CSTALL_MASK , +SKL_ADSPCS_CSTALL (SKL_DSP_CORES_MASK ));/* set reset state */ return skl_dsp_core_set_reset_state (ctx);
@@ -127,9 +127,8 @@ int skl_dsp_start_core(struct sst_dsp *ctx)/* run core */ dev_dbg (ctx->dev,"run core...\n" ); -sst_dsp_shim_write_unlocked (ctx,SKL_ADSP_REG_ADSPCS , -sst_dsp_shim_read_unlocked (ctx,SKL_ADSP_REG_ADSPCS ) & - ~SKL_ADSPCS_CSTALL (SKL_DSP_CORES_MASK )); +sst_dsp_shim_update_bits_unlocked (ctx,SKL_ADSP_REG_ADSPCS , +SKL_ADSPCS_CSTALL_MASK ,0 );if (!is_skl_dsp_core_enable (ctx)) {skl_dsp_reset_core (ctx);
Signature · 1 line
2.8.1
PATCH 7/7 ASoC: Intel: Add support for PM ops in bxt-rt298
In reply to Vinod KoulFrom: Jeeja KP <[email protected]>
We need card to be early suspended and late resumed, so use prepare and complete for card suspend and resume.
--- sound/soc/intel/boards/bxt_rt298.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
sound/soc/intel/boards/bxt_rt298.c +23 -0
@@ -454,10 +454,33 @@ static int broxton_audio_probe(struct platform_device *pdev)return devm_snd_soc_register_card (&pdev->dev, &broxton_rt298); } +/* +* we want the card to be suspend first and then platform driver. This +* allows the DAPM to tear down pipelines on suspend and then platform shuts +* down the DSP. For this use .prepare for suspending card +* +* Similarly, use complete to let DSP download firmware first and then sync +* DAPM and restore pipelines to DSP +*/ +static void broxton_rt298_complete (struct device *dev) +{ +snd_soc_resume (dev); +} + +static const struct dev_pm_ops broxton_pm_ops = { + .prepare = snd_soc_suspend, + .complete = broxton_rt298_complete, + .freeze = snd_soc_suspend, + .thaw = snd_soc_resume, + .poweroff = snd_soc_poweroff, + .restore = snd_soc_resume, +}; +static struct platform_driver broxton_audio = { .probe = broxton_audio_probe, .driver = { .name ="bxt_alc298s_i2s" , + .pm = &broxton_pm_ops, }, };module_platform_driver (broxton_audio)
Signature · 1 line
1.9.1
Mark Brown
maintainerApplied "ASoC: Intel: Add support for PM ops in bxt-rt298" to the asoc tree
The patch
ASoC: Intel: Add support for PM ops in bxt-rt298
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
3513798ca4bceae7cb66a7f430160f60f788cedeMon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Mon, 13 Jun 2016 17:59:04 +0530
Subject: [PATCH] ASoC: Intel: Add support for PM ops in bxt-rt298
We need card to be early suspended and late resumed, so use prepare and complete for card suspend and resume.
--- sound/soc/intel/boards/bxt_rt298.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
sound/soc/intel/boards/bxt_rt298.c +23 -0
@@ -454,10 +454,33 @@ static int broxton_audio_probe(struct platform_device *pdev)return devm_snd_soc_register_card (&pdev->dev, &broxton_rt298); } +/* +* we want the card to be suspend first and then platform driver. This +* allows the DAPM to tear down pipelines on suspend and then platform shuts +* down the DSP. For this use .prepare for suspending card +* +* Similarly, use complete to let DSP download firmware first and then sync +* DAPM and restore pipelines to DSP +*/ +static void broxton_rt298_complete (struct device *dev) +{ +snd_soc_resume (dev); +} + +static const struct dev_pm_ops broxton_pm_ops = { + .prepare = snd_soc_suspend, + .complete = broxton_rt298_complete, + .freeze = snd_soc_suspend, + .thaw = snd_soc_resume, + .poweroff = snd_soc_poweroff, + .restore = snd_soc_resume, +}; +static struct platform_driver broxton_audio = { .probe = broxton_audio_probe, .driver = { .name ="bxt_alc298s_i2s" , + .pm = &broxton_pm_ops, }, };module_platform_driver (broxton_audio)
Signature · 1 line
2.8.1