aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/twl6040.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/twl6040.c')
-rw-r--r--sound/soc/codecs/twl6040.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 5b9c79b6f65e..2d8c6b825e57 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1052,6 +1052,19 @@ int twl6040_get_trim_value(struct snd_soc_codec *codec, enum twl6040_trim trim)
1052} 1052}
1053EXPORT_SYMBOL_GPL(twl6040_get_trim_value); 1053EXPORT_SYMBOL_GPL(twl6040_get_trim_value);
1054 1054
1055int twl6040_get_hs_step_size(struct snd_soc_codec *codec)
1056{
1057 struct twl6040 *twl6040 = codec->control_data;
1058
1059 if (twl6040_get_revid(twl6040) < TWL6040_REV_ES1_2)
1060 /* For ES under ES_1.3 HS step is 2 mV */
1061 return 2;
1062 else
1063 /* For ES_1.3 HS step is 1 mV */
1064 return 1;
1065}
1066EXPORT_SYMBOL_GPL(twl6040_get_hs_step_size);
1067
1055static const struct snd_kcontrol_new twl6040_snd_controls[] = { 1068static const struct snd_kcontrol_new twl6040_snd_controls[] = {
1056 /* Capture gains */ 1069 /* Capture gains */
1057 SOC_DOUBLE_TLV("Capture Preamplifier Volume", 1070 SOC_DOUBLE_TLV("Capture Preamplifier Volume",
@@ -1125,14 +1138,14 @@ static const struct snd_soc_dapm_widget twl6040_dapm_widgets[] = {
1125 TWL6040_REG_MICRCTL, 2, 0), 1138 TWL6040_REG_MICRCTL, 2, 0),
1126 1139
1127 /* Microphone bias */ 1140 /* Microphone bias */
1128 SND_SOC_DAPM_MICBIAS("Headset Mic Bias", 1141 SND_SOC_DAPM_SUPPLY("Headset Mic Bias",
1129 TWL6040_REG_AMICBCTL, 0, 0), 1142 TWL6040_REG_AMICBCTL, 0, 0, NULL, 0),
1130 SND_SOC_DAPM_MICBIAS("Main Mic Bias", 1143 SND_SOC_DAPM_SUPPLY("Main Mic Bias",
1131 TWL6040_REG_AMICBCTL, 4, 0), 1144 TWL6040_REG_AMICBCTL, 4, 0, NULL, 0),
1132 SND_SOC_DAPM_MICBIAS("Digital Mic1 Bias", 1145 SND_SOC_DAPM_SUPPLY("Digital Mic1 Bias",
1133 TWL6040_REG_DMICBCTL, 0, 0), 1146 TWL6040_REG_DMICBCTL, 0, 0, NULL, 0),
1134 SND_SOC_DAPM_MICBIAS("Digital Mic2 Bias", 1147 SND_SOC_DAPM_SUPPLY("Digital Mic2 Bias",
1135 TWL6040_REG_DMICBCTL, 4, 0), 1148 TWL6040_REG_DMICBCTL, 4, 0, NULL, 0),
1136 1149
1137 /* DACs */ 1150 /* DACs */
1138 SND_SOC_DAPM_DAC("HSDAC Left", "Headset Playback", SND_SOC_NOPM, 0, 0), 1151 SND_SOC_DAPM_DAC("HSDAC Left", "Headset Playback", SND_SOC_NOPM, 0, 0),
@@ -1527,7 +1540,6 @@ static int twl6040_probe(struct snd_soc_codec *codec)
1527 1540
1528 priv->codec = codec; 1541 priv->codec = codec;
1529 codec->control_data = dev_get_drvdata(codec->dev->parent); 1542 codec->control_data = dev_get_drvdata(codec->dev->parent);
1530 codec->ignore_pmdown_time = 1;
1531 1543
1532 if (pdata && pdata->hs_left_step && pdata->hs_right_step) { 1544 if (pdata && pdata->hs_left_step && pdata->hs_right_step) {
1533 priv->hs_left_step = pdata->hs_left_step; 1545 priv->hs_left_step = pdata->hs_left_step;
@@ -1613,6 +1625,7 @@ static struct snd_soc_codec_driver soc_codec_dev_twl6040 = {
1613 .reg_cache_size = ARRAY_SIZE(twl6040_reg), 1625 .reg_cache_size = ARRAY_SIZE(twl6040_reg),
1614 .reg_word_size = sizeof(u8), 1626 .reg_word_size = sizeof(u8),
1615 .reg_cache_default = twl6040_reg, 1627 .reg_cache_default = twl6040_reg,
1628 .ignore_pmdown_time = true,
1616 1629
1617 .controls = twl6040_snd_controls, 1630 .controls = twl6040_snd_controls,
1618 .num_controls = ARRAY_SIZE(twl6040_snd_controls), 1631 .num_controls = ARRAY_SIZE(twl6040_snd_controls),