Skip to contentSkip to conversation

Introduce Intel Tangier GPIO driver

PATCH In review Raag Jadav 2 participants 6 messages Feb 16, 2023

Subsystems (3)
lore
Share & tools
lore

Raag Jadav

author
#0 lore raw

cover Introduce Intel Tangier GPIO driver

Multiple Intel platforms started using similar GPIO controllers. There was a need to develop a common library driver. Intel Tangier implements the common GPIO functionalities for Elkhart Lake and Merrifield platforms.

This patch set introduces:

1. Intel Tangier driver that supports the common GPIO functionalities for Elkhart Lake and Merrifield platforms.

2. Intel Tangier adaptation for Merrifield GPIO driver.

3. GPIO driver for Elkhart Lake PSE GPIO IP.

Pandith N (3):
gpio: tangier: Introduce tangier gpio driver
gpio: merrifield: Adapt to tangier driver
gpio: elkhartlake: Introduce Elkhart Lake PSE GPIO

 MAINTAINERS                     |   2 +
 drivers/gpio/Kconfig            |  24 +-
 drivers/gpio/Makefile           |   2 +
 drivers/gpio/gpio-elkhartlake.c |  94 ++++++
 drivers/gpio/gpio-merrifield.c  | 444 ++--------------------------
 drivers/gpio/gpio-tangier.c     | 505 ++++++++++++++++++++++++++++++++
 drivers/gpio/gpio-tangier.h     | 120 ++++++++
 7 files changed, 776 insertions(+), 415 deletions(-)
 create mode 100644 drivers/gpio/gpio-elkhartlake.c
 create mode 100644 drivers/gpio/gpio-tangier.c
 create mode 100644 drivers/gpio/gpio-tangier.h
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/3 gpio: tangier: Introduce tangier gpio driver

From: Pandith N <[email protected]>

Intel Elkhart Lake and Merrifield platforms have same GPIO IP. Intel Tangier implements the common GPIO functionalities for both Elkhart Lake and Merrifield platforms.

---
 MAINTAINERS                 |   1 +
 drivers/gpio/Kconfig        |   8 +
 drivers/gpio/Makefile       |   1 +
 drivers/gpio/gpio-tangier.c | 505 ++++++++++++++++++++++++++++++++++++
 drivers/gpio/gpio-tangier.h | 110 ++++++++
 5 files changed, 625 insertions(+)
 create mode 100644 drivers/gpio/gpio-tangier.c
 create mode 100644 drivers/gpio/gpio-tangier.h
MAINTAINERS +1 -0
index 7f86d02cb427..3e9d42b2747d 100644
@@ -10395,6 +10395,7 @@ F:	drivers/gpio/gpio-ml-ioh.c
 F:	drivers/gpio/gpio-pch.c
 F:	drivers/gpio/gpio-sch.c
 F:	drivers/gpio/gpio-sodaville.c
+F:	drivers/gpio/gpio-tangier.c
 
 INTEL GVT-g DRIVERS (Intel GPU Virtualization)
 M:	Zhenyu Wang <[email protected]>
drivers/gpio/Kconfig +8 -0
index ec7cfd4f52b1..952afd4e28b6 100644
@@ -626,6 +626,14 @@ config GPIO_SYSCON
 	help
 	  Say yes here to support GPIO functionality though SYSCON driver.
 
+config GPIO_TANGIER
+	tristate
+	select GPIOLIB_IRQCHIP
+	help
+	  GPIO support for Intel Tangier and compatible platforms.
+
+	  If built as a module its name will be gpio-tangier.
+
 config GPIO_TB10X
 	bool
 	select GPIO_GENERIC
drivers/gpio/Makefile +1 -0
index 010587025fc8..a6cea9d2c973 100644
@@ -146,6 +146,7 @@ obj-$(CONFIG_GPIO_SPRD)			+= gpio-sprd.o
 obj-$(CONFIG_GPIO_STMPE)		+= gpio-stmpe.o
 obj-$(CONFIG_GPIO_STP_XWAY)		+= gpio-stp-xway.o
 obj-$(CONFIG_GPIO_SYSCON)		+= gpio-syscon.o
+obj-$(CONFIG_GPIO_TANGIER)		+= gpio-tangier.o
 obj-$(CONFIG_GPIO_TB10X)		+= gpio-tb10x.o
 obj-$(CONFIG_GPIO_TC3589X)		+= gpio-tc3589x.o
 obj-$(CONFIG_GPIO_TEGRA186)		+= gpio-tegra186.o
drivers/gpio/gpio-tangier.c new file +505 -0

505 lines not on this page · raw message

drivers/gpio/gpio-tangier.h new file +110 -0

110 lines not on this page · raw message

Signature · 1 line
2.17.1
author
#2 lore raw

PATCH 2/3 gpio: merrifield: Adapt to tangier driver

In reply to Raag Jadav

From: Pandith N <[email protected]>

Make use of Intel Tangier as a library driver for Merrifield.

---
 drivers/gpio/Kconfig           |   4 +-
 drivers/gpio/gpio-merrifield.c | 444 +++------------------------------
 drivers/gpio/gpio-tangier.h    |   5 +
 3 files changed, 38 insertions(+), 415 deletions(-)
drivers/gpio/Kconfig +3 -1
index 952afd4e28b6..7fc7a2768705 100644
@@ -631,6 +631,8 @@ config GPIO_TANGIER
 	select GPIOLIB_IRQCHIP
 	help
 	  GPIO support for Intel Tangier and compatible platforms.
+	  Currently supported:
+	   - Merrifield
 
 	  If built as a module its name will be gpio-tangier.
 
@@ -1524,7 +1526,7 @@ config GPIO_BT8XX
 config GPIO_MERRIFIELD
 	tristate "Intel Merrifield GPIO support"
 	depends on X86_INTEL_MID
-	select GPIOLIB_IRQCHIP
+	select GPIO_TANGIER
 	help
 	  Say Y here to support Intel Merrifield GPIO.
 
drivers/gpio/gpio-merrifield.c +30 -414

502 lines not on this page · raw message

drivers/gpio/gpio-tangier.h +5 -0
index 4850af012f17..414530c60c5a 100644
@@ -18,6 +18,11 @@
 
 struct device;
 
+/* Merrifield specific wake registers */
+#define GWMR_MRFLD	0x400	/* Wake mask */
+#define GWSR_MRFLD	0x418	/* Wake source */
+#define GSIR_MRFLD	0xc00	/* Secure input */
+
 #define GPIO_PINRANGE(gstart, gend, pstart)		\
 	{						\
 		.gpio_base = (gstart),			\
Signature · 1 line
2.17.1
#3 lore raw

Re: [PATCH v1 2/3] gpio: merrifield: Adapt to tangier driver

Quoted 3 lines · Raag Jadav

From: Pandith N <[email protected]>

Make use of Intel Tangier as a library driver for Merrifield.

...

drivers/gpio/gpio-merrifield.c static struct pci_driver mrfld_gpio_driver = { · line 148

Quoted 2 lines
drivers/gpio/gpio-merrifield.c +1 -1
-MODULE_LICENSE("GPL v2");
+MODULE_LICENSE("GPL");

Stray change.
No need to resend, it can be fixed when applying.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author
#4 lore raw

PATCH 3/3 gpio: elkhartlake: Introduce Elkhart Lake PSE GPIO

In reply to Raag Jadav

From: Pandith N <[email protected]>

This driver adds support for Elkhart Lake PSE GPIO controller, using Intel Tangier as a library driver.

---
 MAINTAINERS                     |  1 +
 drivers/gpio/Kconfig            | 12 +++++
 drivers/gpio/Makefile           |  1 +
 drivers/gpio/gpio-elkhartlake.c | 94 +++++++++++++++++++++++++++++++++
 drivers/gpio/gpio-tangier.h     |  5 ++
 5 files changed, 113 insertions(+)
 create mode 100644 drivers/gpio/gpio-elkhartlake.c
MAINTAINERS +1 -0
index 3e9d42b2747d..aec1a2040f32 100644
@@ -10389,6 +10389,7 @@ M:	Andy Shevchenko <[email protected]>
 L:	[email protected]
 S:	Supported
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git
+F:	drivers/gpio/gpio-elkhartlake.c
 F:	drivers/gpio/gpio-ich.c
 F:	drivers/gpio/gpio-merrifield.c
 F:	drivers/gpio/gpio-ml-ioh.c
drivers/gpio/Kconfig +12 -0
index 7fc7a2768705..c60066d4cd72 100644
@@ -242,6 +242,17 @@ config GPIO_DWAPB
 	  Say Y or M here to build support for the Synopsys DesignWare APB
 	  GPIO block.
 
+config GPIO_ELKHARTLAKE
+	tristate "Intel Elkhart Lake PSE GPIO support"
+	depends on (X86 && ACPI) || COMPILE_TEST
+	select GPIO_TANGIER
+	help
+	  Select this option to enable GPIO support for Intel Elkhart Lake
+	  PSE GPIO IP.
+
+	  To compile this driver as a module, choose M here: the module will
+	  be called gpio-elkhartlake.
+
 config GPIO_EIC_SPRD
 	tristate "Spreadtrum EIC support"
 	depends on ARCH_SPRD || COMPILE_TEST
@@ -632,6 +643,7 @@ config GPIO_TANGIER
 	help
 	  GPIO support for Intel Tangier and compatible platforms.
 	  Currently supported:
+	   - Elkhart Lake
 	   - Merrifield
 
 	  If built as a module its name will be gpio-tangier.
drivers/gpio/Makefile +1 -0
index a6cea9d2c973..8c34d5e39eb8 100644
@@ -54,6 +54,7 @@ obj-$(CONFIG_GPIO_DAVINCI)		+= gpio-davinci.o
 obj-$(CONFIG_GPIO_DLN2)			+= gpio-dln2.o
 obj-$(CONFIG_GPIO_DWAPB)		+= gpio-dwapb.o
 obj-$(CONFIG_GPIO_EIC_SPRD)		+= gpio-eic-sprd.o
+obj-$(CONFIG_GPIO_ELKHARTLAKE)		+= gpio-elkhartlake.o
 obj-$(CONFIG_GPIO_EM)			+= gpio-em.o
 obj-$(CONFIG_GPIO_EN7523)		+= gpio-en7523.o
 obj-$(CONFIG_GPIO_EP93XX)		+= gpio-ep93xx.o
drivers/gpio/gpio-elkhartlake.c new file +94 -0

94 lines not on this page · raw message

drivers/gpio/gpio-tangier.h +5 -0
index 414530c60c5a..6390a14ed9de 100644
@@ -18,6 +18,11 @@
 
 struct device;
 
+/* Elkhart Lake specific wake registers */
+#define GWMR_EHL	0x100	/* Wake mask */
+#define GWSR_EHL	0x118	/* Wake source */
+#define GSIR_EHL	0x130	/* Secure input */
+
 /* Merrifield specific wake registers */
 #define GWMR_MRFLD	0x400	/* Wake mask */
 #define GWSR_MRFLD	0x418	/* Wake source */
Signature · 1 line
2.17.1
#5 lore raw
In reply to Raag Jadav
Quoted 5 lines · Raag Jadav

Multiple Intel platforms started using similar GPIO controllers. There was a need to develop a common library driver. Intel Tangier implements the common GPIO functionalities for Elkhart Lake and Merrifield platforms.

Quoted 8 lines

This patch set introduces:

1. Intel Tangier driver that supports the common GPIO functionalities for Elkhart Lake and Merrifield platforms.

2. Intel Tangier adaptation for Merrifield GPIO driver.

3. GPIO driver for Elkhart Lake PSE GPIO IP.

Thank you!

I will apply this locally and it will be part of Linux Next after v6.3-rc1 is out.

Signature · 2 lines
With Best Regards,
Andy Shevchenko