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
444 }444 }
445}445}
446 446
447static DECLARE_TLV_DB_SCALE(dig_vol_tlv, -10200, 25, 0);447static const DECLARE_TLV_DB_RANGE(dig_vol_tlv, 0, 912,
448 TLV_DB_MINMAX_ITEM(-10200, 1200));
448static DECLARE_TLV_DB_SCALE(amp_gain_tlv, 0, 1, 1);449static DECLARE_TLV_DB_SCALE(amp_gain_tlv, 0, 1, 1);
449 450
450static const char * const cs35l36_pcm_sftramp_text[] = {451static 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
143 0, 0xA0, 96, adc_att_tlv),143 0, 0xA0, 96, adc_att_tlv),
144 SOC_DOUBLE_R_SX_TLV("PGA Volume",144 SOC_DOUBLE_R_SX_TLV("PGA Volume",
145 CS42L51_ALC_PGA_CTL, CS42L51_ALC_PGB_CTL,145 CS42L51_ALC_PGA_CTL, CS42L51_ALC_PGB_CTL,
146 0, 0x1A, 30, pga_tlv),146 0, 0x19, 30, pga_tlv),
147 SOC_SINGLE("Playback Deemphasis Switch", CS42L51_DAC_CTL, 3, 1, 0),147 SOC_SINGLE("Playback Deemphasis Switch", CS42L51_DAC_CTL, 3, 1, 0),
148 SOC_SINGLE("Auto-Mute Switch", CS42L51_DAC_CTL, 2, 1, 0),148 SOC_SINGLE("Auto-Mute Switch", CS42L51_DAC_CTL, 2, 1, 0),
149 SOC_SINGLE("Soft Ramp Switch", CS42L51_DAC_CTL, 1, 1, 0),149 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
137 137
138static DECLARE_TLV_DB_SCALE(pga_tlv, -600, 50, 0);138static DECLARE_TLV_DB_SCALE(pga_tlv, -600, 50, 0);
139 139
140static DECLARE_TLV_DB_SCALE(mix_tlv, -50, 50, 0);140static DECLARE_TLV_DB_SCALE(pass_tlv, -6000, 50, 0);
141
142static DECLARE_TLV_DB_SCALE(mix_tlv, -5150, 50, 0);
141 143
142static DECLARE_TLV_DB_SCALE(beep_tlv, -56, 200, 0);144static DECLARE_TLV_DB_SCALE(beep_tlv, -56, 200, 0);
143 145
@@ -351,7 +353,7 @@ static const struct snd_kcontrol_new cs42l52_snd_controls[] = { · 207 unmodified lines
351 CS42L52_SPKB_VOL, 0, 0x40, 0xC0, hl_tlv),353 CS42L52_SPKB_VOL, 0, 0x40, 0xC0, hl_tlv),
352 354
353 SOC_DOUBLE_R_SX_TLV("Bypass Volume", CS42L52_PASSTHRUA_VOL,355 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),
355 357
356 SOC_DOUBLE("Bypass Mute", CS42L52_MISC_CTL, 4, 5, 1, 0),358 SOC_DOUBLE("Bypass Mute", CS42L52_MISC_CTL, 4, 5, 1, 0),
357 359
@@ -364,7 +366,7 @@ static const struct snd_kcontrol_new cs42l52_snd_controls[] = { · 6 unmodified lines
364 CS42L52_ADCB_VOL, 0, 0xA0, 0x78, ipd_tlv),366 CS42L52_ADCB_VOL, 0, 0xA0, 0x78, ipd_tlv),
365 SOC_DOUBLE_R_SX_TLV("ADC Mixer Volume",367 SOC_DOUBLE_R_SX_TLV("ADC Mixer Volume",
366 CS42L52_ADCA_MIXER_VOL, CS42L52_ADCB_MIXER_VOL,368 CS42L52_ADCA_MIXER_VOL, CS42L52_ADCB_MIXER_VOL,
367 0, 0x19, 0x7F, ipd_tlv),369 0, 0x19, 0x7F, mix_tlv),
368 370
369 SOC_DOUBLE("ADC Switch", CS42L52_ADC_MISC_CTL, 0, 1, 1, 0),371 SOC_DOUBLE("ADC Switch", CS42L52_ADC_MISC_CTL, 0, 1, 1, 0),
370 372
sound/soc/codecs/cs42l56.c+2−2
@@ -391,9 +391,9 @@ static const struct snd_kcontrol_new cs42l56_snd_controls[] = { · 390 unmodified lines
391 SOC_DOUBLE("ADC Boost Switch", CS42L56_GAIN_BIAS_CTL, 3, 2, 1, 1),391 SOC_DOUBLE("ADC Boost Switch", CS42L56_GAIN_BIAS_CTL, 3, 2, 1, 1),
392 392
393 SOC_DOUBLE_R_SX_TLV("Headphone Volume", CS42L56_HPA_VOLUME,393 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),
395 SOC_DOUBLE_R_SX_TLV("LineOut Volume", CS42L56_LOA_VOLUME,395 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),
397 397
398 SOC_SINGLE_TLV("Bass Shelving Volume", CS42L56_TONE_CTL,398 SOC_SINGLE_TLV("Bass Shelving Volume", CS42L56_TONE_CTL,
399 0, 0x00, 1, tone_tlv),399 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
348 SOC_ENUM("ADC2 NG Delay", adc2_ng_delay_enum),348 SOC_ENUM("ADC2 NG Delay", adc2_ng_delay_enum),
349 349
350 SOC_SINGLE_SX_TLV("ADC1A PGA Volume",350 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),
352 SOC_SINGLE_SX_TLV("ADC1B PGA Volume",352 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),
354 SOC_SINGLE_SX_TLV("ADC2A PGA Volume",354 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),
356 SOC_SINGLE_SX_TLV("ADC2B PGA Volume",356 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),
358 358
359 SOC_SINGLE_SX_TLV("ADC1A Digital Volume",359 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),
361 SOC_SINGLE_SX_TLV("ADC1B Digital Volume",361 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),
363 SOC_SINGLE_SX_TLV("ADC2A Digital Volume",363 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),
365 SOC_SINGLE_SX_TLV("ADC2B Digital Volume",365 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),
367};367};
368 368
369static const struct snd_soc_dapm_widget cs53l30_dapm_widgets[] = {369static 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