Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114481
b: refs/heads/master
c: b84ee0b
h: refs/heads/master
i:
  114479: 98104f7
v: v3
  • Loading branch information
Marek Vasut authored and Jean Delvare committed Oct 14, 2008
1 parent 2e66637 commit 04c50cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 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: b806a71a0e9dacb6763371561caa693c78b93d40
refs/heads/master: b84ee0b0c7dc91b729672e6a971fe3b0629ef0ad
12 changes: 9 additions & 3 deletions trunk/drivers/i2c/chips/tps65010.c
Original file line number Diff line number Diff line change
Expand Up @@ -456,14 +456,17 @@ static irqreturn_t tps65010_irq(int irq, void *_tps)

/* offsets 0..3 == GPIO1..GPIO4
* offsets 4..5 == LED1/nPG, LED2 (we set one of the non-BLINK modes)
* offset 6 == vibrator motor driver
*/
static void
tps65010_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
{
if (offset < 4)
tps65010_set_gpio_out_value(offset + 1, value);
else
else if (offset < 6)
tps65010_set_led(offset - 3, value ? ON : OFF);
else
tps65010_set_vib(value);
}

static int
Expand All @@ -477,8 +480,10 @@ tps65010_output(struct gpio_chip *chip, unsigned offset, int value)
if (!(tps->outmask & (1 << offset)))
return -EINVAL;
tps65010_set_gpio_out_value(offset + 1, value);
} else
} else if (offset < 6)
tps65010_set_led(offset - 3, value ? ON : OFF);
else
tps65010_set_vib(value);

return 0;
}
Expand Down Expand Up @@ -646,7 +651,7 @@ static int tps65010_probe(struct i2c_client *client,
tps->chip.get = tps65010_gpio_get;

tps->chip.base = board->base;
tps->chip.ngpio = 6;
tps->chip.ngpio = 7;
tps->chip.can_sleep = 1;

status = gpiochip_add(&tps->chip);
Expand Down Expand Up @@ -675,6 +680,7 @@ static const struct i2c_device_id tps65010_id[] = {
{ "tps65011", TPS65011 },
{ "tps65012", TPS65012 },
{ "tps65013", TPS65013 },
{ "tps65014", TPS65011 }, /* tps65011 charging at 6.5V max */
{ }
};
MODULE_DEVICE_TABLE(i2c, tps65010_id);
Expand Down

0 comments on commit 04c50cd

Please sign in to comment.