Skip to content

Commit

Permalink
ASoC: twl6040: Read the TRIM values from the chip
Browse files Browse the repository at this point in the history
Update the reg_cache with values from chip regarding to TRIM.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Peter Ujfalusi authored and Mark Brown committed Sep 26, 2011
1 parent c0fd9c9 commit f97217f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sound/soc/codecs/twl6040.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,16 @@ static void twl6040_init_chip(struct snd_soc_codec *codec)
struct twl6040 *twl6040 = codec->control_data;
u8 val;

/* Update reg_cache: ASICREV, and TRIM values */
val = twl6040_get_revid(twl6040);
twl6040_write_reg_cache(codec, TWL6040_REG_ASICREV, val);

twl6040_read_reg_volatile(codec, TWL6040_REG_TRIM1);
twl6040_read_reg_volatile(codec, TWL6040_REG_TRIM2);
twl6040_read_reg_volatile(codec, TWL6040_REG_TRIM3);
twl6040_read_reg_volatile(codec, TWL6040_REG_HSOTRIM);
twl6040_read_reg_volatile(codec, TWL6040_REG_HFOTRIM);

/* Change chip defaults */
/* No imput selected for microphone amplifiers */
twl6040_write_reg_cache(codec, TWL6040_REG_MICLCTL, 0x18);
Expand Down

0 comments on commit f97217f

Please sign in to comment.