From patchwork Fri Feb 5 13:32:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 8234291 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8E5359F1C1 for ; Fri, 5 Feb 2016 13:35:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9395C2012B for ; Fri, 5 Feb 2016 13:35:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6F8D720122 for ; Fri, 5 Feb 2016 13:35:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752976AbcBENe5 (ORCPT ); Fri, 5 Feb 2016 08:34:57 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33829 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753673AbcBENdt (ORCPT ); Fri, 5 Feb 2016 08:33:49 -0500 Received: by mail-wm0-f67.google.com with SMTP id p63so3046961wmp.1; Fri, 05 Feb 2016 05:33:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=l46GtnGys6369rN/QN/I8IbKS4qu9zA4NK7XQJoTaLo=; b=w2ozWO+/TKY6LiWrFM6AFoA5ipLa91nv2VrXnpPCIVMLqgwfOkiMvd/AgKt+xzF4b+ 2XMD3Fp4RaZT3nVVAtDOhi11StFw5m+6myIKjJM1Un5ENmCP6NzuzwbZLam60n+TETF3 5iV97f/6R0UZ2UgcqThpp1pgKw1gJAzUEdx+s9IC0mp1Vae/u6W6kIC7yBFAmZ1dTwpW aITTZZ6IjdrDuk77SjYmj8B7dggch9z4esHJl4miFsxgXZXjsQHxCWA9XQMjSSgZ3qta Lsdor59phtihyjBUFi0E4U/EZIAMCzThPwhEtUjlQjMspnlajHqLhww417OOak4ohzXs 1azg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=l46GtnGys6369rN/QN/I8IbKS4qu9zA4NK7XQJoTaLo=; b=Sg4EhhVa5+bYtbq6bo+NJtmOudunnwPdDOKaVTlCJVUdRizSrsGrtcMmTE8no30n4A qXBRELmPvhwlhhM0JrPOyvupub0+yowYmE8WeqTV8EJ4bXPhKfRyc2GT1RnvtQ/ZNW3+ f424iVbEk56o2/xXF1y9nwP+B1bi6EKJLT2K1Fn0qeBwJomW7WpB81WkIGi5Wr3N6Hw3 EKxkh2shhdfyQWQ9UmrMGqa+KP9mQrZnbPF10vnE+WrWXolKEDtC6IOkH0VVq7raxPNK 0QCtubcRszB2YX+Zza1lXbhcXeFgN9o8P1a55QOZvxrf/KA1wQw3jXIAEujz87/YGoWK Hz9w== X-Gm-Message-State: AG10YOSSSsPcDUKQ5Q9cujnxGIyaKnIhiMS/KXBDBqiU52gJNWLKc9KcjOXyXoMdyaHWRw== X-Received: by 10.194.123.103 with SMTP id lz7mr15584442wjb.140.1454679228602; Fri, 05 Feb 2016 05:33:48 -0800 (PST) Received: from cizrna.lan ([109.72.12.57]) by smtp.gmail.com with ESMTPSA id g3sm15915346wjw.31.2016.02.05.05.33.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Feb 2016 05:33:47 -0800 (PST) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Cc: Sameer Nanda , Benson Leung , =?UTF-8?q?Enric=20Balletb=C3=B2?= , Vic Yang , Vincent Palatin , Randall Spangler , Gwendal Grignou , Tomeu Vizoso , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , linux-pm@vger.kernel.org Subject: [PATCH v1 3/6] power_supply: Add types for USB Type C and PD chargers Date: Fri, 5 Feb 2016 14:32:58 +0100 Message-Id: <1454679181-8949-4-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454679181-8949-1-git-send-email-tomeu.vizoso@collabora.com> References: <1454679181-8949-1-git-send-email-tomeu.vizoso@collabora.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Benson Leung 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, /* Type C Power Delivery Port */ POWER_SUPPLY_TYPE_USB_PD_DRP, /* Type C PD Dual Role Port */ Signed-off-by: Benson Leung Signed-off-by: Tomeu Vizoso Reviewed-by: Alec Berg Reviewed-by: Vincent Palatin Reviewed-by: Todd Broch --- drivers/power/power_supply_sysfs.c | 3 ++- include/linux/power_supply.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c index ed2d7fd0c734..80fed98832f9 100644 --- a/drivers/power/power_supply_sysfs.c +++ b/drivers/power/power_supply_sysfs.c @@ -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" diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index ef9f1592185d..206c3384c6fa 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -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, /* Type C Power Delivery Port */ + POWER_SUPPLY_TYPE_USB_PD_DRP, /* Type C PD Dual Role Port */ }; enum power_supply_notifier_events {