ASoC: dapm: Initialise kcontrol data for mux/demux controls
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Thu, 23 Jun 2022 10:51:15 +0000 (11:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:24:39 +0000 (21:24 +0200)
commitab2f5e5f3ce12f74b095de8cfee7c680e5a981b3
tree28009e2d9e7013c0a25e06baf748a4c62706faf0
parent269be8b2907378adf72d7347cfa43ef230351a06
ASoC: dapm: Initialise kcontrol data for mux/demux controls

[ Upstream commit 11d7a12f7f50baa5af9090b131c9b03af59503e7 ]

DAPM keeps a copy of the current value of mux/demux controls,
however this value is only initialised in the case of autodisable
controls. This leads to false notification events when first
modifying a DAPM kcontrol that has a non-zero default.

Autodisable controls are left as they are, since they already
initialise the value, and there would be more work required to
support autodisable muxes where the first option isn't disabled
and/or that isn't the default.

Technically this issue could affect mixer/switch elements as well,
although not on any of the devices I am currently running. There
is also a little more work to do to address the issue there due to
that side supporting stereo controls, so that has not been tackled
in this patch.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220623105120.1981154-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/soc-dapm.c