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

Commit 28f36ff3 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "smb138x-charger: expose CHARGE_TYPE in parallel psy"

parents 369bd984 04fe8da8
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2830,7 +2830,9 @@ static void smblib_pl_taper_work(struct work_struct *work)
	union power_supply_propval pval = {0, };
	int rc;

	smblib_dbg(chg, PR_PARALLEL, "starting parallel taper work\n");
	if (chg->pl.slave_fcc_ua < MINIMUM_PARALLEL_FCC_UA) {
		smblib_dbg(chg, PR_PARALLEL, "parallel taper is done\n");
		vote(chg->pl_disable_votable, TAPER_END_VOTER, true, 0);
		goto done;
	}
@@ -2842,6 +2844,7 @@ static void smblib_pl_taper_work(struct work_struct *work)
	}

	if (pval.intval == POWER_SUPPLY_CHARGE_TYPE_TAPER) {
		smblib_dbg(chg, PR_PARALLEL, "master is taper charging; reducing slave FCC\n");
		vote(chg->awake_votable, PL_TAPER_WORK_RUNNING_VOTER, true, 0);
		/* Reduce the taper percent by 25 percent */
		chg->pl.taper_pct = chg->pl.taper_pct
@@ -2855,6 +2858,8 @@ static void smblib_pl_taper_work(struct work_struct *work)
	/*
	 * Master back to Fast Charge, get out of this round of taper reduction
	 */
	smblib_dbg(chg, PR_PARALLEL, "master is fast charging; waiting for next taper\n");

done:
	vote(chg->awake_votable, PL_TAPER_WORK_RUNNING_VOTER, false, 0);
}
+4 −0
Original line number Diff line number Diff line
@@ -397,6 +397,7 @@ static int smb138x_init_batt_psy(struct smb138x *chip)
 *****************************/

static enum power_supply_property smb138x_parallel_props[] = {
	POWER_SUPPLY_PROP_CHARGE_TYPE,
	POWER_SUPPLY_PROP_CHARGING_ENABLED,
	POWER_SUPPLY_PROP_PIN_ENABLED,
	POWER_SUPPLY_PROP_INPUT_SUSPEND,
@@ -417,6 +418,9 @@ static int smb138x_parallel_get_prop(struct power_supply *psy,
	u8 temp;

	switch (prop) {
	case POWER_SUPPLY_PROP_CHARGE_TYPE:
		rc = smblib_get_prop_batt_charge_type(chg, val);
		break;
	case POWER_SUPPLY_PROP_CHARGING_ENABLED:
		rc = smblib_read(chg, BATTERY_CHARGER_STATUS_5_REG,
				 &temp);