Loading drivers/power/supply/qcom/smblite-lib.c +8 −1 Original line number Original line Diff line number Diff line Loading @@ -191,6 +191,7 @@ static void smblite_lib_notify_device_mode(struct smb_charger *chg, bool enable) extcon_set_state_sync(chg->extcon, EXTCON_USB, enable); extcon_set_state_sync(chg->extcon, EXTCON_USB, enable); } } #define VBOOST_5P00V 0x03 static void smblite_lib_notify_usb_host(struct smb_charger *chg, bool enable) static void smblite_lib_notify_usb_host(struct smb_charger *chg, bool enable) { { int rc = 0; int rc = 0; Loading @@ -208,7 +209,13 @@ static void smblite_lib_notify_usb_host(struct smb_charger *chg, bool enable) "Couldn't enable VBUS in OTG mode rc=%d\n", rc); "Couldn't enable VBUS in OTG mode rc=%d\n", rc); return; return; } } rc = smblite_lib_masked_write(chg, DCDC_BST_VREG_SEL, VBOOST_MASK, VBOOST_5P00V); if (rc < 0) { smblite_lib_err(chg, "Couldn't write BST_VREG_SEL rc=%d\n", rc); return; } smblite_lib_notify_extcon_props(chg, EXTCON_USB_HOST); smblite_lib_notify_extcon_props(chg, EXTCON_USB_HOST); } else { } else { smblite_lib_dbg(chg, PR_OTG, "disabling VBUS in OTG mode\n"); smblite_lib_dbg(chg, PR_OTG, "disabling VBUS in OTG mode\n"); Loading drivers/power/supply/qcom/smblite-reg.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -101,6 +101,9 @@ enum { #define DCDC_CMD_OTG_REG (DCDC_BASE + 0x50) #define DCDC_CMD_OTG_REG (DCDC_BASE + 0x50) #define OTG_EN_BIT BIT(0) #define OTG_EN_BIT BIT(0) #define DCDC_BST_VREG_SEL (DCDC_BASE + 0x52) #define VBOOST_MASK GENMASK(1, 0) #define DCDC_OTG_CFG_REG (DCDC_BASE + 0x56) #define DCDC_OTG_CFG_REG (DCDC_BASE + 0x56) #define OTG_EN_SRC_CFG_BIT BIT(0) #define OTG_EN_SRC_CFG_BIT BIT(0) Loading Loading
drivers/power/supply/qcom/smblite-lib.c +8 −1 Original line number Original line Diff line number Diff line Loading @@ -191,6 +191,7 @@ static void smblite_lib_notify_device_mode(struct smb_charger *chg, bool enable) extcon_set_state_sync(chg->extcon, EXTCON_USB, enable); extcon_set_state_sync(chg->extcon, EXTCON_USB, enable); } } #define VBOOST_5P00V 0x03 static void smblite_lib_notify_usb_host(struct smb_charger *chg, bool enable) static void smblite_lib_notify_usb_host(struct smb_charger *chg, bool enable) { { int rc = 0; int rc = 0; Loading @@ -208,7 +209,13 @@ static void smblite_lib_notify_usb_host(struct smb_charger *chg, bool enable) "Couldn't enable VBUS in OTG mode rc=%d\n", rc); "Couldn't enable VBUS in OTG mode rc=%d\n", rc); return; return; } } rc = smblite_lib_masked_write(chg, DCDC_BST_VREG_SEL, VBOOST_MASK, VBOOST_5P00V); if (rc < 0) { smblite_lib_err(chg, "Couldn't write BST_VREG_SEL rc=%d\n", rc); return; } smblite_lib_notify_extcon_props(chg, EXTCON_USB_HOST); smblite_lib_notify_extcon_props(chg, EXTCON_USB_HOST); } else { } else { smblite_lib_dbg(chg, PR_OTG, "disabling VBUS in OTG mode\n"); smblite_lib_dbg(chg, PR_OTG, "disabling VBUS in OTG mode\n"); Loading
drivers/power/supply/qcom/smblite-reg.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -101,6 +101,9 @@ enum { #define DCDC_CMD_OTG_REG (DCDC_BASE + 0x50) #define DCDC_CMD_OTG_REG (DCDC_BASE + 0x50) #define OTG_EN_BIT BIT(0) #define OTG_EN_BIT BIT(0) #define DCDC_BST_VREG_SEL (DCDC_BASE + 0x52) #define VBOOST_MASK GENMASK(1, 0) #define DCDC_OTG_CFG_REG (DCDC_BASE + 0x56) #define DCDC_OTG_CFG_REG (DCDC_BASE + 0x56) #define OTG_EN_SRC_CFG_BIT BIT(0) #define OTG_EN_SRC_CFG_BIT BIT(0) Loading