diff mbox series

[3/3] ASoC: mt6358: Remove undefined HPx Mux enumeration values

Message ID 20230224-asoc-mt6358-quick-fixes-v1-3-747d9186be4b@kernel.org (mailing list archive)
State Accepted
Commit 8cbd7273a724d4e9615b26d696bb1221a8a48e4c
Headers show
Series ASoC: mt6358: Fixes from an initial glance at a kselftest run | expand

Commit Message

Mark Brown Feb. 26, 2023, 12:47 p.m. UTC
The HPx Mux enumerations define values 5, 6 and 7 but describe them as
"undefined" and map them to the value 0 on writing. Given the descriptions
and behaviour it seems that these values are invalid and should not be
present in the register, the current behaviour is detected as problematic
by mixer-test:

# # HPL Mux.0 expected 5 but read 0, is_volatile 0
# # HPL Mux.0 expected 6 but read 0, is_volatile 0
# # HPL Mux.0 expected 7 but read 0, is_volatile 0

Remove the values from the enumeration, this will prevent userspace setting
them.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/mt6358.c | 6 ------
 1 file changed, 6 deletions(-)

Comments

AngeloGioacchino Del Regno Feb. 27, 2023, 8:55 a.m. UTC | #1
Il 26/02/23 13:47, Mark Brown ha scritto:
> The HPx Mux enumerations define values 5, 6 and 7 but describe them as
> "undefined" and map them to the value 0 on writing. Given the descriptions
> and behaviour it seems that these values are invalid and should not be
> present in the register, the current behaviour is detected as problematic
> by mixer-test:
> 
> # # HPL Mux.0 expected 5 but read 0, is_volatile 0
> # # HPL Mux.0 expected 6 but read 0, is_volatile 0
> # # HPL Mux.0 expected 7 but read 0, is_volatile 0
> 
> Remove the values from the enumeration, this will prevent userspace setting
> them.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
diff mbox series

Patch

diff --git a/sound/soc/codecs/mt6358.c b/sound/soc/codecs/mt6358.c
index 89d0dcb2635b..b54610b27906 100644
--- a/sound/soc/codecs/mt6358.c
+++ b/sound/soc/codecs/mt6358.c
@@ -637,9 +637,6 @@  static const char * const hp_in_mux_map[] = {
 	"Audio Playback",
 	"Test Mode",
 	"HP Impedance",
-	"undefined1",
-	"undefined2",
-	"undefined3",
 };
 
 static int hp_in_mux_map_value[] = {
@@ -648,9 +645,6 @@  static int hp_in_mux_map_value[] = {
 	HP_MUX_HP,
 	HP_MUX_TEST_MODE,
 	HP_MUX_HP_IMPEDANCE,
-	HP_MUX_OPEN,
-	HP_MUX_OPEN,
-	HP_MUX_OPEN,
 };
 
 static SOC_VALUE_ENUM_SINGLE_DECL(hpl_in_mux_map_enum,