summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorBin Yang <yangbin@rock-chips.com>2018-12-11 17:26:45 +0800
committerTao Huang <huangtao@rock-chips.com>2018-12-12 15:04:03 +0800
commita45a91483c2212edbe81f9d521b84668c041a75c (patch)
tree63a147b7ccb7fc259508ce189cb7301ecd8e8fc8 /drivers/mfd
parent4604ed7218fecddba41772e4ca82179c968cc565 (diff)
mfd/fusb302: cleanup vbus gpio
Currently driver uses gpiod_set_raw_value() to control VBUS, which unable to parse flags 'GPIO_ACTIVE_LOW' in device tree. We cannot ensure that vbus-gpio will be designed to active-high in all products. So we should use the gpiod_set_value() to control VBUS, and also gpio flags be used correctly in device tree synchronously. Change-Id: I94d143dde7b44d89b5593fbb5014859fedb83b04 Signed-off-by: Bin Yang <yangbin@rock-chips.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/fusb302.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mfd/fusb302.c b/drivers/mfd/fusb302.c
index 240cecac65b5..a627252d6710 100644
--- a/drivers/mfd/fusb302.c
+++ b/drivers/mfd/fusb302.c
@@ -354,7 +354,7 @@ static void platform_set_vbus_lvl_enable(struct fusb30x_chip *chip, int vbus_5v,
gpio_vbus_value = gpiod_get_value(chip->gpio_vbus_5v);
if (chip->gpio_vbus_5v) {
- gpiod_set_raw_value(chip->gpio_vbus_5v, vbus_5v);
+ gpiod_set_value(chip->gpio_vbus_5v, vbus_5v);
/* Only set state here, don't sync notifier to PMIC */
extcon_set_state(chip->extcon, EXTCON_USB_VBUS_EN, vbus_5v);
} else {
@@ -364,7 +364,7 @@ static void platform_set_vbus_lvl_enable(struct fusb30x_chip *chip, int vbus_5v,
}
if (chip->gpio_vbus_other)
- gpiod_set_raw_value(chip->gpio_vbus_5v, vbus_other);
+ gpiod_set_value(chip->gpio_vbus_other, vbus_other);
if (chip->gpio_discharge && !vbus_5v && gpio_vbus_value) {
gpiod_set_value(chip->gpio_discharge, 1);
@@ -3124,7 +3124,7 @@ static int fusb_initialize_gpio(struct fusb30x_chip *chip)
dev_warn(chip->dev,
"Could not get named GPIO for VBus5V!\n");
else
- gpiod_set_raw_value(chip->gpio_vbus_5v, 0);
+ gpiod_set_value(chip->gpio_vbus_5v, 0);
chip->gpio_vbus_other = devm_gpiod_get_optional(chip->dev,
"vbus-other",
@@ -3133,7 +3133,7 @@ static int fusb_initialize_gpio(struct fusb30x_chip *chip)
dev_warn(chip->dev,
"Could not get named GPIO for VBusOther!\n");
else
- gpiod_set_raw_value(chip->gpio_vbus_other, 0);
+ gpiod_set_value(chip->gpio_vbus_other, 0);
chip->gpio_discharge = devm_gpiod_get_optional(chip->dev, "discharge",
GPIOD_OUT_LOW);