]> git.karo-electronics.de Git - linux-beck.git/commitdiff
power_supply: Add types for USB chargers
authorHeikki Krogerus <ext-heikki.krogerus@nokia.com>
Mon, 4 Oct 2010 07:51:37 +0000 (10:51 +0300)
committerAnton Vorontsov <cbouatmailru@gmail.com>
Wed, 6 Oct 2010 13:37:09 +0000 (17:37 +0400)
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>
drivers/power/power_supply_sysfs.c
include/linux/power_supply.h

index 9d30eeb8c8104187320794eca0e11e8d191c8ad0..88f5e43100c24b92c2706e4078ed45f281363770 100644 (file)
@@ -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"
index 30083a896f3628418fa42114a582dc18396c66e9..d37fef67ece2e65ee2e685956f3660d36cc5cd09 100644 (file)
@@ -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 {