summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorGary Zhang <b13634@freescale.com>2011-12-13 16:11:18 +0800
committerJason Liu <r64343@freescale.com>2012-01-09 21:10:46 +0800
commitb3399f3c4a3eb9a7699f2e76f6f195e36ff9eaba (patch)
tree7ae04adb23ed45fe51b400a90cd4b2392d9199c0 /sound
parent70a0d6e96f6043dca97ceec4442c60808b6c9a19 (diff)
ENGR00162649 sgtl5000: reduce the DAC volume
1. if the DAC volume is largest, output is harsh. so reduce the DAC volume. 2. increase ADC volume Signed-off-by: Gary Zhang <b13634@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/sgtl5000.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
index 98e9c13a7615..c6d067e95c0c 100644
--- a/sound/soc/codecs/sgtl5000.c
+++ b/sound/soc/codecs/sgtl5000.c
@@ -347,7 +347,7 @@ static int dac_info_volsw(struct snd_kcontrol *kcontrol,
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
uinfo->value.integer.min = 0;
- uinfo->value.integer.max = 0xfc - 0x3c;
+ uinfo->value.integer.max = 0xfc - 0x60;
return 0;
}
@@ -390,9 +390,9 @@ static int dac_get_volsw(struct snd_kcontrol *kcontrol,
/* get right channel volume */
r = (reg & SGTL5000_DAC_VOL_RIGHT_MASK) >> SGTL5000_DAC_VOL_RIGHT_SHIFT;
- /* make sure value fall in (0x3c,0xfc) */
- l = clamp(l, 0x3c, 0xfc);
- r = clamp(r, 0x3c, 0xfc);
+ /* make sure value fall in (0x60,0xfc) */
+ l = clamp(l, 0x60, 0xfc);
+ r = clamp(r, 0x60, 0xfc);
/* invert it and map to userspace value */
l = 0xfc - l;
@@ -438,9 +438,9 @@ static int dac_put_volsw(struct snd_kcontrol *kcontrol,
l = ucontrol->value.integer.value[0];
r = ucontrol->value.integer.value[1];
- /* make sure userspace volume fall in (0, 0xfc-0x3c) */
- l = clamp(l, 0, 0xfc - 0x3c);
- r = clamp(r, 0, 0xfc - 0x3c);
+ /* make sure userspace volume fall in (0, 0xfc-0x60) */
+ l = clamp(l, 0, 0xfc - 0x60);
+ r = clamp(r, 0, 0xfc - 0x60);
/* invert it, get the value can be set to register */
l = 0xfc - l;
@@ -1603,6 +1603,11 @@ static int sgtl5000_probe(struct snd_soc_codec *codec)
snd_soc_write(codec, SGTL5000_CHIP_MIC_CTRL, 0);
+ snd_soc_write(codec, SGTL5000_CHIP_DAC_VOL, 0x6060);
+ snd_soc_write(codec, SGTL5000_CHIP_ANA_ADC_CTRL,
+ (0xf << SGTL5000_ADC_VOL_LEFT_SHIFT) |\
+ (0xf << SGTL5000_ADC_VOL_RIGHT_SHIFT));
+
/*
* disable DAP
* TODO: