Loading drivers/platform/msm/qpnp-revid.c +13 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #define REVID_TYPE 0x4 #define REVID_SUBTYPE 0x5 #define REVID_STATUS1 0x8 #define REVID_SPARE_0 0x60 #define QPNP_REVID_DEV_NAME "qcom,qpnp-revid" Loading @@ -48,6 +49,7 @@ static const char *const pmic_names[] = { "PMK8001", "PMI8996", [25] = "PM8937", [55] = "PMI8937", }; struct revid_chip { Loading Loading @@ -109,6 +111,8 @@ EXPORT_SYMBOL(get_revid_data); #define PM8941_PERIPHERAL_SUBTYPE 0x01 #define PM8226_PERIPHERAL_SUBTYPE 0x04 #define PMD9655_PERIPHERAL_SUBTYPE 0x0F #define PMI8950_PERIPHERAL_SUBTYPE 0x11 #define PMI8937_PERIPHERAL_SUBTYPE 0x37 static size_t build_pmic_string(char *buf, size_t n, int sid, u8 subtype, u8 rev1, u8 rev2, u8 rev3, u8 rev4) { Loading Loading @@ -144,7 +148,7 @@ static size_t build_pmic_string(char *buf, size_t n, int sid, static int qpnp_revid_probe(struct spmi_device *spmi) { u8 rev1, rev2, rev3, rev4, pmic_type, pmic_subtype, pmic_status; u8 option1, option2, option3, option4; u8 option1, option2, option3, option4, spare0; struct resource *resource; char pmic_string[PMIC_STRING_MAXLENGTH] = {'\0'}; struct revid_chip *revid_chip; Loading Loading @@ -172,6 +176,14 @@ static int qpnp_revid_probe(struct spmi_device *spmi) else pmic_status = 0; /* special case for PMI8937 */ if (pmic_subtype == PMI8950_PERIPHERAL_SUBTYPE) { /* read spare register */ spare0 = qpnp_read_byte(spmi, resource->start + REVID_SPARE_0); if (spare0) pmic_subtype = PMI8937_PERIPHERAL_SUBTYPE; } revid_chip = devm_kzalloc(&spmi->dev, sizeof(struct revid_chip), GFP_KERNEL); if (!revid_chip) Loading drivers/power/qpnp-fg.c +3 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ enum pmic_subtype { PMI8994 = 10, PMI8950 = 17, PMI8996 = 19, PMI8937 = 55, }; enum wa_flags { Loading Loading @@ -6002,6 +6003,7 @@ static int fg_hw_init(struct fg_chip *chip) break; case PMI8950: case PMI8937: rc = fg_8950_hw_init(chip); /* Setup workaround flag based on PMIC type */ if (fg_sense_type == INTERNAL_CURRENT_SENSE) Loading Loading @@ -6094,6 +6096,7 @@ static int fg_detect_pmic_type(struct fg_chip *chip) switch (pmic_rev_id->pmic_subtype) { case PMI8994: case PMI8950: case PMI8937: case PMI8996: chip->pmic_subtype = pmic_rev_id->pmic_subtype; chip->pmic_revision[REVID_RESERVED] = pmic_rev_id->rev1; Loading drivers/power/qpnp-smbcharger.c +12 −4 Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ struct smbchg_chip { bool hvdcp3_supported; bool restricted_charging; bool skip_usb_suspend_for_fake_battery; bool hvdcp_not_supported; u8 original_usbin_allowance; struct parallel_usb_cfg parallel; struct delayed_work parallel_en_work; Loading Loading @@ -282,6 +283,7 @@ enum pmic_subtype { PMI8994 = 10, PMI8950 = 17, PMI8996 = 19, PMI8937 = 55, }; enum smbchg_wa { Loading Loading @@ -4447,6 +4449,7 @@ static void handle_usb_removal(struct smbchg_chip *chip) vote(chip->usb_icl_votable, WEAK_CHARGER_ICL_VOTER, false, 0); chip->usb_icl_delta = 0; vote(chip->usb_icl_votable, SW_AICL_ICL_VOTER, false, 0); if (!chip->hvdcp_not_supported) restore_from_hvdcp_detection(chip); } Loading Loading @@ -4519,7 +4522,8 @@ static void handle_usb_insertion(struct smbchg_chip *chip) } schedule_work(&chip->usb_set_online_work); if (usb_supply_type == POWER_SUPPLY_TYPE_USB_DCP) if (!chip->hvdcp_not_supported && (usb_supply_type == POWER_SUPPLY_TYPE_USB_DCP)) schedule_delayed_work(&chip->hvdcp_det_work, msecs_to_jiffies(HVDCP_NOTIFY_MS)); Loading Loading @@ -7393,6 +7397,7 @@ static int smbchg_check_chg_version(struct smbchg_chip *chip) chip->schg_version = QPNP_SCHG; break; case PMI8950: case PMI8937: chip->wa_flags |= SMBCHG_BATT_OV_WA; if (pmic_rev_id->rev4 < 2) /* PMI8950 1.0 */ { chip->wa_flags |= SMBCHG_AICL_DEGLITCH_WA; Loading @@ -7402,6 +7407,8 @@ static int smbchg_check_chg_version(struct smbchg_chip *chip) } use_pmi8994_tables(chip); chip->schg_version = QPNP_SCHG_LITE; if (pmic_rev_id->pmic_subtype == PMI8937) chip->hvdcp_not_supported = true; break; case PMI8996: chip->wa_flags |= SMBCHG_CC_ESR_WA Loading @@ -7414,8 +7421,9 @@ static int smbchg_check_chg_version(struct smbchg_chip *chip) pmic_rev_id->pmic_subtype); } pr_smb(PR_STATUS, "pmic=%s, wa_flags=0x%x\n", pmic_rev_id->pmic_name, chip->wa_flags); pr_smb(PR_STATUS, "pmic=%s, wa_flags=0x%x, hvdcp_supported=%s\n", pmic_rev_id->pmic_name, chip->wa_flags, chip->hvdcp_not_supported ? "false" : "true"); return 0; } Loading Loading
drivers/platform/msm/qpnp-revid.c +13 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #define REVID_TYPE 0x4 #define REVID_SUBTYPE 0x5 #define REVID_STATUS1 0x8 #define REVID_SPARE_0 0x60 #define QPNP_REVID_DEV_NAME "qcom,qpnp-revid" Loading @@ -48,6 +49,7 @@ static const char *const pmic_names[] = { "PMK8001", "PMI8996", [25] = "PM8937", [55] = "PMI8937", }; struct revid_chip { Loading Loading @@ -109,6 +111,8 @@ EXPORT_SYMBOL(get_revid_data); #define PM8941_PERIPHERAL_SUBTYPE 0x01 #define PM8226_PERIPHERAL_SUBTYPE 0x04 #define PMD9655_PERIPHERAL_SUBTYPE 0x0F #define PMI8950_PERIPHERAL_SUBTYPE 0x11 #define PMI8937_PERIPHERAL_SUBTYPE 0x37 static size_t build_pmic_string(char *buf, size_t n, int sid, u8 subtype, u8 rev1, u8 rev2, u8 rev3, u8 rev4) { Loading Loading @@ -144,7 +148,7 @@ static size_t build_pmic_string(char *buf, size_t n, int sid, static int qpnp_revid_probe(struct spmi_device *spmi) { u8 rev1, rev2, rev3, rev4, pmic_type, pmic_subtype, pmic_status; u8 option1, option2, option3, option4; u8 option1, option2, option3, option4, spare0; struct resource *resource; char pmic_string[PMIC_STRING_MAXLENGTH] = {'\0'}; struct revid_chip *revid_chip; Loading Loading @@ -172,6 +176,14 @@ static int qpnp_revid_probe(struct spmi_device *spmi) else pmic_status = 0; /* special case for PMI8937 */ if (pmic_subtype == PMI8950_PERIPHERAL_SUBTYPE) { /* read spare register */ spare0 = qpnp_read_byte(spmi, resource->start + REVID_SPARE_0); if (spare0) pmic_subtype = PMI8937_PERIPHERAL_SUBTYPE; } revid_chip = devm_kzalloc(&spmi->dev, sizeof(struct revid_chip), GFP_KERNEL); if (!revid_chip) Loading
drivers/power/qpnp-fg.c +3 −0 Original line number Diff line number Diff line Loading @@ -105,6 +105,7 @@ enum pmic_subtype { PMI8994 = 10, PMI8950 = 17, PMI8996 = 19, PMI8937 = 55, }; enum wa_flags { Loading Loading @@ -6002,6 +6003,7 @@ static int fg_hw_init(struct fg_chip *chip) break; case PMI8950: case PMI8937: rc = fg_8950_hw_init(chip); /* Setup workaround flag based on PMIC type */ if (fg_sense_type == INTERNAL_CURRENT_SENSE) Loading Loading @@ -6094,6 +6096,7 @@ static int fg_detect_pmic_type(struct fg_chip *chip) switch (pmic_rev_id->pmic_subtype) { case PMI8994: case PMI8950: case PMI8937: case PMI8996: chip->pmic_subtype = pmic_rev_id->pmic_subtype; chip->pmic_revision[REVID_RESERVED] = pmic_rev_id->rev1; Loading
drivers/power/qpnp-smbcharger.c +12 −4 Original line number Diff line number Diff line Loading @@ -141,6 +141,7 @@ struct smbchg_chip { bool hvdcp3_supported; bool restricted_charging; bool skip_usb_suspend_for_fake_battery; bool hvdcp_not_supported; u8 original_usbin_allowance; struct parallel_usb_cfg parallel; struct delayed_work parallel_en_work; Loading Loading @@ -282,6 +283,7 @@ enum pmic_subtype { PMI8994 = 10, PMI8950 = 17, PMI8996 = 19, PMI8937 = 55, }; enum smbchg_wa { Loading Loading @@ -4447,6 +4449,7 @@ static void handle_usb_removal(struct smbchg_chip *chip) vote(chip->usb_icl_votable, WEAK_CHARGER_ICL_VOTER, false, 0); chip->usb_icl_delta = 0; vote(chip->usb_icl_votable, SW_AICL_ICL_VOTER, false, 0); if (!chip->hvdcp_not_supported) restore_from_hvdcp_detection(chip); } Loading Loading @@ -4519,7 +4522,8 @@ static void handle_usb_insertion(struct smbchg_chip *chip) } schedule_work(&chip->usb_set_online_work); if (usb_supply_type == POWER_SUPPLY_TYPE_USB_DCP) if (!chip->hvdcp_not_supported && (usb_supply_type == POWER_SUPPLY_TYPE_USB_DCP)) schedule_delayed_work(&chip->hvdcp_det_work, msecs_to_jiffies(HVDCP_NOTIFY_MS)); Loading Loading @@ -7393,6 +7397,7 @@ static int smbchg_check_chg_version(struct smbchg_chip *chip) chip->schg_version = QPNP_SCHG; break; case PMI8950: case PMI8937: chip->wa_flags |= SMBCHG_BATT_OV_WA; if (pmic_rev_id->rev4 < 2) /* PMI8950 1.0 */ { chip->wa_flags |= SMBCHG_AICL_DEGLITCH_WA; Loading @@ -7402,6 +7407,8 @@ static int smbchg_check_chg_version(struct smbchg_chip *chip) } use_pmi8994_tables(chip); chip->schg_version = QPNP_SCHG_LITE; if (pmic_rev_id->pmic_subtype == PMI8937) chip->hvdcp_not_supported = true; break; case PMI8996: chip->wa_flags |= SMBCHG_CC_ESR_WA Loading @@ -7414,8 +7421,9 @@ static int smbchg_check_chg_version(struct smbchg_chip *chip) pmic_rev_id->pmic_subtype); } pr_smb(PR_STATUS, "pmic=%s, wa_flags=0x%x\n", pmic_rev_id->pmic_name, chip->wa_flags); pr_smb(PR_STATUS, "pmic=%s, wa_flags=0x%x, hvdcp_supported=%s\n", pmic_rev_id->pmic_name, chip->wa_flags, chip->hvdcp_not_supported ? "false" : "true"); return 0; } Loading