ASoC: TWL4030: Using codec_regcache in twl4030_init_chip
cover ASoC: TWL4030: Using codec_regcache in twl4030_init_chip
Hello,
The twl4030_init_chip used the twl4030_reg array directly to set the default register values.
In other places the defaults has been modified in the codec->reg_cache (prime example is the Headset ramp delay configuration).
Switch using the codec->reg_cache in the twl4030_init_chip function, so updated defaults will be actually used.
---
Peter Ujfalusi (1):
ASoC: TWL4030: Use reg_cache in twl4030_init_chip
sound/soc/codecs/twl4030.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
PATCH 1/1 ASoC: TWL4030: Use reg_cache in twl4030_init_chip
Use the codec->reg_cache instead of the array directly in twl4030_init_chip for setting the default values.
--- sound/soc/codecs/twl4030.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/codecs/twl4030.c +2 -2
@@ -145,7 +145,6 @@ struct twl4030_priv {static inline unsigned int twl4030_read_reg_cache (struct snd_soc_codec *codec,unsigned int reg) { -u8 *cache = codec->reg_cache;if (reg >=TWL4030_CACHEREGNUM )return -EIO ;
@@ -204,6 +203,7 @@ static void twl4030_codec_enable(struct snd_soc_codec *codec, int enable)static void twl4030_init_chip (struct snd_soc_codec *codec) { +u8 *cache = codec->reg_cache;int i;/* clear CODECPDZ prior to setting register defaults */
@@ -211,7 +211,7 @@ static void twl4030_init_chip(struct snd_soc_codec *codec)/* set all audio section registers to reasonable defaults */ for (i =TWL4030_REG_OPTION ; i <=TWL4030_REG_MISC_SET_2 ; i++) -twl4030_write (codec, i, twl4030_reg[i]); +twl4030_write (codec, i, cache[i]); }
Signature · 1 line
1.6.3.1
Mark Brown
AppliedRe: [PATCH 1/1] ASoC: TWL4030: Use reg_cache in twl4030_init_chip
Quoted 4 lines · Peter Ujfalusi
Use the
codec->reg_cacheinstead of the array directly intwl4030_init_chipfor setting the default values.Signed-off-by Peter Ujfalusi <[email protected]>
Applied, thanks.