GPIO: Rename "drivers/gpio.c" to "drivers/gpiolib.c"
Subsystems (7)
PATCH 1/5 GPIO: Rename "drivers/gpio.c" to "drivers/gpiolib.c"
Rename "drivers/gpio.c" to "drivers/gpiolib.c".
Reason is for understand functionality of driver.
---
drivers/gpio/Makefile | 3 ++-
drivers/gpio/{gpio.c => gpiolib.c} | 0
2 files changed, 2 insertions(+), 1 deletion(-)
rename drivers/gpio/{gpio.c => gpiolib.c} (100%)drivers/gpio/Makefile +2 -1
@@ -1,4 +1,5 @@ -obj-$(CONFIG_GPIOLIB) += gpio.o +obj-$(CONFIG_GPIOLIB) += gpiolib.o + obj-$(CONFIG_GPIO_BCM2835) += gpio-bcm2835.o obj-$(CONFIG_GPIO_CLPS711X) += gpio-clps711x.o obj-$(CONFIG_GPIO_GENERIC) += gpio-generic.o
drivers/gpio/gpiolib.c renamed from drivers/gpio/gpio.c +0 -0
Signature · 7 lines
1.8.1.5 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/1 ubimkvol: Typo fix
--- commands/ubi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
commands/ubi.c +1 -1
@@ -47,7 +47,7 @@ static int do_ubimkvol(int argc, char *argv[])static const __maybe_unused char cmd_ubimkvol_help[] ="Usage: ubimkvol <ubidev> <name> <size>\n" "Create an ubi volume on <ubidev> with name <name> and size <size>\n" -"If size os zero all available space is used for the volume\n" ; +"If size is zero all available space is used for the volume\n" ;BAREBOX_CMD_START (ubimkvol) .cmd = do_ubimkvol,
Signature · 7 lines
1.8.1.5 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/5 ARM: i.MX: Move GPIO driver to drivers/gpio
In reply to Alexander Shiyan--- arch/arm/mach-imx/Makefile | 2 +- drivers/gpio/Kconfig | 3 +++ drivers/gpio/Makefile | 1 + arch/arm/mach-imx/gpio.c => drivers/gpio/gpio-imx.c | 0 4 files changed, 5 insertions(+), 1 deletion(-) rename arch/arm/mach-imx/gpio.c => drivers/gpio/gpio-imx.c (100%)
arch/arm/mach-imx/Makefile +1 -1
@@ -1,4 +1,4 @@ -obj-y += clocksource.o gpio.o +obj-y += clocksource.o obj-$(CONFIG_ARCH_IMX1) += imx1.o iomux-v1.o clk-imx1.o obj-$(CONFIG_ARCH_IMX25) += imx25.o iomux-v3.o clk-imx25.o obj-$(CONFIG_ARCH_IMX21) += imx21.o iomux-v1.o clk-imx21.o
drivers/gpio/Kconfig +3 -0
@@ -27,6 +27,9 @@ config GPIO_GENERIC_PLATFORM Say yes here to support basic platform memory-mapped GPIO controllers +config GPIO_IMX + def_bool ARCH_IMX + config GPIO_PL061 bool "PrimeCell PL061 GPIO support" depends on ARM_AMBA
drivers/gpio/Makefile +1 -0
@@ -3,5 +3,6 @@ obj-$(CONFIG_GPIOLIB) += gpiolib.o obj-$(CONFIG_GPIO_BCM2835) += gpio-bcm2835.o obj-$(CONFIG_GPIO_CLPS711X) += gpio-clps711x.o obj-$(CONFIG_GPIO_GENERIC) += gpio-generic.o +obj-$(CONFIG_GPIO_IMX) += gpio-imx.o obj-$(CONFIG_GPIO_PL061) += gpio-pl061.o obj-$(CONFIG_GPIO_STMPE) += gpio-stmpe.o
drivers/gpio/gpio-imx.c renamed from arch/arm/mach-imx/gpio.c +0 -0
Signature · 7 lines
1.8.1.5 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 3/5 GPIO: i.MX: Rewrite driver for using generic GPIO code
In reply to Alexander Shiyan--- arch/arm/Kconfig | 1 - drivers/gpio/Kconfig | 1 + drivers/gpio/gpio-imx.c | 125 ++++++++++++------------------------------------ 3 files changed, 31 insertions(+), 96 deletions(-)
arch/arm/Kconfig +0 -1
@@ -72,7 +72,6 @@ config ARCH_HIGHBANK config ARCH_IMX bool "Freescale iMX-based" - select GENERIC_GPIO select GPIOLIB select COMMON_CLK select CLKDEV_LOOKUP
drivers/gpio/Kconfig +1 -0
@@ -29,6 +29,7 @@ config GPIO_GENERIC_PLATFORM config GPIO_IMX def_bool ARCH_IMX + select GPIO_GENERIC config GPIO_PL061 bool "PrimeCell PL061 GPIO support"
drivers/gpio/gpio-imx.c +30 -95
151 lines not on this page · raw message
Signature · 7 lines
1.8.1.5 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
maintainerRe: [PATCH 3/5] GPIO: i.MX: Rewrite driver for using generic GPIO code
Quoted 25 lines · Alexander Shiyan
Signed-off-by Alexander Shiyan <[email protected]>--- arch/arm/Kconfig | 1 - drivers/gpio/Kconfig | 1 + drivers/gpio/gpio-imx.c | 125 ++++++++++++------------------------------------ 3 files changed, 31 insertions(+), 96 deletions(-)arch/arm/Kconfig +0
-1@@ -72,7 +72,6 @@ config ARCH_HIGHBANK config ARCH_IMX bool "Freescale iMX-based" - select GENERIC_GPIO select GPIOLIB select COMMON_CLK select CLKDEV_LOOKUPdrivers/gpio/Kconfig +0
-0
drivers/gpio/Kconfig config GPIO_GENERIC_PLATFORM · line 32
Quoted 4 lines
drivers/gpio/Kconfig +1
-0@@ -29,6 +29,7 @@ config GPIO_GENERIC_PLATFORM config GPIO_IMX def_bool ARCH_IMX + select GPIO_GENERIC
I'm not convinced by this change. Indeed this makes for smaller sourcecode, but the binary gets over 1kb bigger. I think this is too much for no additional gain.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re[2]: [PATCH 3/5] GPIO: i.MX: Rewrite driver for using generic GPIO code
Quoted 27 lines · Alexander Shiyan
Quoted 26 lines
Signed-off-by Alexander Shiyan <[email protected]>--- arch/arm/Kconfig | 1 - drivers/gpio/Kconfig | 1 + drivers/gpio/gpio-imx.c | 125 ++++++++++++------------------------------------ 3 files changed, 31 insertions(+), 96 deletions(-)arch/arm/Kconfig +0
-1@@ -72,7 +72,6 @@ config ARCH_HIGHBANK config ARCH_IMX bool "Freescale iMX-based" - select GENERIC_GPIO select GPIOLIB select COMMON_CLK select CLKDEV_LOOKUPdrivers/gpio/Kconfig +0
-0@@ -29,6 +29,7 @@ config GPIO_GENERIC_PLATFORM
Quoted 7 lines
drivers/gpio/Kconfig config GPIO_GENERIC_PLATFORM · line 32
Quoted 3 lines
drivers/gpio/Kconfig +1
-0config GPIO_IMX def_bool ARCH_IMX + select GPIO_GENERICI'm not convinced by this change. Indeed this makes for smaller sourcecode, but the binary gets over 1kb bigger. I think this is too much for no additional gain.
The main idea of this change is reuse code if we can have multiple targets in barebox. Probably, now is too early for this.
---
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
maintainerRe: [PATCH 3/5] GPIO: i.MX: Rewrite driver for using generic GPIO code
Quoted 35 lines · Alexander Shiyan
Quoted 27 lines · Alexander Shiyan
Quoted 26 lines
Signed-off-by Alexander Shiyan <[email protected]>--- arch/arm/Kconfig | 1 - drivers/gpio/Kconfig | 1 + drivers/gpio/gpio-imx.c | 125 ++++++++++++------------------------------------ 3 files changed, 31 insertions(+), 96 deletions(-)arch/arm/Kconfig +0
-1@@ -72,7 +72,6 @@ config ARCH_HIGHBANK config ARCH_IMX bool "Freescale iMX-based" - select GENERIC_GPIO select GPIOLIB select COMMON_CLK select CLKDEV_LOOKUPdrivers/gpio/Kconfig +0
-0@@ -29,6 +29,7 @@ config GPIO_GENERIC_PLATFORMQuoted 7 lines
drivers/gpio/Kconfig config GPIO_GENERIC_PLATFORM · line 32
Quoted 3 lines
drivers/gpio/Kconfig +1
-0config GPIO_IMX def_bool ARCH_IMX + select GPIO_GENERICI'm not convinced by this change. Indeed this makes for smaller sourcecode, but the binary gets over 1kb bigger. I think this is too much for no additional gain.
Quoted 2 lines
The main idea of this change is reuse code if we can have multiple targets in barebox. Probably, now is too early for this.
Yeah, it may change once multiple gpio drivers are compiled into the binary.
BTW maybe you can lower the impact of the generic gpio driver by making the basic-mmio-gpio platform driver optional. It is not used by the i.MX part.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re[2]: [PATCH 3/5] GPIO: i.MX: Rewrite driver for using generic GPIO code
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines · Alexander Shiyan
Quoted 7 lines
Signed-off-by Alexander Shiyan <[email protected]>--- arch/arm/Kconfig | 1 - drivers/gpio/Kconfig | 1 + drivers/gpio/gpio-imx.c | 125 ++++++++++++------------------------------------ 3 files changed, 31 insertions(+), 96 deletions(-)
...
Quoted 11 lines
Quoted 10 lines
Quoted 7 lines
drivers/gpio/Kconfig config GPIO_GENERIC_PLATFORM · line 32
Quoted 3 lines
config
GPIO_IMXdrivers/gpio/Kconfig +1
-0def_bool ARCH_IMX + select GPIO_GENERICI'm not convinced by this change. Indeed this makes for smaller sourcecode, but the binary gets over 1kb bigger. I think this is too much for no additional gain.
The main idea of this change is reuse code if we can have multiple targets in barebox. Probably, now is too early for this.
Quoted 6 lines
Yeah, it may change once multiple gpio drivers are compiled into the binary.
BTW maybe you can lower the impact of the generic gpio driver by making the basic-mmio-gpio platform driver optional. It is not used by the i.MX part.
"basic-mmio-gpio" driver is a part of generic GPIO but it is already a separate config symbol GPIO_GENERIC_PLATFORM.
In any case I will think about optimization this code.
---
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
PATCH 4/5 GPIO: i.MX: Cleanup driver code
In reply to Alexander ShiyanThis patch provides only cleanup for i.MX GPIO driver. Indentation, reduced licence text etc.
--- drivers/gpio/gpio-imx.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-)
drivers/gpio/gpio-imx.c +12 -22
@@ -1,23 +1,14 @@/* -* arch/arm/mach-imx/gpio.c +* GPIO driver for i.MX machines * * author: Sascha Hauer * Created: april 20th, 2004 * Copyright: Synertronixx GmbH * -* Common code for i.MX machines -* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* */ #include <init.h>
@@ -33,15 +24,15 @@ struct imx_gpio_regs { };static struct imx_gpio_regs regs_imx1 = { - .dr =0x1c , - .gdir =0x00 , - .psr =0x24 , + .dr =0x1c , + .gdir =0x00 , + .psr =0x24 , };static struct imx_gpio_regs regs_imx31 = { - .dr =0x00 , - .gdir =0x04 , - .psr =0x08 , + .dr =0x00 , + .gdir =0x04 , + .psr =0x08 , };static int imx_gpio_probe (struct device_d *dev)
@@ -128,15 +119,14 @@ static struct platform_device_id imx_gpio_ids[] = { };static struct driver_d imx_gpio_driver = { - .name ="imx-gpio" , - .probe = imx_gpio_probe, - .of_compatible =DRV_OF_COMPAT (imx_gpio_dt_ids), - .id_table = imx_gpio_ids, + .name ="imx-gpio" , + .probe = imx_gpio_probe, + .of_compatible =DRV_OF_COMPAT (imx_gpio_dt_ids), + .id_table = imx_gpio_ids, };static int imx_gpio_add (void ) { -platform_driver_register (&imx_gpio_driver); -return 0 ; +return platform_driver_register (&imx_gpio_driver); }coredevice_initcall (imx_gpio_add);
Signature · 7 lines
1.8.1.5 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 4/5] GPIO: i.MX: Cleanup driver code
Quoted 2 lines · Alexander Shiyan
This patch provides only cleanup for i.MX GPIO driver. Indentation, reduced licence text etc.
no please drop it this is just noise on the history when doing blame
Quoted 86 lines
Signed-off-by Alexander Shiyan <[email protected]>--- drivers/gpio/gpio-imx.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-)drivers/gpio/gpio-imx.c +12
-22@@ -1,23 +1,14 @@/* -* arch/arm/mach-imx/gpio.c +* GPIO driver for i.MX machines * * author: Sascha Hauer * Created: april 20th, 2004 * Copyright: Synertronixx GmbH * -* Common code for i.MX machines -* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* */ #include <init.h> @@ -33,15 +24,15 @@ struct imx_gpio_regs { };static struct imx_gpio_regs regs_imx1 = { - .dr =0x1c , - .gdir =0x00 , - .psr =0x24 , + .dr =0x1c , + .gdir =0x00 , + .psr =0x24 , };static struct imx_gpio_regs regs_imx31 = { - .dr =0x00 , - .gdir =0x04 , - .psr =0x08 , + .dr =0x00 , + .gdir =0x04 , + .psr =0x08 , };static int imx_gpio_probe (struct device_d *dev)@@ -128,15 +119,14 @@ static struct platform_device_id imx_gpio_ids[] = { };static struct driver_d imx_gpio_driver = { - .name ="imx-gpio" , - .probe = imx_gpio_probe, - .of_compatible =DRV_OF_COMPAT (imx_gpio_dt_ids), - .id_table = imx_gpio_ids, + .name ="imx-gpio" , + .probe = imx_gpio_probe, + .of_compatible =DRV_OF_COMPAT (imx_gpio_dt_ids), + .id_table = imx_gpio_ids, };static int imx_gpio_add (void ) { -platform_driver_register (&imx_gpio_driver); -return 0 ; +return platform_driver_register (&imx_gpio_driver); }coredevice_initcall (imx_gpio_add);Signature · 7 lines
1.8.1.5 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
maintainerRe: [PATCH 4/5] GPIO: i.MX: Cleanup driver code
In reply to Alexander ShiyanQuoted 13 lines · Alexander Shiyan
This patch provides only cleanup for i.MX GPIO driver. Indentation, reduced licence text etc.
Signed-off-by Alexander Shiyan <[email protected]>--- drivers/gpio/gpio-imx.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-)drivers/gpio/gpio-imx.c +0
-0
drivers/gpio/gpio-imx.c line 2
Quoted 3 lines
drivers/gpio/gpio-imx.c +1
-1@@ -1,23 +1,14 @@/* -* arch/arm/mach-imx/gpio.c +* GPIO driver for i.MX machines
This hunk is good.
drivers/gpio/gpio-imx.c line 9
Quoted 7 lines
drivers/gpio/gpio-imx.c +0
-2* * author: Sascha Hauer * Created: april 20th, 2004 * Copyright: Synertronixx GmbH * -* Common code for i.MX machines -*
Ok aswell.
drivers/gpio/gpio-imx.c static struct platform_device_id imx_gpio_ids[] = { · line 130
Quoted 5 lines
drivers/gpio/gpio-imx.c +1
-2static int imx_gpio_add (void ) { -platform_driver_register (&imx_gpio_driver); -return 0 ; +return platform_driver_register (&imx_gpio_driver);
Also fine. Drop the remaining hunks please.
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 5/5 Introduce coredevice_platform_driver() macro and use it for GPIO drivers
In reply to Alexander Shiyan--- drivers/gpio/gpio-bcm2835.c | 7 +------ drivers/gpio/gpio-clps711x.c | 7 +------ drivers/gpio/gpio-generic.c | 8 +------- drivers/gpio/gpio-imx.c | 7 +------ drivers/gpio/gpio-stmpe.c | 7 +------ include/driver.h | 6 ++++-- 6 files changed, 9 insertions(+), 33 deletions(-)
drivers/gpio/gpio-bcm2835.c +1 -6
@@ -150,9 +150,4 @@ static struct driver_d bcm2835_gpio_driver = { .probe = bcm2835_gpio_probe, .of_compatible = DRV_OF_COMPAT(bcm2835_gpio_dt_ids), }; - -static int bcm2835_gpio_add (void ) -{ -return platform_driver_register (&bcm2835_gpio_driver); -} -coredevice_initcall (bcm2835_gpio_add); +coredevice_platform_driver (bcm2835_gpio_driver);
drivers/gpio/gpio-clps711x.c +1 -6
@@ -62,9 +62,4 @@ static struct driver_d clps711x_gpio_driver = { .name = "clps711x-gpio", .probe = clps711x_gpio_probe, }; - -static __init int clps711x_gpio_register (void ) -{ -return platform_driver_register (&clps711x_gpio_driver); -} -coredevice_initcall (clps711x_gpio_register); +coredevice_platform_driver (clps711x_gpio_driver);
drivers/gpio/gpio-generic.c +1 -7
@@ -414,13 +414,7 @@ static struct driver_d bgpio_driver = { .probe = bgpio_dev_probe, .remove = bgpio_dev_remove, }; - -static int bgpio_register (void ) -{ -return platform_driver_register (&bgpio_driver); -} -coredevice_initcall (bgpio_register); - +coredevice_platform_driver (bgpio_driver);#endif MODULE_DESCRIPTION ("Driver for basic memory-mapped GPIO controllers" );
drivers/gpio/gpio-imx.c +1 -6
@@ -124,9 +124,4 @@ static struct driver_d imx_gpio_driver = { .of_compatible = DRV_OF_COMPAT(imx_gpio_dt_ids), .id_table = imx_gpio_ids, }; - -static int imx_gpio_add (void ) -{ -return platform_driver_register (&imx_gpio_driver); -} -coredevice_initcall (imx_gpio_add); +coredevice_platform_driver (imx_gpio_driver);
drivers/gpio/gpio-stmpe.c +1 -6
@@ -153,9 +153,4 @@ static struct driver_d stmpe_gpio_driver = { .name = "stmpe-gpio", .probe = stmpe_gpio_probe, }; - -static int stmpe_gpio_add (void ) -{ -return platform_driver_register (&stmpe_gpio_driver); -} -coredevice_initcall (stmpe_gpio_add); +coredevice_platform_driver (stmpe_gpio_driver);
include/driver.h +4 -2
@@ -406,10 +406,12 @@ int platform_driver_register(struct driver_d *drv); } \ level##_initcall(drv##_register) -#define device_platform_driver (drv) \ - register_driver_macro(device,platform,drv)#define console_platform_driver (drv) \ register_driver_macro(console,platform,drv) +#define coredevice_platform_driver (drv) \ + register_driver_macro(coredevice,platform,drv) +#define device_platform_driver (drv) \ + register_driver_macro(device,platform,drv)int platform_device_register (struct device_d *new_device);
Signature · 7 lines
1.8.1.5 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
maintainerQuoted 4 lines · Alexander Shiyan
Rename "
drivers/gpio.c" to "drivers/gpiolib.c".
Reason is for understand functionality of driver.Signed-off-by Alexander Shiyan <[email protected]>
Applied 1-3
Sascha
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox