Loading Documentation/devicetree/bindings/power/supply/qcom/qpnp-smb5.txt +6 −0 Original line number Diff line number Diff line Loading @@ -263,6 +263,12 @@ Charger specific properties: Definition: Boolean flag which when present enables mositure protection feature for uUSB connector type. - qcom,hvdcp-autonomous-enable Usage: optional Value type: bool Definition: Boolean flag which when present enables hardware-controlled operation of HVDCP. ============================================= Second Level Nodes - SMB5 Charger Peripherals ============================================= Loading drivers/power/supply/qcom/qpnp-smb5.c +10 −2 Original line number Diff line number Diff line Loading @@ -187,6 +187,7 @@ struct smb_dt_props { int chg_inhibit_thr_mv; bool no_battery; bool hvdcp_disable; bool hvdcp_autonomous; int sec_charger_config; int auto_recharge_soc; int auto_recharge_vbat_mv; Loading Loading @@ -407,6 +408,9 @@ static int smb5_parse_dt(struct smb5 *chip) "qcom,hvdcp-disable"); chg->hvdcp_disable = chip->dt.hvdcp_disable; chip->dt.hvdcp_autonomous = of_property_read_bool(node, "qcom,hvdcp-autonomous-enable"); rc = of_property_read_u32(node, "qcom,chg-inhibit-threshold-mv", &chip->dt.chg_inhibit_thr_mv); if (!rc && (chip->dt.chg_inhibit_thr_mv < 0 || Loading Loading @@ -1845,11 +1849,15 @@ static int smb5_init_hw(struct smb5 *chip) } /* * Disable HVDCP autonomous mode operation by default. Additionally, if * specified in DT: disable HVDCP and HVDCP authentication algorithm. * Disable HVDCP autonomous mode operation by default, providing a DT * knob to turn it on if required. Additionally, if specified in DT, * disable HVDCP and HVDCP authentication algorithm. */ val = (chg->hvdcp_disable) ? 0 : (HVDCP_AUTH_ALG_EN_CFG_BIT | HVDCP_EN_BIT); if (chip->dt.hvdcp_autonomous) val |= HVDCP_AUTONOMOUS_MODE_EN_CFG_BIT; rc = smblib_masked_write(chg, USBIN_OPTIONS_1_CFG_REG, (HVDCP_AUTH_ALG_EN_CFG_BIT | HVDCP_EN_BIT | HVDCP_AUTONOMOUS_MODE_EN_CFG_BIT), Loading Loading
Documentation/devicetree/bindings/power/supply/qcom/qpnp-smb5.txt +6 −0 Original line number Diff line number Diff line Loading @@ -263,6 +263,12 @@ Charger specific properties: Definition: Boolean flag which when present enables mositure protection feature for uUSB connector type. - qcom,hvdcp-autonomous-enable Usage: optional Value type: bool Definition: Boolean flag which when present enables hardware-controlled operation of HVDCP. ============================================= Second Level Nodes - SMB5 Charger Peripherals ============================================= Loading
drivers/power/supply/qcom/qpnp-smb5.c +10 −2 Original line number Diff line number Diff line Loading @@ -187,6 +187,7 @@ struct smb_dt_props { int chg_inhibit_thr_mv; bool no_battery; bool hvdcp_disable; bool hvdcp_autonomous; int sec_charger_config; int auto_recharge_soc; int auto_recharge_vbat_mv; Loading Loading @@ -407,6 +408,9 @@ static int smb5_parse_dt(struct smb5 *chip) "qcom,hvdcp-disable"); chg->hvdcp_disable = chip->dt.hvdcp_disable; chip->dt.hvdcp_autonomous = of_property_read_bool(node, "qcom,hvdcp-autonomous-enable"); rc = of_property_read_u32(node, "qcom,chg-inhibit-threshold-mv", &chip->dt.chg_inhibit_thr_mv); if (!rc && (chip->dt.chg_inhibit_thr_mv < 0 || Loading Loading @@ -1845,11 +1849,15 @@ static int smb5_init_hw(struct smb5 *chip) } /* * Disable HVDCP autonomous mode operation by default. Additionally, if * specified in DT: disable HVDCP and HVDCP authentication algorithm. * Disable HVDCP autonomous mode operation by default, providing a DT * knob to turn it on if required. Additionally, if specified in DT, * disable HVDCP and HVDCP authentication algorithm. */ val = (chg->hvdcp_disable) ? 0 : (HVDCP_AUTH_ALG_EN_CFG_BIT | HVDCP_EN_BIT); if (chip->dt.hvdcp_autonomous) val |= HVDCP_AUTONOMOUS_MODE_EN_CFG_BIT; rc = smblib_masked_write(chg, USBIN_OPTIONS_1_CFG_REG, (HVDCP_AUTH_ALG_EN_CFG_BIT | HVDCP_EN_BIT | HVDCP_AUTONOMOUS_MODE_EN_CFG_BIT), Loading