power_supply: Add types for USB Type C and PD chargers
authorBenson Leung <bleung@chromium.org>
Fri, 12 Feb 2016 12:56:59 +0000 (13:56 +0100)
committerSebastian Reichel <sre@kernel.org>
Mon, 15 Feb 2016 06:02:32 +0000 (07:02 +0100)
This adds power supply types for USB chargers defined in
the USB Type-C Specification 1.1 and in the
USB Power Delivery Specification Revision 2.0 V1.1.

The following are added :
POWER_SUPPLY_TYPE_USB_TYPE_C, /* Type C Port */
POWER_SUPPLY_TYPE_USB_PD, /* Power Delivery Port */
POWER_SUPPLY_TYPE_USB_PD_DRP, /* PD Dual Role Port */

Signed-off-by: Benson Leung <bleung@chromium.org>
[tomeu: remove the mention to Type C from the comments]
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/power_supply_sysfs.c
include/linux/power_supply.h

index ed2d7fd0c734dc47fc192fe7cccf825c63e1a35b..80fed98832f9e9723df62e8fd3feb3948ca24da3 100644 (file)
@@ -45,7 +45,8 @@ static ssize_t power_supply_show_property(struct device *dev,
                                          char *buf) {
        static char *type_text[] = {
                "Unknown", "Battery", "UPS", "Mains", "USB",
-               "USB_DCP", "USB_CDP", "USB_ACA"
+               "USB_DCP", "USB_CDP", "USB_ACA", "USB_C",
+               "USB_PD", "USB_PD_DRP"
        };
        static char *status_text[] = {
                "Unknown", "Charging", "Discharging", "Not charging", "Full"
index ef9f1592185d3189867b564efc4fdb8c151597a7..7510617906264cf8d7ae6dda754470afea793218 100644 (file)
@@ -163,6 +163,9 @@ enum power_supply_type {
        POWER_SUPPLY_TYPE_USB_DCP,      /* Dedicated Charging Port */
        POWER_SUPPLY_TYPE_USB_CDP,      /* Charging Downstream Port */
        POWER_SUPPLY_TYPE_USB_ACA,      /* Accessory Charger Adapters */
+       POWER_SUPPLY_TYPE_USB_TYPE_C,   /* Type C Port */
+       POWER_SUPPLY_TYPE_USB_PD,       /* Power Delivery Port */
+       POWER_SUPPLY_TYPE_USB_PD_DRP,   /* PD Dual Role Port */
 };
 
 enum power_supply_notifier_events {