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

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

Merge "power: power_supply_core: Provide helper function to set usb otg"

parents 6b59e71d 047e1ac2
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -181,6 +181,22 @@ int power_supply_set_scope(struct power_supply *psy, int scope)
}
EXPORT_SYMBOL_GPL(power_supply_set_scope);

/**
 * power_supply_set_usb_otg - set otg of the usb power supply
 * @psy:	the usb power supply to control
 * @scope:	value to set the otg property to
 */
int power_supply_set_usb_otg(struct power_supply *psy, int otg)
{
	const union power_supply_propval ret = {otg, };

	if (psy->set_property)
		return psy->set_property(psy, POWER_SUPPLY_PROP_USB_OTG,
								&ret);
	return -ENXIO;
}
EXPORT_SYMBOL(power_supply_set_usb_otg);

/**
 * power_supply_set_supply_type - set type of the power supply
 * @psy:	the power supply to control
+3 −0
Original line number Diff line number Diff line
@@ -269,6 +269,7 @@ extern int power_supply_set_online(struct power_supply *psy, bool enable);
extern int power_supply_set_health_state(struct power_supply *psy, int health);
extern int power_supply_set_present(struct power_supply *psy, bool enable);
extern int power_supply_set_scope(struct power_supply *psy, int scope);
extern int power_supply_set_usb_otg(struct power_supply *psy, int otg);
extern int power_supply_set_charge_type(struct power_supply *psy, int type);
extern int power_supply_set_supply_type(struct power_supply *psy,
					enum power_supply_type supply_type);
@@ -306,6 +307,8 @@ static inline int power_supply_set_present(struct power_supply *psy,
static inline int power_supply_set_scope(struct power_supply *psy,
							int scope)
							{ return -ENOSYS; }
static inline int power_supply_set_usb_otg(struct power_supply *psy, int otg)
							{ return -ENOSYS; }
static inline int power_supply_set_charge_type(struct power_supply *psy,
							int type)
							{ return -ENOSYS; }