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

Commit 5ead0e2f authored by Ashay Jaiswal's avatar Ashay Jaiswal Committed by Gerrit - the friendly Code Review server
Browse files

power_supply: Add TYPEC power supply properties



Add TYPEC power supply type and following TYPEC related
properties:

- TYPE/TYPEC_MODE: property which is used to report the typec state
	- TYPEC_UFP (upstream facing port).
	- TYPEC_DFP (downstream facing port).
- CURRENT_CAPABILITY: property which is used to report
		current capability (in mA) of the charger.
	This can be one of the following:
	- 900, 1500, 3000

Change-Id: I0eb838f11038eef139d3617e1e1e79b791173209
Signed-off-by: default avatarAshay Jaiswal <ashayj@codeaurora.org>
parent 9c186765
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ static ssize_t power_supply_show_property(struct device *dev,
		"Unknown", "Battery", "UPS", "Mains", "USB",
		"USB_DCP", "USB_CDP", "USB_ACA",
		"USB_HVDCP", "USB_HVDCP_3", "Wireless", "BMS", "USB_Parallel",
		"Wipower"
		"Wipower", "TYPEC", "TYPEC_UFP", "TYPEC_DFP"
	};
	static char *status_text[] = {
		"Unknown", "Charging", "Discharging", "Not charging", "Full"
@@ -243,6 +243,8 @@ static struct device_attribute power_supply_attrs[] = {
	POWER_SUPPLY_ATTR(cycle_count_id),
	POWER_SUPPLY_ATTR(safety_timer_expired),
	POWER_SUPPLY_ATTR(restricted_charging),
	POWER_SUPPLY_ATTR(current_capability),
	POWER_SUPPLY_ATTR(typec_mode),
	/* Local extensions of type int64_t */
	POWER_SUPPLY_ATTR(charge_counter_ext),
	/* Properties of type `const char *' */
+5 −0
Original line number Diff line number Diff line
@@ -206,6 +206,8 @@ enum power_supply_property {
	POWER_SUPPLY_PROP_CYCLE_COUNT_ID,
	POWER_SUPPLY_PROP_SAFETY_TIMER_EXPIRED,
	POWER_SUPPLY_PROP_RESTRICTED_CHARGING,
	POWER_SUPPLY_PROP_CURRENT_CAPABILITY,
	POWER_SUPPLY_PROP_TYPEC_MODE,
	/* Local extensions of type int64_t */
	POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT,
	/* Properties of type `const char *' */
@@ -230,6 +232,9 @@ enum power_supply_type {
	POWER_SUPPLY_TYPE_BMS,		/* Battery Monitor System */
	POWER_SUPPLY_TYPE_USB_PARALLEL,		/* USB Parallel Path */
	POWER_SUPPLY_TYPE_WIPOWER,		/* Wipower */
	POWER_SUPPLY_TYPE_TYPEC,	/*Type-C */
	POWER_SUPPLY_TYPE_UFP,		/* Type-C UFP */
	POWER_SUPPLY_TYPE_DFP,		/* TYpe-C DFP */
};

enum power_supply_notifier_events {