[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1286178698-28428-2-git-send-email-ext-heikki.krogerus@nokia.com>
Date: Mon, 4 Oct 2010 10:51:37 +0300
From: "Krogerus Heikki (EXT-Teleca/Helsinki)"
<ext-heikki.krogerus@...ia.com>
To: cbouatmailru@...il.com
Cc: linux-kernel@...r.kernel.org, ext-heikki.krogerus@...ia.com
Subject: [PATCH 1/2] power_supply: add types for USB chargers
From: Heikki Krogerus <ext-heikki.krogerus@...ia.com>
This adds power supply types for USB chargers defined in
Battery Charging Specification 1.1.
Signed-off-by: Heikki Krogerus <ext-heikki.krogerus@...ia.com>
---
drivers/power/power_supply_sysfs.c | 3 ++-
include/linux/power_supply.h | 5 ++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c
index 9d30eeb..88f5e43 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
@@ -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"
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 30083a8..d37fef6 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -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 {
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists