Skip to content

Commit

Permalink
power_supply: Add types for USB chargers
Browse files Browse the repository at this point in the history
This adds power supply types for USB chargers defined in
Battery Charging Specification 1.1.

Signed-off-by: Heikki Krogerus <ext-heikki.krogerus@nokia.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
  • Loading branch information
Heikki Krogerus authored and Anton Vorontsov committed Oct 6, 2010
1 parent 353f867 commit 85efc8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/power/power_supply_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ static ssize_t power_supply_show_property(struct device *dev,
struct device_attribute *attr,
char *buf) {
static char *type_text[] = {
"Battery", "UPS", "Mains", "USB"
"Battery", "UPS", "Mains", "USB",
"USB_DCP", "USB_CDP", "USB_ACA"
};
static char *status_text[] = {
"Unknown", "Charging", "Discharging", "Not charging", "Full"
Expand Down
5 changes: 4 additions & 1 deletion include/linux/power_supply.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ enum power_supply_type {
POWER_SUPPLY_TYPE_BATTERY = 0,
POWER_SUPPLY_TYPE_UPS,
POWER_SUPPLY_TYPE_MAINS,
POWER_SUPPLY_TYPE_USB,
POWER_SUPPLY_TYPE_USB, /* Standard Downstream Port */
POWER_SUPPLY_TYPE_USB_DCP, /* Dedicated Charging Port */
POWER_SUPPLY_TYPE_USB_CDP, /* Charging Downstream Port */
POWER_SUPPLY_TYPE_USB_ACA, /* Accessory Charger Adapters */
};

union power_supply_propval {
Expand Down

0 comments on commit 85efc8a

Please sign in to comment.