Skip to contentSkip to conversation

pinctrl: Add pinctrl-s3c24xx driver

PATCH Superseded Heiko Stübner 2 participants 4 messages May 3, 2013 – May 11, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 pinctrl: Add pinctrl-s3c24xx driver

The s3c24xx pins follow a similar pattern as the other Samsung SoCs and can therefore reuse the already introduced infrastructure.

The s3c24xx SoCs have one design oddity in that the first 4 external interrupts do not reside in the eint pending register but in the main interrupt controller instead. We solve this by forwarding the external interrupt from the main controller into the irq domain of the pin bank. The masking/acking of these interrupts is handled in the same way.

Furthermore the S3C2412/2413 SoCs contain another oddity in that they keep the same 4 eints in the main interrupt controller and eintpend register and requiring ack operations to happen in both. This is solved by using different compatible properties for the wakeup eint node which set a property accordingly.

---
changes since v4:
- fix wrong s3c2413 naming
between s3c2412 and s3c2413, the s3c2412 is the base type. Till v4 the naming was mixed up, with parts being labeled as s3c2412* and others as s3c2413*. Fix this by renaming the s3c2413* parts to s3c2412. No functional changes.

changes since v3:
- address comments from Sylwester Nawrocki:
(typos, wrong comments, etc)

changes since v2:
- address more comments from Tomasz Figa:
* remove obsolete ctrl_type references
* remove redundant check for parent_chip
* update docs and commit message

changes since v1:
- address comments from Tomasz Figa:
* split handling functions for eints 0-3 for s3c2412 and all others
* change the handling for s3c2412 eints 0-3 in that they now use chained_irq_* for the outer parent interrupt

 .../bindings/pinctrl/samsung-pinctrl.txt           |    8 +
 drivers/gpio/gpio-samsung.c                        |    4 +
 drivers/pinctrl/Kconfig                            |    5 +
 drivers/pinctrl/Makefile                           |    1 +
 drivers/pinctrl/pinctrl-s3c24xx.c                  |  652 ++++++++++++++++++++
 drivers/pinctrl/pinctrl-samsung.c                  |   10 +
 drivers/pinctrl/pinctrl-samsung.h                  |    4 +
 7 files changed, 684 insertions(+), 0 deletions(-)
 create mode 100644 drivers/pinctrl/pinctrl-s3c24xx.c
Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt +8 -0
index c70fca1..dc50c7e 100644
@@ -7,6 +7,10 @@ on-chip controllers onto these pads.
 
 Required Properties:
 - compatible: should be one of the following.
+  - "samsung,s3c2412-pinctrl": for S3C2412-compatible pin-controller,
+  - "samsung,s3c2416-pinctrl": for S3C2416-compatible pin-controller,
+  - "samsung,s3c2440-pinctrl": for S3C2440-compatible pin-controller,
+  - "samsung,s3c2450-pinctrl": for S3C2450-compatible pin-controller,
   - "samsung,s3c64xx-pinctrl": for S3C64xx-compatible pin-controller,
   - "samsung,exynos4210-pinctrl": for Exynos4210 compatible pin-controller.
   - "samsung,exynos4x12-pinctrl": for Exynos4x12 compatible pin-controller.
@@ -106,6 +110,10 @@ B. External Wakeup Interrupts: For supporting external wakeup interrupts, a
 
    - compatible: identifies the type of the external wakeup interrupt controller
      The possible values are:
+     - samsung,s3c2410-wakeup-eint: represents wakeup interrupt controller
+       found on Samsung S3C24xx SoCs except S3C2412 and S3C2413,
+     - samsung,s3c2412-wakeup-eint: represents wakeup interrupt controller
+       found on Samsung S3C2412 and S3C2413 SoCs,
      - samsung,s3c64xx-wakeup-eint: represents wakeup interrupt controller
        found on Samsung S3C64xx SoCs,
      - samsung,exynos4210-wakeup-eint: represents wakeup interrupt controller
drivers/gpio/gpio-samsung.c +4 -0
index dc06a6f..73017b9 100644
@@ -3026,6 +3026,10 @@ static __init int samsung_gpiolib_init(void)
 	*/
 	struct device_node *pctrl_np;
 	static const struct of_device_id exynos_pinctrl_ids[] = {
+		{ .compatible = "samsung,s3c2412-pinctrl", },
+		{ .compatible = "samsung,s3c2416-pinctrl", },
+		{ .compatible = "samsung,s3c2440-pinctrl", },
+		{ .compatible = "samsung,s3c2450-pinctrl", },
 		{ .compatible = "samsung,s3c64xx-pinctrl", },
 		{ .compatible = "samsung,exynos4210-pinctrl", },
 		{ .compatible = "samsung,exynos4x12-pinctrl", },
drivers/pinctrl/Kconfig +5 -0
index 7402ac9..58d73ac 100644
@@ -226,6 +226,11 @@ config PINCTRL_EXYNOS5440
 	select PINMUX
 	select PINCONF
 
+config PINCTRL_S3C24XX
+	bool "Samsung S3C24XX SoC pinctrl driver"
+	depends on ARCH_S3C24XX
+	select PINCTRL_SAMSUNG
+
 config PINCTRL_S3C64XX
 	bool "Samsung S3C64XX SoC pinctrl driver"
 	depends on ARCH_S3C64XX
drivers/pinctrl/Makefile +1 -0
index 21d34c2..1ccdfd8 100644
@@ -45,6 +45,7 @@ obj-$(CONFIG_PINCTRL_COH901)	+= pinctrl-coh901.o
 obj-$(CONFIG_PINCTRL_SAMSUNG)	+= pinctrl-samsung.o
 obj-$(CONFIG_PINCTRL_EXYNOS)	+= pinctrl-exynos.o
 obj-$(CONFIG_PINCTRL_EXYNOS5440)	+= pinctrl-exynos5440.o
+obj-$(CONFIG_PINCTRL_S3C24XX)	+= pinctrl-s3c24xx.o
 obj-$(CONFIG_PINCTRL_S3C64XX)	+= pinctrl-s3c64xx.o
 obj-$(CONFIG_PINCTRL_XWAY)	+= pinctrl-xway.o
 obj-$(CONFIG_PINCTRL_LANTIQ)	+= pinctrl-lantiq.o
drivers/pinctrl/pinctrl-s3c24xx.c new file +652 -0

652 lines not on this page · raw message

drivers/pinctrl/pinctrl-samsung.c +10 -0
index e836135..234c32f 100644
@@ -977,6 +977,16 @@ static const struct of_device_id samsung_pinctrl_dt_match[] = {
 	{ .compatible = "samsung,s3c64xx-pinctrl",
 		.data = s3c64xx_pin_ctrl },
 #endif
+#ifdef CONFIG_PINCTRL_S3C24XX
+	{ .compatible = "samsung,s3c2412-pinctrl",
+		.data = s3c2412_pin_ctrl },
+	{ .compatible = "samsung,s3c2416-pinctrl",
+		.data = s3c2416_pin_ctrl },
+	{ .compatible = "samsung,s3c2440-pinctrl",
+		.data = s3c2440_pin_ctrl },
+	{ .compatible = "samsung,s3c2450-pinctrl",
+		.data = s3c2450_pin_ctrl },
+#endif
 	{},
 };
 MODULE_DEVICE_TABLE(of, samsung_pinctrl_dt_match);
drivers/pinctrl/pinctrl-samsung.h +4 -0
index 7c7f9eb..c79d634 100644
@@ -246,5 +246,9 @@ extern struct samsung_pin_ctrl exynos4210_pin_ctrl[];
 extern struct samsung_pin_ctrl exynos4x12_pin_ctrl[];
 extern struct samsung_pin_ctrl exynos5250_pin_ctrl[];
 extern struct samsung_pin_ctrl s3c64xx_pin_ctrl[];
+extern struct samsung_pin_ctrl s3c2412_pin_ctrl[];
+extern struct samsung_pin_ctrl s3c2416_pin_ctrl[];
+extern struct samsung_pin_ctrl s3c2440_pin_ctrl[];
+extern struct samsung_pin_ctrl s3c2450_pin_ctrl[];
 
 #endif /* __PINCTRL_SAMSUNG_H */
Signature · 1 line
1.7.2.3
#1 lore raw

PATCH v5 1/1 pinctrl: Add pinctrl-s3c24xx driver

Quoted 16 lines · Heiko St?bner

The s3c24xx pins follow a similar pattern as the other Samsung SoCs and can therefore reuse the already introduced infrastructure.

The s3c24xx SoCs have one design oddity in that the first 4 external interrupts do not reside in the eint pending register but in the main interrupt controller instead. We solve this by forwarding the external interrupt from the main controller into the irq domain of the pin bank. The masking/acking of these interrupts is handled in the same way.

Furthermore the S3C2412/2413 SoCs contain another oddity in that they keep the same 4 eints in the main interrupt controller and eintpend register and requiring ack operations to happen in both. This is solved by using different compatible properties for the wakeup eint node which set a property accordingly.

Quoted 4 lines

Looks good to me.

Linus, if you want me to take into samsung tree, please let me know.

Thanks.

- Kukjin

Quoted 34 lines

---
changes since v4:
- fix wrong s3c2413 naming
between s3c2412 and s3c2413, the s3c2412 is the base type. Till v4 the naming was mixed up, with parts being labeled as s3c2412* and others as s3c2413*. Fix this by renaming the s3c2413* parts to s3c2412. No functional changes.

changes since v3:
- address comments from Sylwester Nawrocki:
(typos, wrong comments, etc)

changes since v2:
- address more comments from Tomasz Figa:
* remove obsolete ctrl_type references
* remove redundant check for parent_chip
* update docs and commit message

changes since v1:
- address comments from Tomasz Figa:
* split handling functions for eints 0-3 for s3c2412 and all others
* change the handling for s3c2412 eints 0-3 in that they now use chained_irq_* for the outer parent interrupt

 .../bindings/pinctrl/samsung-pinctrl.txt           |    8 +
 drivers/gpio/gpio-samsung.c                        |    4 +
 drivers/pinctrl/Kconfig                            |    5 +
 drivers/pinctrl/Makefile                           |    1 +
 drivers/pinctrl/pinctrl-s3c24xx.c                  |  652 ++++++++++++++++++++
 drivers/pinctrl/pinctrl-samsung.c                  |   10 +
 drivers/pinctrl/pinctrl-samsung.h                  |    4 +
 7 files changed, 684 insertions(+), 0 deletions(-)
 create mode 100644 drivers/pinctrl/pinctrl-s3c24xx.c

[...]

#2 lore raw

PATCH v5 1/1 pinctrl: Add pinctrl-s3c24xx driver

Am Freitag, 10. Mai 2013, 02:32:05 schrieb Kukjin Kim:

Quoted 16 lines
Quoted 15 lines · Heiko St?bner

The s3c24xx pins follow a similar pattern as the other Samsung SoCs and can therefore reuse the already introduced infrastructure.

The s3c24xx SoCs have one design oddity in that the first 4 external interrupts do not reside in the eint pending register but in the main interrupt controller instead. We solve this by forwarding the external interrupt from the main controller into the irq domain of the pin bank. The masking/acking of these interrupts is handled in the same way.

Furthermore the S3C2412/2413 SoCs contain another oddity in that they keep the same 4 eints in the main interrupt controller and eintpend register and requiring ack operations to happen in both. This is solved by using different compatible properties for the wakeup eint node which set a property accordingly.

Quoted 8 lines
Quoted 4 lines

Looks good to me.

Linus, if you want me to take into samsung tree, please let me know.

in v4 Linus said:

"Are you taking this through the Samsung tree?"

This would also enable me to put the s3c2416 devicetree support on top of it in this cycle, which of course needs the pinctrl driver.

Heiko

#3 lore raw

PATCH v5 1/1 pinctrl: Add pinctrl-s3c24xx driver

Quoted 30 lines · Heiko St?bner

Am Freitag, 10. Mai 2013, 02:32:05 schrieb Kukjin Kim:

Quoted 2 lines
Quoted 1 line · Heiko St?bner

The s3c24xx pins follow a similar pattern as the other Samsung SoCs

and

Quoted 11 lines
Quoted 11 lines

can therefore reuse the already introduced infrastructure.

The s3c24xx SoCs have one design oddity in that the first 4 external interrupts do not reside in the eint pending register but in the main interrupt controller instead. We solve this by forwarding the external interrupt from the main controller into the irq domain of the pin bank. The masking/acking of these interrupts is handled in the same way.

Furthermore the S3C2412/2413 SoCs contain another oddity in that they keep the same 4 eints in the main interrupt controller and eintpend register and requiring ack operations to happen in both. This is

solved

Quoted 1 line
Quoted 1 line

by using different compatible properties for the wakeup eint node

which

Quoted 10 lines
Quoted 6 lines

set a property accordingly.

Looks good to me.

Linus, if you want me to take into samsung tree, please let me know.

Quoted 8 lines

in v4 Linus said:

"Are you taking this through the Samsung tree?"

This would also enable me to put the s3c2416 devicetree support on top of it
in this cycle, which of course needs the pinctrl driver.

OK, will apply into samsung tree.

Thanks.

- Kukjin