Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0fef82e1 authored by Ashay Jaiswal's avatar Ashay Jaiswal
Browse files

power: fg/smbcharger:add support for PMI8940



PMI8940 uses the same fuel-gauge/charger block as PMI8950.
Add support of PMI8940 in order to configure charger/FG
based on PMIC.

CRs-Fixed: 1011021
Change-Id: Ifcdc893a6da3b7bd592d78c353b209ab264e5605
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
parent cef63bd6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@ enum pmic_subtype {
	PMI8950		= 17,
	PMI8996		= 19,
	PMI8937		= 55,
	PMI8940		= 64,
};

enum wa_flags {
@@ -7530,6 +7531,7 @@ static int fg_hw_init(struct fg_chip *chip)
		break;
	case PMI8950:
	case PMI8937:
	case PMI8940:
		rc = fg_8950_hw_init(chip);
		/* Setup workaround flag based on PMIC type */
		chip->wa_flag |= BCL_HI_POWER_FOR_CHGLED_WA;
@@ -7867,6 +7869,7 @@ static int fg_detect_pmic_type(struct fg_chip *chip)
	case PMI8950:
	case PMI8937:
	case PMI8996:
	case PMI8940:
		chip->pmic_subtype = pmic_rev_id->pmic_subtype;
		chip->pmic_revision[REVID_RESERVED]	= pmic_rev_id->rev1;
		chip->pmic_revision[REVID_VARIANT]	= pmic_rev_id->rev2;
+6 −1
Original line number Diff line number Diff line
@@ -295,6 +295,7 @@ enum pmic_subtype {
	PMI8950		= 17,
	PMI8996		= 19,
	PMI8937		= 55,
	PMI8940		= 64,
};

enum smbchg_wa {
@@ -7869,6 +7870,8 @@ static int smbchg_check_chg_version(struct smbchg_chip *chip)
	case PMI8950:
		chip->wa_flags |= SMBCHG_RESTART_WA;
	case PMI8937:
		/* fall through */
	case PMI8940:
		chip->wa_flags |= SMBCHG_BATT_OV_WA;
		if (pmic_rev_id->rev4 < 2) /* PMI8950 1.0 */ {
			chip->wa_flags |= SMBCHG_AICL_DEGLITCH_WA;
@@ -7883,7 +7886,9 @@ static int smbchg_check_chg_version(struct smbchg_chip *chip)
			ARRAY_SIZE(aicl_rerun_period_schg_lite);

		chip->schg_version = QPNP_SCHG_LITE;
		if (pmic_rev_id->pmic_subtype == PMI8937)
		/* PMI8937/PMI8940 doesn't support HVDCP */
		if ((pmic_rev_id->pmic_subtype == PMI8937)
			|| (pmic_rev_id->pmic_subtype == PMI8940))
			chip->hvdcp_not_supported = true;
		break;
	case PMI8996: