summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBin Yang <yangbin@rock-chips.com>2016-09-23 15:22:34 +0800
committerHuang, Tao <huangtao@rock-chips.com>2016-10-09 18:20:05 +0800
commitc5e75fc60d987bf27ce9443d1680c4325e3c393f (patch)
treecb8298ec7b88d66c8fa2237da948615d2b6c3ad7 /drivers
parent4190022d1f5bbc7b87d2052952e403c49ed1e3c8 (diff)
mfd: fusb302: Add EXTCON_USB_VBUS_EN for fusb302
Some rk3399 board(rk3399 MID or rk3399 VR) is use rk81x generated vbus. So need fusb302 send a extcon to notify rk818 when OTG or DP cable plugin. If use EXTCON_USB_HOST, the extcon will notify dwc3 and rk818_charger at the same time,so need to add a new extcon EXTCON_USB_VBUS_EN. Change-Id: Ib019ed7c2d4343c50dcef739ab3076f592979ea0 Signed-off-by: Bin Yang <yangbin@rock-chips.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mfd/fusb302.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/mfd/fusb302.c b/drivers/mfd/fusb302.c
index ca0eb20c0014..3baaa6c21f65 100644
--- a/drivers/mfd/fusb302.c
+++ b/drivers/mfd/fusb302.c
@@ -103,6 +103,7 @@ static void dump_notify_info(struct fusb30x_chip *chip)
static const unsigned int fusb302_cable[] = {
EXTCON_USB,
EXTCON_USB_HOST,
+ EXTCON_USB_VBUS_EN,
EXTCON_CHG_USB_SDP,
EXTCON_CHG_USB_CDP,
EXTCON_CHG_USB_DCP,
@@ -199,8 +200,13 @@ static void fusb_timer_start(struct hrtimer *timer, int ms)
static void platform_set_vbus_lvl_enable(struct fusb30x_chip *chip, int vbus_5v,
int vbus_other)
{
- if (chip->gpio_vbus_5v)
+ if (chip->gpio_vbus_5v) {
gpiod_set_raw_value(chip->gpio_vbus_5v, vbus_5v);
+ } else {
+ extcon_set_state(chip->extcon, EXTCON_USB_VBUS_EN, vbus_5v);
+ extcon_sync(chip->extcon, EXTCON_USB_VBUS_EN);
+ dev_info(chip->dev, "fusb302 send extcon to enable vbus 5v\n");
+ }
if (chip->gpio_vbus_other)
gpiod_set_raw_value(chip->gpio_vbus_5v, vbus_other);