From patchwork Fri Feb 12 12:56:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 8290591 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6D3DDBEEE5 for ; Fri, 12 Feb 2016 12:57:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F56D203F4 for ; Fri, 12 Feb 2016 12:57:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 83773203E5 for ; Fri, 12 Feb 2016 12:57:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752627AbcBLM5p (ORCPT ); Fri, 12 Feb 2016 07:57:45 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33306 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752460AbcBLM5m (ORCPT ); Fri, 12 Feb 2016 07:57:42 -0500 Received: by mail-wm0-f67.google.com with SMTP id c200so2562630wme.0; Fri, 12 Feb 2016 04:57:42 -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=68ON4gPu6AugmS+pKMJPot7Vu+RiRAnkTAwDhxmNuMQ=; b=R2VA9NiFNaAAaJdP0y9Yvdt9duzBbqEK7Dre/Rvut9Cl8Tx9teGWmRt/tX2Oo/IY4y jTNwhHkd0Gc2O2OEBP9M09UGMg4pt+yt0w54YvtqzqEZ2dhGFDIra4a8Jebpc/9yXy7c 8OWtI22FKpInCJwlk8lJX/nLLMgq5DpRrSN/M/wsuAoWpxYlZLwTlkiF0Ug++Gyg2fkP 7eaMhE9E7s/zmItUgplYziDLMMdsUUJP5iQcChwGLnhGYFNW+n2cwfSu7fV0FqfwEaoB 3jYfw4l3qrhEonPktZKRAULLKFZvKVn6ruPHW1uSqRFYDcdtqi0OwuaQdTkfve0JiwBR tHZw== 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=68ON4gPu6AugmS+pKMJPot7Vu+RiRAnkTAwDhxmNuMQ=; b=Un/rxx3StsIYQ+y4DE8HMu3GMBxJ7RQ86Q1VQcdJN4yLUPwtu+kPYlDq0xjIf3CAfZ XVci3zYBfPpO5WTu8GUuMfP4D5OM1qfTzLCvD7ZpXXRmWoHPQbBdDZcgZy4xMVK3RiUT JvN9hFVHReAMp7wqS6JWDWNIU39pLznlGZsM4e17eGl4lDUWNBw/b02NXiOMbZJqD2Nl Ho4rvqUD38EC4WzRi8AOLol+ubkq0tDgVnzV5R/Fc9cHfJURgQ90w+BVR04EunVY5CQF fXUV9icx7dkgNbwLwf89iPBIOmSiNpGeFTcx/Grr9HyMMkKMMROLaaINyAFTpwYNHeoV 1GJA== X-Gm-Message-State: AG10YOTkkX7bu3shYpyUIAXDKTSkkuVnSUIevVR2P+Fggq9/N0+xIeJVR5GGIKqa+uHeDQ== X-Received: by 10.28.63.200 with SMTP id m191mr2757574wma.21.1455281861505; Fri, 12 Feb 2016 04:57:41 -0800 (PST) Received: from cizrna.lan ([109.72.12.248]) by smtp.gmail.com with ESMTPSA id ei9sm11960549wjd.40.2016.02.12.04.57.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Feb 2016 04:57:40 -0800 (PST) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Cc: Sameer Nanda , Lee Jones , Benson Leung , =?UTF-8?q?Enric=20Balletb=C3=B2?= , Vic Yang , Vincent Palatin , Randall Spangler , Todd Broch , Gwendal Grignou , Tomeu Vizoso , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , linux-pm@vger.kernel.org Subject: [PATCH v2 2/8] power_supply: Add types for USB Type C and PD chargers Date: Fri, 12 Feb 2016 13:56:59 +0100 Message-Id: <1455281825-23526-3-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455281825-23526-1-git-send-email-tomeu.vizoso@collabora.com> References: <1455281825-23526-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=-6.9 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, /* Power Delivery Port */ POWER_SUPPLY_TYPE_USB_PD_DRP, /* PD Dual Role Port */ Signed-off-by: Benson Leung [tomeu: remove the mention to Type C from the comments] Signed-off-by: Tomeu Vizoso Reviewed-by: Alec Berg Reviewed-by: Vincent Palatin Reviewed-by: Todd Broch --- Changes in v2: - Remove the mention to Type C from the comments where it didn't make sense, as suggested by Benson Leung. 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..751061790626 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, /* Power Delivery Port */ + POWER_SUPPLY_TYPE_USB_PD_DRP, /* PD Dual Role Port */ }; enum power_supply_notifier_events {