Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148306
b: refs/heads/master
c: f3b5d30
h: refs/heads/master
v: v3
  • Loading branch information
Peter Ujfalusi authored and Mark Brown committed May 25, 2009
1 parent f2b975a commit f94f2cb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5a2e9a48b1d6de35ae5efea35d117133c3eb30f2
refs/heads/master: f3b5d3002d5b43d277dedc1e044d02f2a40a43c5
7 changes: 6 additions & 1 deletion trunk/sound/soc/codecs/twl4030.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ static const u8 twl4030_reg[TWL4030_CACHEREGNUM] = {
0x00, /* REG_VIBRA_PWM_SET (0x47) */
0x00, /* REG_ANAMIC_GAIN (0x48) */
0x00, /* REG_MISC_SET_2 (0x49) */
0x00, /* REG_SW_SHADOW (0x4A) - Shadow, non HW register */
};

/* codec private data */
Expand Down Expand Up @@ -172,7 +173,11 @@ static int twl4030_write(struct snd_soc_codec *codec,
unsigned int reg, unsigned int value)
{
twl4030_write_reg_cache(codec, reg, value);
return twl4030_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, value, reg);
if (likely(reg < TWL4030_REG_SW_SHADOW))
return twl4030_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, value,
reg);
else
return 0;
}

static void twl4030_codec_enable(struct snd_soc_codec *codec, int enable)
Expand Down
7 changes: 6 additions & 1 deletion trunk/sound/soc/codecs/twl4030.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@
#define TWL4030_REG_VIBRA_PWM_SET 0x47
#define TWL4030_REG_ANAMIC_GAIN 0x48
#define TWL4030_REG_MISC_SET_2 0x49
#define TWL4030_REG_SW_SHADOW 0x4A

#define TWL4030_CACHEREGNUM (TWL4030_REG_MISC_SET_2 + 1)
#define TWL4030_CACHEREGNUM (TWL4030_REG_SW_SHADOW + 1)

/* Bitfield Definitions */

Expand Down Expand Up @@ -260,6 +261,10 @@
#define TWL4030_SMOOTH_ANAVOL_EN 0x02
#define TWL4030_DIGMIC_LR_SWAP_EN 0x01

/* TWL4030_REG_SW_SHADOW (0x4A) Fields */
#define TWL4030_HFL_EN 0x01
#define TWL4030_HFR_EN 0x02

#define TWL4030_DAI_HIFI 0
#define TWL4030_DAI_VOICE 1

Expand Down

0 comments on commit f94f2cb

Please sign in to comment.