Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 16a30fbb authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown
Browse files

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.

Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 203350c1
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -145,7 +145,6 @@ struct twl4030_priv {
static inline unsigned int twl4030_read_reg_cache(struct snd_soc_codec *codec,
static inline unsigned int twl4030_read_reg_cache(struct snd_soc_codec *codec,
	unsigned int reg)
	unsigned int reg)
{
{
	u8 *cache = codec->reg_cache;


	if (reg >= TWL4030_CACHEREGNUM)
	if (reg >= TWL4030_CACHEREGNUM)
		return -EIO;
		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)
static void twl4030_init_chip(struct snd_soc_codec *codec)
{
{
	u8 *cache = codec->reg_cache;
	int i;
	int i;


	/* clear CODECPDZ prior to setting register defaults */
	/* 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 */
	/* set all audio section registers to reasonable defaults */
	for (i = TWL4030_REG_OPTION; i <= TWL4030_REG_MISC_SET_2; i++)
	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]);


}
}