[1/2] ASoC: max98088: fix dai1/2_hw_params access

Message ID 20221213095328.122309-1-r.czerwinski@pengutronix.de
State New
Headers
Series [1/2] ASoC: max98088: fix dai1/2_hw_params access |

Commit Message

Rouven Czerwinski Dec. 13, 2022, 9:53 a.m. UTC
  From: Marco Felsch <m.felsch@pengutronix.de>

According the reference manuals [1], [2] updating register 0x14/1c
should only be done after #shdn bit is set to 0.

[1] https://datasheets.maximintegrated.com/en/ds/MAX98089.pdf
[2] https://datasheets.maximintegrated.com/en/ds/MAX98088.pdf

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 sound/soc/codecs/max98088.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Mark Brown Dec. 13, 2022, 12:04 p.m. UTC | #1
On Tue, Dec 13, 2022 at 10:53:27AM +0100, Rouven Czerwinski wrote:
> From: Marco Felsch <m.felsch@pengutronix.de>
> 
> According the reference manuals [1], [2] updating register 0x14/1c
> should only be done after #shdn bit is set to 0.
> 
> [1] https://datasheets.maximintegrated.com/en/ds/MAX98089.pdf
> [2] https://datasheets.maximintegrated.com/en/ds/MAX98088.pdf
> 
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> ---
>  sound/soc/codecs/max98088.c | 8 ++++----

You've not provided a Signed-off-by for this so I can't do anything with
it, please see Documentation/process/submitting-patches.rst for details
on what this is and why it's important.
  

Patch

diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c
index 405ec16be2b6..7f108e147355 100644
--- a/sound/soc/codecs/max98088.c
+++ b/sound/soc/codecs/max98088.c
@@ -977,6 +977,8 @@  static int max98088_dai1_hw_params(struct snd_pcm_substream *substream,
 
        rate = params_rate(params);
 
+       snd_soc_component_update_bits(component, M98088_REG_51_PWR_SYS, M98088_SHDNRUN, 0);
+
        switch (params_width(params)) {
        case 16:
                snd_soc_component_update_bits(component, M98088_REG_14_DAI1_FORMAT,
@@ -990,8 +992,6 @@  static int max98088_dai1_hw_params(struct snd_pcm_substream *substream,
                return -EINVAL;
        }
 
-       snd_soc_component_update_bits(component, M98088_REG_51_PWR_SYS, M98088_SHDNRUN, 0);
-
        if (rate_value(rate, &regval))
                return -EINVAL;
 
@@ -1047,6 +1047,8 @@  static int max98088_dai2_hw_params(struct snd_pcm_substream *substream,
 
        rate = params_rate(params);
 
+       snd_soc_component_update_bits(component, M98088_REG_51_PWR_SYS, M98088_SHDNRUN, 0);
+
        switch (params_width(params)) {
        case 16:
                snd_soc_component_update_bits(component, M98088_REG_1C_DAI2_FORMAT,
@@ -1060,8 +1062,6 @@  static int max98088_dai2_hw_params(struct snd_pcm_substream *substream,
                return -EINVAL;
        }
 
-       snd_soc_component_update_bits(component, M98088_REG_51_PWR_SYS, M98088_SHDNRUN, 0);
-
        if (rate_value(rate, &regval))
                return -EINVAL;