lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221213095328.122309-2-r.czerwinski@pengutronix.de>
Date:   Tue, 13 Dec 2022 10:53:28 +0100
From:   Rouven Czerwinski <r.czerwinski@...gutronix.de>
To:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>
Cc:     kernel@...gutronix.de, Marco Felsch <m.felsch@...gutronix.de>,
        alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] ASoC: max98088: fix initial dai mute state

From: Marco Felsch <m.felsch@...gutronix.de>

According the datasheets [1], [2] the initial value of register
0x2f/0x31 (dai1/dai2) is 0x00 which means that dai is unmuted. So upon
the first playback request the register is not touched since it is
cached by regmap. But the device output keeps silent. After ending the
playback session the mute() callback updates the register. Now the 2nd
playback request updates the register again (-> unmute the device) and
now we can really hear the output signal.

I've checked the register initial value which is '0x00' so the driver is
correct. Accroding the above inspections it seems that the hardware does
not update the register correctly on power up because the output is
muted.

To fix that we need to explicit set the mute state. Now the first
playback request gets played correctly.

[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@...gutronix.de>
---
 sound/soc/codecs/max98088.c | 5 +++++
 1 file changed, 5 insertions(+)

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:
-- 
2.38.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ