summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/twl6040.c
diff options
context:
space:
mode:
authorLiam Girdwood <lrg@ti.com>2012-01-09 16:10:16 +0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-20 17:58:26 +0400
commit08656910bb80882aaad739faea6dac3a0818f71c (patch)
treee0fcaf1dd7b21086dbcb4aa0dc8bf4d16a4d2c91 /sound/soc/codecs/twl6040.c
parent9b85fc90634972634a229aaa1c94f8c9a50fddbc (diff)
downloadlinux-08656910bb80882aaad739faea6dac3a0818f71c.tar.xz
ASoC: twl6040 - add method to query HS DC offset step size in mV
Provide a method for mach drivers to query the HS DC offset step size in mV. Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/twl6040.c')
-rw-r--r--sound/soc/codecs/twl6040.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 5b9c79b6f65e..284dd2e99971 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)
}
EXPORT_SYMBOL_GPL(twl6040_get_trim_value);
+int twl6040_get_hs_step_size(struct snd_soc_codec *codec)
+{
+ struct twl6040 *twl6040 = codec->control_data;
+
+ if (twl6040_get_revid(twl6040) < TWL6040_REV_ES1_2)
+ /* For ES under ES_1.3 HS step is 2 mV */
+ return 2;
+ else
+ /* For ES_1.3 HS step is 1 mV */
+ return 1;
+}
+EXPORT_SYMBOL_GPL(twl6040_get_hs_step_size);
+
static const struct snd_kcontrol_new twl6040_snd_controls[] = {
/* Capture gains */
SOC_DOUBLE_TLV("Capture Preamplifier Volume",