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

Commit 210d0a71 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: smb5: enable software ICL adjustment for thermal regulation"

parents 71f1e4e5 8bc6dc42
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2113,7 +2113,8 @@ static int smb5_init_hw(struct smb5 *chip)
	 */
	if (chg->wa_flags & SW_THERM_REGULATION_WA) {
		rc = smblib_write(chg, MISC_THERMREG_SRC_CFG_REG,
					THERMREG_DIE_CMP_SRC_EN_BIT);
					THERMREG_SW_ICL_ADJUST_BIT
					| THERMREG_DIE_CMP_SRC_EN_BIT);
		if (rc < 0) {
			dev_err(chg->dev, "Couldn't disable HW thermal regulation rc=%d\n",
				rc);
+19 −2
Original line number Diff line number Diff line
@@ -97,6 +97,8 @@
#define SRC_VOTER		"SRC_VOTER"
#define SWITCHER_TOGGLE_VOTER	"SWITCHER_TOGGLE_VOTER"

#define THERMAL_SUSPEND_DECIDEGC	1400

#define smb1390_dbg(chip, reason, fmt, ...)				\
	do {								\
		if (chip->debug_mask & (reason))			\
@@ -747,9 +749,24 @@ static int smb1390_get_prop(struct power_supply *psy,
			else
				rc = -ENODATA;
		} else {
			/*
			 * Add a filter to the die temp value read:
			 * If temp > THERMAL_SUSPEND_DECIDEGC then
			 *	- treat it as an error and report last valid
			 *	  cached temperature.
			 *	- return -ENODATA if the cached value is
			 *	  invalid.
			 */

			rc = smb1390_get_die_temp(chip, val);
			if (rc >= 0)
			if (rc >= 0) {
				if (val->intval <= THERMAL_SUSPEND_DECIDEGC)
					chip->die_temp = val->intval;
				else if (chip->die_temp == -ENODATA)
					rc = -ENODATA;
				else
					val->intval = chip->die_temp;
			}
		}
		break;
	case POWER_SUPPLY_PROP_CP_ISNS: