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

Commit 734ca0f9 authored by Guru Das Srinagesh's avatar Guru Das Srinagesh
Browse files

power: smb5-lib: Set default WLS VOUT to 5 V when standalone



In the absence of secondary chargers, set the VOUT of the wireless
charger to 5V upon DC attach by default.

Change-Id: Idb11260567446f4feb49c121a17969cfe09b3829
Signed-off-by: default avatarGuru Das Srinagesh <gurus@codeaurora.org>
parent 54f3590a
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -5491,8 +5491,8 @@ irqreturn_t dc_plugin_irq_handler(int irq, void *data)
	dcin_present = input_present & INPUT_PRESENT_DC;
	vbus_present = input_present & INPUT_PRESENT_USB;

	if (dcin_present) {
		if (!vbus_present && chg->sec_cp_present) {
	if (dcin_present && !vbus_present) {
		if (chg->sec_cp_present) {
			pval.intval = wireless_vout;
			rc = smblib_set_prop_voltage_wls_output(chg, &pval);
			if (rc < 0)
@@ -5505,6 +5505,16 @@ irqreturn_t dc_plugin_irq_handler(int irq, void *data)
			if (rc < 0)
				dev_err(chg->dev, "Couldn't enable secondary chargers  rc=%d\n",
					rc);
		} else {
			/*
			 * If no secondary charger is present, commence
			 * wireless charging at 5 V by default.
			 */
			pval.intval = 5000000;
			rc = smblib_set_prop_voltage_wls_output(chg, &pval);
			if (rc < 0)
				dev_err(chg->dev, "Couldn't set dc voltage to 5 V rc=%d\n",
					rc);
		}
	} else if (chg->cp_reason == POWER_SUPPLY_CP_WIRELESS) {
		sec_charger = chg->sec_pl_present ?