Loading drivers/power/supply/qcom/smb5-lib.c +23 −2 Original line number Diff line number Diff line Loading @@ -6574,6 +6574,10 @@ irqreturn_t smb5_typec_attach_detach_irq_handler(int irq, void *data) bool attached = false; int rc; /* IRQ not expected to be executed for uUSB, return */ if (chg->connector_type == QTI_POWER_SUPPLY_CONNECTOR_MICRO_USB) return IRQ_HANDLED; smblib_dbg(chg, PR_INTERRUPT, "IRQ: %s\n", irq_data->name); rc = smblib_read(chg, TYPE_C_STATE_MACHINE_STATUS_REG, &stat); Loading Loading @@ -7308,10 +7312,27 @@ static void smblib_uusb_otg_work(struct work_struct *work) goto out; } otg = !!(stat & U_USB_GROUND_NOVBUS_BIT); if (chg->otg_present != otg) if (chg->otg_present != otg) { if (otg) { /* otg cable inserted */ if (chg->typec_port) { typec_partner_register(chg); typec_set_data_role(chg->typec_port, TYPEC_HOST); typec_set_pwr_role(chg->typec_port, TYPEC_SOURCE); } } else if (chg->typec_port) { /* otg cable removed */ typec_set_data_role(chg->typec_port, TYPEC_DEVICE); typec_set_pwr_role(chg->typec_port, TYPEC_SINK); typec_partner_unregister(chg); } smblib_notify_usb_host(chg, otg); else } else { goto out; } chg->otg_present = otg; if (!otg) Loading drivers/power/supply/qcom/smblite-lib.c +16 −0 Original line number Diff line number Diff line Loading @@ -2907,6 +2907,22 @@ irqreturn_t smblite_usb_id_irq_handler(int irq, void *data) smblite_lib_dbg(chg, PR_INTERRUPT, "IRQ: %s, id_state=%d\n", "usb-id-irq", id_state); if (id_state) { /*otg cable removed */ if (chg->otg_present) { if (chg->typec_port) { typec_set_data_role(chg->typec_port, TYPEC_DEVICE); typec_set_pwr_role(chg->typec_port, TYPEC_SINK); typec_partner_unregister(chg); } } } else if (chg->typec_port) { /*otg cable inserted */ typec_partner_register(chg); typec_set_data_role(chg->typec_port, TYPEC_HOST); typec_set_pwr_role(chg->typec_port, TYPEC_SOURCE); } smblite_lib_notify_usb_host(chg, !id_state); Loading Loading
drivers/power/supply/qcom/smb5-lib.c +23 −2 Original line number Diff line number Diff line Loading @@ -6574,6 +6574,10 @@ irqreturn_t smb5_typec_attach_detach_irq_handler(int irq, void *data) bool attached = false; int rc; /* IRQ not expected to be executed for uUSB, return */ if (chg->connector_type == QTI_POWER_SUPPLY_CONNECTOR_MICRO_USB) return IRQ_HANDLED; smblib_dbg(chg, PR_INTERRUPT, "IRQ: %s\n", irq_data->name); rc = smblib_read(chg, TYPE_C_STATE_MACHINE_STATUS_REG, &stat); Loading Loading @@ -7308,10 +7312,27 @@ static void smblib_uusb_otg_work(struct work_struct *work) goto out; } otg = !!(stat & U_USB_GROUND_NOVBUS_BIT); if (chg->otg_present != otg) if (chg->otg_present != otg) { if (otg) { /* otg cable inserted */ if (chg->typec_port) { typec_partner_register(chg); typec_set_data_role(chg->typec_port, TYPEC_HOST); typec_set_pwr_role(chg->typec_port, TYPEC_SOURCE); } } else if (chg->typec_port) { /* otg cable removed */ typec_set_data_role(chg->typec_port, TYPEC_DEVICE); typec_set_pwr_role(chg->typec_port, TYPEC_SINK); typec_partner_unregister(chg); } smblib_notify_usb_host(chg, otg); else } else { goto out; } chg->otg_present = otg; if (!otg) Loading
drivers/power/supply/qcom/smblite-lib.c +16 −0 Original line number Diff line number Diff line Loading @@ -2907,6 +2907,22 @@ irqreturn_t smblite_usb_id_irq_handler(int irq, void *data) smblite_lib_dbg(chg, PR_INTERRUPT, "IRQ: %s, id_state=%d\n", "usb-id-irq", id_state); if (id_state) { /*otg cable removed */ if (chg->otg_present) { if (chg->typec_port) { typec_set_data_role(chg->typec_port, TYPEC_DEVICE); typec_set_pwr_role(chg->typec_port, TYPEC_SINK); typec_partner_unregister(chg); } } } else if (chg->typec_port) { /*otg cable inserted */ typec_partner_register(chg); typec_set_data_role(chg->typec_port, TYPEC_HOST); typec_set_pwr_role(chg->typec_port, TYPEC_SOURCE); } smblite_lib_notify_usb_host(chg, !id_state); Loading