gpio: davinci: preparation fixes and updates to reuse it for Keystone
Subsystems (2)
PATCH 1/2 gpio: davinci: get rid of DAVINCI_N_GPIO
In reply to Grygorii StrashkoSince 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
@@ -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
PATCH 2/2 gpio: introduce GPIO_DAVINCI kconfig option
In reply to Grygorii StrashkoThe 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
@@ -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
@@ -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
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
Re: [PATCH 1/2] gpio: davinci: get rid of DAVINCI_N_GPIO
In reply to Grygorii StrashkoQuoted 4 lines · Grygorii Strashko
Since Davinci GPIO driver is moved to support gpiolib it has to use
ARCH_NR_GPIOS(can be configured usingCONFIG_ARCH_NR_GPIOKconfigoption) configuration instead of any mach/platform specific options.
Quoted 8 lines
Hence, replace private
DAVINCI_N_GPIOwith commonARCH_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.
Signed-off-by Grygorii Strashko <[email protected]>
Regards,
--Prabhakar Lad
Re: [PATCH 2/2] gpio: introduce GPIO_DAVINCI kconfig option
In reply to Grygorii StrashkoQuoted 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_DAVINCIKconfigoption 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.Signed-off-by Grygorii Strashko <[email protected]>
Regards,
--Prabhakar Lad
Re: [PATCH 1/2] gpio: davinci: get rid of DAVINCI_N_GPIO
In reply to Grygorii StrashkoQuoted 4 lines · Grygorii Strashko
Since Davinci GPIO driver is moved to support gpiolib it has to use
ARCH_NR_GPIOS(can be configured usingCONFIG_ARCH_NR_GPIOKconfigoption) configuration instead of any mach/platform specific options.
Quoted 8 lines
Hence, replace private
DAVINCI_N_GPIOwith commonARCH_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.
Signed-off-by Grygorii Strashko <[email protected]>
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
Re: [PATCH 2/2] gpio: introduce GPIO_DAVINCI kconfig option
In reply to Grygorii StrashkoQuoted 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_DAVINCIKconfigoption 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.Signed-off-by Grygorii Strashko <[email protected]>
Sekhar, same comment here.
Yours,
Linus Walleij
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 ofDAVINCI_N_GPIO
gpio: introduceGPIO_DAVINCIkconfig optiondrivers/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,
Re: [PATCH 1/2] gpio: davinci: get rid of DAVINCI_N_GPIO
In reply to Linus WalleijQuoted 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 usingCONFIG_ARCH_NR_GPIOKconfigoption) configuration instead of any mach/platform specific options.Hence, replace private
DAVINCI_N_GPIOwith commonARCH_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.
Signed-off-by Grygorii Strashko <[email protected]>Acked-by Linus Walleij <[email protected]>
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
Re: [PATCH 2/2] gpio: introduce GPIO_DAVINCI kconfig option
In reply to Linus WalleijQuoted 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_DAVINCIKconfigoption 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
Signed-off-by Grygorii Strashko <[email protected]>Acked-by Linus Walleij <[email protected]>Sekhar, same comment here.
Queuing this with your's, Santosh's and Prabhakar's acks.
Thanks,
Sekhar