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

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

Merge "power: qpnp-qg: Update the property to force-recharge"

parents 738500de 42033781
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1890,7 +1890,7 @@ static int qg_charge_full_update(struct qpnp_qg *chip)
			/* Force recharge */
			prop.intval = 0;
			rc = power_supply_set_property(chip->batt_psy,
				POWER_SUPPLY_PROP_RECHARGE_SOC, &prop);
				POWER_SUPPLY_PROP_FORCE_RECHARGE, &prop);
			if (rc < 0)
				pr_err("Failed to force recharge rc=%d\n", rc);
			else
+13 −0
Original line number Diff line number Diff line
@@ -1173,6 +1173,7 @@ static enum power_supply_property smb5_batt_props[] = {
	POWER_SUPPLY_PROP_CYCLE_COUNT,
	POWER_SUPPLY_PROP_RECHARGE_SOC,
	POWER_SUPPLY_PROP_CHARGE_FULL,
	POWER_SUPPLY_PROP_FORCE_RECHARGE,
};

static int smb5_batt_get_prop(struct power_supply *psy,
@@ -1288,6 +1289,9 @@ static int smb5_batt_get_prop(struct power_supply *psy,
		rc = smblib_get_prop_from_bms(chg,
				POWER_SUPPLY_PROP_CHARGE_FULL, val);
		break;
	case POWER_SUPPLY_PROP_FORCE_RECHARGE:
		val->intval = 0;
		break;
	default:
		pr_err("batt power supply prop %d not supported\n", psp);
		return -EINVAL;
@@ -1367,6 +1371,15 @@ static int smb5_batt_set_prop(struct power_supply *psy,
	case POWER_SUPPLY_PROP_RECHARGE_SOC:
		rc = smblib_set_prop_rechg_soc_thresh(chg, val);
		break;
	case POWER_SUPPLY_PROP_FORCE_RECHARGE:
			/* toggle charging to force recharge */
			vote(chg->chg_disable_votable, FORCE_RECHARGE_VOTER,
					true, 0);
			/* charge disable delay */
			msleep(50);
			vote(chg->chg_disable_votable, FORCE_RECHARGE_VOTER,
					false, 0);
		break;
	default:
		rc = -EINVAL;
	}
+1 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ enum print_reason {
#define WBC_VOTER			"WBC_VOTER"
#define HW_LIMIT_VOTER			"HW_LIMIT_VOTER"
#define PL_SMB_EN_VOTER			"PL_SMB_EN_VOTER"
#define FORCE_RECHARGE_VOTER		"FORCE_RECHARGE_VOTER"

#define BOOST_BACK_STORM_COUNT	3
#define WEAK_CHG_STORM_COUNT	8