Skip to content

Commit

Permalink
mfd: Fix tps6586x GPIO value setting
Browse files Browse the repository at this point in the history
In the current code, every time we set a TPS6586x GPIO pin,
the tps6586x_gpio_set function is resetting all other GPIO pins.
We need to update the right GPIOxOUT bit of the GPIOSET2 register instead
of overriding the full value.

Tested by setting sequentially GPIO2 and GPIO3 and verifying the
pins voltage.

Change-Id: I560edde146c5425cce37432c4ee91569eea5adcf
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Vincent Palatin authored and Samuel Ortiz committed May 26, 2011
1 parent ea91db5 commit e6f1945
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mfd/tps6586x.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ static void tps6586x_gpio_set(struct gpio_chip *chip, unsigned offset,
{
struct tps6586x *tps6586x = container_of(chip, struct tps6586x, gpio);

__tps6586x_write(tps6586x->client, TPS6586X_GPIOSET2,
value << offset);
tps6586x_update(tps6586x->dev, TPS6586X_GPIOSET2,
value << offset, 1 << offset);
}

static int tps6586x_gpio_output(struct gpio_chip *gc, unsigned offset,
Expand Down

0 comments on commit e6f1945

Please sign in to comment.