Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 230392
b: refs/heads/master
c: d5876ce
h: refs/heads/master
v: v3
  • Loading branch information
Peter Ujfalusi authored and Liam Girdwood committed Nov 30, 2010
1 parent 054f4ed commit 5f9e574
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 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: 3e202345abc2cea09a3601df527629102f37e563
refs/heads/master: d5876ce1242b78987e6243ba3cb23bb61d44d4a9
10 changes: 6 additions & 4 deletions trunk/sound/soc/codecs/tpa6130a2.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct tpa6130a2_data {
unsigned char regs[TPA6130A2_CACHEREGNUM];
struct regulator *supply;
int power_gpio;
unsigned char power_state;
u8 power_state:1;
enum tpa_model id;
};

Expand Down Expand Up @@ -116,7 +116,7 @@ static int tpa6130a2_initialize(void)
return ret;
}

static int tpa6130a2_power(int power)
static int tpa6130a2_power(u8 power)
{
struct tpa6130a2_data *data;
u8 val;
Expand All @@ -126,8 +126,10 @@ static int tpa6130a2_power(int power)
data = i2c_get_clientdata(tpa6130a2_client);

mutex_lock(&data->mutex);
if (power && !data->power_state) {
if (power == data->power_state)
goto exit;

if (power) {
ret = regulator_enable(data->supply);
if (ret != 0) {
dev_err(&tpa6130a2_client->dev,
Expand All @@ -154,7 +156,7 @@ static int tpa6130a2_power(int power)
val = tpa6130a2_read(TPA6130A2_REG_CONTROL);
val &= ~TPA6130A2_SWS;
tpa6130a2_i2c_write(TPA6130A2_REG_CONTROL, val);
} else if (!power && data->power_state) {
} else {
/* set SWS */
val = tpa6130a2_read(TPA6130A2_REG_CONTROL);
val |= TPA6130A2_SWS;
Expand Down

0 comments on commit 5f9e574

Please sign in to comment.