diff mbox series

ASoC: pcm: save fixed-up hw_params of BE

Message ID 1555638792-20848-1-git-send-email-libin.yang@intel.com (mailing list archive)
State Accepted
Commit ae061d2a857f84ad47b77b04c3ad37478651ab6c
Headers show
Series ASoC: pcm: save fixed-up hw_params of BE | expand

Commit Message

Yang, Libin April 19, 2019, 1:53 a.m. UTC
From: Libin Yang <libin.yang@intel.com>

Some drivers mandate setting up hw params after resuming from system sleep.
Since, the hw_params ioctl is not invoked upon resuming, the fixed-up BE
dai hw params should be saved so the driver can use it in its resume
sequence.

Signed-off-by: Libin Yang <libin.yang@intel.com>
---
 sound/soc/soc-pcm.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Pierre-Louis Bossart April 19, 2019, 3:30 p.m. UTC | #1
On 4/18/19 8:53 PM, libin.yang@intel.com wrote:
> From: Libin Yang <libin.yang@intel.com>
> 
> Some drivers mandate setting up hw params after resuming from system sleep.
> Since, the hw_params ioctl is not invoked upon resuming, the fixed-up BE
> dai hw params should be saved so the driver can use it in its resume
> sequence.

This functionality is needed for SOF. We initially thought of 
implementing it as an SOF-specific patch but thought this could be 
useful to others, and don't see any negative impact.

Libin and Ranjani, can you clarify what 'some drivers' means. I took it 
as "SOF and other DPCM-based drivers without the 'INFO_RESUME' flag". 
Please confirm if I was correct, if we want feedback we should clarify 
who might benefit. Thanks!


> Signed-off-by: Libin Yang <libin.yang@intel.com>
> ---
>   sound/soc/soc-pcm.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
> index d212475..7469535 100644
> --- a/sound/soc/soc-pcm.c
> +++ b/sound/soc/soc-pcm.c
> @@ -2164,6 +2164,10 @@ int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int stream)
>   			}
>   		}
>   
> +		/* copy the fixed-up hw params for BE dai */
> +		memcpy(&be->dpcm[stream].hw_params, &dpcm->hw_params,
> +		       sizeof(struct snd_pcm_hw_params));
> +
>   		/* only allow hw_params() if no connected FEs are running */
>   		if (!snd_soc_dpcm_can_be_params(fe, be, stream))
>   			continue;
>
diff mbox series

Patch

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index d212475..7469535 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2164,6 +2164,10 @@  int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int stream)
 			}
 		}
 
+		/* copy the fixed-up hw params for BE dai */
+		memcpy(&be->dpcm[stream].hw_params, &dpcm->hw_params,
+		       sizeof(struct snd_pcm_hw_params));
+
 		/* only allow hw_params() if no connected FEs are running */
 		if (!snd_soc_dpcm_can_be_params(fe, be, stream))
 			continue;