From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753736AbcCHEko (ORCPT ); Mon, 7 Mar 2016 23:40:44 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:35045 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753367AbcCHEkd (ORCPT ); Mon, 7 Mar 2016 23:40:33 -0500 Date: Tue, 8 Mar 2016 11:40:27 +0700 From: Lee Jones To: Lu Baolu Cc: Felipe Balbi , Mathias Nyman , Greg Kroah-Hartman , Heikki Krogerus , MyungJoo Ham , Chanwoo Choi , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Fengguang Wu Subject: Re: [PATCH v2 7/7] mfd: intel_vuport: Add Intel virtual USB port MFD Driver Message-ID: <20160308044027.GI13692@x1> References: <1457340783-1522-1-git-send-email-baolu.lu@linux.intel.com> <1457340783-1522-8-git-send-email-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1457340783-1522-8-git-send-email-baolu.lu@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 07 Mar 2016, Lu Baolu wrote: > Some Intel platforms have an USB port mux controlled by GPIOs. > There's a single ACPI platform device that provides both USB ID > extcon device and a USB port mux device. This MFD driver will > split the 2 devices for their respective drivers. > > Signed-off-by: Lu Baolu > Suggested-by: David Cohen > Reviewed-by: Felipe Balbi > Signed-off-by: Fengguang Wu > --- > MAINTAINERS | 1 + > drivers/mfd/Kconfig | 8 +++++ > drivers/mfd/Makefile | 1 + > drivers/mfd/intel-vuport.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 88 insertions(+) > create mode 100644 drivers/mfd/intel-vuport.c > > diff --git a/MAINTAINERS b/MAINTAINERS > index 399cefe..1671a4d 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -11408,6 +11408,7 @@ F: drivers/usb/mux/intel-mux.c > F: include/linux/usb/intel-mux.h > F: drivers/usb/mux/intel-mux-gpio.c > F: drivers/usb/mux/intel-mux-drcfg.c > +F: drivers/mfd/intel-vuport.c Separate patch please. > USB PRINTER DRIVER (usblp) > M: Pete Zaitcev > diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig > index 9ca66de..8dd1bf3 100644 > --- a/drivers/mfd/Kconfig > +++ b/drivers/mfd/Kconfig > @@ -1534,5 +1534,13 @@ config MFD_VEXPRESS_SYSREG > System Registers are the platform configuration block > on the ARM Ltd. Versatile Express board. > > +config MFD_INTEL_VUPORT > + tristate "Intel virtual USB port controller" > + select MFD_CORE > + depends on X86 && ACPI > + help > + Say Y here to enable support for Intel dual role port mux Either "Intel's" or "the Intel". > + controlled by 3 GPIOs. > + > endmenu > endif > diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile > index 0f230a6..0ccd107 100644 > --- a/drivers/mfd/Makefile > +++ b/drivers/mfd/Makefile > @@ -198,3 +198,4 @@ intel-soc-pmic-objs := intel_soc_pmic_core.o intel_soc_pmic_crc.o > intel-soc-pmic-$(CONFIG_INTEL_PMC_IPC) += intel_soc_pmic_bxtwc.o > obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o > obj-$(CONFIG_MFD_MT6397) += mt6397-core.o > +obj-$(CONFIG_MFD_INTEL_VUPORT) += intel-vuport.o > diff --git a/drivers/mfd/intel-vuport.c b/drivers/mfd/intel-vuport.c > new file mode 100644 > index 0000000..1371099 > --- /dev/null > +++ b/drivers/mfd/intel-vuport.c > @@ -0,0 +1,78 @@ > +/* > + * MFD driver for Intel virtual USB port > + * > + * Copyright(c) 2016 Intel Corporation. > + * Author: Lu Baolu > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + */ > + > +#include > +#include > +#include > +#include > + > +/* ACPI GPIO Mappings */ > +static const struct acpi_gpio_params id_gpio = { 0, 0, false }; > +static const struct acpi_gpio_params vbus_gpio = { 1, 0, false }; > +static const struct acpi_gpio_params mux_gpio = { 2, 0, false }; > +static const struct acpi_gpio_mapping acpi_usb_gpios[] = { > + { "id-gpios", &id_gpio, 1 }, > + { "vbus_en-gpios", &vbus_gpio, 1 }, > + { "usb_mux-gpios", &mux_gpio, 1 }, > + { }, > +}; > + > +static const struct mfd_cell intel_vuport_mfd_cells[] = { > + { > + .name = "extcon-usb-gpio", > + }, > + { > + .name = "intel-mux-gpio", > + }, > +}; Please place single line entries on the same line as the '{' and '}'. As you have above. > +static int vuport_probe(struct platform_device *pdev) > +{ > + struct device *dev = &pdev->dev; > + int ret; > + > + ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(dev), acpi_usb_gpios); > + if (ret) > + return ret; > + > + return mfd_add_devices(&pdev->dev, 0, intel_vuport_mfd_cells, > + ARRAY_SIZE(intel_vuport_mfd_cells), NULL, 0, > + NULL); > +} > + > +static int vuport_remove(struct platform_device *pdev) > +{ > + mfd_remove_devices(&pdev->dev); > + acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pdev->dev)); > + > + return 0; > +} > + > +static struct acpi_device_id vuport_acpi_match[] = { > + { "INT3496" }, > + { } > +}; > +MODULE_DEVICE_TABLE(acpi, vuport_acpi_match); > + > +static struct platform_driver vuport_driver = { > + .driver = { > + .name = "intel-vuport", > + .acpi_match_table = ACPI_PTR(vuport_acpi_match), > + }, > + .probe = vuport_probe, > + .remove = vuport_remove, > +}; > + > +module_platform_driver(vuport_driver); > + > +MODULE_AUTHOR("Lu Baolu "); > +MODULE_DESCRIPTION("Intel virtual USB port"); > +MODULE_LICENSE("GPL v2"); -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog