mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
usb: otg: notify to pmu the otg vbus change
Signed-off-by: lyz <lyz@rock-chips.com>
This commit is contained in:
@@ -8,6 +8,8 @@ enum bc_port_type{
|
||||
USB_BC_TYPE_DCP,
|
||||
USB_BC_TYPE_CDP,
|
||||
USB_BC_TYPE_UNKNOW,
|
||||
USB_OTG_POWER_ON,
|
||||
USB_OTG_POWER_OFF,
|
||||
USB_BC_TYPE_MAX,
|
||||
};
|
||||
enum {
|
||||
|
||||
@@ -182,10 +182,12 @@ static void dwc_otg_uart_mode(void *pdata, int enter_usb_uart_mode)
|
||||
static void usb20otg_power_enable(int enable)
|
||||
{
|
||||
if (0 == enable) {
|
||||
rk_battery_charger_detect_cb(USB_OTG_POWER_OFF);
|
||||
/* disable otg_drv power */
|
||||
if (gpio_is_valid(control_usb->otg_gpios->gpio))
|
||||
gpio_set_value(control_usb->otg_gpios->gpio, 0);
|
||||
} else if (1 == enable) {
|
||||
rk_battery_charger_detect_cb(USB_OTG_POWER_ON);
|
||||
/* enable otg_drv power */
|
||||
if (gpio_is_valid(control_usb->otg_gpios->gpio))
|
||||
gpio_set_value(control_usb->otg_gpios->gpio, 1);
|
||||
|
||||
@@ -191,10 +191,12 @@ static void dwc_otg_uart_mode(void *pdata, int enter_usb_uart_mode)
|
||||
static void usb20otg_power_enable(int enable)
|
||||
{
|
||||
if (0 == enable) {
|
||||
rk_battery_charger_detect_cb(USB_OTG_POWER_OFF);
|
||||
/* disable otg_drv power */
|
||||
if (gpio_is_valid(control_usb->otg_gpios->gpio))
|
||||
gpio_set_value(control_usb->otg_gpios->gpio, 0);
|
||||
} else if (1 == enable) {
|
||||
rk_battery_charger_detect_cb(USB_OTG_POWER_ON);
|
||||
/* enable otg_drv power */
|
||||
if (gpio_is_valid(control_usb->otg_gpios->gpio))
|
||||
gpio_set_value(control_usb->otg_gpios->gpio, 1);
|
||||
|
||||
@@ -172,10 +172,12 @@ static void dwc_otg_uart_mode(void *pdata, int enter_usb_uart_mode)
|
||||
static void usb20otg_power_enable(int enable)
|
||||
{
|
||||
if (0 == enable) {
|
||||
rk_battery_charger_detect_cb(USB_OTG_POWER_OFF);
|
||||
/* disable otg_drv power */
|
||||
if (gpio_is_valid(control_usb->otg_gpios->gpio))
|
||||
gpio_set_value(control_usb->otg_gpios->gpio, 0);
|
||||
} else if (1 == enable) {
|
||||
rk_battery_charger_detect_cb(USB_OTG_POWER_ON);
|
||||
/* enable otg_drv power */
|
||||
if (gpio_is_valid(control_usb->otg_gpios->gpio))
|
||||
gpio_set_value(control_usb->otg_gpios->gpio, 1);
|
||||
|
||||
@@ -177,10 +177,12 @@ static void dwc_otg_uart_mode(void *pdata, int enter_usb_uart_mode)
|
||||
static void usb20otg_power_enable(int enable)
|
||||
{
|
||||
if (0 == enable) {
|
||||
rk_battery_charger_detect_cb(USB_OTG_POWER_OFF);
|
||||
/* disable otg_drv power */
|
||||
if (gpio_is_valid(control_usb->otg_gpios->gpio))
|
||||
gpio_set_value(control_usb->otg_gpios->gpio, 0);
|
||||
} else if (1 == enable) {
|
||||
rk_battery_charger_detect_cb(USB_OTG_POWER_ON);
|
||||
/* enable otg_drv power */
|
||||
if (gpio_is_valid(control_usb->otg_gpios->gpio))
|
||||
gpio_set_value(control_usb->otg_gpios->gpio, 1);
|
||||
|
||||
Reference in New Issue
Block a user