ASoC: Intel: Skylake: Improvements in Skylake driver
Subsystems (3)
cover ASoC: Intel: Skylake: Improvements in Skylake driver
From: Jeeja KP <[email protected]>
This series has the below changes:
o Modify the sequence when deleting the pipeline
o Disable SRAM retention feature
o Cleanup of driver resource in suspend
o Reset the pipe in case of XRUN
o Enable simultaneous HDMI and DP playback
o Instead of modifying the runtime->delay in pointer query, just report position in pointer query
Dharageswari R (4):
ASoC: Intel: Skylake: Don't pause stopped pipeline while deleting
ASoC: Intel: Skylake: Disable SRAM Retention before D3
ASoC: Intel: Skylake: Avoid freeing up of unallocated memory/mcps
ASoC: Intel: Skylake: Clean up of driver resources in suspend
Jeeja KP (6):
ASoC: Intel: Skylake: Reset DSP pipe when host/link DMA is reset
ASoC: Intel: Skylake: Set the pipe state to paused when paused
ASoC: Intel: Skylake: Create Pipe to widget list in soc probe
ASoC: Intel: Skylake: Set the DSP pipe type
ASoC: Intel: Skylake: Copy the pipe parameter by pipe type
ASoC: Intel: Skylake: Report position in pointer query
sound/soc/intel/skylake/skl-messages.c | 45 +++++-- sound/soc/intel/skylake/skl-pcm.c | 93 +++++--------- sound/soc/intel/skylake/skl-sst-ipc.h | 1 + sound/soc/intel/skylake/skl-sst.c | 10 ++ sound/soc/intel/skylake/skl-topology.c | 213 +++++++++++++++++++++++---------- sound/soc/intel/skylake/skl-topology.h | 6 +- sound/soc/intel/skylake/skl.c | 4 + sound/soc/intel/skylake/skl.h | 4 + 8 files changed, 243 insertions(+), 133 deletions(-)
Signature · 1 line
2.5.0
PATCH 1/10 ASoC: Intel: Skylake: Reset DSP pipe when host/link DMA is reset
From: Jeeja KP <[email protected]>
In case of XRUN recovery PCM prepare will be called. In this case Host/Link DMAs are reset and reconfigured, hence the corresponding FE/BE pipe needs to be reset in order to get to a clean state.
--- sound/soc/intel/skylake/skl-messages.c | 23 +++++++++++++++++++++++ sound/soc/intel/skylake/skl-pcm.c | 17 +++++++++++++++++ sound/soc/intel/skylake/skl-topology.h | 5 ++++- 3 files changed, 44 insertions(+), 1 deletion(-)
sound/soc/intel/skylake/skl-messages.c +23 -0
@@ -1130,6 +1130,29 @@ int skl_stop_pipe(struct skl_sst *ctx, struct skl_pipe *pipe)return 0 ; } +/* +* Reset the pipeline by sending set pipe state IPC this will reset the DMA +* from the DSP side +*/ +int skl_reset_pipe (struct skl_sst *ctx,struct skl_pipe *pipe) +{ +int ret; + +/* If pipe was not created in FW, do not try to pause or delete */ +if (pipe->state <SKL_PIPE_PAUSED ) +return 0 ; + + ret =skl_set_pipe_state (ctx, pipe,PPL_RESET ); +if (ret <0 ) { +dev_dbg (ctx->dev,"Failed to reset pipe ret=%d\n" , ret); +return ret; + } + + pipe->state =SKL_PIPE_RESET ; + +return 0 ; +} +/* Algo parameter set helper function */ int skl_set_module_params (struct skl_sst *ctx,u32 *params,int size,u32 param_id,struct skl_module_cfg *mcfg)
sound/soc/intel/skylake/skl-pcm.c +17 -0
@@ -227,16 +227,25 @@ static int skl_pcm_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) {struct hdac_ext_stream *stream =get_hdac_ext_stream (substream); +struct skl *skl =get_skl_ctx (dai->dev);unsigned int format_val;int err; +struct skl_module_cfg *mconfig;dev_dbg (dai->dev,"%s: %s\n" , __func__, dai->name); + mconfig =skl_tplg_fe_get_cpr_module (dai, substream->stream); + format_val =skl_get_format (substream, dai);dev_dbg (dai->dev,"stream_tag=%d formatvalue=%d\n" ,hdac_stream (stream)->stream_tag, format_val);snd_hdac_stream_reset (hdac_stream (stream)); +/* In case of XRUN recovery, reset the FW pipe to clean state */ +if (mconfig && (substream->runtime->status->state == +SNDRV_PCM_STATE_XRUN )) +skl_reset_pipe (skl->skl_sst, mconfig->pipe); + err =snd_hdac_stream_set_params (hdac_stream (stream), format_val);if (err <0 )return err;
@@ -521,6 +530,8 @@ static int skl_link_pcm_prepare(struct snd_pcm_substream *substream,struct skl_dma_params *dma_params;struct snd_soc_dai *codec_dai = rtd->codec_dai;struct hdac_ext_link *link; +struct skl *skl =get_skl_ctx (dai->dev); +struct skl_module_cfg *mconfig =NULL ; dma_params = (struct skl_dma_params *)snd_soc_dai_get_dma_data (codec_dai, substream);
@@ -535,6 +546,12 @@ static int skl_link_pcm_prepare(struct snd_pcm_substream *substream,snd_hdac_ext_link_stream_reset (link_dev); +/* In case of XRUN recovery, reset the FW pipe to clean state */ + mconfig =skl_tplg_be_get_cpr_module (dai, substream->stream); +if (mconfig && (substream->runtime->status->state == +SNDRV_PCM_STATE_XRUN )) +skl_reset_pipe (skl->skl_sst, mconfig->pipe); +snd_hdac_ext_link_stream_setup (link_dev, format_val);snd_hdac_ext_link_set_stream_id (link,hdac_stream (link_dev)->stream_tag);
sound/soc/intel/skylake/skl-topology.h +4 -1
@@ -244,7 +244,8 @@ enum skl_pipe_state {SKL_PIPE_INVALID =0 ,SKL_PIPE_CREATED =1 ,SKL_PIPE_PAUSED =2 , -SKL_PIPE_STARTED =3 +SKL_PIPE_STARTED =3 , +SKL_PIPE_RESET =4 }; struct skl_pipe_module {
@@ -357,6 +358,8 @@ int skl_delete_pipe(struct skl_sst *ctx, struct skl_pipe *pipe);int skl_stop_pipe (struct skl_sst *ctx,struct skl_pipe *pipe); +int skl_reset_pipe (struct skl_sst *ctx,struct skl_pipe *pipe); +int skl_init_module (struct skl_sst *ctx,struct skl_module_cfg *module_config); int skl_bind_modules(struct skl_sst *ctx, struct skl_module_cfg
Signature · 1 line
2.5.0
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Reset DSP pipe when host/link DMA is reset" to the asoc tree
The patch
ASoC: Intel: Skylake: Reset DSP pipe when host/link DMA is reset
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
2004432f946e985fe98b67d515c52d69747016f9Mon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Fri, 3 Jun 2016 18:29:34 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Reset DSP pipe when host/link DMA is
reset
In case of XRUN recovery PCM prepare will be called. In this case Host/Link DMAs are reset and reconfigured, hence the corresponding FE/BE pipe needs to be reset in order to get to a clean state.
--- sound/soc/intel/skylake/skl-messages.c | 23 +++++++++++++++++++++++ sound/soc/intel/skylake/skl-pcm.c | 17 +++++++++++++++++ sound/soc/intel/skylake/skl-topology.h | 5 ++++- 3 files changed, 44 insertions(+), 1 deletion(-)
sound/soc/intel/skylake/skl-messages.c +23 -0
@@ -1130,6 +1130,29 @@ int skl_stop_pipe(struct skl_sst *ctx, struct skl_pipe *pipe)return 0 ; } +/* +* Reset the pipeline by sending set pipe state IPC this will reset the DMA +* from the DSP side +*/ +int skl_reset_pipe (struct skl_sst *ctx,struct skl_pipe *pipe) +{ +int ret; + +/* If pipe was not created in FW, do not try to pause or delete */ +if (pipe->state <SKL_PIPE_PAUSED ) +return 0 ; + + ret =skl_set_pipe_state (ctx, pipe,PPL_RESET ); +if (ret <0 ) { +dev_dbg (ctx->dev,"Failed to reset pipe ret=%d\n" , ret); +return ret; + } + + pipe->state =SKL_PIPE_RESET ; + +return 0 ; +} +/* Algo parameter set helper function */ int skl_set_module_params (struct skl_sst *ctx,u32 *params,int size,u32 param_id,struct skl_module_cfg *mcfg)
sound/soc/intel/skylake/skl-pcm.c +17 -0
@@ -227,16 +227,25 @@ static int skl_pcm_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) {struct hdac_ext_stream *stream =get_hdac_ext_stream (substream); +struct skl *skl =get_skl_ctx (dai->dev);unsigned int format_val;int err; +struct skl_module_cfg *mconfig;dev_dbg (dai->dev,"%s: %s\n" , __func__, dai->name); + mconfig =skl_tplg_fe_get_cpr_module (dai, substream->stream); + format_val =skl_get_format (substream, dai);dev_dbg (dai->dev,"stream_tag=%d formatvalue=%d\n" ,hdac_stream (stream)->stream_tag, format_val);snd_hdac_stream_reset (hdac_stream (stream)); +/* In case of XRUN recovery, reset the FW pipe to clean state */ +if (mconfig && (substream->runtime->status->state == +SNDRV_PCM_STATE_XRUN )) +skl_reset_pipe (skl->skl_sst, mconfig->pipe); + err =snd_hdac_stream_set_params (hdac_stream (stream), format_val);if (err <0 )return err;
@@ -521,6 +530,8 @@ static int skl_link_pcm_prepare(struct snd_pcm_substream *substream,struct skl_dma_params *dma_params;struct snd_soc_dai *codec_dai = rtd->codec_dai;struct hdac_ext_link *link; +struct skl *skl =get_skl_ctx (dai->dev); +struct skl_module_cfg *mconfig =NULL ; dma_params = (struct skl_dma_params *)snd_soc_dai_get_dma_data (codec_dai, substream);
@@ -535,6 +546,12 @@ static int skl_link_pcm_prepare(struct snd_pcm_substream *substream,snd_hdac_ext_link_stream_reset (link_dev); +/* In case of XRUN recovery, reset the FW pipe to clean state */ + mconfig =skl_tplg_be_get_cpr_module (dai, substream->stream); +if (mconfig && (substream->runtime->status->state == +SNDRV_PCM_STATE_XRUN )) +skl_reset_pipe (skl->skl_sst, mconfig->pipe); +snd_hdac_ext_link_stream_setup (link_dev, format_val);snd_hdac_ext_link_set_stream_id (link,hdac_stream (link_dev)->stream_tag);
sound/soc/intel/skylake/skl-topology.h +4 -1
@@ -244,7 +244,8 @@ enum skl_pipe_state {SKL_PIPE_INVALID =0 ,SKL_PIPE_CREATED =1 ,SKL_PIPE_PAUSED =2 , -SKL_PIPE_STARTED =3 +SKL_PIPE_STARTED =3 , +SKL_PIPE_RESET =4 }; struct skl_pipe_module {
@@ -357,6 +358,8 @@ int skl_delete_pipe(struct skl_sst *ctx, struct skl_pipe *pipe);int skl_stop_pipe (struct skl_sst *ctx,struct skl_pipe *pipe); +int skl_reset_pipe (struct skl_sst *ctx,struct skl_pipe *pipe); +int skl_init_module (struct skl_sst *ctx,struct skl_module_cfg *module_config); int skl_bind_modules(struct skl_sst *ctx, struct skl_module_cfg
Signature · 1 line
2.8.1
PATCH 2/10 ASoC: Intel: Skylake: Set the pipe state to paused when paused
In reply to [email protected]From: Jeeja KP <[email protected]>
When pipe is stopped/Paused, set the pipe state to paused instead of created.
--- sound/soc/intel/skylake/skl-messages.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/skylake/skl-messages.c +1 -1
@@ -1125,7 +1125,7 @@ int skl_stop_pipe(struct skl_sst *ctx, struct skl_pipe *pipe)return ret; } - pipe->state =SKL_PIPE_CREATED ; + pipe->state =SKL_PIPE_PAUSED ;return 0 ; }
Signature · 1 line
2.5.0
Mark Brown
maintainerRe: [PATCH 02/10] ASoC: Intel: Skylake: Set the pipe state to paused when paused
Quoted 4 lines · On Fri, Jun 03, 2016 at 06:29:35PM +0530, [email protected] wrote:
From: Jeeja KP <[email protected]>
When pipe is stopped/Paused, set the pipe state to paused instead of created.
because...
Re: [PATCH 02/10] ASoC: Intel: Skylake: Set the pipe state to paused when paused
Quoted 7 lines · Mark Brown
Quoted 4 lines · On Fri, Jun 03, 2016 at 06:29:35PM +0530, [email protected] wrote:
From: Jeeja KP <[email protected]>
When pipe is stopped/Paused, set the pipe state to paused instead of created.
because...
after creation of pipe, pipe can be started and stopped mutiple times. So valid state in this case is PAUSED instead of created.
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Set the pipe state to paused when paused" to the asoc tree
In reply to [email protected]The patch
ASoC: Intel: Skylake: Set the pipe state to paused when paused
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
353f72aa77581926c0634fffe168f206435a8fc6Mon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Fri, 3 Jun 2016 18:29:35 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Set the pipe state to paused when
paused
When pipe is stopped/Paused, set the pipe state to paused instead of created.
--- sound/soc/intel/skylake/skl-messages.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/skylake/skl-messages.c +1 -1
@@ -1125,7 +1125,7 @@ int skl_stop_pipe(struct skl_sst *ctx, struct skl_pipe *pipe)return ret; } - pipe->state =SKL_PIPE_CREATED ; + pipe->state =SKL_PIPE_PAUSED ;return 0 ; }
Signature · 1 line
2.8.1
PATCH 3/10 ASoC: Intel: Skylake: Don't pause stopped pipeline while deleting
In reply to [email protected]From: Dharageswari R <[email protected]>
If pipeline is not STARTED, we do not need to pause pipeline while deleting.
--- sound/soc/intel/skylake/skl-messages.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
sound/soc/intel/skylake/skl-messages.c +11 -9
@@ -1046,7 +1046,7 @@ int skl_delete_pipe(struct skl_sst *ctx, struct skl_pipe *pipe)dev_dbg (ctx->dev,"%s: pipe = %d\n" , __func__, pipe->ppl_id); -/* If pipe is not started, do not try to stop the pipe in FW. */ +/* If pipe is started, do stop the pipe in FW. */ if (pipe->state >SKL_PIPE_STARTED ) { ret =skl_set_pipe_state (ctx, pipe,PPL_PAUSED );if (ret <0 ) {
@@ -1055,18 +1055,20 @@ int skl_delete_pipe(struct skl_sst *ctx, struct skl_pipe *pipe) } pipe->state =SKL_PIPE_PAUSED ; - }else { -/* If pipe was not created in FW, do not try to delete it */ -if (pipe->state <SKL_PIPE_CREATED ) -return 0 ; + } - ret =skl_ipc_delete_pipeline (&ctx->ipc, pipe->ppl_id); -if (ret <0 ) -dev_err (ctx->dev,"Failed to delete pipeline\n" ); +/* If pipe was not created in FW, do not try to delete it */ +if (pipe->state <SKL_PIPE_CREATED ) +return 0 ; - pipe->state =SKL_PIPE_INVALID ; + ret =skl_ipc_delete_pipeline (&ctx->ipc, pipe->ppl_id); +if (ret <0 ) { +dev_err (ctx->dev,"Failed to delete pipeline\n" ); +return ret; } + pipe->state =SKL_PIPE_INVALID ; +return ret; }
Signature · 1 line
2.5.0
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Don't pause stopped pipeline while deleting" to the asoc tree
The patch
ASoC: Intel: Skylake: Don't pause stopped pipeline while deleting
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
1ae7ca041a460502b0f9877d84d0f0d9bed9cb72Mon Sep 17 00:00:00 2001
From: Dharageswari R <[email protected]>
Date: Fri, 3 Jun 2016 18:29:36 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Don't pause stopped pipeline while
deleting
If pipeline is not STARTED, we do not need to pause pipeline while deleting.
--- sound/soc/intel/skylake/skl-messages.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
sound/soc/intel/skylake/skl-messages.c +11 -9
@@ -1046,7 +1046,7 @@ int skl_delete_pipe(struct skl_sst *ctx, struct skl_pipe *pipe)dev_dbg (ctx->dev,"%s: pipe = %d\n" , __func__, pipe->ppl_id); -/* If pipe is not started, do not try to stop the pipe in FW. */ +/* If pipe is started, do stop the pipe in FW. */ if (pipe->state >SKL_PIPE_STARTED ) { ret =skl_set_pipe_state (ctx, pipe,PPL_PAUSED );if (ret <0 ) {
@@ -1055,18 +1055,20 @@ int skl_delete_pipe(struct skl_sst *ctx, struct skl_pipe *pipe) } pipe->state =SKL_PIPE_PAUSED ; - }else { -/* If pipe was not created in FW, do not try to delete it */ -if (pipe->state <SKL_PIPE_CREATED ) -return 0 ; + } - ret =skl_ipc_delete_pipeline (&ctx->ipc, pipe->ppl_id); -if (ret <0 ) -dev_err (ctx->dev,"Failed to delete pipeline\n" ); +/* If pipe was not created in FW, do not try to delete it */ +if (pipe->state <SKL_PIPE_CREATED ) +return 0 ; - pipe->state =SKL_PIPE_INVALID ; + ret =skl_ipc_delete_pipeline (&ctx->ipc, pipe->ppl_id); +if (ret <0 ) { +dev_err (ctx->dev,"Failed to delete pipeline\n" ); +return ret; } + pipe->state =SKL_PIPE_INVALID ; +return ret; }
Signature · 1 line
2.8.1
PATCH 4/10 ASoC: Intel: Skylake: Disable SRAM Retention before D3
In reply to [email protected]From: Dharageswari R <[email protected]>
SW needs to set the PGCTL.LSRMD = 1 to disable LPSRAM retention feature,otherwise it may lead to SRAM ECC Errors.
--- sound/soc/intel/skylake/skl.c | 3 +++ sound/soc/intel/skylake/skl.h | 2 ++ 2 files changed, 5 insertions(+)
sound/soc/intel/skylake/skl.c +3 -0
@@ -184,6 +184,7 @@ static int _skl_suspend(struct hdac_ext_bus *ebus) {struct skl *skl =ebus_to_skl (ebus);struct hdac_bus *bus =ebus_to_hbus (ebus); +struct pci_dev *pci =to_pci_dev (bus->dev);int ret;snd_hdac_ext_bus_link_power_down_all (ebus);
@@ -193,6 +194,8 @@ static int _skl_suspend(struct hdac_ext_bus *ebus)return ret;snd_hdac_bus_stop_chip (bus); +update_pci_dword (pci,AZX_PCIREG_PGCTL , +AZX_PGCTL_LSRMD_MASK ,AZX_PGCTL_LSRMD_MASK );skl_enable_miscbdcge (bus->dev, false);snd_hdac_bus_enter_link_reset (bus);skl_enable_miscbdcge (bus->dev, true);
sound/soc/intel/skylake/skl.h +2 -0
@@ -48,6 +48,8 @@#define AZX_REG_VS_SDXEFIFOS_XBASE 0x1094#define AZX_REG_VS_SDXEFIFOS_XINTERVAL 0x20 +#define AZX_PCIREG_PGCTL 0x44 +#define AZX_PGCTL_LSRMD_MASK (1 << 4)#define AZX_PCIREG_CGCTL 0x48#define AZX_CGCTL_MISCBDCGE_MASK (1 << 6)
Signature · 1 line
2.5.0
Re: [PATCH 04/10] ASoC: Intel: Skylake: Disable SRAM Retention before D3
Quoted 5 lines · On Fri, 03 Jun 2016 14:59:37 +0200, [email protected] wrote:
From: Dharageswari R <[email protected]>
SW needs to set the PGCTL.LSRMD = 1 to disable LPSRAM retention feature,otherwise it may lead to SRAM ECC Errors.
Is this needed only for ASoC driver, or for SKL in general?
thanks,
Takashi
Quoted 51 lines
Signed-off-by Dharageswari R <[email protected]>Signed-off-by Jeeja KP <[email protected]>Signed-off-by Vinod Koul <[email protected]>--- sound/soc/intel/skylake/skl.c | 3 +++ sound/soc/intel/skylake/skl.h | 2 ++ 2 files changed, 5 insertions(+)sound/soc/intel/skylake/skl.c +3
-0@@ -184,6 +184,7 @@ static int _skl_suspend(struct hdac_ext_bus *ebus) {struct skl *skl =ebus_to_skl (ebus);struct hdac_bus *bus =ebus_to_hbus (ebus); +struct pci_dev *pci =to_pci_dev (bus->dev);int ret;snd_hdac_ext_bus_link_power_down_all (ebus);@@ -193,6 +194,8 @@ static int _skl_suspend(struct hdac_ext_bus *ebus)return ret;snd_hdac_bus_stop_chip (bus); +update_pci_dword (pci,AZX_PCIREG_PGCTL , +AZX_PGCTL_LSRMD_MASK ,AZX_PGCTL_LSRMD_MASK );skl_enable_miscbdcge (bus->dev, false);snd_hdac_bus_enter_link_reset (bus);skl_enable_miscbdcge (bus->dev, true);sound/soc/intel/skylake/skl.h +2
-0@@ -48,6 +48,8 @@#define AZX_REG_VS_SDXEFIFOS_XBASE 0x1094#define AZX_REG_VS_SDXEFIFOS_XINTERVAL 0x20 +#define AZX_PCIREG_PGCTL 0x44 +#define AZX_PGCTL_LSRMD_MASK (1 << 4)#define AZX_PCIREG_CGCTL 0x48#define AZX_CGCTL_MISCBDCGE_MASK (1 << 6)Signature · 6 lines
2.5.0 _______________________________________________ Alsa-devel mailing list [email protected] http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Re: [PATCH 04/10] ASoC: Intel: Skylake: Disable SRAM Retention before D3
Quoted 17 lines
-----Original Message-----
From: [email protected] [mailto:alsa-devel-bounces@alsa- project.org] On Behalf Of Takashi Iwai
Sent: Friday, June 3, 2016 6:34 PM
To: Kp, Jeeja <[email protected]>
Cc: [email protected]; R, Dharageswari <[email protected]>; Patches Audio <[email protected]>; Koul, Vinod <[email protected]>; [email protected]; Girdwood, Liam R <[email protected]>
Subject: Re: [alsa-devel] [PATCH 04/10] ASoC: Intel: Skylake: Disable SRAM Retention before D3Quoted 1 line · On Fri, 03 Jun 2016 14:59:37 +0200, [email protected] wrote:
Quoted 7 lines
Quoted 4 lines
From: Dharageswari R <[email protected]>
SW needs to set the PGCTL.LSRMD = 1 to disable LPSRAM retention feature,otherwise it may lead to SRAM ECC Errors.
Is this needed only for ASoC driver, or for SKL in general?
Only needed for ASoC driver.
Regards,
Rakesh
Quoted 59 lines
thanks,
Takashi
Quoted 46 lines
Signed-off-by Dharageswari R <[email protected]>Signed-off-by Jeeja KP <[email protected]>Signed-off-by Vinod Koul <[email protected]>--- sound/soc/intel/skylake/skl.c | 3 +++ sound/soc/intel/skylake/skl.h | 2 ++ 2 files changed, 5 insertions(+)sound/soc/intel/skylake/skl.c +3
-0@@ -184,6 +184,7 @@ static int _skl_suspend(struct hdac_ext_bus *ebus) {struct skl *skl =ebus_to_skl (ebus);struct hdac_bus *bus =ebus_to_hbus (ebus); +struct pci_dev *pci =to_pci_dev (bus->dev);int ret;snd_hdac_ext_bus_link_power_down_all (ebus);@@ -193,6 +194,8 @@ static int _skl_suspend(struct hdac_ext_bus *ebus)return ret;snd_hdac_bus_stop_chip (bus); +update_pci_dword (pci,AZX_PCIREG_PGCTL , +AZX_PGCTL_LSRMD_MASK ,AZX_PGCTL_LSRMD_MASK );skl_enable_miscbdcge (bus->dev, false);snd_hdac_bus_enter_link_reset (bus);skl_enable_miscbdcge (bus->dev, true);sound/soc/intel/skylake/skl.h +2
-1@@ -48,6 +48,8 @@#define AZX_REG_VS_SDXEFIFOS_XBASE 0x1094#define AZX_REG_VS_SDXEFIFOS_XINTERVAL 0x20 +#define AZX_PCIREG_PGCTL 0x44 +#define AZX_PGCTL_LSRMD_MASK (1 << 4)#define AZX_PCIREG_CGCTL 0x48#define AZX_CGCTL_MISCBDCGE_MASK (1 << 6) --2.5.0
Quoted 5 lines
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Disable SRAM Retention before D3" to the asoc tree
In reply to [email protected]The patch
ASoC: Intel: Skylake: Disable SRAM Retention before D3
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
51a01b8c2ea632ed9a57f98c234a0cd9dafe181aMon Sep 17 00:00:00 2001
From: Dharageswari R <[email protected]>
Date: Fri, 3 Jun 2016 18:29:37 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Disable SRAM Retention before D3
SW needs to set the PGCTL.LSRMD = 1 to disable LPSRAM retention feature,otherwise it may lead to SRAM ECC Errors.
--- sound/soc/intel/skylake/skl.c | 3 +++ sound/soc/intel/skylake/skl.h | 2 ++ 2 files changed, 5 insertions(+)
sound/soc/intel/skylake/skl.c +3 -0
@@ -186,6 +186,7 @@ static int _skl_suspend(struct hdac_ext_bus *ebus) {struct skl *skl =ebus_to_skl (ebus);struct hdac_bus *bus =ebus_to_hbus (ebus); +struct pci_dev *pci =to_pci_dev (bus->dev);int ret;snd_hdac_ext_bus_link_power_down_all (ebus);
@@ -195,6 +196,8 @@ static int _skl_suspend(struct hdac_ext_bus *ebus)return ret;snd_hdac_bus_stop_chip (bus); +update_pci_dword (pci,AZX_PCIREG_PGCTL , +AZX_PGCTL_LSRMD_MASK ,AZX_PGCTL_LSRMD_MASK );skl_enable_miscbdcge (bus->dev, false);snd_hdac_bus_enter_link_reset (bus);skl_enable_miscbdcge (bus->dev, true);
sound/soc/intel/skylake/skl.h +2 -0
@@ -48,6 +48,8 @@#define AZX_REG_VS_SDXEFIFOS_XBASE 0x1094#define AZX_REG_VS_SDXEFIFOS_XINTERVAL 0x20 +#define AZX_PCIREG_PGCTL 0x44 +#define AZX_PGCTL_LSRMD_MASK (1 << 4)#define AZX_PCIREG_CGCTL 0x48#define AZX_CGCTL_MISCBDCGE_MASK (1 << 6)
Signature · 1 line
2.8.1
PATCH 5/10 ASoC: Intel: Skylake: Avoid freeing up of unallocated memory/mcps
In reply to [email protected]From: Dharageswari R <[email protected]>
When DSP pipe/module is not initialized successfully, memory/mcps is not allocated. So check the pipe/module state to avoid freeing up of unallocated memory/mcps. And allocate resources when pipe/ module is initialized successfully.
--- sound/soc/intel/skylake/skl-topology.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
sound/soc/intel/skylake/skl-topology.c +9 -6
@@ -514,8 +514,6 @@ skl_tplg_init_pipe_modules(struct skl *skl, struct skl_pipe *pipe)if (!skl_is_pipe_mcps_avail (skl, mconfig))return -ENOMEM ; -skl_tplg_alloc_pipe_mcps (skl, mconfig); -if (mconfig->is_loadable && ctx->dsp->fw_ops.load_mod) { ret = ctx->dsp->fw_ops.load_mod (ctx->dsp, mconfig->id.module_id, mconfig->guid);
@@ -539,6 +537,7 @@ skl_tplg_init_pipe_modules(struct skl *skl, struct skl_pipe *pipe)if (ret <0 )return ret; +skl_tplg_alloc_pipe_mcps (skl, mconfig); ret =skl_tplg_set_module_params (w, ctx);if (ret <0 )return ret;
@@ -591,9 +590,6 @@ static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,if (!skl_is_pipe_mem_avail (skl, mconfig))return -ENOMEM ; -skl_tplg_alloc_pipe_mem (skl, mconfig); -skl_tplg_alloc_pipe_mcps (skl, mconfig); -/* * Create a list of modules for pipe. * This list contains modules from source to sink
@@ -602,6 +598,9 @@ static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,if (ret <0 )return ret; +skl_tplg_alloc_pipe_mem (skl, mconfig); +skl_tplg_alloc_pipe_mcps (skl, mconfig); +/* * we create a w_list of all widgets in that pipe. This list is not * freed on PMD event as widgets within a pipe are static. This
@@ -949,13 +948,17 @@ static int skl_tplg_mixer_dapm_post_pmd_event(struct snd_soc_dapm_widget *w,struct skl_pipe *s_pipe = mconfig->pipe;int ret =0 ; +if (s_pipe->state ==SKL_PIPE_INVALID ) +return -EINVAL ; +skl_tplg_free_pipe_mcps (skl, mconfig);skl_tplg_free_pipe_mem (skl, mconfig);list_for_each_entry (w_module, &s_pipe->w_list, node) { dst_module = w_module->w->priv; -skl_tplg_free_pipe_mcps (skl, dst_module); +if (mconfig->m_state >=SKL_MODULE_INIT_DONE ) +skl_tplg_free_pipe_mcps (skl, dst_module);if (src_module ==NULL ) { src_module = dst_module;continue ;
Signature · 1 line
2.5.0
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Avoid freeing up of unallocated memory/mcps" to the asoc tree
The patch
ASoC: Intel: Skylake: Avoid freeing up of unallocated memory/mcps
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
260eb73aa252d0cbdfe11523d5def9d6d00625d4Mon Sep 17 00:00:00 2001
From: Dharageswari R <[email protected]>
Date: Fri, 3 Jun 2016 18:29:38 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Avoid freeing up of unallocated
memory/mcps
When DSP pipe/module is not initialized successfully, memory/mcps is not allocated. So check the pipe/module state to avoid freeing up of unallocated memory/mcps. And allocate resources when pipe/ module is initialized successfully.
--- sound/soc/intel/skylake/skl-topology.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
sound/soc/intel/skylake/skl-topology.c +9 -6
@@ -514,8 +514,6 @@ skl_tplg_init_pipe_modules(struct skl *skl, struct skl_pipe *pipe)if (!skl_is_pipe_mcps_avail (skl, mconfig))return -ENOMEM ; -skl_tplg_alloc_pipe_mcps (skl, mconfig); -if (mconfig->is_loadable && ctx->dsp->fw_ops.load_mod) { ret = ctx->dsp->fw_ops.load_mod (ctx->dsp, mconfig->id.module_id, mconfig->guid);
@@ -539,6 +537,7 @@ skl_tplg_init_pipe_modules(struct skl *skl, struct skl_pipe *pipe)if (ret <0 )return ret; +skl_tplg_alloc_pipe_mcps (skl, mconfig); ret =skl_tplg_set_module_params (w, ctx);if (ret <0 )return ret;
@@ -591,9 +590,6 @@ static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,if (!skl_is_pipe_mem_avail (skl, mconfig))return -ENOMEM ; -skl_tplg_alloc_pipe_mem (skl, mconfig); -skl_tplg_alloc_pipe_mcps (skl, mconfig); -/* * Create a list of modules for pipe. * This list contains modules from source to sink
@@ -602,6 +598,9 @@ static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,if (ret <0 )return ret; +skl_tplg_alloc_pipe_mem (skl, mconfig); +skl_tplg_alloc_pipe_mcps (skl, mconfig); +/* * we create a w_list of all widgets in that pipe. This list is not * freed on PMD event as widgets within a pipe are static. This
@@ -949,13 +948,17 @@ static int skl_tplg_mixer_dapm_post_pmd_event(struct snd_soc_dapm_widget *w,struct skl_pipe *s_pipe = mconfig->pipe;int ret =0 ; +if (s_pipe->state ==SKL_PIPE_INVALID ) +return -EINVAL ; +skl_tplg_free_pipe_mcps (skl, mconfig);skl_tplg_free_pipe_mem (skl, mconfig);list_for_each_entry (w_module, &s_pipe->w_list, node) { dst_module = w_module->w->priv; -skl_tplg_free_pipe_mcps (skl, dst_module); +if (mconfig->m_state >=SKL_MODULE_INIT_DONE ) +skl_tplg_free_pipe_mcps (skl, dst_module);if (src_module ==NULL ) { src_module = dst_module;continue ;
Signature · 1 line
2.8.1
PATCH 6/10 ASoC: Intel: Skylake: Clean up of driver resources in suspend
In reply to [email protected]From: Dharageswari R <[email protected]>
On suspend firmware is re-initialized so resources are reset inside firmware. Driver should also clear the firmware counters at this time.
--- sound/soc/intel/skylake/skl-pcm.c | 12 +++++++-- sound/soc/intel/skylake/skl-sst-ipc.h | 1 + sound/soc/intel/skylake/skl-sst.c | 10 +++++++ sound/soc/intel/skylake/skl-topology.c | 49 ++++++++++++++++++++++++++++++++++ sound/soc/intel/skylake/skl.c | 1 + sound/soc/intel/skylake/skl.h | 2 ++ 6 files changed, 73 insertions(+), 2 deletions(-)
sound/soc/intel/skylake/skl-pcm.c +10 -2
@@ -1197,9 +1197,17 @@ static int skl_pcm_new(struct snd_soc_pcm_runtime *rtd)static int skl_platform_soc_probe (struct snd_soc_platform *platform) {struct hdac_ext_bus *ebus =dev_get_drvdata (platform->dev); +struct skl *skl =ebus_to_skl (ebus); +int ret; -if (ebus->ppcap) -return skl_tplg_init (platform, ebus); +if (ebus->ppcap) { + ret =skl_tplg_init (platform, ebus); +if (ret <0 ) { +dev_err (platform->dev,"Failed to init topology!\n" ); +return ret; + } + skl->platform = platform; + }return 0 ; }
sound/soc/intel/skylake/skl-sst-ipc.h +1 -0
@@ -139,5 +139,6 @@ void skl_ipc_int_disable(struct sst_dsp *dsp);bool skl_ipc_int_status (struct sst_dsp *dsp);void skl_ipc_free (struct sst_generic_ipc *ipc);int skl_ipc_init (struct device *dev,struct skl_sst *skl); +void skl_clear_module_cnt (struct sst_dsp *ctx);#endif /* __SKL_IPC_H */
sound/soc/intel/skylake/skl-sst.c +10 -0
@@ -379,6 +379,16 @@ static int skl_unload_module(struct sst_dsp *ctx, u16 mod_id)return ret; } +void skl_clear_module_cnt (struct sst_dsp *ctx) +{ +struct skl_module_table *module; + +list_for_each_entry (module, &ctx->module_list, list) { + module->usage_cnt =0 ; + } +} +EXPORT_SYMBOL_GPL (skl_clear_module_cnt); +static void skl_clear_module_table (struct sst_dsp *ctx) {struct skl_module_table *module, *tmp;
sound/soc/intel/skylake/skl-topology.c +49 -0
55 lines not on this page · raw message
sound/soc/intel/skylake/skl.c +1 -0
@@ -199,6 +199,7 @@ static int _skl_suspend(struct hdac_ext_bus *ebus)skl_enable_miscbdcge (bus->dev, false);snd_hdac_bus_enter_link_reset (bus);skl_enable_miscbdcge (bus->dev, true); +skl_cleanup_resources (skl);return 0 ; }
sound/soc/intel/skylake/skl.h +2 -0
@@ -67,6 +67,7 @@ struct skl { unsigned int init_failed:1; /* delayed init failed */struct platform_device *dmic_dev;struct platform_device *i2s_dev; +struct snd_soc_platform *platform;struct nhlt_acpi_table *nhlt;/* nhlt ptr */ struct skl_sst *skl_sst;/* sst skl ctx */
@@ -115,4 +116,5 @@ int skl_init_dsp(struct skl *skl);int skl_free_dsp (struct skl *skl);int skl_suspend_dsp (struct skl *skl);int skl_resume_dsp (struct skl *skl); +void skl_cleanup_resources (struct skl *skl);#endif /* __SOUND_SOC_SKL_H */
Signature · 1 line
2.5.0
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Clean up of driver resources in suspend" to the asoc tree
The patch
ASoC: Intel: Skylake: Clean up of driver resources 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
fe3f4442e2166453f68f0995fd4a95e98c0cd1c9Mon Sep 17 00:00:00 2001
From: Dharageswari R <[email protected]>
Date: Fri, 3 Jun 2016 18:29:39 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Clean up of driver resources in suspend
On suspend firmware is re-initialized so resources are reset inside firmware. Driver should also clear the firmware counters at this time.
--- sound/soc/intel/skylake/skl-pcm.c | 12 +++++++-- sound/soc/intel/skylake/skl-sst-ipc.h | 1 + sound/soc/intel/skylake/skl-sst.c | 10 +++++++ sound/soc/intel/skylake/skl-topology.c | 49 ++++++++++++++++++++++++++++++++++ sound/soc/intel/skylake/skl.c | 1 + sound/soc/intel/skylake/skl.h | 2 ++ 6 files changed, 73 insertions(+), 2 deletions(-)
sound/soc/intel/skylake/skl-pcm.c +10 -2
@@ -1197,9 +1197,17 @@ static int skl_pcm_new(struct snd_soc_pcm_runtime *rtd)static int skl_platform_soc_probe (struct snd_soc_platform *platform) {struct hdac_ext_bus *ebus =dev_get_drvdata (platform->dev); +struct skl *skl =ebus_to_skl (ebus); +int ret; -if (ebus->ppcap) -return skl_tplg_init (platform, ebus); +if (ebus->ppcap) { + ret =skl_tplg_init (platform, ebus); +if (ret <0 ) { +dev_err (platform->dev,"Failed to init topology!\n" ); +return ret; + } + skl->platform = platform; + }return 0 ; }
sound/soc/intel/skylake/skl-sst-ipc.h +1 -0
@@ -139,5 +139,6 @@ void skl_ipc_int_disable(struct sst_dsp *dsp);bool skl_ipc_int_status (struct sst_dsp *dsp);void skl_ipc_free (struct sst_generic_ipc *ipc);int skl_ipc_init (struct device *dev,struct skl_sst *skl); +void skl_clear_module_cnt (struct sst_dsp *ctx);#endif /* __SKL_IPC_H */
sound/soc/intel/skylake/skl-sst.c +10 -0
@@ -379,6 +379,16 @@ static int skl_unload_module(struct sst_dsp *ctx, u16 mod_id)return ret; } +void skl_clear_module_cnt (struct sst_dsp *ctx) +{ +struct skl_module_table *module; + +list_for_each_entry (module, &ctx->module_list, list) { + module->usage_cnt =0 ; + } +} +EXPORT_SYMBOL_GPL (skl_clear_module_cnt); +static void skl_clear_module_table (struct sst_dsp *ctx) {struct skl_module_table *module, *tmp;
sound/soc/intel/skylake/skl-topology.c +49 -0
55 lines not on this page · raw message
sound/soc/intel/skylake/skl.c +1 -0
@@ -201,6 +201,7 @@ static int _skl_suspend(struct hdac_ext_bus *ebus)skl_enable_miscbdcge (bus->dev, false);snd_hdac_bus_enter_link_reset (bus);skl_enable_miscbdcge (bus->dev, true); +skl_cleanup_resources (skl);return 0 ; }
sound/soc/intel/skylake/skl.h +2 -0
@@ -67,6 +67,7 @@ struct skl { unsigned int init_failed:1; /* delayed init failed */struct platform_device *dmic_dev;struct platform_device *i2s_dev; +struct snd_soc_platform *platform;struct nhlt_acpi_table *nhlt;/* nhlt ptr */ struct skl_sst *skl_sst;/* sst skl ctx */
@@ -121,4 +122,5 @@ int skl_init_dsp(struct skl *skl);int skl_free_dsp (struct skl *skl);int skl_suspend_dsp (struct skl *skl);int skl_resume_dsp (struct skl *skl); +void skl_cleanup_resources (struct skl *skl);#endif /* __SOUND_SOC_SKL_H */
Signature · 1 line
2.8.1
PATCH 7/10 ASoC: Intel: Skylake: Create Pipe to widget list in soc probe
In reply to [email protected]From: Jeeja KP <[email protected]>
We need to Identify the DSP pipe type and based on it being a pass thru pipeline or not, we need to copy the pipeline params.
Pipe to widget mapping was earlier done in pre PMD widget handler, but since the pipe type would now be required in hw_params for bypass pipelines we need to move this to be done during the ASoC probe of the platform component.
--- sound/soc/intel/skylake/skl-topology.c | 85 ++++++++++++++-------------------- 1 file changed, 34 insertions(+), 51 deletions(-)
sound/soc/intel/skylake/skl-topology.c +34 -51
@@ -379,43 +379,6 @@ static void skl_tplg_update_module_params(struct snd_soc_dapm_widget *w, }/* -* A pipe can have multiple modules, each of them will be a DAPM widget as -* well. While managing a pipeline we need to get the list of all the -* widgets in a pipelines, so this helper - skl_tplg_get_pipe_widget() helps -* to get the SKL type widgets in that pipeline -*/ -static int skl_tplg_alloc_pipe_widget (struct device *dev, -struct snd_soc_dapm_widget *w,struct skl_pipe *pipe) -{ -struct skl_module_cfg *src_module =NULL ; -struct snd_soc_dapm_path *p =NULL ; -struct skl_pipe_module *p_module =NULL ; - - p_module =devm_kzalloc (dev,sizeof (*p_module),GFP_KERNEL ); -if (!p_module) -return -ENOMEM ; - - p_module->w = w; -list_add_tail (&p_module->node, &pipe->w_list); - -snd_soc_dapm_widget_for_each_sink_path (w, p) { -if ((p->sink->priv ==NULL ) - && (!is_skl_dsp_widget_type (w))) -continue ; - -if ((p->sink->priv !=NULL ) && p->connect - &&is_skl_dsp_widget_type (p->sink)) { - - src_module = p->sink->priv; -if (pipe->ppl_id == src_module->pipe->ppl_id) -skl_tplg_alloc_pipe_widget (dev, - p->sink, pipe); - } - } -return 0 ; -} - -/* * some modules can have multiple params set from user control and * need to be set after module is initialized. If set_param flag is * set module params will be done after module is initialised.
@@ -601,20 +564,6 @@ static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,skl_tplg_alloc_pipe_mem (skl, mconfig);skl_tplg_alloc_pipe_mcps (skl, mconfig); -/* -* we create a w_list of all widgets in that pipe. This list is not -* freed on PMD event as widgets within a pipe are static. This -* saves us cycles to get widgets in pipe every time. -* -* So if we have already initialized all the widgets of a pipeline -* we skip, so check for list_empty and create the list if empty -*/ -if (list_empty (&s_pipe->w_list)) { - ret =skl_tplg_alloc_pipe_widget (ctx->dev, w, s_pipe); -if (ret <0 ) -return ret; - } -/* Init all pipe modules from source to sink */ ret =skl_tplg_init_pipe_modules (skl, s_pipe);if (ret <0 )
@@ -1789,6 +1738,37 @@ static struct snd_soc_tplg_ops skl_tplg_ops = { .bytes_ext_ops_count = ARRAY_SIZE(skl_tlv_ops), }; +/* +* A pipe can have multiple modules, each of them will be a DAPM widget as +* well. While managing a pipeline we need to get the list of all the +* widgets in a pipelines, so this helper - skl_tplg_create_pipe_widget_list() +* helps to get the SKL type widgets in that pipeline +*/ +static int skl_tplg_create_pipe_widget_list (struct snd_soc_platform *platform) +{ +struct snd_soc_dapm_widget *w; +struct skl_module_cfg *mcfg =NULL ; +struct skl_pipe_module *p_module =NULL ; +struct skl_pipe *pipe; + +list_for_each_entry (w, &platform->component.card->widgets, list) { +if (is_skl_dsp_widget_type (w) && w->priv !=NULL ) { + mcfg = w->priv; + pipe = mcfg->pipe; + + p_module =devm_kzalloc (platform->dev, +sizeof (*p_module),GFP_KERNEL ); +if (!p_module) +return -ENOMEM ; + + p_module->w = w; +list_add_tail (&p_module->node, &pipe->w_list); + } + } + +return 0 ; +} +/* This will be read from topology manifest, currently defined here */ #define SKL_MAX_MCPS 30000000#define SKL_FW_MAX_MEM 1000000
@@ -1831,6 +1811,9 @@ int skl_tplg_init(struct snd_soc_platform *platform, struct hdac_ext_bus *ebus) skl->resource.max_mem =SKL_FW_MAX_MEM ; skl->tplg = fw; + ret =skl_tplg_create_pipe_widget_list (platform); +if (ret <0 ) +return ret;return 0 ; }
Signature · 1 line
2.5.0
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Create Pipe to widget list in soc probe" to the asoc tree
The patch
ASoC: Intel: Skylake: Create Pipe to widget list in soc probe
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
287af4f9f2679fd897e492338e4729c68f0c4a17Mon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Fri, 3 Jun 2016 18:29:40 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Create Pipe to widget list in soc probe
We need to Identify the DSP pipe type and based on it being a pass thru pipeline or not, we need to copy the pipeline params.
Pipe to widget mapping was earlier done in pre PMD widget handler, but since the pipe type would now be required in hw_params for bypass pipelines we need to move this to be done during the ASoC probe of the platform component.
--- sound/soc/intel/skylake/skl-topology.c | 85 ++++++++++++++-------------------- 1 file changed, 34 insertions(+), 51 deletions(-)
sound/soc/intel/skylake/skl-topology.c +34 -51
@@ -379,43 +379,6 @@ static void skl_tplg_update_module_params(struct snd_soc_dapm_widget *w, }/* -* A pipe can have multiple modules, each of them will be a DAPM widget as -* well. While managing a pipeline we need to get the list of all the -* widgets in a pipelines, so this helper - skl_tplg_get_pipe_widget() helps -* to get the SKL type widgets in that pipeline -*/ -static int skl_tplg_alloc_pipe_widget (struct device *dev, -struct snd_soc_dapm_widget *w,struct skl_pipe *pipe) -{ -struct skl_module_cfg *src_module =NULL ; -struct snd_soc_dapm_path *p =NULL ; -struct skl_pipe_module *p_module =NULL ; - - p_module =devm_kzalloc (dev,sizeof (*p_module),GFP_KERNEL ); -if (!p_module) -return -ENOMEM ; - - p_module->w = w; -list_add_tail (&p_module->node, &pipe->w_list); - -snd_soc_dapm_widget_for_each_sink_path (w, p) { -if ((p->sink->priv ==NULL ) - && (!is_skl_dsp_widget_type (w))) -continue ; - -if ((p->sink->priv !=NULL ) && p->connect - &&is_skl_dsp_widget_type (p->sink)) { - - src_module = p->sink->priv; -if (pipe->ppl_id == src_module->pipe->ppl_id) -skl_tplg_alloc_pipe_widget (dev, - p->sink, pipe); - } - } -return 0 ; -} - -/* * some modules can have multiple params set from user control and * need to be set after module is initialized. If set_param flag is * set module params will be done after module is initialised.
@@ -601,20 +564,6 @@ static int skl_tplg_mixer_dapm_pre_pmu_event(struct snd_soc_dapm_widget *w,skl_tplg_alloc_pipe_mem (skl, mconfig);skl_tplg_alloc_pipe_mcps (skl, mconfig); -/* -* we create a w_list of all widgets in that pipe. This list is not -* freed on PMD event as widgets within a pipe are static. This -* saves us cycles to get widgets in pipe every time. -* -* So if we have already initialized all the widgets of a pipeline -* we skip, so check for list_empty and create the list if empty -*/ -if (list_empty (&s_pipe->w_list)) { - ret =skl_tplg_alloc_pipe_widget (ctx->dev, w, s_pipe); -if (ret <0 ) -return ret; - } -/* Init all pipe modules from source to sink */ ret =skl_tplg_init_pipe_modules (skl, s_pipe);if (ret <0 )
@@ -1789,6 +1738,37 @@ static struct snd_soc_tplg_ops skl_tplg_ops = { .bytes_ext_ops_count = ARRAY_SIZE(skl_tlv_ops), }; +/* +* A pipe can have multiple modules, each of them will be a DAPM widget as +* well. While managing a pipeline we need to get the list of all the +* widgets in a pipelines, so this helper - skl_tplg_create_pipe_widget_list() +* helps to get the SKL type widgets in that pipeline +*/ +static int skl_tplg_create_pipe_widget_list (struct snd_soc_platform *platform) +{ +struct snd_soc_dapm_widget *w; +struct skl_module_cfg *mcfg =NULL ; +struct skl_pipe_module *p_module =NULL ; +struct skl_pipe *pipe; + +list_for_each_entry (w, &platform->component.card->widgets, list) { +if (is_skl_dsp_widget_type (w) && w->priv !=NULL ) { + mcfg = w->priv; + pipe = mcfg->pipe; + + p_module =devm_kzalloc (platform->dev, +sizeof (*p_module),GFP_KERNEL ); +if (!p_module) +return -ENOMEM ; + + p_module->w = w; +list_add_tail (&p_module->node, &pipe->w_list); + } + } + +return 0 ; +} +/* This will be read from topology manifest, currently defined here */ #define SKL_MAX_MCPS 30000000#define SKL_FW_MAX_MEM 1000000
@@ -1831,6 +1811,9 @@ int skl_tplg_init(struct snd_soc_platform *platform, struct hdac_ext_bus *ebus) skl->resource.max_mem =SKL_FW_MAX_MEM ; skl->tplg = fw; + ret =skl_tplg_create_pipe_widget_list (platform); +if (ret <0 ) +return ret;return 0 ; }
Signature · 1 line
2.8.1
PATCH 8/10 ASoC: Intel: Skylake: Set the DSP pipe type
In reply to [email protected]From: Jeeja KP <[email protected]>
DSP pipe type can be a pass through or it can be processing pipe. In case of pass through pipe, it is a single pipeline with both host and link copier in the same pipeline.
Identify the DSP pipe type if it pass through or not. Pass through pipe is identified by checking if it has both host and link copier in the same pipeline.
--- sound/soc/intel/skylake/skl-topology.c | 27 +++++++++++++++++++++++++++ sound/soc/intel/skylake/skl-topology.h | 1 + 2 files changed, 28 insertions(+)
sound/soc/intel/skylake/skl-topology.c +27 -0
@@ -1769,6 +1769,29 @@ static int skl_tplg_create_pipe_widget_list(struct snd_soc_platform *platform)return 0 ; } +static void skl_tplg_set_pipe_type (struct skl *skl,struct skl_pipe *pipe) +{ +struct skl_pipe_module *w_module; +struct snd_soc_dapm_widget *w; +struct skl_module_cfg *mconfig; +bool host_found = false, link_found = false; + +list_for_each_entry (w_module, &pipe->w_list, node) { + w = w_module->w; + mconfig = w->priv; + +if (mconfig->dev_type ==SKL_DEVICE_HDAHOST ) + host_found = true; +else if (mconfig->dev_type !=SKL_DEVICE_NONE ) + link_found = true; + } + +if (host_found && link_found) + pipe->passthru = true; +else + pipe->passthru = false; +} +/* This will be read from topology manifest, currently defined here */ #define SKL_MAX_MCPS 30000000#define SKL_FW_MAX_MEM 1000000
@@ -1782,6 +1805,7 @@ int skl_tplg_init(struct snd_soc_platform *platform, struct hdac_ext_bus *ebus)const struct firmware *fw;struct hdac_bus *bus =ebus_to_hbus (ebus);struct skl *skl =ebus_to_skl (ebus); +struct skl_pipeline *ppl; ret =request_firmware (&fw, skl->tplg_name, bus->dev);if (ret <0 ) {
@@ -1815,5 +1839,8 @@ int skl_tplg_init(struct snd_soc_platform *platform, struct hdac_ext_bus *ebus)if (ret <0 )return ret; +list_for_each_entry (ppl, &skl->ppl_list, node) +skl_tplg_set_pipe_type (skl, ppl->pipe); +return 0 ; }
sound/soc/intel/skylake/skl-topology.h +1 -0
@@ -271,6 +271,7 @@ struct skl_pipe {struct skl_pipe_params *p_params;enum skl_pipe_state state;struct list_head w_list; +bool passthru; };enum skl_module_state {
Signature · 1 line
2.5.0
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Set the DSP pipe type" to the asoc tree
The patch
ASoC: Intel: Skylake: Set the DSP pipe type
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
f0aa94faa0e8990647eed4d8e232e1e6d5671ff2Mon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Fri, 3 Jun 2016 18:29:41 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Set the DSP pipe type
DSP pipe type can be a pass through or it can be processing pipe. In case of pass through pipe, it is a single pipeline with both host and link copier in the same pipeline.
Identify the DSP pipe type if it pass through or not. Pass through pipe is identified by checking if it has both host and link copier in the same pipeline.
--- sound/soc/intel/skylake/skl-topology.c | 27 +++++++++++++++++++++++++++ sound/soc/intel/skylake/skl-topology.h | 1 + 2 files changed, 28 insertions(+)
sound/soc/intel/skylake/skl-topology.c +27 -0
@@ -1769,6 +1769,29 @@ static int skl_tplg_create_pipe_widget_list(struct snd_soc_platform *platform)return 0 ; } +static void skl_tplg_set_pipe_type (struct skl *skl,struct skl_pipe *pipe) +{ +struct skl_pipe_module *w_module; +struct snd_soc_dapm_widget *w; +struct skl_module_cfg *mconfig; +bool host_found = false, link_found = false; + +list_for_each_entry (w_module, &pipe->w_list, node) { + w = w_module->w; + mconfig = w->priv; + +if (mconfig->dev_type ==SKL_DEVICE_HDAHOST ) + host_found = true; +else if (mconfig->dev_type !=SKL_DEVICE_NONE ) + link_found = true; + } + +if (host_found && link_found) + pipe->passthru = true; +else + pipe->passthru = false; +} +/* This will be read from topology manifest, currently defined here */ #define SKL_MAX_MCPS 30000000#define SKL_FW_MAX_MEM 1000000
@@ -1782,6 +1805,7 @@ int skl_tplg_init(struct snd_soc_platform *platform, struct hdac_ext_bus *ebus)const struct firmware *fw;struct hdac_bus *bus =ebus_to_hbus (ebus);struct skl *skl =ebus_to_skl (ebus); +struct skl_pipeline *ppl; ret =request_firmware (&fw, skl->tplg_name, bus->dev);if (ret <0 ) {
@@ -1815,5 +1839,8 @@ int skl_tplg_init(struct snd_soc_platform *platform, struct hdac_ext_bus *ebus)if (ret <0 )return ret; +list_for_each_entry (ppl, &skl->ppl_list, node) +skl_tplg_set_pipe_type (skl, ppl->pipe); +return 0 ; }
sound/soc/intel/skylake/skl-topology.h +1 -0
@@ -271,6 +271,7 @@ struct skl_pipe {struct skl_pipe_params *p_params;enum skl_pipe_state state;struct list_head w_list; +bool passthru; };enum skl_module_state {
Signature · 1 line
2.8.1
PATCH 9/10 ASoC: Intel: Skylake: Copy the pipe parameter by pipe type
In reply to [email protected]From: Jeeja KP <[email protected]>
For pass through pipe, Host and Link DMA id's are valid, instead of overwriting the params set the host and link based on pipe type.
--- sound/soc/intel/skylake/skl-topology.c | 39 ++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-)
sound/soc/intel/skylake/skl-topology.c +35 -4
@@ -1111,6 +1111,39 @@ static int skl_tplg_tlv_control_set(struct snd_kcontrol *kcontrol, }/* +* Fill the dma id for host and link. In case of passthrough +* pipeline, this will both host and link in the same +* pipeline, so need to copy the link and host based on dev_type +*/ +static void skl_tplg_fill_dma_id (struct skl_module_cfg *mcfg, +struct skl_pipe_params *params) +{ +struct skl_pipe *pipe = mcfg->pipe; + +if (pipe->passthru) { +switch (mcfg->dev_type) { +case SKL_DEVICE_HDALINK : + pipe->p_params->link_dma_id = params->link_dma_id; +break ; + +case SKL_DEVICE_HDAHOST : + pipe->p_params->host_dma_id = params->host_dma_id; +break ; + +default : +break ; + } + pipe->p_params->s_fmt = params->s_fmt; + pipe->p_params->ch = params->ch; + pipe->p_params->s_freq = params->s_freq; + pipe->p_params->stream = params->stream; + + }else { +memcpy (pipe->p_params, params,sizeof (*params)); + } +} + +/* * The FE params are passed by hw_params of the DAI. * On hw_params, the params are stored in Gateway module of the FE and we * need to calculate the format in DSP module configuration, that
@@ -1120,10 +1153,9 @@ int skl_tplg_update_pipe_params(struct device *dev,struct skl_module_cfg *mconfig, struct skl_pipe_params *params) { - struct skl_pipe *pipe = mconfig->pipe; struct skl_module_fmt *format = NULL; -memcpy (pipe->p_params, params,sizeof (*params)); +skl_tplg_fill_dma_id (mconfig, params);if (params->stream ==SNDRV_PCM_STREAM_PLAYBACK ) format = &mconfig->in_fmt[0 ];
@@ -1310,12 +1342,11 @@ static int skl_tplg_be_fill_pipe_params(struct snd_soc_dai *dai,struct skl_module_cfg *mconfig, struct skl_pipe_params *params) { - struct skl_pipe *pipe = mconfig->pipe; struct nhlt_specific_cfg *cfg;struct skl *skl =get_skl_ctx (dai->dev);int link_type =skl_tplg_be_link_type (mconfig->dev_type); -memcpy (pipe->p_params, params,sizeof (*params)); +skl_tplg_fill_dma_id (mconfig, params);if (link_type ==NHLT_LINK_HDA )return 0 ;
Signature · 1 line
2.5.0
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Copy the pipe parameter by pipe type" to the asoc tree
The patch
ASoC: Intel: Skylake: Copy the pipe parameter by pipe type
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
8871dcb9f0840c642507754b309aa506dc245985Mon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Fri, 3 Jun 2016 18:29:42 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Copy the pipe parameter by pipe type
For pass through pipe, Host and Link DMA id's are valid, instead of overwriting the params set the host and link based on pipe type.
--- sound/soc/intel/skylake/skl-topology.c | 39 ++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-)
sound/soc/intel/skylake/skl-topology.c +35 -4
@@ -1111,6 +1111,39 @@ static int skl_tplg_tlv_control_set(struct snd_kcontrol *kcontrol, }/* +* Fill the dma id for host and link. In case of passthrough +* pipeline, this will both host and link in the same +* pipeline, so need to copy the link and host based on dev_type +*/ +static void skl_tplg_fill_dma_id (struct skl_module_cfg *mcfg, +struct skl_pipe_params *params) +{ +struct skl_pipe *pipe = mcfg->pipe; + +if (pipe->passthru) { +switch (mcfg->dev_type) { +case SKL_DEVICE_HDALINK : + pipe->p_params->link_dma_id = params->link_dma_id; +break ; + +case SKL_DEVICE_HDAHOST : + pipe->p_params->host_dma_id = params->host_dma_id; +break ; + +default : +break ; + } + pipe->p_params->s_fmt = params->s_fmt; + pipe->p_params->ch = params->ch; + pipe->p_params->s_freq = params->s_freq; + pipe->p_params->stream = params->stream; + + }else { +memcpy (pipe->p_params, params,sizeof (*params)); + } +} + +/* * The FE params are passed by hw_params of the DAI. * On hw_params, the params are stored in Gateway module of the FE and we * need to calculate the format in DSP module configuration, that
@@ -1120,10 +1153,9 @@ int skl_tplg_update_pipe_params(struct device *dev,struct skl_module_cfg *mconfig, struct skl_pipe_params *params) { - struct skl_pipe *pipe = mconfig->pipe; struct skl_module_fmt *format = NULL; -memcpy (pipe->p_params, params,sizeof (*params)); +skl_tplg_fill_dma_id (mconfig, params);if (params->stream ==SNDRV_PCM_STREAM_PLAYBACK ) format = &mconfig->in_fmt[0 ];
@@ -1310,12 +1342,11 @@ static int skl_tplg_be_fill_pipe_params(struct snd_soc_dai *dai,struct skl_module_cfg *mconfig, struct skl_pipe_params *params) { - struct skl_pipe *pipe = mconfig->pipe; struct nhlt_specific_cfg *cfg;struct skl *skl =get_skl_ctx (dai->dev);int link_type =skl_tplg_be_link_type (mconfig->dev_type); -memcpy (pipe->p_params, params,sizeof (*params)); +skl_tplg_fill_dma_id (mconfig, params);if (link_type ==NHLT_LINK_HDA )return 0 ;
Signature · 1 line
2.8.1
PATCH 10/10 ASoC: Intel: Skylake: Report position in pointer query
In reply to [email protected]From: Jeeja KP <[email protected]>
Don't update the runtime_delay in pointer query, delay need to reported as part of soc driver ops delay function. The delay value overwritten by ASoC core so this is dummy code and hence removing it.
--- sound/soc/intel/skylake/skl-pcm.c | 64 +++------------------------------------ 1 file changed, 4 insertions(+), 60 deletions(-)
sound/soc/intel/skylake/skl-pcm.c +4 -60
@@ -1026,51 +1026,11 @@ static int skl_platform_pcm_trigger(struct snd_pcm_substream *substream,return 0 ; } -/* calculate runtime delay from LPIB */ -static int skl_get_delay_from_lpib (struct hdac_ext_bus *ebus, -struct hdac_ext_stream *sstream, -unsigned int pos) -{ -struct hdac_bus *bus =ebus_to_hbus (ebus); -struct hdac_stream *hstream =hdac_stream (sstream); -struct snd_pcm_substream *substream = hstream->substream; -int stream = substream->stream; -unsigned int lpib_pos =snd_hdac_stream_get_pos_lpib (hstream); -int delay; - -if (stream ==SNDRV_PCM_STREAM_PLAYBACK ) - delay = pos - lpib_pos; -else - delay = lpib_pos - pos; - -if (delay <0 ) { -if (delay >= hstream->delay_negative_threshold) - delay =0 ; -else - delay += hstream->bufsize; - } - -if (hstream->bufsize == delay) - delay =0 ; - -if (delay >= hstream->period_bytes) { -dev_info (bus->dev, -"Unstable LPIB (%d >= %d); disabling LPIB delay counting\n" , - delay, hstream->period_bytes); - delay =0 ; - } - -return bytes_to_frames (substream->runtime, delay); -} - -static unsigned int skl_get_position (struct hdac_ext_stream *hstream, -int codec_delay) +static snd_pcm_uframes_t skl_platform_pcm_pointer + (struct snd_pcm_substream *substream) { -struct hdac_stream *hstr =hdac_stream (hstream); -struct snd_pcm_substream *substream = hstr->substream; -struct hdac_ext_bus *ebus; +struct hdac_ext_stream *hstream =get_hdac_ext_stream (substream);unsigned int pos; -int delay;/* use the position buffer as default */ pos =snd_hdac_stream_get_pos_posbuf (hdac_stream (hstream));
@@ -1078,23 +1038,7 @@ static unsigned int skl_get_position(struct hdac_ext_stream *hstream,if (pos >=hdac_stream (hstream)->bufsize) pos =0 ; -if (substream->runtime) { - ebus =get_bus_ctx (substream); - delay =skl_get_delay_from_lpib (ebus, hstream, pos) - + codec_delay; - substream->runtime->delay += delay; - } - -return pos; -} - -static snd_pcm_uframes_t skl_platform_pcm_pointer - (struct snd_pcm_substream *substream) -{ -struct hdac_ext_stream *hstream =get_hdac_ext_stream (substream); - -return bytes_to_frames (substream->runtime, -skl_get_position (hstream,0 )); +return bytes_to_frames (substream->runtime, pos); } static u64 skl_adjust_codec_delay(struct snd_pcm_substream *substream,
Signature · 1 line
2.5.0
Mark Brown
maintainerApplied "ASoC: Intel: Skylake: Report position in pointer query" to the asoc tree
The patch
ASoC: Intel: Skylake: Report position in pointer query
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
7b96144df1b143750921605d8b29494d3e93c150Mon Sep 17 00:00:00 2001
From: Jeeja KP <[email protected]>
Date: Fri, 3 Jun 2016 18:29:43 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Report position in pointer query
Don't update the runtime_delay in pointer query, delay need to reported as part of soc driver ops delay function. The delay value overwritten by ASoC core so this is dummy code and hence removing it.
--- sound/soc/intel/skylake/skl-pcm.c | 64 +++------------------------------------ 1 file changed, 4 insertions(+), 60 deletions(-)
sound/soc/intel/skylake/skl-pcm.c +4 -60
@@ -1026,51 +1026,11 @@ static int skl_platform_pcm_trigger(struct snd_pcm_substream *substream,return 0 ; } -/* calculate runtime delay from LPIB */ -static int skl_get_delay_from_lpib (struct hdac_ext_bus *ebus, -struct hdac_ext_stream *sstream, -unsigned int pos) -{ -struct hdac_bus *bus =ebus_to_hbus (ebus); -struct hdac_stream *hstream =hdac_stream (sstream); -struct snd_pcm_substream *substream = hstream->substream; -int stream = substream->stream; -unsigned int lpib_pos =snd_hdac_stream_get_pos_lpib (hstream); -int delay; - -if (stream ==SNDRV_PCM_STREAM_PLAYBACK ) - delay = pos - lpib_pos; -else - delay = lpib_pos - pos; - -if (delay <0 ) { -if (delay >= hstream->delay_negative_threshold) - delay =0 ; -else - delay += hstream->bufsize; - } - -if (hstream->bufsize == delay) - delay =0 ; - -if (delay >= hstream->period_bytes) { -dev_info (bus->dev, -"Unstable LPIB (%d >= %d); disabling LPIB delay counting\n" , - delay, hstream->period_bytes); - delay =0 ; - } - -return bytes_to_frames (substream->runtime, delay); -} - -static unsigned int skl_get_position (struct hdac_ext_stream *hstream, -int codec_delay) +static snd_pcm_uframes_t skl_platform_pcm_pointer + (struct snd_pcm_substream *substream) { -struct hdac_stream *hstr =hdac_stream (hstream); -struct snd_pcm_substream *substream = hstr->substream; -struct hdac_ext_bus *ebus; +struct hdac_ext_stream *hstream =get_hdac_ext_stream (substream);unsigned int pos; -int delay;/* use the position buffer as default */ pos =snd_hdac_stream_get_pos_posbuf (hdac_stream (hstream));
@@ -1078,23 +1038,7 @@ static unsigned int skl_get_position(struct hdac_ext_stream *hstream,if (pos >=hdac_stream (hstream)->bufsize) pos =0 ; -if (substream->runtime) { - ebus =get_bus_ctx (substream); - delay =skl_get_delay_from_lpib (ebus, hstream, pos) - + codec_delay; - substream->runtime->delay += delay; - } - -return pos; -} - -static snd_pcm_uframes_t skl_platform_pcm_pointer - (struct snd_pcm_substream *substream) -{ -struct hdac_ext_stream *hstream =get_hdac_ext_stream (substream); - -return bytes_to_frames (substream->runtime, -skl_get_position (hstream,0 )); +return bytes_to_frames (substream->runtime, pos); } static u64 skl_adjust_codec_delay(struct snd_pcm_substream *substream,
Signature · 1 line
2.8.1