diff options
author | Preetham Chandru <pchandru@nvidia.com> | 2011-08-18 17:10:02 +0530 |
---|---|---|
committer | Niket Sirsi <nsirsi@nvidia.com> | 2011-08-22 17:45:39 -0700 |
commit | 8be8be6967e1a11193ae63e00ab07ee2000a6ba1 (patch) | |
tree | 27d26c53198458233df5057963f5b4462b8626d7 | |
parent | 9ae82c3c8834d1d732b7715db76bcececdb5321a (diff) |
mfd: fix tps6586x GPIO value setting
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.
Also Inverted GPIO and subdevices initialization.
When using a fixed voltage regulator, this allows to declare
and initialize it conveniently from the "subdev" list.
Bug: 829647
Change-Id: I1480c2d1f2bee549ebc81fef264841c9a9e4daaa
signed-off-by: Preetham Chandru <pchandru@nvidia.com>
Reviewed-on: http://git-master/r/47809
Reviewed-by: Allen R Martin <amartin@nvidia.com>
-rw-r--r-- | drivers/mfd/tps6586x.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c index 851049b38a6d..90dfbdc665c8 100644 --- a/drivers/mfd/tps6586x.c +++ b/drivers/mfd/tps6586x.c @@ -296,8 +296,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_input(struct gpio_chip *gc, unsigned offset) @@ -548,14 +548,14 @@ static int __devinit tps6586x_i2c_probe(struct i2c_client *client, } } + tps6586x_gpio_init(tps6586x, pdata->gpio_base); + ret = tps6586x_add_subdevs(tps6586x, pdata); if (ret) { dev_err(&client->dev, "add devices failed: %d\n", ret); goto err_add_devs; } - tps6586x_gpio_init(tps6586x, pdata->gpio_base); - tps6586x_i2c_client = client; return 0; |