aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/twl4030.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>2010-05-26 04:38:16 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2010-05-31 06:08:58 -0400
commit979bb1f4b8b058e9fb23d6166807e30b507a1a6d (patch)
treeb64514fa9151951809f49ff7feb0c8b59b733070 /sound/soc/codecs/twl4030.c
parentcbd2db128f2cbec1a70aa6897cc4cddbbadecbf6 (diff)
ASoC: TWL4030: Make offset cancellation path configurable
Add means for machine drivers to select the path for offset cancellation. Reset the reg cache value to the chip reset value at the same time. Machine drivers can specify which path need to be used for offset cancellation via the twl4030_setup.offset_cncl_path. For paths use the defines from include/linux/mfd/twl4030-codec.h: TWL4030_OFFSET_CNCL_SEL_* Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc/codecs/twl4030.c')
-rw-r--r--sound/soc/codecs/twl4030.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 1e0aba5b2c5d..a6cbaf3c51f2 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -46,7 +46,7 @@ static const u8 twl4030_reg[TWL4030_CACHEREGNUM] = {
46 0xc3, /* REG_OPTION (0x2) */ 46 0xc3, /* REG_OPTION (0x2) */
47 0x00, /* REG_UNKNOWN (0x3) */ 47 0x00, /* REG_UNKNOWN (0x3) */
48 0x00, /* REG_MICBIAS_CTL (0x4) */ 48 0x00, /* REG_MICBIAS_CTL (0x4) */
49 0x20, /* REG_ANAMICL (0x5) */ 49 0x00, /* REG_ANAMICL (0x5) */
50 0x00, /* REG_ANAMICR (0x6) */ 50 0x00, /* REG_ANAMICR (0x6) */
51 0x00, /* REG_AVADC_CTL (0x7) */ 51 0x00, /* REG_AVADC_CTL (0x7) */
52 0x00, /* REG_ADCMICSEL (0x8) */ 52 0x00, /* REG_ADCMICSEL (0x8) */
@@ -281,6 +281,8 @@ static void twl4030_apll_enable(struct snd_soc_codec *codec, int enable)
281 281
282static void twl4030_power_up(struct snd_soc_codec *codec) 282static void twl4030_power_up(struct snd_soc_codec *codec)
283{ 283{
284 struct snd_soc_device *socdev = codec->socdev;
285 struct twl4030_setup_data *setup = socdev->codec_data;
284 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec); 286 struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
285 u8 anamicl, regmisc1, byte; 287 u8 anamicl, regmisc1, byte;
286 int i = 0; 288 int i = 0;
@@ -293,6 +295,8 @@ static void twl4030_power_up(struct snd_soc_codec *codec)
293 295
294 /* initiate offset cancellation */ 296 /* initiate offset cancellation */
295 anamicl = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICL); 297 anamicl = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICL);
298 anamicl &= ~TWL4030_OFFSET_CNCL_SEL;
299 anamicl |= setup->offset_cncl_path;
296 twl4030_write(codec, TWL4030_REG_ANAMICL, 300 twl4030_write(codec, TWL4030_REG_ANAMICL,
297 anamicl | TWL4030_CNCL_OFFSET_START); 301 anamicl | TWL4030_CNCL_OFFSET_START);
298 302