diff options
author | Brian Austin <brian.austin@cirrus.com> | 2012-03-30 11:43:55 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-03 06:43:23 -0400 |
commit | 1d99f2436d0d1c7741d6dfd9d27b5376cdbbca40 (patch) | |
tree | f3fc73ca59b2d3876b429de52c66e4c2e6294a78 /sound/soc/codecs/cs42l73.c | |
parent | 152ad442315517e6275efe6c142c06cb8aced6dd (diff) |
ASoC: core: Rework SOC_DOUBLE_R_SX_TLV add SOC_SINGLE_SX_TLV
Some codecs namely Cirrus Logic Codecs have a way of wrapping the dB scale around 0dB without 0dB being in the middle.
Rework of SOC_DOUBLE_R_SX_TLV to be more consistent with other asoc tlv macros.
Add single register macro : SOC_SINGLE_SX_TLV.
Use snd_soc_info_volsw for .info
Use snd_soc_get_volsw_sx, snd_soc_put_volsw_sx for single and double.
kcontrols for CS42L51 and CS42L73 are adjusted to these new TLV Macros.
The max value is determined by: (number of steps) +1 for 0dB +max from codec datasheet.
Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/cs42l73.c')
-rw-r--r-- | sound/soc/codecs/cs42l73.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c index 78979b3e0e95..d39b3e78703b 100644 --- a/sound/soc/codecs/cs42l73.c +++ b/sound/soc/codecs/cs42l73.c | |||
@@ -402,37 +402,37 @@ static const struct snd_kcontrol_new ear_amp_ctl = | |||
402 | 402 | ||
403 | static const struct snd_kcontrol_new cs42l73_snd_controls[] = { | 403 | static const struct snd_kcontrol_new cs42l73_snd_controls[] = { |
404 | SOC_DOUBLE_R_SX_TLV("Headphone Analog Playback Volume", | 404 | SOC_DOUBLE_R_SX_TLV("Headphone Analog Playback Volume", |
405 | CS42L73_HPAAVOL, CS42L73_HPBAVOL, 7, | 405 | CS42L73_HPAAVOL, CS42L73_HPBAVOL, 0, |
406 | 0xffffffC1, 0x0C, hpaloa_tlv), | 406 | 0x41, 0x4B, hpaloa_tlv), |
407 | 407 | ||
408 | SOC_DOUBLE_R_SX_TLV("LineOut Analog Playback Volume", CS42L73_LOAAVOL, | 408 | SOC_DOUBLE_R_SX_TLV("LineOut Analog Playback Volume", CS42L73_LOAAVOL, |
409 | CS42L73_LOBAVOL, 7, 0xffffffC1, 0x0C, hpaloa_tlv), | 409 | CS42L73_LOBAVOL, 0, 0x41, 0x4B, hpaloa_tlv), |
410 | 410 | ||
411 | SOC_DOUBLE_R_SX_TLV("Input PGA Analog Volume", CS42L73_MICAPREPGAAVOL, | 411 | SOC_DOUBLE_R_SX_TLV("Input PGA Analog Volume", CS42L73_MICAPREPGAAVOL, |
412 | CS42L73_MICBPREPGABVOL, 5, 0xffffff35, | 412 | CS42L73_MICBPREPGABVOL, 5, 0x34, |
413 | 0x34, micpga_tlv), | 413 | 0x24, micpga_tlv), |
414 | 414 | ||
415 | SOC_DOUBLE_R("MIC Preamp Switch", CS42L73_MICAPREPGAAVOL, | 415 | SOC_DOUBLE_R("MIC Preamp Switch", CS42L73_MICAPREPGAAVOL, |
416 | CS42L73_MICBPREPGABVOL, 6, 1, 1), | 416 | CS42L73_MICBPREPGABVOL, 6, 1, 1), |
417 | 417 | ||
418 | SOC_DOUBLE_R_SX_TLV("Input Path Digital Volume", CS42L73_IPADVOL, | 418 | SOC_DOUBLE_R_SX_TLV("Input Path Digital Volume", CS42L73_IPADVOL, |
419 | CS42L73_IPBDVOL, 7, 0xffffffA0, 0xA0, ipd_tlv), | 419 | CS42L73_IPBDVOL, 0, 0xA0, 0x6C, ipd_tlv), |
420 | 420 | ||
421 | SOC_DOUBLE_R_SX_TLV("HL Digital Playback Volume", | 421 | SOC_DOUBLE_R_SX_TLV("HL Digital Playback Volume", |
422 | CS42L73_HLADVOL, CS42L73_HLBDVOL, 7, 0xffffffE5, | 422 | CS42L73_HLADVOL, CS42L73_HLBDVOL, |
423 | 0xE4, hl_tlv), | 423 | 0, 0x34, 0xE4, hl_tlv), |
424 | 424 | ||
425 | SOC_SINGLE_TLV("ADC A Boost Volume", | 425 | SOC_SINGLE_TLV("ADC A Boost Volume", |
426 | CS42L73_ADCIPC, 2, 0x01, 1, adc_boost_tlv), | 426 | CS42L73_ADCIPC, 2, 0x01, 1, adc_boost_tlv), |
427 | 427 | ||
428 | SOC_SINGLE_TLV("ADC B Boost Volume", | 428 | SOC_SINGLE_TLV("ADC B Boost Volume", |
429 | CS42L73_ADCIPC, 6, 0x01, 1, adc_boost_tlv), | 429 | CS42L73_ADCIPC, 6, 0x01, 1, adc_boost_tlv), |
430 | 430 | ||
431 | SOC_SINGLE_TLV("Speakerphone Digital Playback Volume", | 431 | SOC_SINGLE_SX_TLV("Speakerphone Digital Volume", |
432 | CS42L73_SPKDVOL, 0, 0xE4, 1, hl_tlv), | 432 | CS42L73_SPKDVOL, 0, 0x34, 0xE4, hl_tlv), |
433 | 433 | ||
434 | SOC_SINGLE_TLV("Ear Speaker Digital Playback Volume", | 434 | SOC_SINGLE_SX_TLV("Ear Speaker Digital Volume", |
435 | CS42L73_ESLDVOL, 0, 0xE4, 1, hl_tlv), | 435 | CS42L73_ESLDVOL, 0, 0x34, 0xE4, hl_tlv), |
436 | 436 | ||
437 | SOC_DOUBLE_R("Headphone Analog Playback Switch", CS42L73_HPAAVOL, | 437 | SOC_DOUBLE_R("Headphone Analog Playback Switch", CS42L73_HPAAVOL, |
438 | CS42L73_HPBAVOL, 7, 1, 1), | 438 | CS42L73_HPBAVOL, 7, 1, 1), |