Skip to contentSkip to conversation

gpio: davinci: preparation fixes and updates to reuse it for Keystone

PATCH In review Grygorii Strashko 5 participants 10 messages Nov 21, 2013 – Dec 15, 2013

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH 1/2 gpio: davinci: get rid of DAVINCI_N_GPIO

In reply to Grygorii Strashko

Since Davinci GPIO driver is moved to support gpiolib it has to use ARCH_NR_GPIOS (can be configured using CONFIG_ARCH_NR_GPIO Kconfig option) configuration instead of any mach/platform specific options.

Hence, replace private DAVINCI_N_GPIO with common ARCH_NR_GPIOS. This is safe because default value for ARCH_NR_GPIOS=256 and maximum number of supported GPIOs for Davinci is DAVINCI_N_GPIO=144.

More over, this is one of steps to re-use Davinci GPIO driver by other mach/platform.

---
 drivers/gpio/gpio-davinci.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpio/gpio-davinci.c +2 -2
index 1f33fcd..944c819 100644
@@ -160,8 +160,8 @@ static int davinci_gpio_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	if (WARN_ON(DAVINCI_N_GPIO < ngpio))
-		ngpio = DAVINCI_N_GPIO;
+	if (WARN_ON(ARCH_NR_GPIOS < ngpio))
+		ngpio = ARCH_NR_GPIOS;
 
 	chips = devm_kzalloc(dev,
 			     ngpio * sizeof(struct davinci_gpio_controller),
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 2/2 gpio: introduce GPIO_DAVINCI kconfig option

In reply to Grygorii Strashko

The compatible to Davinci GPIO HW block is used by other TI SoCs, like Keystone, where GPIO support is declared as optional.

Hence, introduce GPIO_DAVINCI Kconfig option which will allow to enable Davinci GPIO driver for Keystone SoCs when needed. At same time, kept Davinci GPIO driver enabled for Davinci SoCs by default.

---
 drivers/gpio/Kconfig  |    7 +++++++
 drivers/gpio/Makefile |    2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/gpio/Kconfig +7 -0
index 0f04444..7c75f5a 100644
@@ -115,6 +115,13 @@ config GPIO_CLPS711X
 	help
 	  Say yes here to support GPIO on CLPS711X SoCs.
 
+config GPIO_DAVINCI
+	bool "TI Davinci/Keystone GPIO support"
+	default y if ARCH_DAVINCI
+	depends on ARM && (ARCH_DAVINCI || ARCH_KEYSTONE)
+	help
+	  Say yes here to enable GPIO support for TI Davinci/Keystone SoCs.
+
 config GPIO_GENERIC_PLATFORM
 	tristate "Generic memory-mapped GPIO controller support (MMIO platform device)"
 	select GPIO_GENERIC
drivers/gpio/Makefile +1 -1
index 7971e36..28a0ffc 100644
@@ -22,7 +22,7 @@ obj-$(CONFIG_GPIO_CLPS711X)	+= gpio-clps711x.o
 obj-$(CONFIG_GPIO_CS5535)	+= gpio-cs5535.o
 obj-$(CONFIG_GPIO_DA9052)	+= gpio-da9052.o
 obj-$(CONFIG_GPIO_DA9055)	+= gpio-da9055.o
-obj-$(CONFIG_ARCH_DAVINCI)	+= gpio-davinci.o
+obj-$(CONFIG_GPIO_DAVINCI)	+= gpio-davinci.o
 obj-$(CONFIG_GPIO_EM)		+= gpio-em.o
 obj-$(CONFIG_GPIO_EP93XX)	+= gpio-ep93xx.o
 obj-$(CONFIG_GPIO_F7188X)	+= gpio-f7188x.o
Signature · 1 line
1.7.9.5
#0 lore raw

cover gpio: davinci: preparation fixes and updates to reuse it for Keystone

This series is a preparation step for reusing Davinci GPIO driver for Keystone SoCs.
And it's been created in order to break the strict dependency of Davinci GPIO driver from Davinci platform code.

Based on patch:
http://www.spinics.net/lists/kernel/msg1632405.html

Grygorii Strashko (2):
gpio: davinci: get rid of DAVINCI_N_GPIO
gpio: introduce GPIO_DAVINCI kconfig option

 drivers/gpio/Kconfig        |    7 +++++++
 drivers/gpio/Makefile       |    2 +-
 drivers/gpio/gpio-davinci.c |    4 ++--
 3 files changed, 10 insertions(+), 3 deletions(-)
Signature · 1 line
1.7.9.5
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] gpio: davinci: get rid of DAVINCI_N_GPIO

In reply to Grygorii Strashko
Quoted 4 lines · Grygorii Strashko

Since Davinci GPIO driver is moved to support gpiolib it has to use ARCH_NR_GPIOS (can be configured using CONFIG_ARCH_NR_GPIO Kconfig option) configuration instead of any mach/platform specific options.

Quoted 8 lines

Hence, replace private DAVINCI_N_GPIO with common ARCH_NR_GPIOS. This is safe because default value for ARCH_NR_GPIOS=256 and maximum number of supported GPIOs for Davinci is DAVINCI_N_GPIO=144.

More over, this is one of steps to re-use Davinci GPIO driver by other mach/platform.

Regards,
--Prabhakar Lad

Acked-by on v1 2/2
#6 lore raw

Re: [PATCH 2/2] gpio: introduce GPIO_DAVINCI kconfig option

In reply to Grygorii Strashko
Quoted 8 lines · Grygorii Strashko

The compatible to Davinci GPIO HW block is used by other TI SoCs, like Keystone, where GPIO support is declared as optional.

Hence, introduce GPIO_DAVINCI Kconfig option which will allow to enable Davinci GPIO driver for Keystone SoCs when needed. At same time, kept Davinci GPIO driver enabled for Davinci SoCs by default.

Regards,
--Prabhakar Lad

Acked-by on v1 1/2
#3 lore raw

Re: [PATCH 1/2] gpio: davinci: get rid of DAVINCI_N_GPIO

In reply to Grygorii Strashko
Quoted 4 lines · Grygorii Strashko

Since Davinci GPIO driver is moved to support gpiolib it has to use ARCH_NR_GPIOS (can be configured using CONFIG_ARCH_NR_GPIO Kconfig option) configuration instead of any mach/platform specific options.

Quoted 8 lines

Hence, replace private DAVINCI_N_GPIO with common ARCH_NR_GPIOS. This is safe because default value for ARCH_NR_GPIOS=256 and maximum number of supported GPIOs for Davinci is DAVINCI_N_GPIO=144.

More over, this is one of steps to re-use Davinci GPIO driver by other mach/platform.

Now we have a handful of people patching DaVinci GPIOs...

Sekhar: can you coordinate the different DaVinci patches? If you want me to take a complete set of stuff at the end of the day you can give me a pull request for inclusion into the GPIO tree.

Yours,
Linus Walleij

Acked-by on v1 2/2
#7 lore raw

Re: [PATCH 2/2] gpio: introduce GPIO_DAVINCI kconfig option

In reply to Grygorii Strashko
Quoted 8 lines · Grygorii Strashko

The compatible to Davinci GPIO HW block is used by other TI SoCs, like Keystone, where GPIO support is declared as optional.

Hence, introduce GPIO_DAVINCI Kconfig option which will allow to enable Davinci GPIO driver for Keystone SoCs when needed. At same time, kept Davinci GPIO driver enabled for Davinci SoCs by default.

Sekhar, same comment here.

Yours,
Linus Walleij

Acked-by on the v1 series
#9 lore raw
In reply to Grygorii Strashko
Quoted 8 lines · Grygorii Strashko

This series is a preparation step for reusing Davinci GPIO driver for Keystone SoCs.
And it's been created in order to break the strict dependency of Davinci GPIO driver from Davinci platform code.

Based on patch:
http://www.spinics.net/lists/kernel/msg1632405.html

Quoted 9 lines

Grygorii Strashko (2):
gpio: davinci: get rid of DAVINCI_N_GPIO
gpio: introduce GPIO_DAVINCI kconfig option

 drivers/gpio/Kconfig        |    7 +++++++
 drivers/gpio/Makefile       |    2 +-
 drivers/gpio/gpio-davinci.c |    4 ++--
 3 files changed, 10 insertions(+), 3 deletions(-)

Thanks Grygorii and clean-up is inline as discussed off-list. FWIW,

#4 lore raw

Re: [PATCH 1/2] gpio: davinci: get rid of DAVINCI_N_GPIO

In reply to Linus Walleij
Quoted 11 lines · Linus Walleij
Quoted 8 lines · Grygorii Strashko

Since Davinci GPIO driver is moved to support gpiolib it has to use ARCH_NR_GPIOS (can be configured using CONFIG_ARCH_NR_GPIO Kconfig option) configuration instead of any mach/platform specific options.

Hence, replace private DAVINCI_N_GPIO with common ARCH_NR_GPIOS. This is safe because default value for ARCH_NR_GPIOS=256 and maximum number of supported GPIOs for Davinci is DAVINCI_N_GPIO=144.

Quoted 6 lines
Quoted 4 lines

More over, this is one of steps to re-use Davinci GPIO driver by other mach/platform.

Added to v3.14/gpio of my k.org tree with Prabhakar's, Santosh's and your acks.

Quoted 6 lines

Now we have a handful of people patching DaVinci GPIOs...

Sekhar: can you coordinate the different DaVinci patches? If you want me to take a complete set of stuff at the end of the day you can give me a pull request for inclusion into the GPIO tree.

Will do.

Thanks,
Sekhar

#8 lore raw

Re: [PATCH 2/2] gpio: introduce GPIO_DAVINCI kconfig option

In reply to Linus Walleij
Quoted 10 lines · Linus Walleij
Quoted 7 lines · Grygorii Strashko

The compatible to Davinci GPIO HW block is used by other TI SoCs, like Keystone, where GPIO support is declared as optional.

Hence, introduce GPIO_DAVINCI Kconfig option which will allow to enable Davinci GPIO driver for Keystone SoCs when needed. At same time, kept Davinci GPIO driver enabled for Davinci SoCs by default.

Quoted 5 lines
Quoted 1 line

Sekhar, same comment here.

Queuing this with your's, Santosh's and Prabhakar's acks.

Thanks,
Sekhar