Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353433
b: refs/heads/master
c: 5712ded
h: refs/heads/master
i:
  353431: 12a05c4
v: v3
  • Loading branch information
Peter Ujfalusi authored and Mark Brown committed Jan 2, 2013
1 parent 347d0db commit 599ba41
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 14 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: e04d6e55fe02351b1ac338d9e8082fcc434610ce
refs/heads/master: 5712ded9cf0b6981825af3c86e0059be93e5e17c
44 changes: 31 additions & 13 deletions trunk/sound/soc/codecs/twl4030.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
/* Register descriptions are here */
#include <linux/mfd/twl4030-audio.h>

/* TWL4030 PMBR1 Register */
#define TWL4030_PMBR1_REG 0x0D
/* TWL4030 PMBR1 Register GPIO6 mux bits */
#define TWL4030_GPIO6_PWM0_MUTE(value) ((value & 0x03) << 2)

/* Shadow register used by the audio driver */
#define TWL4030_REG_SW_SHADOW 0x4A
#define TWL4030_CACHEREGNUM (TWL4030_REG_SW_SHADOW + 1)
Expand Down Expand Up @@ -348,19 +353,32 @@ static void twl4030_init_chip(struct snd_soc_codec *codec)

pdata = twl4030_get_pdata(codec);

if (pdata && pdata->hs_extmute &&
gpio_is_valid(pdata->hs_extmute_gpio)) {
int ret;

if (!pdata->hs_extmute_gpio)
dev_warn(codec->dev,
"Extmute GPIO is 0 is this correct?\n");

ret = gpio_request_one(pdata->hs_extmute_gpio,
GPIOF_OUT_INIT_LOW, "hs_extmute");
if (ret) {
dev_err(codec->dev, "Failed to get hs_extmute GPIO\n");
pdata->hs_extmute_gpio = -1;
if (pdata && pdata->hs_extmute) {
if (gpio_is_valid(pdata->hs_extmute_gpio)) {
int ret;

if (!pdata->hs_extmute_gpio)
dev_warn(codec->dev,
"Extmute GPIO is 0 is this correct?\n");

ret = gpio_request_one(pdata->hs_extmute_gpio,
GPIOF_OUT_INIT_LOW,
"hs_extmute");
if (ret) {
dev_err(codec->dev,
"Failed to get hs_extmute GPIO\n");
pdata->hs_extmute_gpio = -1;
}
} else {
u8 pin_mux;

/* Set TWL4030 GPIO6 as EXTMUTE signal */
twl_i2c_read_u8(TWL4030_MODULE_INTBR, &pin_mux,
TWL4030_PMBR1_REG);
pin_mux &= ~TWL4030_GPIO6_PWM0_MUTE(0x03);
pin_mux |= TWL4030_GPIO6_PWM0_MUTE(0x02);
twl_i2c_write_u8(TWL4030_MODULE_INTBR, pin_mux,
TWL4030_PMBR1_REG);
}
}

Expand Down

0 comments on commit 599ba41

Please sign in to comment.