Message ID | 20221213095328.122309-2-r.czerwinski@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/2] ASoC: max98088: fix dai1/2_hw_params access | expand |
On Tue, Dec 13, 2022 at 10:53:28AM +0100, Rouven Czerwinski wrote: > To fix that we need to explicit set the mute state. Now the first > playback request gets played correctly. > +++ b/sound/soc/codecs/max98088.c > @@ -1710,6 +1710,11 @@ static int max98088_probe(struct snd_soc_component *component) > snd_soc_component_write(component, M98088_REG_1E_DAI2_IOCFG, > M98088_S2NORMAL|M98088_SDATA); > > + snd_soc_component_update_bits(component, M98088_REG_2F_LVL_DAI1_PLAY, > + M98088_DAI_MUTE_MASK, M98088_DAI_MUTE); > + snd_soc_component_update_bits(component, M98088_REG_31_LVL_DAI2_PLAY, > + M98088_DAI_MUTE_MASK, M98088_DAI_MUTE); > + Won't this be broken again after suspend? The device gets powered off over suspend, then when it powers on again with the output unmuted nothing will do another write since the register is already in the state in the cache.
Hi Mark, On 22-12-13, Mark Brown wrote: > On Tue, Dec 13, 2022 at 10:53:28AM +0100, Rouven Czerwinski wrote: > > > To fix that we need to explicit set the mute state. Now the first > > playback request gets played correctly. > > > +++ b/sound/soc/codecs/max98088.c > > @@ -1710,6 +1710,11 @@ static int max98088_probe(struct snd_soc_component *component) > > snd_soc_component_write(component, M98088_REG_1E_DAI2_IOCFG, > > M98088_S2NORMAL|M98088_SDATA); > > > > + snd_soc_component_update_bits(component, M98088_REG_2F_LVL_DAI1_PLAY, > > + M98088_DAI_MUTE_MASK, M98088_DAI_MUTE); > > + snd_soc_component_update_bits(component, M98088_REG_31_LVL_DAI2_PLAY, > > + M98088_DAI_MUTE_MASK, M98088_DAI_MUTE); > > + > > Won't this be broken again after suspend? The device gets powered off > over suspend, then when it powers on again with the output unmuted > nothing will do another write since the register is already in the state > in the cache. I didn't found any suspend logic within the driver. Is this handled within the ASoC core? Regards, Marco
On Thu, Dec 15, 2022 at 10:17:47AM +0100, Marco Felsch wrote: > On 22-12-13, Mark Brown wrote: > > > + snd_soc_component_update_bits(component, M98088_REG_2F_LVL_DAI1_PLAY, > > > + M98088_DAI_MUTE_MASK, M98088_DAI_MUTE); > > > + snd_soc_component_update_bits(component, M98088_REG_31_LVL_DAI2_PLAY, > > > + M98088_DAI_MUTE_MASK, M98088_DAI_MUTE); > > > + > > Won't this be broken again after suspend? The device gets powered off > > over suspend, then when it powers on again with the output unmuted > > nothing will do another write since the register is already in the state > > in the cache. > I didn't found any suspend logic within the driver. Is this handled > within the ASoC core? Register save and restore for the device won't be.
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index 7f108e147355..c00d7726ac04 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c @@ -1710,6 +1710,11 @@ static int max98088_probe(struct snd_soc_component *component) snd_soc_component_write(component, M98088_REG_1E_DAI2_IOCFG, M98088_S2NORMAL|M98088_SDATA); + snd_soc_component_update_bits(component, M98088_REG_2F_LVL_DAI1_PLAY, + M98088_DAI_MUTE_MASK, M98088_DAI_MUTE); + snd_soc_component_update_bits(component, M98088_REG_31_LVL_DAI2_PLAY, + M98088_DAI_MUTE_MASK, M98088_DAI_MUTE); + max98088_handle_pdata(component); err_access: