Skip to content

Commit c5e75fc

Browse files
Bin Yangrkhuangtao
authored andcommitted
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>
1 parent 4190022 commit c5e75fc

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/mfd/fusb302.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ static void dump_notify_info(struct fusb30x_chip *chip)
103103
static const unsigned int fusb302_cable[] = {
104104
EXTCON_USB,
105105
EXTCON_USB_HOST,
106+
EXTCON_USB_VBUS_EN,
106107
EXTCON_CHG_USB_SDP,
107108
EXTCON_CHG_USB_CDP,
108109
EXTCON_CHG_USB_DCP,
@@ -199,8 +200,13 @@ static void fusb_timer_start(struct hrtimer *timer, int ms)
199200
static void platform_set_vbus_lvl_enable(struct fusb30x_chip *chip, int vbus_5v,
200201
int vbus_other)
201202
{
202-
if (chip->gpio_vbus_5v)
203+
if (chip->gpio_vbus_5v) {
203204
gpiod_set_raw_value(chip->gpio_vbus_5v, vbus_5v);
205+
} else {
206+
extcon_set_state(chip->extcon, EXTCON_USB_VBUS_EN, vbus_5v);
207+
extcon_sync(chip->extcon, EXTCON_USB_VBUS_EN);
208+
dev_info(chip->dev, "fusb302 send extcon to enable vbus 5v\n");
209+
}
204210

205211
if (chip->gpio_vbus_other)
206212
gpiod_set_raw_value(chip->gpio_vbus_5v, vbus_other);

0 commit comments

Comments
 (0)