From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753704AbeD3Nh2 (ORCPT ); Mon, 30 Apr 2018 09:37:28 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:38300 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751741AbeD3Nh0 (ORCPT ); Mon, 30 Apr 2018 09:37:26 -0400 X-Google-Smtp-Source: AB8JxZqRrtplA0Dga5QyfluUwegCGDVfx3gK1s/ZQrqiClZa4jCqhoq5hp1OtWB4XwftLm+jtlTwOMmx71K/N/YJMjI= MIME-Version: 1.0 In-Reply-To: References: <20180430131403.14296-1-enric.balletbo@collabora.com> <20180430131403.14296-3-enric.balletbo@collabora.com> From: Enric Balletbo Serra Date: Mon, 30 Apr 2018 15:37:23 +0200 Message-ID: Subject: Re: [PATCH v2 2/3] power: supply: add cros-ec USBPD charger driver. To: Miguel Ojeda Cc: Enric Balletbo i Serra , Lee Jones , Sebastian Reichel , Gwendal Grignou , Sameer Nanda , Linux PM list , Guenter Roeck , linux-kernel , Benson Leung Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Miguel, 2018-04-30 15:20 GMT+02:00 Miguel Ojeda : > On Mon, Apr 30, 2018 at 3:14 PM, Enric Balletbo i Serra > wrote: >> From: Sameer Nanda >> >> This driver gets various bits of information about what is connected to >> USB PD ports from the EC and converts that into power_supply properties. >> >> Signed-off-by: Sameer Nanda >> Signed-off-by: Enric Balletbo i Serra >> --- >> >> Changes in v2: >> - [2/3] Add SPDX header, use devm_ variant and drop .owner >> - [2/3] Removed the PD log functionality (will be send on a follow up patch) >> - [2/3] Removed the extra custom sysfs attributes (will be send on a follow up patch) >> >> drivers/power/supply/Kconfig | 10 + >> drivers/power/supply/Makefile | 1 + >> drivers/power/supply/cros_usbpd-charger.c | 511 ++++++++++++++++++++++ >> include/linux/mfd/cros_ec.h | 2 + >> 4 files changed, 524 insertions(+) >> create mode 100644 drivers/power/supply/cros_usbpd-charger.c >> >> diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig >> index 428b426842f4..046eb23ba6f0 100644 >> --- a/drivers/power/supply/Kconfig >> +++ b/drivers/power/supply/Kconfig >> @@ -624,4 +624,14 @@ config CHARGER_RT9455 >> help >> Say Y to enable support for Richtek RT9455 battery charger. >> >> +config CHARGER_CROS_USBPD >> + tristate "ChromeOS EC based USBPD charger" >> + depends on MFD_CROS_EC >> + default n >> + help >> + Say Y here to enable ChromeOS EC based USBPD charger >> + driver. This driver gets various bits of information about >> + what is connected to USB PD ports from the EC and converts >> + that into power_supply properties. >> + >> endif # POWER_SUPPLY >> diff --git a/drivers/power/supply/Makefile b/drivers/power/supply/Makefile >> index e83aa843bcc6..907e26f824b2 100644 >> --- a/drivers/power/supply/Makefile >> +++ b/drivers/power/supply/Makefile >> @@ -83,3 +83,4 @@ obj-$(CONFIG_CHARGER_TPS65090) += tps65090-charger.o >> obj-$(CONFIG_CHARGER_TPS65217) += tps65217_charger.o >> obj-$(CONFIG_AXP288_FUEL_GAUGE) += axp288_fuel_gauge.o >> obj-$(CONFIG_AXP288_CHARGER) += axp288_charger.o >> +obj-$(CONFIG_CHARGER_CROS_USBPD) += cros_usbpd-charger.o >> diff --git a/drivers/power/supply/cros_usbpd-charger.c b/drivers/power/supply/cros_usbpd-charger.c >> new file mode 100644 >> index 000000000000..c57d1c41828c >> --- /dev/null >> +++ b/drivers/power/supply/cros_usbpd-charger.c >> @@ -0,0 +1,511 @@ >> +// SPDX-License-Identifier: GPL-2.0 > > If this is GPL-2.0... > Good catch, I think that this should be SPDX-License-Identifier: GPL-2.0+ I will change in next version when I get more review. >> +/* >> + * Power supply driver for ChromeOS EC based USB PD Charger. >> + * >> + * Copyright (c) 2014 - 2018 Google, Inc >> + */ >> + >> + >> +module_platform_driver(cros_usbpd_charger_driver); >> + >> +MODULE_LICENSE("GPL"); > > ...then this should be "GPL v2": > https://elixir.bootlin.com/linux/v4.17-rc3/source/include/linux/module.h#L175 > > Cheers, > Miguel Thanks, Enric