mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Krogerus Heikki (EXT-Teleca/Helsinki)"  <ext-heikki.krogerus@nokia.com>
To: cbouatmailru@gmail.com
Cc: linux-kernel@vger.kernel.org, ext-heikki.krogerus@nokia.com
Subject: [PATCH 1/2] power_supply: add types for USB chargers
Date: Mon,  4 Oct 2010 10:51:37 +0300	[thread overview]
Message-ID: <1286178698-28428-2-git-send-email-ext-heikki.krogerus@nokia.com> (raw)
In-Reply-To: <1286178698-28428-1-git-send-email-ext-heikki.krogerus@nokia.com>

From: Heikki Krogerus <ext-heikki.krogerus@nokia.com>

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>
---
 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


  reply	other threads:[~2010-10-04  7:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-04  7:51 [PATCH 0/2] minor changes to power_supply Krogerus Heikki (EXT-Teleca/Helsinki)
2010-10-04  7:51 ` Krogerus Heikki (EXT-Teleca/Helsinki) [this message]
2010-10-04  7:51 ` [PATCH 2/2] power_supply: Introduce maximum current property Krogerus Heikki (EXT-Teleca/Helsinki)
2010-10-06  6:17 ` [PATCH 0/2] minor changes to power_supply Heikki Krogerus
2010-10-06 13:47 ` Anton Vorontsov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1286178698-28428-2-git-send-email-ext-heikki.krogerus@nokia.com \
    --to=ext-heikki.krogerus@nokia.com \
    --cc=cbouatmailru@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®