Add RTDM gpio driver for the OMAP family of SOCs
PATCH 1/1 Add RTDM gpio driver for the OMAP family of SOCs
Add new gpio RTDM driver for OMAP family of SOCs, tested on beaglebone black and beaglebone green (AM335x)
Signed-off-by Greg Gallagher <[email protected]>
--- kernel/drivers/gpio/Kconfig | 8 ++++++ kernel/drivers/gpio/Makefile | 2 ++ kernel/drivers/gpio/gpio-omap.c | 43 +++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 kernel/drivers/gpio/gpio-omap.c
kernel/drivers/gpio/Kconfig +8 -0
@@ -49,6 +49,14 @@ config XENO_DRIVERS_GPIO_XILINX Enables support for the GPIO controller available from Xilinx's softcore IP. +config XENO_DRIVERS_GPIO_OMAP + depends on ARCH_OMAP2PLUS || ARCH_OMAP + tristate "Support for OMAP GPIOs" + help + + Enables support for the GPIO controller available from + OMAP family SOC. + config XENO_DRIVERS_GPIO_DEBUG bool "Enable GPIO core debugging features"
kernel/drivers/gpio/Makefile +2 -0
@@ -5,6 +5,7 @@ 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_OMAP) += xeno-gpio-omap.o obj-$(CONFIG_XENO_DRIVERS_GPIO) += gpio-core.o xeno-gpio-bcm2835-y := gpio-bcm2835.o
@@ -12,3 +13,4 @@ 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 +xeno-gpio-omap-y := gpio-omap.o
kernel/drivers/gpio/gpio-omap.c new file +43 -0
43 lines not on this page · raw message
Signature · 1 line
2.17.1
Jan Kiszka
AppliedQuoted 87 lines · Greg Gallagher via Xenomai
Add new gpio RTDM driver for OMAP family of SOCs, tested on beaglebone black and beaglebone green (AM335x)
Signed-off-by Greg Gallagher <[email protected]>--- kernel/drivers/gpio/Kconfig | 8 ++++++ kernel/drivers/gpio/Makefile | 2 ++ kernel/drivers/gpio/gpio-omap.c | 43 +++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+)create mode 100644
kernel/drivers/gpio/gpio-omap.ckernel/drivers/gpio/Kconfig +8
-0@@ -49,6 +49,14 @@ config XENO_DRIVERS_GPIO_XILINX Enables support for the GPIO controller available from Xilinx's softcore IP. +config XENO_DRIVERS_GPIO_OMAP + depends on ARCH_OMAP2PLUS || ARCH_OMAP + tristate "Support for OMAP GPIOs" + help + + Enables support for the GPIO controller available from + OMAP family SOC. + config XENO_DRIVERS_GPIO_DEBUG bool "Enable GPIO core debugging features"kernel/drivers/gpio/Makefile +2
-0@@ -5,6 +5,7 @@ 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_OMAP) += xeno-gpio-omap.o obj-$(CONFIG_XENO_DRIVERS_GPIO) += gpio-core.o xeno-gpio-bcm2835-y := gpio-bcm2835.o@@ -12,3 +13,4 @@ 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 +xeno-gpio-omap-y := gpio-omap.okernel/drivers/gpio/gpio-omap.c new file +33
-0@@ -0,0 +1,43 @@ +/** +* @note Copyright (C) 2020 Greg Gallagher <[email protected]> +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of the +* License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include <linux/module.h> +#include <rtdm/gpio.h> + +#define RTDM_SUBCLASS_OMAP 6 + +static const char *compat_array[] = { +"ti,omap4-gpio" , +"ti,omap3-gpio" , +"ti,omap2-gpio" , +}; + +static int __init omap_gpio_init (void ) +{ +return rtdm_gpiochip_scan_array_of (NULL , compat_array, +ARRAY_SIZE (compat_array), +RTDM_SUBCLASS_OMAP );
kernel/drivers/gpio/gpio-omap.c line 43
Quoted 10 lines
kernel/drivers/gpio/gpio-omap.c new file +10
-0+} +module_init (omap_gpio_init); + +static void __exit omap_gpio_exit(void) +{ +rtdm_gpiochip_remove_of (RTDM_SUBCLASS_OMAP ); +} +module_exit (omap_gpio_exit); + +MODULE_LICENSE ("GPL" );
Thanks, applied to next. Also enabled in CI.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux