Re: [PATCH v2] pinctrl: Add pinctrl-s3c24xx driver
Hi Heiko, As previously, generally looks good to me, but see my comments inline. On Thursday 11 of April 2013 01:16:41 Heiko Stübner wrote: 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. To solve this a ctrl_type enum is introduced which can keep the type of controller Hmm, I think you forgot to edit the commit message, since we decided to replace ctrl_type with another compatible string. in the samsung_pin_ctrl struct for later retrieval. The ctrl_type enum contains only S3C24XX and S3C2412 types, as the eint-speciality is currently the only use-case. But it can be expaned if other SoCs gain special handling requirements later on. Signed-off-by: Heiko Stuebner he...@sntech.de --- 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 OK, so you finally decided to use the way I suggested. Have you managed to do some testing on a S3C2412? .../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 | 664 drivers/pinctrl/pinctrl-samsung.c | 10 + drivers/pinctrl/pinctrl-samsung.h | 16 + 7 files changed, 708 insertions(+), 0 deletions(-) create mode 100644 drivers/pinctrl/pinctrl-s3c24xx.c diff --git a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt index c70fca1..e4443e3 100644 --- a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt @@ -7,6 +7,10 @@ on-chip controllers onto these pads. Required Properties: - compatible: should be one of the following. + - samsung,s3c2413-pinctrl: for S3C64xx-compatible pin-controller, + - samsung,s3c2416-pinctrl: for S3C64xx-compatible pin-controller, + - samsung,s3c2440-pinctrl: for S3C64xx-compatible pin-controller, + - samsung,s3c2450-pinctrl: for S3C64xx-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 diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c index dc06a6f..73017b9 100644 --- a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c @@ -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,s3c2413-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, }, diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index 7402ac9..58d73ac 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -226,6 +226,11 @@ config PINCTRL_EXYNOS5440 select PINMUX select PINCONF +config PINCTRL_S3C24XX + bool Samsung S3C24XX SoC pinctrl driver + depends on
Re: [PATCH v2] pinctrl: Add pinctrl-s3c24xx driver
Am Donnerstag, 11. April 2013, 10:54:45 schrieb Tomasz Figa: Hi Heiko, As previously, generally looks good to me, but see my comments inline. On Thursday 11 of April 2013 01:16:41 Heiko Stübner wrote: 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. To solve this a ctrl_type enum is introduced which can keep the type of controller Hmm, I think you forgot to edit the commit message, since we decided to replace ctrl_type with another compatible string. One should not do these things after midnight :-) [true for most of the other mistakes below too]. in the samsung_pin_ctrl struct for later retrieval. The ctrl_type enum contains only S3C24XX and S3C2412 types, as the eint-speciality is currently the only use-case. But it can be expaned if other SoCs gain special handling requirements later on. Signed-off-by: Heiko Stuebner he...@sntech.de --- 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 OK, so you finally decided to use the way I suggested. Have you managed to do some testing on a S3C2412? Nope, after pondering everything a bit more ... your description just sounded more plausible :-) . I only have access to s3c2416 and s3c2450 boards, so everything else is just done according to datasheets and in the hope of it being correct. S3C2412 is really the only familiy member having the 4 eints in both registers. Also the (reworked) legacy eint code also uses this scheme ... so at least now both are either correct or wrong. We will only know if someone with a s3c2412 comes along at some point :-) . .../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 | 664 drivers/pinctrl/pinctrl-samsung.c | 10 + drivers/pinctrl/pinctrl-samsung.h | 16 + 7 files changed, 708 insertions(+), 0 deletions(-) create mode 100644 drivers/pinctrl/pinctrl-s3c24xx.c diff --git a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt index c70fca1..e4443e3 100644 --- a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt @@ -7,6 +7,10 @@ on-chip controllers onto these pads. Required Properties: - compatible: should be one of the following. + - samsung,s3c2413-pinctrl: for S3C64xx-compatible pin-controller, + - samsung,s3c2416-pinctrl: for S3C64xx-compatible pin-controller, + - samsung,s3c2440-pinctrl: for S3C64xx-compatible pin-controller, + - samsung,s3c2450-pinctrl: for S3C64xx-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 diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c index dc06a6f..73017b9 100644 --- a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c @@ -3026,6 +3026,10 @@ static __init int samsung_gpiolib_init(void) */ struct device_node *pctrl_np;
Re: [PATCH v2] pinctrl: Add pinctrl-s3c24xx driver
On Thursday 11 of April 2013 11:32:03 Heiko Stübner wrote: Am Donnerstag, 11. April 2013, 10:54:45 schrieb Tomasz Figa: Hi Heiko, As previously, generally looks good to me, but see my comments inline. On Thursday 11 of April 2013 01:16:41 Heiko Stübner wrote: 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. To solve this a ctrl_type enum is introduced which can keep the type of controller Hmm, I think you forgot to edit the commit message, since we decided to replace ctrl_type with another compatible string. One should not do these things after midnight :-) [true for most of the other mistakes below too]. in the samsung_pin_ctrl struct for later retrieval. The ctrl_type enum contains only S3C24XX and S3C2412 types, as the eint-speciality is currently the only use-case. But it can be expaned if other SoCs gain special handling requirements later on. Signed-off-by: Heiko Stuebner he...@sntech.de --- 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 OK, so you finally decided to use the way I suggested. Have you managed to do some testing on a S3C2412? Nope, after pondering everything a bit more ... your description just sounded more plausible :-) . I only have access to s3c2416 and s3c2450 boards, so everything else is just done according to datasheets and in the hope of it being correct. S3C2412 is really the only familiy member having the 4 eints in both registers. Also the (reworked) legacy eint code also uses this scheme ... so at least now both are either correct or wrong. We will only know if someone with a s3c2412 comes along at some point :-) . That's why I was wondering whether it is possible to get a board with S3C2412 or 13 somewhere. The Logitech controller would be pretty interesting, but is it still possible to get it? (Btw. Is it mach-jive in the kernel?) Best regards, -- Tomasz Figa Samsung Poland RD Center SW Solution Development, Kernel and System Framework -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] pinctrl: Add pinctrl-s3c24xx driver
Am Donnerstag, 11. April 2013, 11:43:19 schrieb Tomasz Figa: On Thursday 11 of April 2013 11:32:03 Heiko Stübner wrote: Am Donnerstag, 11. April 2013, 10:54:45 schrieb Tomasz Figa: Hi Heiko, As previously, generally looks good to me, but see my comments inline. On Thursday 11 of April 2013 01:16:41 Heiko Stübner wrote: 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. To solve this a ctrl_type enum is introduced which can keep the type of controller Hmm, I think you forgot to edit the commit message, since we decided to replace ctrl_type with another compatible string. One should not do these things after midnight :-) [true for most of the other mistakes below too]. in the samsung_pin_ctrl struct for later retrieval. The ctrl_type enum contains only S3C24XX and S3C2412 types, as the eint-speciality is currently the only use-case. But it can be expaned if other SoCs gain special handling requirements later on. Signed-off-by: Heiko Stuebner he...@sntech.de --- 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 OK, so you finally decided to use the way I suggested. Have you managed to do some testing on a S3C2412? Nope, after pondering everything a bit more ... your description just sounded more plausible :-) . I only have access to s3c2416 and s3c2450 boards, so everything else is just done according to datasheets and in the hope of it being correct. S3C2412 is really the only familiy member having the 4 eints in both registers. Also the (reworked) legacy eint code also uses this scheme ... so at least now both are either correct or wrong. We will only know if someone with a s3c2412 comes along at some point :-) . That's why I was wondering whether it is possible to get a board with S3C2412 or 13 somewhere. The Logitech controller would be pretty interesting, but is it still possible to get it? (Btw. Is it mach-jive in the kernel?) The squeezebox controller is still available in some shops, but the prices their asking (=160 EUR for the controller alone) are in no relation to the age and power of the hardware. And yes they're the jive mach. -- To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2] 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. To solve this a ctrl_type enum is introduced which can keep the type of controller in the samsung_pin_ctrl struct for later retrieval. The ctrl_type enum contains only S3C24XX and S3C2412 types, as the eint-speciality is currently the only use-case. But it can be expaned if other SoCs gain special handling requirements later on. Signed-off-by: Heiko Stuebner he...@sntech.de --- 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 | 664 drivers/pinctrl/pinctrl-samsung.c | 10 + drivers/pinctrl/pinctrl-samsung.h | 16 + 7 files changed, 708 insertions(+), 0 deletions(-) create mode 100644 drivers/pinctrl/pinctrl-s3c24xx.c diff --git a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt index c70fca1..e4443e3 100644 --- a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt @@ -7,6 +7,10 @@ on-chip controllers onto these pads. Required Properties: - compatible: should be one of the following. + - samsung,s3c2413-pinctrl: for S3C64xx-compatible pin-controller, + - samsung,s3c2416-pinctrl: for S3C64xx-compatible pin-controller, + - samsung,s3c2440-pinctrl: for S3C64xx-compatible pin-controller, + - samsung,s3c2450-pinctrl: for S3C64xx-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 diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c index dc06a6f..73017b9 100644 --- a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c @@ -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,s3c2413-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, }, diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index 7402ac9..58d73ac 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -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 diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile index 21d34c2..1ccdfd8 100644 --- a/drivers/pinctrl/Makefile +++ b/drivers/pinctrl/Makefile @@ -45,6 +45,7 @@ obj-$(CONFIG_PINCTRL_COH901) += pinctrl-coh901.o obj-$(CONFIG_PINCTRL_SAMSUNG) +=