All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Gallagher <greg@embeddedgreg.com>
To: xenomai@xenomai.org
Subject: [Xenomai] [PATCH 3/3] Allow for more then one rt gpio driver to be built and loaded at the same build
Date: Thu,  1 Feb 2018 21:23:04 -0500	[thread overview]
Message-ID: <1517538184-25673-3-git-send-email-greg@embeddedgreg.com> (raw)
In-Reply-To: <1517538184-25673-1-git-send-email-greg@embeddedgreg.com>

Some SOCs will have two GPIO chips that require two independent drivers.  In my
case I was working with the Zynq SOC and needed a driver for the gpios on the
FPGA and a driver for the gpios available on the ARM core. This change allows
for two rt gpio drivers to be built and loaded at the same time.
The rt gpio driver will be renamed from xeno-gpio to the following:

xeno-gpio-bcm2835.ko
xeno-gpio-mxc.ko
xeno-gpio-sun8i-h3.ko
xeno-gpio-zynq7000.ko

This also moves the gpio-core logic into the kernel image.
---
 kernel/drivers/gpio/Kconfig  | 12 ++++++------
 kernel/drivers/gpio/Makefile | 22 ++++++++++++----------
 2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/kernel/drivers/gpio/Kconfig b/kernel/drivers/gpio/Kconfig
index b7efa54..48475f2 100644
--- a/kernel/drivers/gpio/Kconfig
+++ b/kernel/drivers/gpio/Kconfig
@@ -1,7 +1,7 @@
 menu "Real-time GPIO drivers"
 
 config XENO_DRIVERS_GPIO
-       tristate "GPIO controller"
+       bool "GPIO controller"
        depends on GPIOLIB
        help
 
@@ -11,7 +11,7 @@ if XENO_DRIVERS_GPIO
 
 config XENO_DRIVERS_GPIO_BCM2835
 	depends on MACH_BCM2708 || ARCH_BCM2835
-	bool "Support for BCM2835 GPIOs"
+	tristate "Support for BCM2835 GPIOs"
 	help
 
 	Enables support for the GPIO controller available from
@@ -19,7 +19,7 @@ config XENO_DRIVERS_GPIO_BCM2835
 
 config XENO_DRIVERS_GPIO_MXC
 	depends on GPIO_MXC
-	bool "Support for MXC GPIOs"
+	tristate "Support for MXC GPIOs"
 	help
 
 	Suitable for the GPIO controller available from
@@ -27,7 +27,7 @@ config XENO_DRIVERS_GPIO_MXC
 
 config XENO_DRIVERS_GPIO_SUN8I_H3
 	depends on MACH_SUN8I && PINCTRL_SUN8I_H3
-	bool "Support for SUN8I H3 GPIOs"
+	tristate "Support for SUN8I H3 GPIOs"
 	help
 
 	Suitable for the GPIO controller available from Allwinner's H3
@@ -35,7 +35,7 @@ config XENO_DRIVERS_GPIO_SUN8I_H3
 
 config XENO_DRIVERS_GPIO_ZYNQ7000
 	depends on ARCH_ZYNQ
-	bool "Support for Zynq7000 GPIOs"
+	tristate "Support for Zynq7000 GPIOs"
 	help
 
 	Enables support for the GPIO controller available from
@@ -43,7 +43,7 @@ config XENO_DRIVERS_GPIO_ZYNQ7000
 
 config XENO_DRIVERS_GPIO_XILINX
 	depends on ARCH_ZYNQ
-	bool "Support for Xilinx GPIOs"
+	tristate "Support for Xilinx GPIOs"
 	help
 
 	Enables support for the GPIO controller available from
diff --git a/kernel/drivers/gpio/Makefile b/kernel/drivers/gpio/Makefile
index 3737330..8648fcc 100644
--- a/kernel/drivers/gpio/Makefile
+++ b/kernel/drivers/gpio/Makefile
@@ -1,12 +1,14 @@
 ccflags-$(CONFIG_XENO_DRIVERS_GPIO_DEBUG) := -DDEBUG
 
-obj-$(CONFIG_XENO_DRIVERS_GPIO) += xeno_gpio.o
-
-xeno_gpio-y := gpio-core.o
-
-xeno_gpio-$(CONFIG_XENO_DRIVERS_GPIO_BCM2835) += gpio-bcm2835.o
-xeno_gpio-$(CONFIG_XENO_DRIVERS_GPIO_MXC) += gpio-mxc.o
-xeno_gpio-$(CONFIG_XENO_DRIVERS_GPIO_SUN8I_H3) += gpio-sun8i-h3.o
-xeno_gpio-$(CONFIG_XENO_DRIVERS_GPIO_ZYNQ7000) += gpio-zynq7000.o
-xeno_gpio-$(CONFIG_XENO_DRIVERS_GPIO_XILINX) += gpio-xilinx.o
-
+obj-$(CONFIG_XENO_DRIVERS_GPIO_BCM2835) += xeno-gpio-bcm2835.o
+obj-$(CONFIG_XENO_DRIVERS_GPIO_MXC) += xeno-gpio-mxc.o
+obj-$(CONFIG_XENO_DRIVERS_GPIO_SUN8I_H3) += xeno-gpio-sun8i-h3.o
+obj-$(CONFIG_XENO_DRIVERS_GPIO_ZYNQ7000) += xeno-gpio-zynq7000.o
+obj-$(CONFIG_XENO_DRIVERS_GPIO_XILINX) += xeno-gpio-xilinx.o
+obj-$(CONFIG_XENO_DRIVERS_GPIO) += gpio-core.o
+
+xeno-gpio-bcm2835-y := gpio-bcm2835.o
+xeno-gpio-mxc-y := gpio-mxc.o
+xeno-gpio-sun8i-h3-y := gpio-sun8i-h3.o
+xeno-gpio-zynq7000-y := gpio-zynq7000.o
+xeno-gpio-xilinx-y := gpio-xilinx.o
-- 
2.7.4



  parent reply	other threads:[~2018-02-02  2:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02  2:23 [Xenomai] [PATCH 1/3] Add Xilinx AXI gpio driver Greg Gallagher
2018-02-02  2:23 ` [Xenomai] [PATCH 2/3] Handle device paths from the device tree that start with a forward slash Greg Gallagher
2018-02-02  2:23 ` Greg Gallagher [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-01-31  2:36 [Xenomai] [PATCH 1/3] Add Xilinx AXI gpio driver Greg Gallagher
2018-01-31  2:36 ` [Xenomai] [PATCH 3/3] Allow for more then one rt gpio driver to be built and loaded at the same build Greg Gallagher
2018-02-01 10:30   ` Philippe Gerum
2018-02-01 15:20     ` Greg Gallagher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1517538184-25673-3-git-send-email-greg@embeddedgreg.com \
    --to=greg@embeddedgreg.com \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.