Skip to contentSkip to conversation

gpio: Renesas R-Car GPIO driver V3

PATCH In review Magnus Damm 4 participants 6 messages Mar 26, 2013 – Mar 27, 2013

Subsystems (3)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

PATCH 1/1 gpio: Renesas R-Car GPIO driver V3

From: Magnus Damm <[email protected]>

This patch is V3 of a GPIO driver for the R-Car series of SoCs from Renesas. This driver is designed to be reusable between multiple SoCs that share the same basic building block, but so far it has only been used on R-Car H1 (r8a7779).

Each driver instance handles 32 GPIOs with individually maskable IRQs. The driver operates on a single I/O memory range and the 32 GPIOs are hooked up a single interrupt.

In the case of R-Car H1 either external IRQ pins or GPIOs with interrupts can be used for on-board interupts. For external IRQs 4 pins are supported, and in the case of GPIO there are 202 GPIOS as 202 interrupts hooked up via 6 driver instances and to the GIC and the Cortex-A9 Quad.

At this point this driver is interfacing as a regular platform device driver. In the future DT support will be submitted as an incremental feature patch.

---

Changes since V2:
- Simple merge of [PATCH 00/03] gpio: Renesas R-Car GPIO driver update

Changes since V1:
- Update based on most suggestions from review by Laurent, thanks!

 drivers/gpio/Kconfig                    |    6 
 drivers/gpio/Makefile                   |    1 
 drivers/gpio/gpio-rcar.c                |  373 +++++++++++++++++++++++++++++++
 include/linux/platform_data/gpio-rcar.h |   25 ++
 4 files changed, 405 insertions(+)
drivers/gpio/Kconfig +6 -0
@@ -204,6 +204,12 @@ config GPIO_PXA
 	help
 	  Say yes here to support the PXA GPIO device
 
+config GPIO_RCAR
+	tristate "Renesas R-Car GPIO"
+	depends on ARM
+	help
+	  Say yes here to support GPIO on Renesas R-Car SoCs.
+
 config GPIO_SPEAR_SPICS
 	bool "ST SPEAr13xx SPI Chip Select as GPIO support"
 	depends on PLAT_SPEAR
drivers/gpio/Makefile +1 -0
@@ -57,6 +57,7 @@ obj-$(CONFIG_GPIO_PL061)	+= gpio-pl061.o
 obj-$(CONFIG_GPIO_PXA)		+= gpio-pxa.o
 obj-$(CONFIG_GPIO_RC5T583)	+= gpio-rc5t583.o
 obj-$(CONFIG_GPIO_RDC321X)	+= gpio-rdc321x.o
+obj-$(CONFIG_GPIO_RCAR)		+= gpio-rcar.o
 obj-$(CONFIG_PLAT_SAMSUNG)	+= gpio-samsung.o
 obj-$(CONFIG_ARCH_SA1100)	+= gpio-sa1100.o
 obj-$(CONFIG_GPIO_SCH)		+= gpio-sch.o
drivers/gpio/gpio-rcar.c new file +373 -0

373 lines not on this page · raw message

include/linux/platform_data/gpio-rcar.h new file +25 -0
@@ -0,0 +1,25 @@
+/*
+ * Renesas R-Car GPIO Support
+ *
+ *  Copyright (C) 2013 Magnus Damm
+ *
+ * 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
+ *
+ * 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.
+ */
+
+#ifndef __GPIO_RCAR_H__
+#define __GPIO_RCAR_H__
+
+struct gpio_rcar_config {
+	unsigned int gpio_base;
+	unsigned int irq_base;
+	unsigned int number_of_pins;
+};
+
+#endif /* __GPIO_RCAR_H__ */
Acked-by on v1 1/1
#1 lore raw

Hi Magnus,

Thanks for the patch.

Quoted 17 lines · On Tuesday 26 March 2013 09:23:01 Magnus Damm wrote:

From: Magnus Damm <[email protected]>

This patch is V3 of a GPIO driver for the R-Car series of SoCs from Renesas. This driver is designed to be reusable between multiple SoCs that share the same basic building block, but so far it has only been used on R-Car H1 (r8a7779).

Each driver instance handles 32 GPIOs with individually maskable IRQs. The driver operates on a single I/O memory range and the 32 GPIOs are hooked up a single interrupt.

In the case of R-Car H1 either external IRQ pins or GPIOs with interrupts can be used for on-board interupts. For external IRQs 4 pins are supported, and in the case of GPIO there are 202 GPIOS as 202 interrupts hooked up via 6 driver instances and to the GIC and the Cortex-A9 Quad.

Quoted 5 lines

At this point this driver is interfacing as a regular platform device driver. In the future DT support will be submitted as an incremental feature patch.

I've taken the patch in my tree.

Signature · 3 lines
Regards,

Laurent Pinchart
author maintainer
#2 lore raw

Hi Laurent,

Quoted 12 lines · Laurent Pinchart

Hi Magnus,

Thanks for the patch.

Quoted 6 lines · On Tuesday 26 March 2013 09:23:01 Magnus Damm wrote:

From: Magnus Damm <[email protected]>

This patch is V3 of a GPIO driver for the R-Car series of SoCs from Renesas. This driver is designed to be reusable between multiple SoCs that share the same basic building block, but so far it has only been used on R-Car H1 (r8a7779).

Quoted 5 lines
Quoted 1 line

I've taken the patch in my tree.

That's great, thanks!

/ magnus

#3 lore raw
Quoted 16 lines · Magnus Damm

Hi Laurent,

Quoted 11 lines · Laurent Pinchart

Hi Magnus,

Thanks for the patch.

Quoted 6 lines · On Tuesday 26 March 2013 09:23:01 Magnus Damm wrote:

From: Magnus Damm <[email protected]>

This patch is V3 of a GPIO driver for the R-Car series of SoCs from Renesas. This driver is designed to be reusable between multiple SoCs that share the same basic building block, but so far it has only been used on R-Car H1 (r8a7779).

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

I've taken the patch in my tree.

That's great, thanks!

And in turn I have added it to the pinmux branch of the renesas tree.

Reviewed-by on v1 1/1
#4 lore raw
In reply to Magnus Damm
Quoted 17 lines · Magnus Damm

From: Magnus Damm <[email protected]>

This patch is V3 of a GPIO driver for the R-Car series of SoCs from Renesas. This driver is designed to be reusable between multiple SoCs that share the same basic building block, but so far it has only been used on R-Car H1 (r8a7779).

Each driver instance handles 32 GPIOs with individually maskable IRQs. The driver operates on a single I/O memory range and the 32 GPIOs are hooked up a single interrupt.

In the case of R-Car H1 either external IRQ pins or GPIOs with interrupts can be used for on-board interupts. For external IRQs 4 pins are supported, and in the case of GPIO there are 202 GPIOS as 202 interrupts hooked up via 6 driver instances and to the GIC and the Cortex-A9 Quad.

Quoted 5 lines

At this point this driver is interfacing as a regular platform device driver. In the future DT support will be submitted as an incremental feature patch.

Gorgeous driver.

Yours,
Linus Walleij

author maintainer
#5 lore raw
Quoted 19 lines · Linus Walleij
Quoted 17 lines · Magnus Damm

From: Magnus Damm <[email protected]>

This patch is V3 of a GPIO driver for the R-Car series of SoCs from Renesas. This driver is designed to be reusable between multiple SoCs that share the same basic building block, but so far it has only been used on R-Car H1 (r8a7779).

Each driver instance handles 32 GPIOs with individually maskable IRQs. The driver operates on a single I/O memory range and the 32 GPIOs are hooked up a single interrupt.

In the case of R-Car H1 either external IRQ pins or GPIOs with interrupts can be used for on-board interupts. For external IRQs 4 pins are supported, and in the case of GPIO there are 202 GPIOS as 202 interrupts hooked up via 6 driver instances and to the GIC and the Cortex-A9 Quad.

Quoted 8 lines
Quoted 5 lines

At this point this driver is interfacing as a regular platform device driver. In the future DT support will be submitted as an incremental feature patch.

Gorgeous driver.

Thanks! This particular GPIO hardware block hasn't been around for so long so it's still not spoiled by special cases like the PFC or INTC stuff.

Cheers,

/ magnus