ASoC: twl6040 - add method to query HS DC offset step size in mV
PATCH 1/1 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 <[email protected]>
--- sound/soc/codecs/twl6040.c | 13 +++++++++++++ sound/soc/codecs/twl6040.h | 1 + 2 files changed, 14 insertions(+), 0 deletions(-)
sound/soc/codecs/twl6040.c +13 -0
@@ -1029,6 +1029,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",
sound/soc/codecs/twl6040.h +1 -0
@@ -38,5 +38,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__ */
Signature · 1 line
1.7.5.4
Mark Brown
AppliedQuoted 3 lines · Liam Girdwood
Provide a method for mach drivers to query the HS DC offset step size in mV.
Signed-off-by Liam Girdwood <[email protected]>
Applied, thanks.