diff mbox series

ASoC: ops: Fix multiple value control type

Message ID 1655492828-5471-1-git-send-email-spujar@nvidia.com
State New
Headers show
Series ASoC: ops: Fix multiple value control type | expand

Commit Message

Sameer Pujar June 17, 2022, 7:07 p.m. UTC
The commit aa2a4b897132("ASoC: ops: Fix boolean/integer detection for
simple controls") fixes false positives with controls not ending in
" Volume" string. But it now forces boolean type for the multi value
controls. Fix this by adding a max check before assigning types.

Fixes: aa2a4b897132("ASoC: ops: Fix boolean/integer detection for simple controls")
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
---
 sound/soc/soc-ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Brown June 17, 2022, 11:15 p.m. UTC | #1
On Sat, Jun 18, 2022 at 12:37:08AM +0530, Sameer Pujar wrote:
> The commit aa2a4b897132("ASoC: ops: Fix boolean/integer detection for
> simple controls") fixes false positives with controls not ending in
> " Volume" string. But it now forces boolean type for the multi value
> controls. Fix this by adding a max check before assigning types.

Thanks but someone already sent a fix for this.
diff mbox series

Patch

diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c
index 0267e39..21be8e8 100644
--- a/sound/soc/soc-ops.c
+++ b/sound/soc/soc-ops.c
@@ -190,7 +190,7 @@  int snd_soc_info_volsw(struct snd_kcontrol *kcontrol,
 			vol_string = NULL;
 	}
 
-	if (!vol_string)
+	if (!vol_string && max == 1)
 		uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
 	else
 		uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;