History

ASoC: Fixup Cirrus SX control usage

Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>: Mostly the usage of the SX controls seems to match the lowest gain value + number of gain levels expected. The one notable exception there being cs53l30 as David noted. However, there are a couple of other places where the minimum value/TLVs are slightly incorrectly specified.

Mark Brown committed 4 years ago

Commit 07551992 parents d69a155 fcb3b5a5 files · +18 −15Browse files

Unified · Split

5 files
  1. sound/soc/codecs/cs35l36.c +2 −1
  2. sound/soc/codecs/cs42l51.c +1 −1
  3. sound/soc/codecs/cs42l52.c +5 −3
  4. sound/soc/codecs/cs42l56.c +2 −2
  5. sound/soc/codecs/cs53l30.c +8 −8
sound/soc/codecs/cs35l36.c+2−1
@@ -444,7 +444,8 @@ static bool cs35l36_volatile_reg(struct device *dev, unsigned int reg) · 443 unmodified lines
444444 }
445445 }
446446
447−static DECLARE_TLV_DB_SCALE(dig_vol_tlv, -10200, 25, 0);
447+static const DECLARE_TLV_DB_RANGE(dig_vol_tlv, 0, 912,
448+ TLV_DB_MINMAX_ITEM(-10200, 1200));
448449 static DECLARE_TLV_DB_SCALE(amp_gain_tlv, 0, 1, 1);
449450
450451 static const char * const cs35l36_pcm_sftramp_text[] = {
sound/soc/codecs/cs42l51.c+1−1
@@ -143,7 +143,7 @@ static const struct snd_kcontrol_new cs42l51_snd_controls[] = { · 142 unmodified lines
143143 0, 0xA0, 96, adc_att_tlv),
144144 SOC_DOUBLE_R_SX_TLV("PGA Volume",
145145 CS42L51_ALC_PGA_CTL, CS42L51_ALC_PGB_CTL,
146− 0, 0x1A, 30, pga_tlv),
146+ 0, 0x19, 30, pga_tlv),
147147 SOC_SINGLE("Playback Deemphasis Switch", CS42L51_DAC_CTL, 3, 1, 0),
148148 SOC_SINGLE("Auto-Mute Switch", CS42L51_DAC_CTL, 2, 1, 0),
149149 SOC_SINGLE("Soft Ramp Switch", CS42L51_DAC_CTL, 1, 1, 0),
sound/soc/codecs/cs42l52.c+5−3
@@ -137,7 +137,9 @@ static DECLARE_TLV_DB_SCALE(mic_tlv, 1600, 100, 0); · 136 unmodified lines
137137
138138 static DECLARE_TLV_DB_SCALE(pga_tlv, -600, 50, 0);
139139
140−static DECLARE_TLV_DB_SCALE(mix_tlv, -50, 50, 0);
140+static DECLARE_TLV_DB_SCALE(pass_tlv, -6000, 50, 0);
141+
142+static DECLARE_TLV_DB_SCALE(mix_tlv, -5150, 50, 0);
141143
142144 static DECLARE_TLV_DB_SCALE(beep_tlv, -56, 200, 0);
143145
@@ -351,7 +353,7 @@ static const struct snd_kcontrol_new cs42l52_snd_controls[] = { · 207 unmodified lines
351353 CS42L52_SPKB_VOL, 0, 0x40, 0xC0, hl_tlv),
352354
353355 SOC_DOUBLE_R_SX_TLV("Bypass Volume", CS42L52_PASSTHRUA_VOL,
354− CS42L52_PASSTHRUB_VOL, 0, 0x88, 0x90, pga_tlv),
356+ CS42L52_PASSTHRUB_VOL, 0, 0x88, 0x90, pass_tlv),
355357
356358 SOC_DOUBLE("Bypass Mute", CS42L52_MISC_CTL, 4, 5, 1, 0),
357359
@@ -364,7 +366,7 @@ static const struct snd_kcontrol_new cs42l52_snd_controls[] = { · 6 unmodified lines
364366 CS42L52_ADCB_VOL, 0, 0xA0, 0x78, ipd_tlv),
365367 SOC_DOUBLE_R_SX_TLV("ADC Mixer Volume",
366368 CS42L52_ADCA_MIXER_VOL, CS42L52_ADCB_MIXER_VOL,
367− 0, 0x19, 0x7F, ipd_tlv),
369+ 0, 0x19, 0x7F, mix_tlv),
368370
369371 SOC_DOUBLE("ADC Switch", CS42L52_ADC_MISC_CTL, 0, 1, 1, 0),
370372
sound/soc/codecs/cs42l56.c+2−2
@@ -391,9 +391,9 @@ static const struct snd_kcontrol_new cs42l56_snd_controls[] = { · 390 unmodified lines
391391 SOC_DOUBLE("ADC Boost Switch", CS42L56_GAIN_BIAS_CTL, 3, 2, 1, 1),
392392
393393 SOC_DOUBLE_R_SX_TLV("Headphone Volume", CS42L56_HPA_VOLUME,
394− CS42L56_HPB_VOLUME, 0, 0x84, 0x48, hl_tlv),
394+ CS42L56_HPB_VOLUME, 0, 0x44, 0x48, hl_tlv),
395395 SOC_DOUBLE_R_SX_TLV("LineOut Volume", CS42L56_LOA_VOLUME,
396− CS42L56_LOB_VOLUME, 0, 0x84, 0x48, hl_tlv),
396+ CS42L56_LOB_VOLUME, 0, 0x44, 0x48, hl_tlv),
397397
398398 SOC_SINGLE_TLV("Bass Shelving Volume", CS42L56_TONE_CTL,
399399 0, 0x00, 1, tone_tlv),
sound/soc/codecs/cs53l30.c+8−8
@@ -348,22 +348,22 @@ static const struct snd_kcontrol_new cs53l30_snd_controls[] = { · 347 unmodified lines
348348 SOC_ENUM("ADC2 NG Delay", adc2_ng_delay_enum),
349349
350350 SOC_SINGLE_SX_TLV("ADC1A PGA Volume",
351− CS53L30_ADC1A_AFE_CTL, 0, 0x34, 0x18, pga_tlv),
351+ CS53L30_ADC1A_AFE_CTL, 0, 0x34, 0x24, pga_tlv),
352352 SOC_SINGLE_SX_TLV("ADC1B PGA Volume",
353− CS53L30_ADC1B_AFE_CTL, 0, 0x34, 0x18, pga_tlv),
353+ CS53L30_ADC1B_AFE_CTL, 0, 0x34, 0x24, pga_tlv),
354354 SOC_SINGLE_SX_TLV("ADC2A PGA Volume",
355− CS53L30_ADC2A_AFE_CTL, 0, 0x34, 0x18, pga_tlv),
355+ CS53L30_ADC2A_AFE_CTL, 0, 0x34, 0x24, pga_tlv),
356356 SOC_SINGLE_SX_TLV("ADC2B PGA Volume",
357− CS53L30_ADC2B_AFE_CTL, 0, 0x34, 0x18, pga_tlv),
357+ CS53L30_ADC2B_AFE_CTL, 0, 0x34, 0x24, pga_tlv),
358358
359359 SOC_SINGLE_SX_TLV("ADC1A Digital Volume",
360− CS53L30_ADC1A_DIG_VOL, 0, 0xA0, 0x0C, dig_tlv),
360+ CS53L30_ADC1A_DIG_VOL, 0, 0xA0, 0x6C, dig_tlv),
361361 SOC_SINGLE_SX_TLV("ADC1B Digital Volume",
362− CS53L30_ADC1B_DIG_VOL, 0, 0xA0, 0x0C, dig_tlv),
362+ CS53L30_ADC1B_DIG_VOL, 0, 0xA0, 0x6C, dig_tlv),
363363 SOC_SINGLE_SX_TLV("ADC2A Digital Volume",
364− CS53L30_ADC2A_DIG_VOL, 0, 0xA0, 0x0C, dig_tlv),
364+ CS53L30_ADC2A_DIG_VOL, 0, 0xA0, 0x6C, dig_tlv),
365365 SOC_SINGLE_SX_TLV("ADC2B Digital Volume",
366− CS53L30_ADC2B_DIG_VOL, 0, 0xA0, 0x0C, dig_tlv),
366+ CS53L30_ADC2B_DIG_VOL, 0, 0xA0, 0x6C, dig_tlv),
367367 };
368368
369369 static const struct snd_soc_dapm_widget cs53l30_dapm_widgets[] = {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t