All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hongzhan Chen <hongzhan.chen@intel.com>
To: xenomai@xenomai.org
Subject: [PATCH 3/3] driver/gpio: Add Intel Cherryview pinctrl driver
Date: Tue, 31 Aug 2021 01:07:36 -0400	[thread overview]
Message-ID: <20210831050736.5371-4-hongzhan.chen@intel.com> (raw)
In-Reply-To: <20210831050736.5371-1-hongzhan.chen@intel.com>

Add support for Intel Cherryview pin controller driver

Signed-off-by: Hongzhan Chen <hongzhan.chen@intel.com>
---
 kernel/drivers/gpio/Kconfig           |  7 +++++
 kernel/drivers/gpio/Makefile          |  2 ++
 kernel/drivers/gpio/gpio-cherryview.c | 42 +++++++++++++++++++++++++++
 3 files changed, 51 insertions(+)
 create mode 100644 kernel/drivers/gpio/gpio-cherryview.c

diff --git a/kernel/drivers/gpio/Kconfig b/kernel/drivers/gpio/Kconfig
index 44f41688c..c257444f0 100644
--- a/kernel/drivers/gpio/Kconfig
+++ b/kernel/drivers/gpio/Kconfig
@@ -57,6 +57,13 @@ config XENO_DRIVERS_GPIO_OMAP
 	Enables support for the GPIO controller available from
 	OMAP family SOC.
 
+config XENO_DRIVERS_GPIO_CHERRYVIEW
+	depends on PINCTRL_CHERRYVIEW
+	tristate "Support for Cherryview GPIOs"
+	help
+
+	Enables support for the Intel Cherryview GPIO controller
+
 config XENO_DRIVERS_GPIO_DEBUG
        bool "Enable GPIO core debugging features"
 
diff --git a/kernel/drivers/gpio/Makefile b/kernel/drivers/gpio/Makefile
index 7bcf59949..e534eab93 100644
--- a/kernel/drivers/gpio/Makefile
+++ b/kernel/drivers/gpio/Makefile
@@ -6,6 +6,7 @@ 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_CHERRYVIEW) += xeno-gpio-cherryview.o
 obj-$(CONFIG_XENO_DRIVERS_GPIO) += gpio-core.o
 
 xeno-gpio-bcm2835-y := gpio-bcm2835.o
@@ -14,3 +15,4 @@ 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
+xeno-gpio-cherryview-y := gpio-cherryview.o
diff --git a/kernel/drivers/gpio/gpio-cherryview.c b/kernel/drivers/gpio/gpio-cherryview.c
new file mode 100644
index 000000000..524199fe9
--- /dev/null
+++ b/kernel/drivers/gpio/gpio-cherryview.c
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * @note Copyright (C) 2021 Hongzhan Chen <hongzhan.chen@intel.com>
+ *
+ * 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.
+ *
+ */
+#include <linux/module.h>
+#include <rtdm/gpio.h>
+
+#define RTDM_SUBCLASS_CHERRYVIEW  7
+
+static const char *compat_array[] = {
+	"INT33FF:00",
+	"INT33FF:01",
+	"INT33FF:02",
+	"INT33FF:03",
+};
+
+static int __init cherryview_gpio_init(void)
+{
+	return rtdm_gpiochip_array_find(NULL, compat_array,
+					ARRAY_SIZE(compat_array),
+					RTDM_SUBCLASS_CHERRYVIEW);
+}
+module_init(cherryview_gpio_init);
+
+static void __exit cherryview_gpio_exit(void)
+{
+	rtdm_gpiochip_remove(RTDM_SUBCLASS_CHERRYVIEW);
+}
+module_exit(cherryview_gpio_exit);
+
+MODULE_LICENSE("GPL");
-- 
2.17.1



  parent reply	other threads:[~2021-08-31  5:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31  5:07 [PATCH V2 0/3] add support for cherryview gpio controller driver Hongzhan Chen
2021-08-31  5:07 ` [PATCH 1/3] drivers/gpio: core: Move out of OF config conditional compilation Hongzhan Chen
2021-08-31 13:05   ` Jan Kiszka
2021-09-01  1:16     ` Chen, Hongzhan
2021-08-31  5:07 ` [PATCH 2/3] drivers/gpio: core: Introduce helper to find gpiochip Hongzhan Chen
2021-08-31  6:47   ` Jan Kiszka
2021-08-31  7:07     ` Chen, Hongzhan
2021-08-31  7:14       ` Jan Kiszka
2021-08-31  5:07 ` Hongzhan Chen [this message]
2021-08-31  6:51   ` [PATCH 3/3] driver/gpio: Add Intel Cherryview pinctrl driver Jan Kiszka
2021-08-31  7:15 ` [PATCH V2 0/3] add support for cherryview gpio controller driver Jan Kiszka
  -- strict thread matches above, loose matches on Subject: below --
2021-08-30  6:45 [PATCH " Hongzhan Chen
2021-08-30  6:45 ` [PATCH 3/3] driver/gpio: Add Intel Cherryview pinctrl driver Hongzhan Chen

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=20210831050736.5371-4-hongzhan.chen@intel.com \
    --to=hongzhan.chen@intel.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.