All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: broonie@kernel.org
Cc: lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com,
	pierre-louis.bossart@linux.intel.com,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	quic_srivasam@quicinc.com,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Subject: [PATCH v2 8/9] ASoC: codecs: wcd934x: fix kcontrol max values
Date: Tue, 22 Feb 2022 18:32:11 +0000	[thread overview]
Message-ID: <20220222183212.11580-9-srinivas.kandagatla@linaro.org> (raw)
In-Reply-To: <20220222183212.11580-1-srinivas.kandagatla@linaro.org>

set "HPH Type" Kcontrol max value of WCD_MBHC_HPH_STEREO instead of UINT_MAX.
set "HPHL/R Impedance" Kcontrols max value to INT_MAX instead of UINT_MAX as
max field is integer type.

Without this patch amixer for these controls will show -1 as max value to userspace.

Fixes: 9fb9b1690f0b ("ASoC: codecs: wcd934x: add mbhc support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 sound/soc/codecs/wcd934x.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c
index 6c468527fec6..f2674905a4a7 100644
--- a/sound/soc/codecs/wcd934x.c
+++ b/sound/soc/codecs/wcd934x.c
@@ -3023,14 +3023,14 @@ static int wcd934x_hph_impedance_get(struct snd_kcontrol *kcontrol,
 	return 0;
 }
 static const struct snd_kcontrol_new hph_type_detect_controls[] = {
-	SOC_SINGLE_EXT("HPH Type", 0, 0, UINT_MAX, 0,
+	SOC_SINGLE_EXT("HPH Type", 0, 0, WCD_MBHC_HPH_STEREO, 0,
 		       wcd934x_get_hph_type, NULL),
 };
 
 static const struct snd_kcontrol_new impedance_detect_controls[] = {
-	SOC_SINGLE_EXT("HPHL Impedance", 0, 0, UINT_MAX, 0,
+	SOC_SINGLE_EXT("HPHL Impedance", 0, 0, INT_MAX, 0,
 		       wcd934x_hph_impedance_get, NULL),
-	SOC_SINGLE_EXT("HPHR Impedance", 0, 1, UINT_MAX, 0,
+	SOC_SINGLE_EXT("HPHR Impedance", 0, 1, INT_MAX, 0,
 		       wcd934x_hph_impedance_get, NULL),
 };
 
-- 
2.21.0


WARNING: multiple messages have this Message-ID (diff)
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: broonie@kernel.org
Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com,
	linux-kernel@vger.kernel.org,
	pierre-louis.bossart@linux.intel.com, tiwai@suse.com,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	quic_srivasam@quicinc.com
Subject: [PATCH v2 8/9] ASoC: codecs: wcd934x: fix kcontrol max values
Date: Tue, 22 Feb 2022 18:32:11 +0000	[thread overview]
Message-ID: <20220222183212.11580-9-srinivas.kandagatla@linaro.org> (raw)
In-Reply-To: <20220222183212.11580-1-srinivas.kandagatla@linaro.org>

set "HPH Type" Kcontrol max value of WCD_MBHC_HPH_STEREO instead of UINT_MAX.
set "HPHL/R Impedance" Kcontrols max value to INT_MAX instead of UINT_MAX as
max field is integer type.

Without this patch amixer for these controls will show -1 as max value to userspace.

Fixes: 9fb9b1690f0b ("ASoC: codecs: wcd934x: add mbhc support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 sound/soc/codecs/wcd934x.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c
index 6c468527fec6..f2674905a4a7 100644
--- a/sound/soc/codecs/wcd934x.c
+++ b/sound/soc/codecs/wcd934x.c
@@ -3023,14 +3023,14 @@ static int wcd934x_hph_impedance_get(struct snd_kcontrol *kcontrol,
 	return 0;
 }
 static const struct snd_kcontrol_new hph_type_detect_controls[] = {
-	SOC_SINGLE_EXT("HPH Type", 0, 0, UINT_MAX, 0,
+	SOC_SINGLE_EXT("HPH Type", 0, 0, WCD_MBHC_HPH_STEREO, 0,
 		       wcd934x_get_hph_type, NULL),
 };
 
 static const struct snd_kcontrol_new impedance_detect_controls[] = {
-	SOC_SINGLE_EXT("HPHL Impedance", 0, 0, UINT_MAX, 0,
+	SOC_SINGLE_EXT("HPHL Impedance", 0, 0, INT_MAX, 0,
 		       wcd934x_hph_impedance_get, NULL),
-	SOC_SINGLE_EXT("HPHR Impedance", 0, 1, UINT_MAX, 0,
+	SOC_SINGLE_EXT("HPHR Impedance", 0, 1, INT_MAX, 0,
 		       wcd934x_hph_impedance_get, NULL),
 };
 
-- 
2.21.0


  parent reply	other threads:[~2022-02-22 18:32 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22 18:32 [PATCH v2 0/9] ASoC: codecs: qcom fix validation failures Srinivas Kandagatla
2022-02-22 18:32 ` Srinivas Kandagatla
2022-02-22 18:32 ` [PATCH v2 1/9] ASoC: codecs: rx-macro: fix accessing compander for aux Srinivas Kandagatla
2022-02-22 18:32   ` Srinivas Kandagatla
2022-02-22 18:32 ` [PATCH v2 2/9] ASoC: codecs: rx-macro: fix accessing array out of bounds for enum type Srinivas Kandagatla
2022-02-22 18:32   ` Srinivas Kandagatla
2022-02-22 18:32 ` [PATCH v2 3/9] ASoC: codecs: tx-macro: " Srinivas Kandagatla
2022-02-22 18:32   ` Srinivas Kandagatla
2022-02-22 18:45   ` Mark Brown
2022-02-22 18:45     ` Mark Brown
2022-02-22 18:32 ` [PATCH v2 4/9] ASoC: codecs: va-macro: " Srinivas Kandagatla
2022-02-22 18:32   ` Srinivas Kandagatla
2022-02-22 18:32 ` [PATCH v2 5/9] ASoC: codecs: wsa-macro: " Srinivas Kandagatla
2022-02-22 18:32   ` Srinivas Kandagatla
2022-02-22 18:32 ` [PATCH v2 6/9] ASoC: codecs: wc938x: " Srinivas Kandagatla
2022-02-22 18:32   ` Srinivas Kandagatla
2022-02-22 18:32 ` [PATCH v2 7/9] ASoC: codecs: wcd938x: fix kcontrol max values Srinivas Kandagatla
2022-02-22 18:32   ` Srinivas Kandagatla
2022-02-22 18:32 ` Srinivas Kandagatla [this message]
2022-02-22 18:32   ` [PATCH v2 8/9] ASoC: codecs: wcd934x: " Srinivas Kandagatla
2022-02-22 18:32 ` [PATCH v2 9/9] ASoC: codecs: wcd934x: fix return value of wcd934x_rx_hph_mode_put Srinivas Kandagatla
2022-02-22 18:32   ` Srinivas Kandagatla
2022-02-23  4:08 ` (subset) [PATCH v2 0/9] ASoC: codecs: qcom fix validation failures Mark Brown
2022-02-23  4:08   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220222183212.11580-9-srinivas.kandagatla@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=quic_srivasam@quicinc.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.