ASoC: twl6040 - add method to query HS DC offset step size in mV
authorLiam Girdwood <lrg@ti.com>
Mon, 9 Jan 2012 12:10:16 +0000 (12:10 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 20 Jan 2012 13:58:26 +0000 (13:58 +0000)
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>
sound/soc/codecs/twl6040.c
sound/soc/codecs/twl6040.h

index 5b9c79b6f65e104fdbbae4779452d15821752c58..284dd2e99971931ed43505c8b27cc858db1143b7 100644 (file)
@@ -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",
index ef273f1fac2f838add14ecc8b01465e4677097af..0611406ca7c0359188575df1e61020c1680e9b4e 100644 (file)
@@ -39,5 +39,6 @@ void twl6040_hs_jack_detect(struct snd_soc_codec *codec,
                            struct snd_soc_jack *jack, int report);
 int twl6040_get_clk_id(struct snd_soc_codec *codec);
 int twl6040_get_trim_value(struct snd_soc_codec *codec, enum twl6040_trim trim);
+int twl6040_get_hs_step_size(struct snd_soc_codec *codec);
 
 #endif /* End of __TWL6040_H__ */