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

Commit e5bec3d8 authored by Ke Liu's avatar Ke Liu
Browse files

power: smb350_charger: add support for specifying fuel gauge part name



SMB350 charger needs to use external fuel gauge part to get battery
capacity. Hence add device support for specifying the name of the fuel
gauge part.

Change-Id: Iba1c48e99b1a602b1e2787690e8294f14a8724d9
Signed-off-by: default avatarKe Liu <keliu@codeaurora.org>
parent be88a07a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ Node optional properties:
- summit,term-current-ma	charging termination current in milliamps.
				valid values are 200/300/400/500/600/700.
				A value of zero means no termination current.
- summit,fuel-gauge-name	A string specify the name of the fuel gauge part.

Example:
	i2c@f9967000 {
@@ -42,5 +43,6 @@ Example:
			summit,chg-shdn-n-gpio = <&pm8941_gpios 13 0x00>;
			summit,chg-current-ma = <1600>;
			summit,term-current-ma = <200>;
			summit,fuel-gauge-name = "bq28400_battery";
		};
	};
+9 −0
Original line number Diff line number Diff line
@@ -101,6 +101,7 @@ struct smb350_chg {
	struct dentry		*dent;
	struct power_supply	dc_psy;
	struct power_supply	batt_psy;
	const char		*fuel_gauge_name;
};

static struct smb350_chg *the_chip;
@@ -800,6 +801,14 @@ static int smb350_parse_dt(struct smb350_chg *chip)
		pr_debug("term_current_ma = %d rc = %d\n",
						chip->term_current_ma, rc);
	}

	rc = of_property_read_string(node, "summit,fuel-gauge-name",
					&(chip->fuel_gauge_name));
	if (rc < 0) {
		pr_debug("read of summit,fuel-gauge-name failure, rc = %d\n",
			rc);
	}

	return 0;
}