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

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

Merge "power: smb5-lib: Load HW JEITA config in general psy events"

parents 3da45a36 557d7b68
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -731,9 +731,10 @@ static int smblib_notifier_call(struct notifier_block *nb,
			chg->bms_psy = psy;
		if (ev == PSY_EVENT_PROP_CHANGED)
			schedule_work(&chg->bms_update_work);
	}

	if (!chg->jeita_configured)
		schedule_work(&chg->jeita_update_work);
	}

	if (chg->sec_pl_present && !chg->pl.psy
		&& !strcmp(psy->desc->name, "parallel")) {
@@ -4086,6 +4087,10 @@ static void jeita_update_work(struct work_struct *work)
		goto out;
	}

	/* if BMS is not ready, defer the work */
	if (!chg->bms_psy)
		return;

	rc = power_supply_get_property(chg->bms_psy,
			POWER_SUPPLY_PROP_RESISTANCE_ID, &val);
	if (rc < 0) {
@@ -4093,6 +4098,10 @@ static void jeita_update_work(struct work_struct *work)
		goto out;
	}

	/* if BMS hasn't read out the batt_id yet, defer the work */
	if (val.intval <= 0)
		return;

	pnode = of_batterydata_get_best_profile(batt_node,
					val.intval / 1000, NULL);
	if (IS_ERR(pnode)) {