From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751791AbbLUS25 (ORCPT ); Mon, 21 Dec 2015 13:28:57 -0500 Received: from mail-yk0-f177.google.com ([209.85.160.177]:34760 "EHLO mail-yk0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751342AbbLUS2w convert rfc822-to-8bit (ORCPT ); Mon, 21 Dec 2015 13:28:52 -0500 MIME-Version: 1.0 In-Reply-To: <20151221151904.GA23780@sudip-pc> References: <1450617891-26167-1-git-send-email-sudipm.mukherjee@gmail.com> <20151220164353.6ef29f77@lxorguk.ukuu.org.uk> <20151220172841.GB8471@sudip-laptop> <20151220174208.1447d2f3@lxorguk.ukuu.org.uk> <20151221151904.GA23780@sudip-pc> Date: Mon, 21 Dec 2015 20:28:51 +0200 Message-ID: Subject: Re: [PATCH v3] serial: 8250: add gpio support to exar From: Andy Shevchenko To: Sudip Mukherjee Cc: One Thousand Gnomes , Greg Kroah-Hartman , Jiri Slaby , "linux-kernel@vger.kernel.org" , "linux-serial@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 21, 2015 at 5:19 PM, Sudip Mukherjee wrote: > diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig > index 6412f14..ec3d287 100644 > --- a/drivers/tty/serial/8250/Kconfig > +++ b/drivers/tty/serial/8250/Kconfig > @@ -378,3 +378,11 @@ config SERIAL_8250_MID > Selecting this option will enable handling of the extra features > present on the UART found on Intel Medfield SOC and various other > Intel platforms. > + > +config SERIAL_8250_EXAR_GPIO > + bool "Support for GPIO pins on XR17V352/354/358" > + depends on SERIAL_8250_PCI && GPIOLIB > + select GPIO_SYSFS > + help > + Selecting this option will enable handling of GPIO pins present > + on Exar XR17V352/354/358 chips. > diff --git a/drivers/tty/serial/8250/Makefile b/drivers/tty/serial/8250/Makefile > index e177f86..1d0fce0 100644 > --- a/drivers/tty/serial/8250/Makefile > +++ b/drivers/tty/serial/8250/Makefile > @@ -28,5 +28,8 @@ obj-$(CONFIG_SERIAL_8250_MT6577) += 8250_mtk.o > obj-$(CONFIG_SERIAL_8250_UNIPHIER) += 8250_uniphier.o > obj-$(CONFIG_SERIAL_8250_INGENIC) += 8250_ingenic.o > obj-$(CONFIG_SERIAL_8250_MID) += 8250_mid.o > +obj-$(CONFIG_SERIAL_8250_EXAR_GPIO) += exar_gpio.o > +exar_gpio-y := 8250_pci.o 8250_gpio.o > + > > CFLAGS_8250_ingenic.o += -I$(srctree)/scripts/dtc/libfdt > > > But I am getting: > ERROR: "xr17v35x_gpio_exit" [drivers/tty/serial/8250/8250_pci.ko] undefined! > ERROR: "xr17v35x_gpio_init" [drivers/tty/serial/8250/8250_pci.ko] undefined! > > I will need little hint for the Makefile, please. Its clear that i have > messed up. Yes, read my previous mail. There are at least two approaches: - use 8250_pci, etc as a library (see example: 8250_mid.c) - force 8250_pci to use external libraries in some cases (seems your approach) In the latter you have to extend 8250_pci and rename it. I have no idea if Greg or anyone else gives a green light for that. Something like this (forget syntax of ifs in Makefile though obj-(…8250_PCI) += 8250_pci.o obj-8250_pci = 8250_pci_orig.o ifneq (…EXAR_GPIO,) obj-8250_pci += exar_gpio.o endif But what I can recommend is to split exar parts out of 8250_pci first to a separate driver, do your part as a part of that new driver. Of course better to gather maintainer's opinion first. -- With Best Regards, Andy Shevchenko