Loading drivers/power/supply/qcom/qpnp-smb5.c +31 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,13 @@ static struct smb_params smb5_pmi632_params = { .max_u = 1000000, .step_u = 250000, }, .dc_icl = { .name = "DC input current limit", .reg = DCDC_CFG_REF_MAX_PSNS_REG, .min_u = 0, .max_u = 1500000, .step_u = 50000, }, .jeita_cc_comp_hot = { .name = "jeita fcc reduction", .reg = JEITA_CCCOMP_CFG_HOT_REG, Loading Loading @@ -140,6 +147,13 @@ static struct smb_params smb5_pm8150b_params = { .max_u = 3000000, .step_u = 500000, }, .dc_icl = { .name = "DC input current limit", .reg = DCDC_CFG_REF_MAX_PSNS_REG, .min_u = 0, .max_u = 1500000, .step_u = 50000, }, .jeita_cc_comp_hot = { .name = "jeita fcc reduction", .reg = JEITA_CCCOMP_CFG_HOT_REG, Loading Loading @@ -954,6 +968,7 @@ static enum power_supply_property smb5_dc_props[] = { POWER_SUPPLY_PROP_INPUT_SUSPEND, POWER_SUPPLY_PROP_PRESENT, POWER_SUPPLY_PROP_ONLINE, POWER_SUPPLY_PROP_CURRENT_MAX, POWER_SUPPLY_PROP_REAL_TYPE, }; Loading @@ -975,6 +990,10 @@ static int smb5_dc_get_prop(struct power_supply *psy, case POWER_SUPPLY_PROP_ONLINE: rc = smblib_get_prop_dc_online(chg, val); break; case POWER_SUPPLY_PROP_CURRENT_MAX: rc = smblib_get_charge_param(chg, &chg->param.dc_icl, &val->intval); break; case POWER_SUPPLY_PROP_REAL_TYPE: val->intval = POWER_SUPPLY_TYPE_WIPOWER; break; Loading @@ -1001,6 +1020,10 @@ static int smb5_dc_set_prop(struct power_supply *psy, rc = vote(chg->dc_suspend_votable, WBC_VOTER, (bool)val->intval, 0); break; case POWER_SUPPLY_PROP_CURRENT_MAX: rc = smblib_set_charge_param(chg, &chg->param.dc_icl, val->intval); break; default: return -EINVAL; } Loading Loading @@ -1656,6 +1679,14 @@ static int smb5_init_hw(struct smb5 *chip) vote(chg->usb_icl_votable, HW_LIMIT_VOTER, chg->hw_max_icl_ua > 0, chg->hw_max_icl_ua); /* set DC icl_max 1A */ rc = smblib_set_charge_param(chg, &chg->param.dc_icl, 1000000); if (rc < 0) { dev_err(chg->dev, "Couldn't set dc_icl rc=%d\n", rc); return rc; } /* * AICL configuration: * start from min and AICL ADC disable, and enable aicl rerun Loading drivers/power/supply/qcom/smb5-lib.h +1 −0 Original line number Diff line number Diff line Loading @@ -235,6 +235,7 @@ struct smb_params { struct smb_chg_param icl_max_stat; struct smb_chg_param icl_stat; struct smb_chg_param otg_cl; struct smb_chg_param dc_icl; struct smb_chg_param jeita_cc_comp_hot; struct smb_chg_param jeita_cc_comp_cold; struct smb_chg_param freq_switcher; Loading drivers/power/supply/qcom/smb5-reg.h +2 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,8 @@ enum { #define DCDC_OTG_CFG_REG (DCDC_BASE + 0x53) #define OTG_EN_SRC_CFG_BIT BIT(1) #define DCDC_CFG_REF_MAX_PSNS_REG (DCDC_BASE + 0x8C) /******************************** * BATIF Peripheral Registers * ********************************/ Loading Loading
drivers/power/supply/qcom/qpnp-smb5.c +31 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,13 @@ static struct smb_params smb5_pmi632_params = { .max_u = 1000000, .step_u = 250000, }, .dc_icl = { .name = "DC input current limit", .reg = DCDC_CFG_REF_MAX_PSNS_REG, .min_u = 0, .max_u = 1500000, .step_u = 50000, }, .jeita_cc_comp_hot = { .name = "jeita fcc reduction", .reg = JEITA_CCCOMP_CFG_HOT_REG, Loading Loading @@ -140,6 +147,13 @@ static struct smb_params smb5_pm8150b_params = { .max_u = 3000000, .step_u = 500000, }, .dc_icl = { .name = "DC input current limit", .reg = DCDC_CFG_REF_MAX_PSNS_REG, .min_u = 0, .max_u = 1500000, .step_u = 50000, }, .jeita_cc_comp_hot = { .name = "jeita fcc reduction", .reg = JEITA_CCCOMP_CFG_HOT_REG, Loading Loading @@ -954,6 +968,7 @@ static enum power_supply_property smb5_dc_props[] = { POWER_SUPPLY_PROP_INPUT_SUSPEND, POWER_SUPPLY_PROP_PRESENT, POWER_SUPPLY_PROP_ONLINE, POWER_SUPPLY_PROP_CURRENT_MAX, POWER_SUPPLY_PROP_REAL_TYPE, }; Loading @@ -975,6 +990,10 @@ static int smb5_dc_get_prop(struct power_supply *psy, case POWER_SUPPLY_PROP_ONLINE: rc = smblib_get_prop_dc_online(chg, val); break; case POWER_SUPPLY_PROP_CURRENT_MAX: rc = smblib_get_charge_param(chg, &chg->param.dc_icl, &val->intval); break; case POWER_SUPPLY_PROP_REAL_TYPE: val->intval = POWER_SUPPLY_TYPE_WIPOWER; break; Loading @@ -1001,6 +1020,10 @@ static int smb5_dc_set_prop(struct power_supply *psy, rc = vote(chg->dc_suspend_votable, WBC_VOTER, (bool)val->intval, 0); break; case POWER_SUPPLY_PROP_CURRENT_MAX: rc = smblib_set_charge_param(chg, &chg->param.dc_icl, val->intval); break; default: return -EINVAL; } Loading Loading @@ -1656,6 +1679,14 @@ static int smb5_init_hw(struct smb5 *chip) vote(chg->usb_icl_votable, HW_LIMIT_VOTER, chg->hw_max_icl_ua > 0, chg->hw_max_icl_ua); /* set DC icl_max 1A */ rc = smblib_set_charge_param(chg, &chg->param.dc_icl, 1000000); if (rc < 0) { dev_err(chg->dev, "Couldn't set dc_icl rc=%d\n", rc); return rc; } /* * AICL configuration: * start from min and AICL ADC disable, and enable aicl rerun Loading
drivers/power/supply/qcom/smb5-lib.h +1 −0 Original line number Diff line number Diff line Loading @@ -235,6 +235,7 @@ struct smb_params { struct smb_chg_param icl_max_stat; struct smb_chg_param icl_stat; struct smb_chg_param otg_cl; struct smb_chg_param dc_icl; struct smb_chg_param jeita_cc_comp_hot; struct smb_chg_param jeita_cc_comp_cold; struct smb_chg_param freq_switcher; Loading
drivers/power/supply/qcom/smb5-reg.h +2 −0 Original line number Diff line number Diff line Loading @@ -138,6 +138,8 @@ enum { #define DCDC_OTG_CFG_REG (DCDC_BASE + 0x53) #define OTG_EN_SRC_CFG_BIT BIT(1) #define DCDC_CFG_REF_MAX_PSNS_REG (DCDC_BASE + 0x8C) /******************************** * BATIF Peripheral Registers * ********************************/ Loading