tps6591x: fix tps6591x_gpio_output() cannot drive 'low' issue
Haley Teng [Wed, 26 Oct 2011 13:37:44 +0000 (21:37 +0800)]
mask the GPIO_SET bit (0x1) before decide set it or not by the input
parameter 'value'

Signed-off-by: Haley Teng <hteng@nvidia.com>
Reviewed-on: http://git-master/r/60425
Reviewed-on: http://git-master/r/66589
(cherry picked from commit d7ac2209e0a3783004fba240eea87a8e569d3745)

Change-Id: I33c69c9aaaf3c9b624fabbcbcab80e75de706d38
Reviewed-on: http://git-master/r/71962
Reviewed-by: Automatic_Commit_Validation_User
Tested-by: Haley Teng <hteng@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/mfd/tps6591x.c

index cc3ff23..8ce4424 100644 (file)
@@ -359,6 +359,7 @@ static int tps6591x_gpio_output(struct gpio_chip *gc, unsigned offset,
        if (ret)
                return ret;
 
+       reg_val &= ~0x1;
        val = (value & 0x1) | 0x4;
        reg_val = reg_val | val;
        return __tps6591x_write(tps6591x->client, TPS6591X_GPIO_BASE_ADDR +