Loading drivers/power/power_supply_core.c +16 −0 Original line number Diff line number Diff line Loading @@ -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 Loading include/linux/power_supply.h +3 −0 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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; } Loading Loading
drivers/power/power_supply_core.c +16 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
include/linux/power_supply.h +3 −0 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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; } Loading