summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorAmit Kamath <akamath@nvidia.com>2010-12-29 18:34:36 +0530
committerBharat Nihalani <bnihalani@nvidia.com>2011-01-03 06:07:28 -0800
commit8d8cf3ddefd69a776b28fb1a1c4be2f5d3131550 (patch)
treeb2ff3f585f0836b917335729e1c6c61011ee3242 /drivers/mfd
parent3d4d46642395ff620b87cf16cb1cffc8dc6e7d8e (diff)
mfd: tps6586x: Fix wrong gpio value
Replaced write to GPIO pin with read-modify write as old value was overwritten. Change-Id: I679994ba920b70f90a2b1654ee2c0fcc3e08d02e Reviewed-on: http://git-master/r/14540 Reviewed-by: Amit Kamath <akamath@nvidia.com> Tested-by: Amit Kamath <akamath@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/tps6586x.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index ad0dfe2a28fb..e2d8c80bc02e 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -311,8 +311,13 @@ static int tps6586x_gpio_output(struct gpio_chip *gc, unsigned offset,
{
struct tps6586x *tps6586x = container_of(gc, struct tps6586x, gpio);
uint8_t val, mask;
+ int ret;
- tps6586x_gpio_set(gc, offset, value);
+ val = value << offset;
+ mask = 0x1 << offset;
+ ret = tps6586x_update(tps6586x->dev, TPS6586X_GPIOSET2, val, mask);
+ if (ret)
+ return ret;
val = 0x1 << (offset * 2);
mask = 0x3 << (offset * 2);
@@ -604,4 +609,3 @@ module_exit(tps6586x_exit);
MODULE_DESCRIPTION("TPS6586X core driver");
MODULE_AUTHOR("Mike Rapoport <mike@compulab.co.il>");
MODULE_LICENSE("GPL");
-