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 16/16] ASoC: codecs: msm8916-wcd-digital: fix tlv min max range
Date: Tue, 22 Feb 2022 11:59:33 +0000	[thread overview]
Message-ID: <20220222115933.9114-17-srinivas.kandagatla@linaro.org> (raw)
In-Reply-To: <20220222115933.9114-1-srinivas.kandagatla@linaro.org>

on Qualcomm codecs gain tlv control specifies min max range as both
negative to positive numbers like

SOC_SINGLE_SX_TLV("... Volume", ..,  -84, 40, gain)

However with recent boundary checks added in commit 817f7c9335ec0
("ASoC: ops: Reject out of bounds values in snd_soc_put_volsw())
setting a value above 40 gain will fail.

So fix this min max range correctly to
SOC_SINGLE_SX_TLV("... Volume", ..,  0, 124, gain)
so that users can now set gain correctly

Fixes: ef8a4757a6db ("ASoC: msm8916-wcd-digital: Add sidetone support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 sound/soc/codecs/msm8916-wcd-digital.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/sound/soc/codecs/msm8916-wcd-digital.c b/sound/soc/codecs/msm8916-wcd-digital.c
index fcc10c8bc625..b32803bf6f63 100644
--- a/sound/soc/codecs/msm8916-wcd-digital.c
+++ b/sound/soc/codecs/msm8916-wcd-digital.c
@@ -554,21 +554,21 @@ static const struct snd_kcontrol_new msm8916_wcd_digital_snd_controls[] = {
 	WCD_IIR_FILTER_CTL("IIR2 Band4", IIR2, BAND4),
 	WCD_IIR_FILTER_CTL("IIR2 Band5", IIR2, BAND5),
 	SOC_SINGLE_SX_TLV("IIR1 INP1 Volume", LPASS_CDC_IIR1_GAIN_B1_CTL,
-			0,  -84, 40, digital_gain),
+			0,  0, 124, digital_gain),
 	SOC_SINGLE_SX_TLV("IIR1 INP2 Volume", LPASS_CDC_IIR1_GAIN_B2_CTL,
-			0,  -84, 40, digital_gain),
+			0,  0, 124, digital_gain),
 	SOC_SINGLE_SX_TLV("IIR1 INP3 Volume", LPASS_CDC_IIR1_GAIN_B3_CTL,
-			0,  -84, 40, digital_gain),
+			0,  0, 124, digital_gain),
 	SOC_SINGLE_SX_TLV("IIR1 INP4 Volume", LPASS_CDC_IIR1_GAIN_B4_CTL,
 			0,  -84,	40, digital_gain),
 	SOC_SINGLE_SX_TLV("IIR2 INP1 Volume", LPASS_CDC_IIR2_GAIN_B1_CTL,
-			0,  -84, 40, digital_gain),
+			0,  0, 124, digital_gain),
 	SOC_SINGLE_SX_TLV("IIR2 INP2 Volume", LPASS_CDC_IIR2_GAIN_B2_CTL,
-			0,  -84, 40, digital_gain),
+			0,  0, 124, digital_gain),
 	SOC_SINGLE_SX_TLV("IIR2 INP3 Volume", LPASS_CDC_IIR2_GAIN_B3_CTL,
-			0,  -84, 40, digital_gain),
+			0,  0, 124, digital_gain),
 	SOC_SINGLE_SX_TLV("IIR2 INP4 Volume", LPASS_CDC_IIR2_GAIN_B4_CTL,
-			0,  -84, 40, digital_gain),
+			0,  0, 124, digital_gain),
 
 };
 
-- 
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 16/16] ASoC: codecs: msm8916-wcd-digital: fix tlv min max range
Date: Tue, 22 Feb 2022 11:59:33 +0000	[thread overview]
Message-ID: <20220222115933.9114-17-srinivas.kandagatla@linaro.org> (raw)
In-Reply-To: <20220222115933.9114-1-srinivas.kandagatla@linaro.org>

on Qualcomm codecs gain tlv control specifies min max range as both
negative to positive numbers like

SOC_SINGLE_SX_TLV("... Volume", ..,  -84, 40, gain)

However with recent boundary checks added in commit 817f7c9335ec0
("ASoC: ops: Reject out of bounds values in snd_soc_put_volsw())
setting a value above 40 gain will fail.

So fix this min max range correctly to
SOC_SINGLE_SX_TLV("... Volume", ..,  0, 124, gain)
so that users can now set gain correctly

Fixes: ef8a4757a6db ("ASoC: msm8916-wcd-digital: Add sidetone support")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 sound/soc/codecs/msm8916-wcd-digital.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/sound/soc/codecs/msm8916-wcd-digital.c b/sound/soc/codecs/msm8916-wcd-digital.c
index fcc10c8bc625..b32803bf6f63 100644
--- a/sound/soc/codecs/msm8916-wcd-digital.c
+++ b/sound/soc/codecs/msm8916-wcd-digital.c
@@ -554,21 +554,21 @@ static const struct snd_kcontrol_new msm8916_wcd_digital_snd_controls[] = {
 	WCD_IIR_FILTER_CTL("IIR2 Band4", IIR2, BAND4),
 	WCD_IIR_FILTER_CTL("IIR2 Band5", IIR2, BAND5),
 	SOC_SINGLE_SX_TLV("IIR1 INP1 Volume", LPASS_CDC_IIR1_GAIN_B1_CTL,
-			0,  -84, 40, digital_gain),
+			0,  0, 124, digital_gain),
 	SOC_SINGLE_SX_TLV("IIR1 INP2 Volume", LPASS_CDC_IIR1_GAIN_B2_CTL,
-			0,  -84, 40, digital_gain),
+			0,  0, 124, digital_gain),
 	SOC_SINGLE_SX_TLV("IIR1 INP3 Volume", LPASS_CDC_IIR1_GAIN_B3_CTL,
-			0,  -84, 40, digital_gain),
+			0,  0, 124, digital_gain),
 	SOC_SINGLE_SX_TLV("IIR1 INP4 Volume", LPASS_CDC_IIR1_GAIN_B4_CTL,
 			0,  -84,	40, digital_gain),
 	SOC_SINGLE_SX_TLV("IIR2 INP1 Volume", LPASS_CDC_IIR2_GAIN_B1_CTL,
-			0,  -84, 40, digital_gain),
+			0,  0, 124, digital_gain),
 	SOC_SINGLE_SX_TLV("IIR2 INP2 Volume", LPASS_CDC_IIR2_GAIN_B2_CTL,
-			0,  -84, 40, digital_gain),
+			0,  0, 124, digital_gain),
 	SOC_SINGLE_SX_TLV("IIR2 INP3 Volume", LPASS_CDC_IIR2_GAIN_B3_CTL,
-			0,  -84, 40, digital_gain),
+			0,  0, 124, digital_gain),
 	SOC_SINGLE_SX_TLV("IIR2 INP4 Volume", LPASS_CDC_IIR2_GAIN_B4_CTL,
-			0,  -84, 40, digital_gain),
+			0,  0, 124, digital_gain),
 
 };
 
-- 
2.21.0


  parent reply	other threads:[~2022-02-22 12:01 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22 11:59 [PATCH 00/16] ASoC: codecs: qcom fix validation failures Srinivas Kandagatla
2022-02-22 11:59 ` Srinivas Kandagatla
2022-02-22 11:59 ` [PATCH 01/16] ASoC: codecs: rx-macro: fix accessing compander for aux Srinivas Kandagatla
2022-02-22 11:59   ` Srinivas Kandagatla
2022-02-22 11:59 ` [PATCH 02/16] ASoC: codecs: rx-macro: fix accessing array out of bounds for enum type Srinivas Kandagatla
2022-02-22 11:59   ` Srinivas Kandagatla
2022-02-22 11:59 ` [PATCH 03/16] ASoC: codecs: tx-macro: " Srinivas Kandagatla
2022-02-22 11:59   ` Srinivas Kandagatla
2022-02-22 11:59 ` [PATCH 04/16] ASoC: codecs: va-macro: " Srinivas Kandagatla
2022-02-22 11:59   ` Srinivas Kandagatla
2022-02-22 11:59 ` [PATCH 05/16] ASoC: codecs: wsa-macro: " Srinivas Kandagatla
2022-02-22 11:59   ` Srinivas Kandagatla
2022-02-22 11:59 ` [PATCH 06/16] ASoC: codecs: wc938x: " Srinivas Kandagatla
2022-02-22 11:59   ` Srinivas Kandagatla
2022-02-22 11:59 ` [PATCH 07/16] ASoC: codecs: wcd938x: fix kcontrol max values Srinivas Kandagatla
2022-02-22 11:59   ` Srinivas Kandagatla
2022-02-22 11:59 ` [PATCH 08/16] ASoC: codecs: wcd934x: " Srinivas Kandagatla
2022-02-22 11:59   ` Srinivas Kandagatla
2022-02-22 11:59 ` [PATCH 09/16] ASoC: codecs: wcd934x: fix return value of wcd934x_rx_hph_mode_put Srinivas Kandagatla
2022-02-22 11:59   ` Srinivas Kandagatla
2022-02-22 17:54   ` Mark Brown
2022-02-22 17:54     ` Mark Brown
2022-02-22 18:22     ` Srinivas Kandagatla
2022-02-22 18:22       ` Srinivas Kandagatla
2022-02-22 11:59 ` [PATCH 10/16] ASoC: codecs: rx-macro: fix tlv min max range Srinivas Kandagatla
2022-02-22 11:59   ` Srinivas Kandagatla
2022-02-22 18:04   ` Mark Brown
2022-02-22 18:04     ` Mark Brown
2022-02-22 18:21     ` Srinivas Kandagatla
2022-02-22 18:21       ` Srinivas Kandagatla
2022-02-22 11:59 ` [PATCH 11/16] ASoC: codecs: tx-macro: " Srinivas Kandagatla
2022-02-22 11:59   ` Srinivas Kandagatla
2022-02-22 11:59 ` [PATCH 12/16] ASoC: codecs: va-macro: " Srinivas Kandagatla
2022-02-22 11:59   ` Srinivas Kandagatla
2022-02-22 11:59 ` [PATCH 13/16] ASoC: codecs: wsa-macro: " Srinivas Kandagatla
2022-02-22 11:59   ` Srinivas Kandagatla
2022-02-22 11:59 ` [PATCH 14/16] ASoC: codecs: wcd938x: " Srinivas Kandagatla
2022-02-22 11:59   ` Srinivas Kandagatla
2022-02-22 11:59 ` [PATCH 15/16] ASoC: codecs: wcd9335: " Srinivas Kandagatla
2022-02-22 11:59   ` Srinivas Kandagatla
2022-02-22 11:59 ` Srinivas Kandagatla [this message]
2022-02-22 11:59   ` [PATCH 16/16] ASoC: codecs: msm8916-wcd-digital: " Srinivas Kandagatla
2022-02-23  4:08 ` (subset) [PATCH 00/16] 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=20220222115933.9114-17-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.