diff mbox series

[1/3] ASoC: cs42l42: Correct definition of ADC Volume control

Message ID 20210729170929.6589-1-rf@opensource.cirrus.com
State Accepted
Commit ee86f680ff4c9b406d49d4e22ddf10805b8a2137
Headers show
Series [1/3] ASoC: cs42l42: Correct definition of ADC Volume control | expand

Commit Message

Richard Fitzgerald July 29, 2021, 5:09 p.m. UTC
The ADC volume is a signed 8-bit number with range -97 to +12,
with -97 being mute. Use a SOC_SINGLE_S8_TLV() to define this
and fix the DECLARE_TLV_DB_SCALE() to have the correct start and
mute flag.

Fixes: 2c394ca79604 ("ASoC: Add support for CS42L42 codec")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 sound/soc/codecs/cs42l42.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Mark Brown July 29, 2021, 7:49 p.m. UTC | #1
On Thu, 29 Jul 2021 18:09:27 +0100, Richard Fitzgerald wrote:
> The ADC volume is a signed 8-bit number with range -97 to +12,
> with -97 being mute. Use a SOC_SINGLE_S8_TLV() to define this
> and fix the DECLARE_TLV_DB_SCALE() to have the correct start and
> mute flag.

Applied to

   torvalds/linux.git master

Thanks!

[1/3] ASoC: cs42l42: Correct definition of ADC Volume control
      commit: ee86f680ff4c9b406d49d4e22ddf10805b8a2137
[2/3] ASoC: cs42l42: Don't allow SND_SOC_DAIFMT_LEFT_J
      commit: 64324bac750b84ca54711fb7d332132fcdb87293
[3/3] ASoC: cs42l42: Fix bclk calculation for mono
      commit: 926ef1a4c245c093acc07807e466ad2ef0ff6ccb

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c
index eff013f295be..2fd20511f246 100644
--- a/sound/soc/codecs/cs42l42.c
+++ b/sound/soc/codecs/cs42l42.c
@@ -405,7 +405,7 @@  static const struct regmap_config cs42l42_regmap = {
 	.use_single_write = true,
 };
 
-static DECLARE_TLV_DB_SCALE(adc_tlv, -9600, 100, false);
+static DECLARE_TLV_DB_SCALE(adc_tlv, -9700, 100, true);
 static DECLARE_TLV_DB_SCALE(mixer_tlv, -6300, 100, true);
 
 static const char * const cs42l42_hpf_freq_text[] = {
@@ -444,8 +444,7 @@  static const struct snd_kcontrol_new cs42l42_snd_controls[] = {
 				CS42L42_ADC_INV_SHIFT, true, false),
 	SOC_SINGLE("ADC Boost Switch", CS42L42_ADC_CTL,
 				CS42L42_ADC_DIG_BOOST_SHIFT, true, false),
-	SOC_SINGLE_SX_TLV("ADC Volume", CS42L42_ADC_VOLUME,
-				CS42L42_ADC_VOL_SHIFT, 0xA0, 0x6C, adc_tlv),
+	SOC_SINGLE_S8_TLV("ADC Volume", CS42L42_ADC_VOLUME, -97, 12, adc_tlv),
 	SOC_SINGLE("ADC WNF Switch", CS42L42_ADC_WNF_HPF_CTL,
 				CS42L42_ADC_WNF_EN_SHIFT, true, false),
 	SOC_SINGLE("ADC HPF Switch", CS42L42_ADC_WNF_HPF_CTL,