[PATCH] MIPS: Remove all the uses of custom gpio.h

2015-07-30 Thread Alban Bedel
Currently CONFIG_ARCH_HAVE_CUSTOM_GPIO_H is defined for all MIPS
machines, and each machine type provides its own gpio.h. However
only a handful really implement the GPIO API, most just forward
everythings to gpiolib.

The Alchemy machine is notable as it provides a system to allow
implementing the GPIO API at the board level. But it is not used by
any board currently supported, so it can also be removed.

For most machine types we can just remove the custom gpio.h, as well
as the custom wrappers if some exists. Some of the code found in
the wrappers must be moved to the respective GPIO driver.

A few more fixes are need in some drivers as they rely on linux/gpio.h
to provides some machine specific definitions, or used asm/gpio.h
instead of linux/gpio.h for the gpio API.

Signed-off-by: Alban Bedel 
---

This patch is based on my previous serie:
"MIPS: ath79: Move the GPIO driver to drivers/gpio".

It supercede my previous patch named:
"MIPS: Remove most of the custom gpio.h"

Compared to the previous patch:
* Fixed gpio_to_irq on jz4740 and rb532
* Cleaned up alchemy as well
* Removed asm/gpio.h

For testing I tried to build all mips defconfig, however my toolchain
couldn't handle a few configs: ip28 malta_qemu_32r6 maltasmvp_eva
sead3micro. If somebody can test these that would be more than welcome.

Now a few stats about the state of CONFIG_ARCH_HAVE_CUSTOM_GPIO_H
after appling this patch. Of the 31 supportd arch, 15 still have
asm/gpio.h, of these 9 are just a "#warning Include linux/gpio.h
instead of asm/gpio.h". So we have 6 arch left: arm, avr32, blackfin,
m68k, sh and unicore32. But only m68k and unicore32 really provides
custom wrappers, all the others only forward to gpiolib.

On the drivers side we only have 13 occurences of '#include
' left, mostly in drivers used on ARM SoC.

So the work left to phase out the legacy GPIO is really not that much
anymore.

Alban
---
 arch/mips/Kconfig   |   1 -
 arch/mips/alchemy/Kconfig   |   7 --
 arch/mips/alchemy/board-gpr.c   |   1 +
 arch/mips/alchemy/board-mtx1.c  |   1 +
 arch/mips/alchemy/common/Makefile   |   7 +-
 arch/mips/alchemy/devboards/db1000.c|   1 +
 arch/mips/alchemy/devboards/db1300.c|   1 +
 arch/mips/alchemy/devboards/db1550.c|   1 +
 arch/mips/alchemy/devboards/pm.c|   2 +-
 arch/mips/ar7/gpio.c|  12 +-
 arch/mips/ar7/platform.c|   1 -
 arch/mips/ar7/setup.c   |   1 -
 arch/mips/include/asm/gpio.h|   6 -
 arch/mips/include/asm/mach-ar7/ar7.h|   4 +
 arch/mips/include/asm/mach-ar7/gpio.h   |  41 ---
 arch/mips/include/asm/mach-ath25/gpio.h |  16 ---
 arch/mips/include/asm/mach-ath79/gpio.h |  26 -
 arch/mips/include/asm/mach-au1x00/gpio-au1000.h | 148 ++--
 arch/mips/include/asm/mach-au1x00/gpio.h|  86 --
 arch/mips/include/asm/mach-bcm47xx/gpio.h   |  17 ---
 arch/mips/include/asm/mach-bcm63xx/gpio.h   |  15 ---
 arch/mips/include/asm/mach-cavium-octeon/gpio.h |  21 
 arch/mips/include/asm/mach-generic/gpio.h   |  21 
 arch/mips/include/asm/mach-jz4740/gpio.h|   2 -
 arch/mips/include/asm/mach-lantiq/gpio.h|  13 ---
 arch/mips/include/asm/mach-loongson64/gpio.h|  36 --
 arch/mips/include/asm/mach-pistachio/gpio.h |  21 
 arch/mips/include/asm/mach-rc32434/gpio.h   |  12 --
 arch/mips/jz4740/gpio.c |  20 ++--
 arch/mips/pci/pci-lantiq.c  |   1 -
 arch/mips/rb532/devices.c   |   1 +
 arch/mips/rb532/gpio.c  |   6 +
 arch/mips/txx9/generic/setup.c  |  16 ---
 drivers/ata/pata_rb532_cf.c |   3 +-
 drivers/gpio/gpio-ath79.c   |  32 -
 drivers/input/misc/rb532_button.c   |   1 +
 drivers/net/ethernet/ti/cpmac.c |   2 +
 37 files changed, 44 insertions(+), 559 deletions(-)
 delete mode 100644 arch/mips/include/asm/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-ar7/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-ath25/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-ath79/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-au1x00/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-bcm47xx/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-bcm63xx/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-cavium-octeon/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-generic/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-lantiq/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-loongson64/gpio.h
 delete mode 100644 arch/mips/include/asm/mach-pistachio/gpio.h

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index cee5f93..6cab2b8 100644
--- a/arch/mips/Kconfig
+++ b

Re: [PATCH] MIPS: Remove all the uses of custom gpio.h

2015-07-30 Thread Jonas Gorski
Hi,

On Thu, Jul 30, 2015 at 7:28 PM, Alban Bedel  wrote:
> Currently CONFIG_ARCH_HAVE_CUSTOM_GPIO_H is defined for all MIPS
> machines, and each machine type provides its own gpio.h. However
> only a handful really implement the GPIO API, most just forward
> everythings to gpiolib.
>
> The Alchemy machine is notable as it provides a system to allow
> implementing the GPIO API at the board level. But it is not used by
> any board currently supported, so it can also be removed.
>
> For most machine types we can just remove the custom gpio.h, as well
> as the custom wrappers if some exists. Some of the code found in
> the wrappers must be moved to the respective GPIO driver.
>
> A few more fixes are need in some drivers as they rely on linux/gpio.h
> to provides some machine specific definitions, or used asm/gpio.h
> instead of linux/gpio.h for the gpio API.
>
> Signed-off-by: Alban Bedel 
> ---
>
> This patch is based on my previous serie:
> "MIPS: ath79: Move the GPIO driver to drivers/gpio".
>
> It supercede my previous patch named:
> "MIPS: Remove most of the custom gpio.h"
>
> Compared to the previous patch:
> * Fixed gpio_to_irq on jz4740 and rb532
> * Cleaned up alchemy as well
> * Removed asm/gpio.h
>
> For testing I tried to build all mips defconfig, however my toolchain
> couldn't handle a few configs: ip28 malta_qemu_32r6 maltasmvp_eva
> sead3micro. If somebody can test these that would be more than welcome.
>
> Now a few stats about the state of CONFIG_ARCH_HAVE_CUSTOM_GPIO_H
> after appling this patch. Of the 31 supportd arch, 15 still have
> asm/gpio.h, of these 9 are just a "#warning Include linux/gpio.h
> instead of asm/gpio.h". So we have 6 arch left: arm, avr32, blackfin,
> m68k, sh and unicore32. But only m68k and unicore32 really provides
> custom wrappers, all the others only forward to gpiolib.
>
> On the drivers side we only have 13 occurences of '#include
> ' left, mostly in drivers used on ARM SoC.
>
> So the work left to phase out the legacy GPIO is really not that much
> anymore.
>
> Alban
> ---
>  arch/mips/Kconfig   |   1 -
>  arch/mips/alchemy/Kconfig   |   7 --
>  arch/mips/alchemy/board-gpr.c   |   1 +
>  arch/mips/alchemy/board-mtx1.c  |   1 +
>  arch/mips/alchemy/common/Makefile   |   7 +-
>  arch/mips/alchemy/devboards/db1000.c|   1 +
>  arch/mips/alchemy/devboards/db1300.c|   1 +
>  arch/mips/alchemy/devboards/db1550.c|   1 +
>  arch/mips/alchemy/devboards/pm.c|   2 +-
>  arch/mips/ar7/gpio.c|  12 +-
>  arch/mips/ar7/platform.c|   1 -
>  arch/mips/ar7/setup.c   |   1 -
>  arch/mips/include/asm/gpio.h|   6 -
>  arch/mips/include/asm/mach-ar7/ar7.h|   4 +
>  arch/mips/include/asm/mach-ar7/gpio.h   |  41 ---
>  arch/mips/include/asm/mach-ath25/gpio.h |  16 ---
>  arch/mips/include/asm/mach-ath79/gpio.h |  26 -
>  arch/mips/include/asm/mach-au1x00/gpio-au1000.h | 148 
> ++--
>  arch/mips/include/asm/mach-au1x00/gpio.h|  86 --
>  arch/mips/include/asm/mach-bcm47xx/gpio.h   |  17 ---
>  arch/mips/include/asm/mach-bcm63xx/gpio.h   |  15 ---
>  arch/mips/include/asm/mach-cavium-octeon/gpio.h |  21 
>  arch/mips/include/asm/mach-generic/gpio.h   |  21 
>  arch/mips/include/asm/mach-jz4740/gpio.h|   2 -
>  arch/mips/include/asm/mach-lantiq/gpio.h|  13 ---
>  arch/mips/include/asm/mach-loongson64/gpio.h|  36 --
>  arch/mips/include/asm/mach-pistachio/gpio.h |  21 
>  arch/mips/include/asm/mach-rc32434/gpio.h   |  12 --
>  arch/mips/jz4740/gpio.c |  20 ++--
>  arch/mips/pci/pci-lantiq.c  |   1 -
>  arch/mips/rb532/devices.c   |   1 +
>  arch/mips/rb532/gpio.c  |   6 +
>  arch/mips/txx9/generic/setup.c  |  16 ---
>  drivers/ata/pata_rb532_cf.c |   3 +-
>  drivers/gpio/gpio-ath79.c   |  32 -
>  drivers/input/misc/rb532_button.c   |   1 +
>  drivers/net/ethernet/ti/cpmac.c |   2 +
>  37 files changed, 44 insertions(+), 559 deletions(-)
>  delete mode 100644 arch/mips/include/asm/gpio.h
>  delete mode 100644 arch/mips/include/asm/mach-ar7/gpio.h
>  delete mode 100644 arch/mips/include/asm/mach-ath25/gpio.h
>  delete mode 100644 arch/mips/include/asm/mach-ath79/gpio.h
>  delete mode 100644 arch/mips/include/asm/mach-au1x00/gpio.h
>  delete mode 100644 arch/mips/include/asm/mach-bcm47xx/gpio.h
>  delete mode 100644 arch/mips/include/asm/mach-bcm63xx/gpio.h
>  delete mode 100644 arch/mips/include/asm/mach-cavium-octeon/gpio.h
>  delete mode 100644 arch/mips/include/asm/mach-generic/gpio.h
>  delete mode 100644 arch/mips/include/asm/mach-lantiq/gp

Re: [PATCH] MIPS: Remove all the uses of custom gpio.h

2015-07-30 Thread Manuel Lauss
On Thu, Jul 30, 2015 at 7:28 PM, Alban Bedel  wrote:
> Currently CONFIG_ARCH_HAVE_CUSTOM_GPIO_H is defined for all MIPS
> machines, and each machine type provides its own gpio.h. However
> only a handful really implement the GPIO API, most just forward
> everythings to gpiolib.
>
> The Alchemy machine is notable as it provides a system to allow
> implementing the GPIO API at the board level. But it is not used by
> any board currently supported, so it can also be removed.

Threre's only out-of-tree users which I also maintain, so it's fine with me.


>  arch/mips/alchemy/Kconfig   |   7 --
>  arch/mips/alchemy/board-gpr.c   |   1 +
>  arch/mips/alchemy/board-mtx1.c  |   1 +
>  arch/mips/alchemy/common/Makefile   |   7 +-
>  arch/mips/alchemy/devboards/db1000.c|   1 +
>  arch/mips/alchemy/devboards/db1300.c|   1 +
>  arch/mips/alchemy/devboards/db1550.c|   1 +
>  arch/mips/alchemy/devboards/pm.c|   2 +-
>  arch/mips/include/asm/mach-au1x00/gpio-au1000.h | 148 
> ++--
>  arch/mips/include/asm/mach-au1x00/gpio.h|  86 --

For the alchemy parts:

Acked-by: Manuel Lauss 


-- 
   Manuel
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] MIPS: Remove all the uses of custom gpio.h

2015-08-03 Thread Linus Walleij
On Thu, Jul 30, 2015 at 7:28 PM, Alban Bedel  wrote:

> Currently CONFIG_ARCH_HAVE_CUSTOM_GPIO_H is defined for all MIPS
> machines, and each machine type provides its own gpio.h. However
> only a handful really implement the GPIO API, most just forward
> everythings to gpiolib.
>
> The Alchemy machine is notable as it provides a system to allow
> implementing the GPIO API at the board level. But it is not used by
> any board currently supported, so it can also be removed.
>
> For most machine types we can just remove the custom gpio.h, as well
> as the custom wrappers if some exists. Some of the code found in
> the wrappers must be moved to the respective GPIO driver.
>
> A few more fixes are need in some drivers as they rely on linux/gpio.h
> to provides some machine specific definitions, or used asm/gpio.h
> instead of linux/gpio.h for the gpio API.
>
> Signed-off-by: Alban Bedel 
> ---
>
> This patch is based on my previous serie:
> "MIPS: ath79: Move the GPIO driver to drivers/gpio".
>
> It supercede my previous patch named:
> "MIPS: Remove most of the custom gpio.h"
>
> Compared to the previous patch:
> * Fixed gpio_to_irq on jz4740 and rb532
> * Cleaned up alchemy as well
> * Removed asm/gpio.h
>
> For testing I tried to build all mips defconfig, however my toolchain
> couldn't handle a few configs: ip28 malta_qemu_32r6 maltasmvp_eva
> sead3micro. If somebody can test these that would be more than welcome.
>
> Now a few stats about the state of CONFIG_ARCH_HAVE_CUSTOM_GPIO_H
> after appling this patch. Of the 31 supportd arch, 15 still have
> asm/gpio.h, of these 9 are just a "#warning Include linux/gpio.h
> instead of asm/gpio.h". So we have 6 arch left: arm, avr32, blackfin,
> m68k, sh and unicore32. But only m68k and unicore32 really provides
> custom wrappers, all the others only forward to gpiolib.
>
> On the drivers side we only have 13 occurences of '#include
> ' left, mostly in drivers used on ARM SoC.
>
> So the work left to phase out the legacy GPIO is really not that much
> anymore.

Very good job being done here.
Reviewed-by: Linus Walleij 

I guess this better go in through the MIPS tree.
Given all the OpenWRT ports using MIPS this is excellent
progress for a large hobbyist community.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] MIPS: Remove all the uses of custom gpio.h

2015-08-03 Thread Ralf Baechle
On Mon, Aug 03, 2015 at 09:13:27AM +0200, Linus Walleij wrote:

> Very good job being done here.
> Reviewed-by: Linus Walleij 
> 
> I guess this better go in through the MIPS tree.
> Given all the OpenWRT ports using MIPS this is excellent
> progress for a large hobbyist community.

Alban has posted a v2 [1] already but I take it that your Reviewed-by: applies
to the v2 patch as well?

  Ralf

[1] https://patchwork.linux-mips.org/patch/10828/
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] MIPS: Remove all the uses of custom gpio.h

2015-08-03 Thread Linus Walleij
On Mon, Aug 3, 2015 at 9:23 AM, Ralf Baechle  wrote:
> On Mon, Aug 03, 2015 at 09:13:27AM +0200, Linus Walleij wrote:
>
>> Very good job being done here.
>> Reviewed-by: Linus Walleij 
>>
>> I guess this better go in through the MIPS tree.
>> Given all the OpenWRT ports using MIPS this is excellent
>> progress for a large hobbyist community.
>
> Alban has posted a v2 [1] already but I take it that your Reviewed-by: applies
> to the v2 patch as well?

Sure thing. Green light for this.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html