aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMR.Swami.Reddy@ti.com <MR.Swami.Reddy@ti.com>2012-12-07 06:30:10 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-24 10:43:56 -0500
commit88ac43924b396e524288570ed3b11e8c94c1191f (patch)
treef5730cdc2be32611e42ef3643f74030c00630e82 /sound
parentec20f2f8d3714cfb491a138eb4c0c720577d49e6 (diff)
ASoC: lm49453: Fix adc, mic and sidetone volume ranges
Add adc, mic, sidetone volume ranges and appropriately added the controls. Fix the DAC HP/EP/LS/LO/HA maximum gain values. Signed-off-by: MR Swami Reddy <mr.swami.reddy@ti.com> Tested-by: Vinod Koul <vinod.koul@intel.com> -- sound/soc/codecs/lm49453.c | 43 ++++++++++++++++++++++++------------------- 1 files changed, 24 insertions(+), 19 deletions(-) Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/lm49453.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/sound/soc/codecs/lm49453.c b/sound/soc/codecs/lm49453.c
index c0d203bfe5f0..f34832851785 100644
--- a/sound/soc/codecs/lm49453.c
+++ b/sound/soc/codecs/lm49453.c
@@ -525,36 +525,41 @@ SOC_DAPM_SINGLE("Port2_2 Switch", LM49453_P0_PORT2_TX2_REG, 7, 1, 0),
525}; 525};
526 526
527/* TLV Declarations */ 527/* TLV Declarations */
528static const DECLARE_TLV_DB_SCALE(digital_tlv, -7650, 150, 1); 528static const DECLARE_TLV_DB_SCALE(adc_dac_tlv, -7650, 150, 1);
529static const DECLARE_TLV_DB_SCALE(port_tlv, 0, 600, 0); 529static const DECLARE_TLV_DB_SCALE(mic_tlv, 0, 200, 1);
530static const DECLARE_TLV_DB_SCALE(port_tlv, -1800, 600, 0);
531static const DECLARE_TLV_DB_SCALE(stn_tlv, -7200, 150, 0);
530 532
531static const struct snd_kcontrol_new lm49453_sidetone_mixer_controls[] = { 533static const struct snd_kcontrol_new lm49453_sidetone_mixer_controls[] = {
532/* Sidetone supports mono only */ 534/* Sidetone supports mono only */
533SOC_DAPM_SINGLE_TLV("Sidetone ADCL Volume", LM49453_P0_STN_VOL_ADCL_REG, 535SOC_DAPM_SINGLE_TLV("Sidetone ADCL Volume", LM49453_P0_STN_VOL_ADCL_REG,
534 0, 0x3F, 0, digital_tlv), 536 0, 0x3F, 0, stn_tlv),
535SOC_DAPM_SINGLE_TLV("Sidetone ADCR Volume", LM49453_P0_STN_VOL_ADCR_REG, 537SOC_DAPM_SINGLE_TLV("Sidetone ADCR Volume", LM49453_P0_STN_VOL_ADCR_REG,
536 0, 0x3F, 0, digital_tlv), 538 0, 0x3F, 0, stn_tlv),
537SOC_DAPM_SINGLE_TLV("Sidetone DMIC1L Volume", LM49453_P0_STN_VOL_DMIC1L_REG, 539SOC_DAPM_SINGLE_TLV("Sidetone DMIC1L Volume", LM49453_P0_STN_VOL_DMIC1L_REG,
538 0, 0x3F, 0, digital_tlv), 540 0, 0x3F, 0, stn_tlv),
539SOC_DAPM_SINGLE_TLV("Sidetone DMIC1R Volume", LM49453_P0_STN_VOL_DMIC1R_REG, 541SOC_DAPM_SINGLE_TLV("Sidetone DMIC1R Volume", LM49453_P0_STN_VOL_DMIC1R_REG,
540 0, 0x3F, 0, digital_tlv), 542 0, 0x3F, 0, stn_tlv),
541SOC_DAPM_SINGLE_TLV("Sidetone DMIC2L Volume", LM49453_P0_STN_VOL_DMIC2L_REG, 543SOC_DAPM_SINGLE_TLV("Sidetone DMIC2L Volume", LM49453_P0_STN_VOL_DMIC2L_REG,
542 0, 0x3F, 0, digital_tlv), 544 0, 0x3F, 0, stn_tlv),
543SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", LM49453_P0_STN_VOL_DMIC2R_REG, 545SOC_DAPM_SINGLE_TLV("Sidetone DMIC2R Volume", LM49453_P0_STN_VOL_DMIC2R_REG,
544 0, 0x3F, 0, digital_tlv), 546 0, 0x3F, 0, stn_tlv),
545}; 547};
546 548
547static const struct snd_kcontrol_new lm49453_snd_controls[] = { 549static const struct snd_kcontrol_new lm49453_snd_controls[] = {
548 /* mic1 and mic2 supports mono only */ 550 /* mic1 and mic2 supports mono only */
549 SOC_SINGLE_TLV("Mic1 Volume", LM49453_P0_ADC_LEVELL_REG, 0, 6, 551 SOC_SINGLE_TLV("Mic1 Volume", LM49453_P0_MICL_REG, 0, 15, 0, mic_tlv),
550 0, digital_tlv), 552 SOC_SINGLE_TLV("Mic2 Volume", LM49453_P0_MICR_REG, 0, 15, 0, mic_tlv),
551 SOC_SINGLE_TLV("Mic2 Volume", LM49453_P0_ADC_LEVELR_REG, 0, 6, 553
552 0, digital_tlv), 554 SOC_SINGLE_TLV("ADCL Volume", LM49453_P0_ADC_LEVELL_REG, 0, 63,
555 0, adc_dac_tlv),
556 SOC_SINGLE_TLV("ADCR Volume", LM49453_P0_ADC_LEVELR_REG, 0, 63,
557 0, adc_dac_tlv),
553 558
554 SOC_DOUBLE_R_TLV("DMIC1 Volume", LM49453_P0_DMIC1_LEVELL_REG, 559 SOC_DOUBLE_R_TLV("DMIC1 Volume", LM49453_P0_DMIC1_LEVELL_REG,
555 LM49453_P0_DMIC1_LEVELR_REG, 0, 6, 0, digital_tlv), 560 LM49453_P0_DMIC1_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
556 SOC_DOUBLE_R_TLV("DMIC2 Volume", LM49453_P0_DMIC2_LEVELL_REG, 561 SOC_DOUBLE_R_TLV("DMIC2 Volume", LM49453_P0_DMIC2_LEVELL_REG,
557 LM49453_P0_DMIC2_LEVELR_REG, 0, 6, 0, digital_tlv), 562 LM49453_P0_DMIC2_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
558 563
559 SOC_DAPM_ENUM("Mic2Mode", lm49453_mic2mode_enum), 564 SOC_DAPM_ENUM("Mic2Mode", lm49453_mic2mode_enum),
560 SOC_DAPM_ENUM("DMIC12 SRC", lm49453_dmic12_cfg_enum), 565 SOC_DAPM_ENUM("DMIC12 SRC", lm49453_dmic12_cfg_enum),
@@ -569,16 +574,16 @@ static const struct snd_kcontrol_new lm49453_snd_controls[] = {
569 2, 1, 0), 574 2, 1, 0),
570 575
571 SOC_DOUBLE_R_TLV("DAC HP Volume", LM49453_P0_DAC_HP_LEVELL_REG, 576 SOC_DOUBLE_R_TLV("DAC HP Volume", LM49453_P0_DAC_HP_LEVELL_REG,
572 LM49453_P0_DAC_HP_LEVELR_REG, 0, 6, 0, digital_tlv), 577 LM49453_P0_DAC_HP_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
573 SOC_DOUBLE_R_TLV("DAC LO Volume", LM49453_P0_DAC_LO_LEVELL_REG, 578 SOC_DOUBLE_R_TLV("DAC LO Volume", LM49453_P0_DAC_LO_LEVELL_REG,
574 LM49453_P0_DAC_LO_LEVELR_REG, 0, 6, 0, digital_tlv), 579 LM49453_P0_DAC_LO_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
575 SOC_DOUBLE_R_TLV("DAC LS Volume", LM49453_P0_DAC_LS_LEVELL_REG, 580 SOC_DOUBLE_R_TLV("DAC LS Volume", LM49453_P0_DAC_LS_LEVELL_REG,
576 LM49453_P0_DAC_LS_LEVELR_REG, 0, 6, 0, digital_tlv), 581 LM49453_P0_DAC_LS_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
577 SOC_DOUBLE_R_TLV("DAC HA Volume", LM49453_P0_DAC_HA_LEVELL_REG, 582 SOC_DOUBLE_R_TLV("DAC HA Volume", LM49453_P0_DAC_HA_LEVELL_REG,
578 LM49453_P0_DAC_HA_LEVELR_REG, 0, 6, 0, digital_tlv), 583 LM49453_P0_DAC_HA_LEVELR_REG, 0, 63, 0, adc_dac_tlv),
579 584
580 SOC_SINGLE_TLV("EP Volume", LM49453_P0_DAC_LS_LEVELL_REG, 585 SOC_SINGLE_TLV("EP Volume", LM49453_P0_DAC_LS_LEVELL_REG,
581 0, 6, 0, digital_tlv), 586 0, 63, 0, adc_dac_tlv),
582 587
583 SOC_SINGLE_TLV("PORT1_1_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL1_REG, 588 SOC_SINGLE_TLV("PORT1_1_RX_LVL Volume", LM49453_P0_PORT1_RX_LVL1_REG,
584 0, 3, 0, port_tlv), 589 0, 3, 0, port_tlv),