ARM: s3c24xx: get rid of custom <mach/gpio.h>
Subsystems (5)
PATCH v3 1/2 ARM: s3c24xx: get rid of custom <mach/gpio.h>
This isolates the custom S3C24xx GPIO definition table to <linux/platform_data/gpio-samsung-s3x24xx.h> as this is used in a few different places in the kernel, removing the need to depend on the implicit inclusion of <mach/gpio.h> from <linux/gpio.h> and thus getting rid of a few nasty cross-dependencies.
We also delete the nifty CONFIG_S3C24XX_GPIO_EXTRA stuff. The biggest this can ever be for the S3C24XX is CONFIG_S3C24XX_GPIO_EXTRA = 128, and then for CPU_S3C2443 or CPU_S3C2416 32*12 GPIOs are added, so 32*12+128 = 512 is the absolute roof value on this platform. So we set the size of ARCH_NR_GPIO to this and the GPIOs array will fit any S3C24XX platform, as per pattern from other archs.
---
ChangeLog v2->v3:
- Move the movement of the S3C64XX gpio.h file out of this patch and into the follow-up patch where it belongs.
ChangeLog v1->v2:
- Added an #ifdef ARCH_S3C24XX around the header inclusion in drivers/gpio/gpio-samsung.c as we would otherwise have colliding definitions when compiling S3C64XX.
- Rename inclusion guard in the header file.
I will take this through the GPIO tree.
--- arch/arm/Kconfig | 3 +- arch/arm/mach-s3c24xx/Kconfig | 21 ---- arch/arm/mach-s3c24xx/common-smdk.c | 2 +- arch/arm/mach-s3c24xx/h1940-bluetooth.c | 1 + arch/arm/mach-s3c24xx/include/mach/gpio.h | 114 --------------------- arch/arm/mach-s3c24xx/mach-amlm5900.c | 1 + arch/arm/mach-s3c24xx/mach-anubis.c | 1 + arch/arm/mach-s3c24xx/mach-at2440evb.c | 1 + arch/arm/mach-s3c24xx/mach-bast.c | 1 + arch/arm/mach-s3c24xx/mach-gta02.c | 1 + arch/arm/mach-s3c24xx/mach-h1940.c | 1 + arch/arm/mach-s3c24xx/mach-jive.c | 1 + arch/arm/mach-s3c24xx/mach-mini2440.c | 1 + arch/arm/mach-s3c24xx/mach-n30.c | 1 + arch/arm/mach-s3c24xx/mach-nexcoder.c | 1 + arch/arm/mach-s3c24xx/mach-osiris.c | 1 + arch/arm/mach-s3c24xx/mach-qt2410.c | 1 + arch/arm/mach-s3c24xx/mach-rx1950.c | 1 + arch/arm/mach-s3c24xx/mach-rx3715.c | 1 + arch/arm/mach-s3c24xx/mach-smdk2413.c | 1 + arch/arm/mach-s3c24xx/mach-smdk2416.c | 1 + arch/arm/mach-s3c24xx/mach-vr1000.c | 1 + arch/arm/mach-s3c24xx/pm-s3c2410.c | 1 + arch/arm/mach-s3c24xx/pm.c | 1 + arch/arm/mach-s3c24xx/s3c2410.c | 1 + arch/arm/mach-s3c24xx/s3c2416.c | 1 + arch/arm/mach-s3c24xx/s3c2440.c | 1 + arch/arm/mach-s3c24xx/s3c2442.c | 1 + arch/arm/mach-s3c24xx/s3c2443.c | 1 + arch/arm/mach-s3c24xx/setup-i2c.c | 1 + arch/arm/mach-s3c24xx/setup-sdhci-gpio.c | 1 + arch/arm/mach-s3c24xx/setup-ts.c | 1 + arch/arm/mach-s3c24xx/simtec-usb.c | 1 + arch/arm/plat-samsung/pm-gpio.c | 3 + arch/arm/plat-samsung/setup-camif.c | 1 + drivers/gpio/gpio-samsung.c | 3 + drivers/mmc/host/s3cmci.c | 1 + include/linux/platform_data/gpio-samsung-s3c24xx.h | 106 +++++++++++++++++++ 38 files changed, 145 insertions(+), 138 deletions(-) delete mode 100644 arch/arm/mach-s3c24xx/include/mach/gpio.h create mode 100644 include/linux/platform_data/gpio-samsung-s3c24xx.h
arch/arm/Kconfig +1 -2
@@ -710,7 +710,6 @@ config ARCH_S3C24XX select HAVE_S3C2410_WATCHDOG if WATCHDOG select HAVE_S3C_RTC if RTC_CLASS select MULTI_IRQ_HANDLER - select NEED_MACH_GPIO_H select NEED_MACH_IO_H select SAMSUNG_ATAGS help
@@ -1593,7 +1592,7 @@ config ARM_PSCI config ARCH_NR_GPIO int default 1024 if ARCH_SHMOBILE || ARCH_TEGRA - default 512 if ARCH_EXYNOS || ARCH_KEYSTONE || SOC_OMAP5 || SOC_DRA7XX + default 512 if ARCH_EXYNOS || ARCH_KEYSTONE || SOC_OMAP5 || SOC_DRA7XX || ARCH_S3C24XX default 392 if ARCH_U8500 default 352 if ARCH_VT8500 default 288 if ARCH_SUNXI
arch/arm/mach-s3c24xx/Kconfig +0 -21
@@ -180,27 +180,6 @@ config CPU_LLSERIAL_S3C2440 Selected if there is an S3C2440 (or register compatible) serial low-level implementation needed -# gpio configurations - -config S3C24XX_GPIO_EXTRA - int - default 128 if S3C24XX_GPIO_EXTRA128 - default 64 if S3C24XX_GPIO_EXTRA64 - default 16 if ARCH_H1940 - default 0 - -config S3C24XX_GPIO_EXTRA64 - bool - help - Add an extra 64 gpio numbers to the available GPIO pool. This is - available for boards that need extra gpios for external devices. - -config S3C24XX_GPIO_EXTRA128 - bool - help - Add an extra 128 gpio numbers to the available GPIO pool. This is - available for boards that need extra gpios for external devices. - config S3C24XX_PLL bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)" depends on ARM_S3C24XX_CPUFREQ
arch/arm/mach-s3c24xx/common-smdk.c +1 -1
@@ -38,7 +38,7 @@#include <mach/regs-gpio.h> #include <linux/platform_data/leds-s3c24xx.h> - +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <linux/platform_data/mtd-nand-s3c2410.h> #include <plat/gpio-cfg.h>
arch/arm/mach-s3c24xx/h1940-bluetooth.c +1 -0
@@ -18,6 +18,7 @@#include <linux/leds.h> #include <linux/gpio.h> #include <linux/rfkill.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <mach/hardware.h> #include <mach/regs-gpio.h>
arch/arm/mach-s3c24xx/include/mach/gpio.h deleted +0 -114
114 lines not on this page · raw message
arch/arm/mach-s3c24xx/mach-amlm5900.c +1 -0
@@ -54,6 +54,7 @@#include <mach/regs-gpio.h> #include <linux/platform_data/i2c-s3c2410.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <plat/devs.h> #include <plat/cpu.h> #include <plat/gpio-cfg.h>
arch/arm/mach-s3c24xx/mach-anubis.c +1 -0
@@ -37,6 +37,7 @@#include <mach/regs-lcd.h> #include <linux/platform_data/mtd-nand-s3c2410.h> #include <linux/platform_data/i2c-s3c2410.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <linux/mtd/mtd.h> #include <linux/mtd/nand.h>
arch/arm/mach-s3c24xx/mach-at2440evb.c +1 -0
@@ -38,6 +38,7 @@#include <mach/regs-lcd.h> #include <linux/platform_data/mtd-nand-s3c2410.h> #include <linux/platform_data/i2c-s3c2410.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <linux/mtd/mtd.h> #include <linux/mtd/nand.h>
arch/arm/mach-s3c24xx/mach-bast.c +1 -0
@@ -35,6 +35,7 @@#include <linux/platform_data/hwmon-s3c.h> #include <linux/platform_data/i2c-s3c2410.h> #include <linux/platform_data/mtd-nand-s3c2410.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <net/ax88796.h>
arch/arm/mach-s3c24xx/mach-gta02.c +1 -0
@@ -70,6 +70,7 @@#include <linux/platform_data/touchscreen-s3c2410.h> #include <linux/platform_data/usb-ohci-s3c2410.h> #include <linux/platform_data/usb-s3c2410_udc.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <mach/fb.h> #include <mach/hardware.h>
arch/arm/mach-s3c24xx/mach-h1940.c +1 -0
@@ -46,6 +46,7 @@#include <linux/platform_data/mmc-s3cmci.h> #include <linux/platform_data/touchscreen-s3c2410.h> #include <linux/platform_data/usb-s3c2410_udc.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <sound/uda1380.h>
arch/arm/mach-s3c24xx/mach-jive.c +1 -0
@@ -34,6 +34,7 @@#include <plat/regs-serial.h> #include <linux/platform_data/mtd-nand-s3c2410.h> #include <linux/platform_data/i2c-s3c2410.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <mach/regs-gpio.h> #include <mach/regs-lcd.h>
arch/arm/mach-s3c24xx/mach-mini2440.c +1 -0
@@ -46,6 +46,7 @@#include <linux/platform_data/i2c-s3c2410.h> #include <linux/platform_data/mmc-s3cmci.h> #include <linux/platform_data/usb-s3c2410_udc.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <linux/mtd/mtd.h> #include <linux/mtd/nand.h>
arch/arm/mach-s3c24xx/mach-n30.c +1 -0
@@ -42,6 +42,7 @@#include <asm/mach/map.h> #include <linux/platform_data/i2c-s3c2410.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <plat/regs-serial.h> #include <plat/clock.h>
arch/arm/mach-s3c24xx/mach-nexcoder.c +1 -0
@@ -39,6 +39,7 @@#include <mach/regs-gpio.h> #include <plat/regs-serial.h> #include <linux/platform_data/i2c-s3c2410.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <plat/gpio-cfg.h> #include <plat/clock.h>
arch/arm/mach-s3c24xx/mach-osiris.c +1 -0
@@ -33,6 +33,7 @@#include <linux/platform_data/mtd-nand-s3c2410.h> #include <linux/platform_data/i2c-s3c2410.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <linux/mtd/mtd.h> #include <linux/mtd/nand.h>
arch/arm/mach-s3c24xx/mach-qt2410.c +1 -0
@@ -54,6 +54,7 @@#include <linux/platform_data/mtd-nand-s3c2410.h> #include <linux/platform_data/usb-s3c2410_udc.h> #include <linux/platform_data/i2c-s3c2410.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <plat/gpio-cfg.h> #include <plat/devs.h>
arch/arm/mach-s3c24xx/mach-rx1950.c +1 -0
@@ -45,6 +45,7 @@#include <linux/platform_data/mtd-nand-s3c2410.h> #include <linux/platform_data/touchscreen-s3c2410.h> #include <linux/platform_data/usb-s3c2410_udc.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <sound/uda1380.h>
arch/arm/mach-s3c24xx/mach-rx3715.c +1 -0
@@ -35,6 +35,7 @@#include <asm/mach/map.h> #include <linux/platform_data/mtd-nand-s3c2410.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <asm/irq.h> #include <asm/mach-types.h>
arch/arm/mach-s3c24xx/mach-smdk2413.c +1 -0
@@ -39,6 +39,7 @@#include <linux/platform_data/usb-s3c2410_udc.h> #include <linux/platform_data/i2c-s3c2410.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <mach/fb.h> #include <plat/clock.h>
arch/arm/mach-s3c24xx/mach-smdk2416.c +1 -0
@@ -41,6 +41,7 @@#include <linux/platform_data/leds-s3c24xx.h> #include <linux/platform_data/i2c-s3c2410.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <plat/gpio-cfg.h> #include <plat/clock.h>
arch/arm/mach-s3c24xx/mach-vr1000.c +1 -0
@@ -37,6 +37,7 @@#include <linux/platform_data/leds-s3c24xx.h> #include <linux/platform_data/i2c-s3c2410.h> #include <linux/platform_data/asoc-s3c24xx_simtec.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <mach/hardware.h> #include <mach/regs-gpio.h>
arch/arm/mach-s3c24xx/pm-s3c2410.c +1 -0
@@ -28,6 +28,7 @@#include <linux/syscore_ops.h> #include <linux/gpio.h> #include <linux/io.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <asm/mach-types.h>
arch/arm/mach-s3c24xx/pm.c +1 -0
@@ -34,6 +34,7 @@#include <linux/interrupt.h> #include <linux/serial_core.h> #include <linux/io.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <plat/regs-serial.h> #include <mach/regs-clock.h>
arch/arm/mach-s3c24xx/s3c2410.c +1 -0
@@ -24,6 +24,7 @@#include <linux/platform_device.h> #include <linux/reboot.h> #include <linux/io.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <asm/mach/arch.h> #include <asm/mach/map.h>
arch/arm/mach-s3c24xx/s3c2416.c +1 -0
@@ -36,6 +36,7 @@#include <linux/clk.h> #include <linux/io.h> #include <linux/reboot.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <asm/mach/arch.h> #include <asm/mach/map.h>
arch/arm/mach-s3c24xx/s3c2440.c +1 -0
@@ -23,6 +23,7 @@#include <linux/gpio.h> #include <linux/clk.h> #include <linux/io.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <asm/mach/arch.h> #include <asm/mach/map.h>
arch/arm/mach-s3c24xx/s3c2442.c +1 -0
@@ -35,6 +35,7 @@#include <linux/gpio.h> #include <linux/clk.h> #include <linux/io.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <mach/hardware.h> #include <linux/atomic.h>
arch/arm/mach-s3c24xx/s3c2443.c +1 -0
@@ -23,6 +23,7 @@#include <linux/clk.h> #include <linux/io.h> #include <linux/reboot.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <asm/mach/arch.h> #include <asm/mach/map.h>
arch/arm/mach-s3c24xx/setup-i2c.c +1 -0
@@ -17,6 +17,7 @@ struct platform_device;#include <plat/gpio-cfg.h> #include <linux/platform_data/i2c-s3c2410.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <mach/hardware.h> #include <mach/regs-gpio.h>
arch/arm/mach-s3c24xx/setup-sdhci-gpio.c +1 -0
@@ -18,6 +18,7 @@#include <linux/platform_device.h> #include <linux/io.h> #include <linux/gpio.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <mach/regs-gpio.h> #include <plat/gpio-cfg.h>
arch/arm/mach-s3c24xx/setup-ts.c +1 -0
@@ -12,6 +12,7 @@#include <linux/kernel.h> #include <linux/gpio.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> struct platform_device ;/* don't need the contents */
arch/arm/mach-s3c24xx/simtec-usb.c +1 -0
@@ -32,6 +32,7 @@#include <asm/irq.h> #include <linux/platform_data/usb-ohci-s3c2410.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <plat/devs.h> #include "bast.h"
arch/arm/plat-samsung/pm-gpio.c +3 -0
@@ -19,6 +19,9 @@#include <linux/io.h> #include <linux/gpio.h> +#ifdef CONFIG_ARCH_S3C24XX +#include <linux/platform_data/gpio-samsung-s3c24xx.h> +#endif #include <plat/gpio-core.h> #include <plat/pm.h>
arch/arm/plat-samsung/setup-camif.c +1 -0
@@ -9,6 +9,7 @@*/ #include <linux/gpio.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include <plat/gpio-cfg.h> /* Number of camera port pins, without FIELD */
drivers/gpio/gpio-samsung.c +3 -0
@@ -27,6 +27,9 @@#include <linux/of.h> #include <linux/slab.h> #include <linux/of_address.h> +#ifdef CONFIG_ARCH_S3C24XX +#include <linux/platform_data/gpio-samsung-s3c24xx.h> +#endif #include <asm/irq.h>
drivers/mmc/host/s3cmci.c +1 -0
@@ -26,6 +26,7 @@#include <mach/dma.h> #include <linux/platform_data/mmc-s3cmci.h> +#include <linux/platform_data/gpio-samsung-s3c24xx.h> #include "s3cmci.h"
include/linux/platform_data/gpio-samsung-s3c24xx.h new file +106 -0
106 lines not on this page · raw message
Signature · 1 line
1.8.3.1
PATCH v3 1/2 ARM: s3c24xx: get rid of custom <mach/gpio.h>
Quoted 15 lines · Linus Walleij
This isolates the custom S3C24xx GPIO definition table to <
linux/platform_data/gpio-samsung-s3x24xx.h> as this is used in a few different places in the kernel, removing the need to depend on the implicit inclusion of <mach/gpio.h> from <linux/gpio.h> and thus getting rid of a few nasty cross-dependencies.We also delete the nifty
CONFIG_S3C24XX_GPIO_EXTRAstuff. The biggest this can ever be for the S3C24XX isCONFIG_S3C24XX_GPIO_EXTRA= 128, and then forCPU_S3C2443orCPU_S3C241632*12 GPIOs are added, so 32*12+128 = 512 is the absolute roof value on this platform. So we set the size ofARCH_NR_GPIOto this and the GPIOs array will fit any S3C24XX platform, as per pattern from other archs.
Quoted 8 lines
Cc Tomasz Figa <[email protected]>Cc Sylwester Nawrocki <[email protected]>Cc Ben Dooks <[email protected]>Cc linux-samsung-soc at vger.kernel.orgAcked-by Kukjin Kim <[email protected]>Acked-by Heiko Stuebner <[email protected]>Tested-by Heiko Stuebner <[email protected]>Signed-off-by Linus Walleij <[email protected]>
I'm getting build errors in linux-next for s3c2410_defconfig now because of this patch :(
Two problems:
* Some files that use functions or macros defined in this file fail to include it. I see drivers/leds/leds-s3c24xx.c and mach-osiris-dvs.c, but there might be more that don't get built by default.
* The file includes <plat/gpio-cfg.h>, which is not a bug yet, but will be once we move s3c24xx to multiplatform, which would make it impossible to include this file from outside of arch/arm.
Note that on Exynos, the solution for the gpio driver dependencies was to scrap the driver and use pinctrl-exynos instead.
Arnd
PATCH v3 1/2 ARM: s3c24xx: get rid of custom <mach/gpio.h>
Quoted 25 lines · Arnd Bergmann
Quoted 15 lines · Linus Walleij
This isolates the custom S3C24xx GPIO definition table to <
linux/platform_data/gpio-samsung-s3x24xx.h> as this is used in a few different places in the kernel, removing the need to depend on the implicit inclusion of <mach/gpio.h> from <linux/gpio.h> and thus getting rid of a few nasty cross-dependencies.We also delete the nifty
CONFIG_S3C24XX_GPIO_EXTRAstuff. The biggest this can ever be for the S3C24XX isCONFIG_S3C24XX_GPIO_EXTRA= 128, and then forCPU_S3C2443orCPU_S3C241632*12 GPIOs are added, so 32*12+128 = 512 is the absolute roof value on this platform. So we set the size ofARCH_NR_GPIOto this and the GPIOs array will fit any S3C24XX platform, as per pattern from other archs.Quoted 8 lines
Cc Tomasz Figa <[email protected]>Cc Sylwester Nawrocki <[email protected]>Cc Ben Dooks <[email protected]>Cc linux-samsung-soc at vger.kernel.orgAcked-by Kukjin Kim <[email protected]>Acked-by Heiko Stuebner <[email protected]>Tested-by Heiko Stuebner <[email protected]>Signed-off-by Linus Walleij <[email protected]>
Quoted 2 lines
I'm getting build errors in linux-next for
s3c2410_defconfignow because of this patch :(
Hm. I just compiled this defconfig on linux-next:
AS arch/arm/boot/compressed/lib1funcs.o AS arch/arm/boot/compressed/ashldi3.o AS arch/arm/boot/compressed/bswapsdi2.o CC arch/arm/boot/compressed/decompress.o CC arch/arm/boot/compressed/misc.o GZIP arch/arm/boot/compressed/piggy.gzip AS arch/arm/boot/compressed/piggy.gzip.o LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
It appears that these problems appear if you explicitly enable the DT board support, can't we just put that into the defconfig then, so we don't miss such things?
Quoted 4 lines
Two problems:
* Some files that use functions or macros defined in this file fail to include it. I see
drivers/leds/leds-s3c24xx.c
I merged a patch fixing this by having that file explicitly include <plat/gpip-cfg.h> (it was already including it implicitly).
Quoted 2 lines
and
mach-osiris-dvs.c,
It needs this:
#include <linux/platform_data/gpio-samsung-s3c24xx.h>
(I have sent a patch.)
Quoted 2 lines
but there might be more that don't get built
by default.
Yeah implicit includes are a nightmare for refactoring... I'm trying to grep around for some symbols to see if I can find some lost cases.
Quoted 3 lines
* The file includes <
plat/gpio-cfg.h>, which is not a bug yet, but will be once we move s3c24xx to multiplatform, which would make it impossible to include this file from outside ofarch/arm.
Yes that needs to be a step for multiplatform enablement. My series only tries to make the problem smaller and remove the dependence on <mach/gpio.h>. All the <mach/*> and <plat/*> stuff needs to go away eventually ...
Quoted 2 lines
Note that on Exynos, the solution for the gpio driver dependencies was to scrap the driver and use pinctrl-exynos instead.
I think the S3C driver is a different piece of hardware unfortunately.
Yours,
Linus Walleij
PATCH v3 1/2 ARM: s3c24xx: get rid of custom <mach/gpio.h>
Am Dienstag, 7. Januar 2014, 19:27:49 schrieb Linus Walleij:
Quoted 12 lines · Arnd Bergmann
Quoted 5 lines · Linus Walleij
* The file includes <
plat/gpio-cfg.h>, which is not a bug yet, butwill be once we move s3c24xx to multiplatform, which would make it impossible to include this file from outside of
arch/arm.Yes that needs to be a step for multiplatform enablement. My series only tries to make the problem smaller and remove the dependence on <
mach/gpio.h>. All the <mach/*> and <plat/*> stuff needs to go away eventually ...
Quoted 4 lines
Quoted 2 lines
Note that on Exynos, the solution for the gpio driver dependencies was to scrap the driver and use pinctrl-exynos instead.
I think the S3C driver is a different piece of hardware unfortunately.
both the s3c24xx as well as the exynos pinctrl driver use the common pinctrl- samsung infrastructure. The biggest part of the pinctrl-{exynos,s3c24xx} drivers is the handling of the gpio-interrupts and defining the available banks.
In general my multiplatform-plan is to provide the basics (pinctrl, common- clock, etc) and then take the easy way out, described in some arm-summit-notes by simply removing the boards and let people with the hardware that care about it readd the specifics :-) .
For example it seems nobody started a S3C2442 machine for quite some time, as it was/is missing the clkdev entries for stuff like the serial ports.
Heiko
PATCH v3 1/2 ARM: s3c24xx: get rid of custom <mach/gpio.h>
In reply to Linus WalleijQuoted 13 lines · Linus Walleij
Quoted 1 line · Arnd Bergmann
On Friday 13 December 2013, Linus Walleij wrote:
Hm. I just compiled this defconfig on linux-next:
AS arch/arm/boot/compressed/lib1funcs.o AS arch/arm/boot/compressed/ashldi3.o AS arch/arm/boot/compressed/bswapsdi2.o CC arch/arm/boot/compressed/decompress.o CC arch/arm/boot/compressed/misc.o GZIP arch/arm/boot/compressed/piggy.gzip AS arch/arm/boot/compressed/piggy.gzip.o LD arch/arm/boot/compressed/vmlinux
Quoted 6 lines
OBJCOPY
arch/arm/boot/zImage
Kernel:arch/arm/boot/zImageis readyIt appears that these problems appear if you explicitly enable the DT board support, can't we just put that into the defconfig then, so we don't miss such things?
I don't understand. I didn't enable it manually and I still get it on linux-next-20130107. Maybe you were still on the older linux-next that had not been updated for some time?
Quoted 8 lines
Quoted 4 lines
Two problems:
* Some files that use functions or macros defined in this file fail to include it. I see
drivers/leds/leds-s3c24xx.cI merged a patch fixing this by having that file explicitly include <
plat/gpip-cfg.h> (it was already including it implicitly).
Quoted 7 lines
Quoted 2 lines
and
mach-osiris-dvs.c,It needs this:
#include <linux/platform_data/gpio-samsung-s3c24xx.h>(I have sent a patch.)
Ok, thanks!
Quoted 6 lines
Quoted 2 lines
but there might be more that don't get built
by default.Yeah implicit includes are a nightmare for refactoring... I'm trying to grep around for some symbols to see if I can find some lost cases.
I just tried building with "make allmodconfig KCONFIG_ALLCONFIG=allconfig", with the allconfig file containing a CONFIG_MACH_S3C2410=y statement. This caught a number of additionl problems, some related and some not.
Quoted 8 lines
Quoted 3 lines
* The file includes <
plat/gpio-cfg.h>, which is not a bug yet, but will be once we move s3c24xx to multiplatform, which would make it impossible to include this file from outside ofarch/arm.Yes that needs to be a step for multiplatform enablement. My series only tries to make the problem smaller and remove the dependence on <
mach/gpio.h>. All the <mach/*> and <plat/*> stuff needs to go away eventually ...
True. What is actually the bigger worry here is that the contents of the new file, while correctly moved out of mach/gpio.h also don't belong into include/linux/platform_data, because they don't define a pdata structure but rather the contents that are supposed to be passed from the platform code. I would much prefer if you could move the file back into mach-s3c24xx/ under a new name and keep it out of platform_data. I suspect that the only thing actually needed by the gpio driver is the number of GPIO lines per platform, and we can find another way to communicate that. Most of the contents should be private to the mach-s3c code and not be visible to either the gpio driver or any drivers using the plat/gpio-cfg.h interface.
Quoted 4 lines
Quoted 2 lines
Note that on Exynos, the solution for the gpio driver dependencies was to scrap the driver and use pinctrl-exynos instead.
I think the S3C driver is a different piece of hardware unfortunately.
But exynos was using this driver before it moved to the new pinctrl driver.
Arnd
PATCH v3 1/2 ARM: s3c24xx: get rid of custom <mach/gpio.h>
Quoted 76 lines · On Tuesday 07 of January 2014 20:52:30 Arnd Bergmann wrote:
Quoted 13 lines · Linus Walleij
Quoted 1 line · Arnd Bergmann
On Friday 13 December 2013, Linus Walleij wrote:
Hm. I just compiled this defconfig on linux-next:
AS arch/arm/boot/compressed/lib1funcs.o AS arch/arm/boot/compressed/ashldi3.o AS arch/arm/boot/compressed/bswapsdi2.o CC arch/arm/boot/compressed/decompress.o CC arch/arm/boot/compressed/misc.o GZIP arch/arm/boot/compressed/piggy.gzip AS arch/arm/boot/compressed/piggy.gzip.o LD arch/arm/boot/compressed/vmlinuxQuoted 6 lines
OBJCOPY
arch/arm/boot/zImage
Kernel:arch/arm/boot/zImageis readyIt appears that these problems appear if you explicitly enable the DT board support, can't we just put that into the defconfig then, so we don't miss such things?
I don't understand. I didn't enable it manually and I still get it on linux-next-20130107. Maybe you were still on the older linux-next that had not been updated for some time?
Quoted 8 lines
Quoted 4 lines
Two problems:
* Some files that use functions or macros defined in this file fail to include it. I see
drivers/leds/leds-s3c24xx.cI merged a patch fixing this by having that file explicitly include <
plat/gpip-cfg.h> (it was already including it implicitly).Quoted 7 lines
Quoted 2 lines
and
mach-osiris-dvs.c,It needs this:
#include <linux/platform_data/gpio-samsung-s3c24xx.h>(I have sent a patch.)
Ok, thanks!
Quoted 6 lines
Quoted 2 lines
but there might be more that don't get built
by default.Yeah implicit includes are a nightmare for refactoring... I'm trying to grep around for some symbols to see if I can find some lost cases.
I just tried building with "make allmodconfig KCONFIG_ALLCONFIG=allconfig", with the allconfig file containing a
CONFIG_MACH_S3C2410=ystatement. This caught a number of additionl problems, some related and some not.Quoted 8 lines
Quoted 3 lines
* The file includes <
plat/gpio-cfg.h>, which is not a bug yet, but will be once we move s3c24xx to multiplatform, which would make it impossible to include this file from outside ofarch/arm.Yes that needs to be a step for multiplatform enablement. My series only tries to make the problem smaller and remove the dependence on <
mach/gpio.h>. All the <mach/*> and <plat/*> stuff needs to go away eventually ...True. What is actually the bigger worry here is that the contents of the new file, while correctly moved out of
mach/gpio.halso don't belong intoinclude/linux/platform_data, because they don't define a pdata structure but rather the contents that are supposed to be passed from the platform code. I would much prefer if you could move the file back into mach-s3c24xx/ under a new name and keep it out ofplatform_data. I suspect that the only thing actually needed by the gpio driver is the number of GPIO lines per platform, and we can find another way to communicate that. Most of the contents should be private to the mach-s3c code and not be visible to either the gpio driver or any drivers using theplat/gpio-cfg.hinterface.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Note that on Exynos, the solution for the gpio driver dependencies was to scrap the driver and use pinctrl-exynos instead.
I think the S3C driver is a different piece of hardware unfortunately.
But exynos was using this driver before it moved to the new pinctrl driver.
Note that, however, pinctrl-samsung is a DT-only driver, so for non-DT platforms the old gpio-samsung needs to be used. There are no DT platforms using the old driver, though, all do use the new one.
Best regards,
Tomasz
PATCH v3 1/2 ARM: s3c24xx: get rid of custom <mach/gpio.h>
In reply to Arnd BergmannQuoted 10 lines · Arnd Bergmann
Quoted 3 lines · Linus Walleij
It appears that these problems appear if you explicitly enable the DT board support, can't we just put that into the defconfig then, so we don't miss such things?
I don't understand. I didn't enable it manually and I still get it on linux-next-20130107. Maybe you were still on the older linux-next that had not been updated for some time?
No that's not the problem, I used the latest... but:
(...)
Quoted 3 lines
I just tried building with "make allmodconfig KCONFIG_ALLCONFIG=allconfig", with the allconfig file containing a
CONFIG_MACH_S3C2410=ystatement. This caught a number of additionl problems, some related and some not.
This was the problem, so making new build rules now to see if I can catch this.
Quoted 7 lines
What is actually the bigger worry here is that the contents of the new file, while correctly moved out of
mach/gpio.halso don't belong intoinclude/linux/platform_data, because they don't define a pdata structure but rather the contents that are supposed to be passed from the platform code. I would much prefer if you could move the file back into mach-s3c24xx/ under a new name and keep it out ofplatform_data.
Unfortunately it cannot live right under mach-s3c24xx because there are drivers here and there referring directly to the contents of this file.
The only quick-fix option would be to move it back to <mach/gpio-samsung-s3c24xx.h>
but the real solution is of course to augment all drivers to use gpio descriptors and add descriptor tables to the boardfiles.
I'm a bit reluctant to do that as I'd prefer to be able to test such modifications on HW ... plus time may be better invested in DT migration (as I think is the conclusion of this thread eventually).
Quoted 3 lines
I suspect that the only thing actually needed by the gpio driver is the number of GPIO lines per platform, and we can find another way to communicate that.
A bit more: if you look in drivers/gpio/gpio-samsung.c you see bank base GPIO offset for each bank into the global scope *and* the number of GPIOs for each bank propagated from machine headers instead of using platform data.
Again the proper solution (if the boardfiles are kept) is to switch to using a GPIO descriptor table. Or using DT.
Quoted 3 lines
Most of the contents should
be private to the mach-s3c code and not be visible to either the gpio driver or any drivers using theplat/gpio-cfg.hinterface.
Samsungs <plat/gpio-cfg.h> is basically a custom legacy pin control implementation.
The real solution to getting rid of that file is to switch over to using pinctrl-[samsung|s3c24xx] which as Heiko describes mandates also using DT, and thus blocks attempts
at using this path for fixing the legacy boardfiles.
It's one of these situations where we end up with an all-or-nothing conversion path: either you change everything over to device tree or everything stays in two copies ... I'm trying to refactor the existing board files here maybe that is in vain :-/ as GPIO maintainer I want to get rid of <mach/gpio.h>.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Note that on Exynos, the solution for the gpio driver dependencies was to scrap the driver and use pinctrl-exynos instead.
I think the S3C driver is a different piece of hardware unfortunately.
But exynos was using this driver before it moved to the new pinctrl driver.
I was wrong about this, too much in my head. As Tomasz says, pinctrl-samsung can be used, but mandates that everything is moved over to device tree.
Probably the best thing now that I have one problem less is to leave it to the S3C maintainers to complete their DT migration?
Yours,
Linus Walleij
PATCH v3 1/2 ARM: s3c24xx: get rid of custom <mach/gpio.h>
Quoted 9 lines · Linus Walleij
Quoted 7 lines · Arnd Bergmann
What is actually the bigger worry here is that the contents of the new file, while correctly moved out of
mach/gpio.halso don't belong intoinclude/linux/platform_data, because they don't define a pdata structure but rather the contents that are supposed to be passed from the platform code. I would much prefer if you could move the file back into mach-s3c24xx/ under a new name and keep it out ofplatform_data.
Quoted 3 lines
Unfortunately it cannot live right under mach-s3c24xx because there are drivers here and there referring directly to the contents of this file.
I think they only reference a small portion of the total contents. The idea was to make whatever is really needed by drivers visible in a header and keep everything else in the mach directory.
Quoted 4 lines
The only quick-fix option would be to move it back to <
mach/gpio-samsung-s3c24xx.h>
but the real solution is of course to augment all drivers to use gpio descriptors and add descriptor tables to the boardfiles.
Right. I would use <mach/gpio-samsung.h> though, so you don't have to #ifdef it on the platform as you currently do in the gpio driver.
Quoted 4 lines
I'm a bit reluctant to do that as I'd prefer to be able to test such modifications on HW ... plus time may be better invested in DT migration (as I think is the conclusion of this thread eventually).
Doing the full DT migration would of course be best, but I would suspect that to take quite a while still.
Quoted 11 lines
Quoted 3 lines
I suspect that the only thing actually needed by the gpio driver is the number of GPIO lines per platform, and we can find another way to communicate that.
A bit more: if you look in
drivers/gpio/gpio-samsung.cyou see bank base GPIO offset for each bank into the global scope *and* the number of GPIOs for each bank propagated from machine headers instead of using platform data.Again the proper solution (if the boardfiles are kept) is to switch to using a GPIO descriptor table. Or using DT.
Ok.
Quoted 12 lines
Quoted 3 lines
Most of the contents should
be private to the mach-s3c code and not be visible to either the gpio driver or any drivers using theplat/gpio-cfg.hinterface.Samsungs <
plat/gpio-cfg.h> is basically a custom legacy pin control implementation.The real solution to getting rid of that file is to switch over to using pinctrl-[samsung|s3c24xx] which as Heiko describes mandates also using DT, and thus blocks attempts
at using this path for fixing the legacy boardfiles.
Quoted 6 lines
It's one of these situations where we end up with an all-or-nothing conversion path: either you change everything over to device tree or everything stays in two copies ... I'm trying to refactor the existing board files here maybe that is in vain :-/ as GPIO maintainer I want to get rid of <
mach/gpio.h>.
Well, we can't do it all at once, and we have to start untangling this somewhere. Getting rid of mach/gpio.h sounds as good to me as any other part of the puzzle, as long as we don't do something bad along the lines that comes back to bite us later.
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Note that on Exynos, the solution for the gpio driver dependencies was to scrap the driver and use pinctrl-exynos instead.
I think the S3C driver is a different piece of hardware unfortunately.
But exynos was using this driver before it moved to the new pinctrl driver.
Quoted 6 lines
I was wrong about this, too much in my head. As Tomasz says, pinctrl-samsung can be used, but mandates that everything is moved over to device tree.
Probably the best thing now that I have one problem less is to leave it to the S3C maintainers to complete their DT migration?
Let me have another look first, maybe I can find an intermediate step that helps you on your conquest to kill mach/gpio.h.
Arnd
PATCH v3 1/2 ARM: s3c24xx: get rid of custom <mach/gpio.h>
Quoted 2 lines · Arnd Bergmann
Quoted 1 line · Linus Walleij
On Tue, Jan 7, 2014 at 8:52 PM, Arnd Bergmann <[email protected]> wrote:
b> >
Quoted 9 lines
Quoted 6 lines
I was wrong about this, too much in my head. As Tomasz says, pinctrl-samsung can be used, but mandates that everything is moved over to device tree.
Probably the best thing now that I have one problem less is to leave it to the S3C maintainers to complete their DT migration?
Let me have another look first, maybe I can find an intermediate step that helps you on your conquest to kill
mach/gpio.h.
I've asked the mighty grep and it said that these are the files using the contents you moved around:
drivers/gpio/gpio-samsung.cdrivers/leds/leds-s3c24xx.cdrivers/mmc/host/s3cmci.csound/soc/samsung/h1940_uda1380.csound/soc/samsung/neo1973_wm8753.csound/soc/samsung/rx1950_uda1380.csound/soc/samsung/s3c2412-i2s.csound/soc/samsung/s3c24xx-i2s.csound/soc/samsung/smartq_wm8987.c
The symbols used in these drivers are:
S3C....GP.()S3C_GPIO_END
S3C_GPIO_PULL_.*S3C_GPIO_SFN()s3c_gpio_cfgall_range()s3c_gpio_setpull()
which is basically all of the mach/gpio.h file, plus a few small parts of the plat/gpio-cfg.h file. The rest of plat/gpio-cfg.h however is used in board files to call into the gpio-samsung.c driver, so we still need the header file for those, until the board files get replaced with DT descriptions using the pinctrl interface.
I think it would be worthwhile to go ahead and make all inclusions of the plat/gpio-cfg.h file explicit, and remove it from mach/gpio.h, that part should be simple enough and helpful at the same time. Besides the leds-s3c24xx.c and gpio-samsung.c files we already talked about, I think it's only s3cmci.c, s3c2412-i2s.c and s3c24xx-i2s.c that still need this outside of mach-s3c*.
The correct way to get rid of S3C...._GP. and S3C_GPIO_END would be to pass the GPIO numbers from platform code in platform_data pointers. It's not hard to do, but tedious to get right for the seven drivers that need them.
Arnd
PATCH v3 1/2 ARM: s3c24xx: get rid of custom <mach/gpio.h>
Quoted 13 lines · Arnd Bergmann
I've asked the mighty grep and it said that these are the files using the contents you moved around:
drivers/gpio/gpio-samsung.cdrivers/leds/leds-s3c24xx.cdrivers/mmc/host/s3cmci.csound/soc/samsung/h1940_uda1380.csound/soc/samsung/neo1973_wm8753.csound/soc/samsung/rx1950_uda1380.csound/soc/samsung/s3c2412-i2s.csound/soc/samsung/s3c24xx-i2s.csound/soc/samsung/smartq_wm8987.c
Quoted 8 lines
The symbols used in these drivers are:
S3C....GP.()
S3C_GPIO_END
S3C_GPIO_PULL_.*S3C_GPIO_SFN()s3c_gpio_cfgall_range()s3c_gpio_setpull()
Hm I will look closer at these. Maybe I can even fix some to just pass GPIO thru platform data and end-of-story them. Targeting v3.15.
But I guess you want me to move the <linux/platform_data/gpio-s3c*> back to <mach/*> before v3.14 so focusing on that now. (These patches cannot be just reverted as people have fixed other Samsung GPIO issues on top of them, so it needs to be done carefully.)
Quoted 3 lines
I think it would be worthwhile to go ahead and make all inclusions of the
plat/gpio-cfg.hfile explicit, and remove it frommach/gpio.h, that part should be simple enough and helpful at the same time.
<plat/gpio-cfg.h> is used by S5P as well, but I guess you've checked that.
If I take it driver-by-driver it should be possible to get rid of it or most of it I think, reducing it to the arch/arm/mach-* folder.
Certainly I should be attacking S3C and S5P simultaneously.
Yours,
Linus Walleij
PATCH v3 1/2 ARM: s3c24xx: get rid of custom <mach/gpio.h>
Quoted 24 lines · On Tuesday 14 January 2014 11:42:08 Linus Walleij wrote:
Quoted 13 lines · Arnd Bergmann
I've asked the mighty grep and it said that these are the files using the contents you moved around:
drivers/gpio/gpio-samsung.cdrivers/leds/leds-s3c24xx.cdrivers/mmc/host/s3cmci.csound/soc/samsung/h1940_uda1380.csound/soc/samsung/neo1973_wm8753.csound/soc/samsung/rx1950_uda1380.csound/soc/samsung/s3c2412-i2s.csound/soc/samsung/s3c24xx-i2s.csound/soc/samsung/smartq_wm8987.cQuoted 8 lines
The symbols used in these drivers are:
S3C....GP.()
S3C_GPIO_END
S3C_GPIO_PULL_.*S3C_GPIO_SFN()s3c_gpio_cfgall_range()s3c_gpio_setpull()
Quoted 3 lines
Hm I will look closer at these. Maybe I can even fix some to just pass GPIO thru platform data and end-of-story them. Targeting v3.15.
Ok, sounds good. That will take care of the first two of this list, which are the most common ones. The others are from plat/gpio-cfg.h.
Quoted 6 lines
But I guess you want me to move the <linux/platform_data/gpio-s3c*> back to <mach/*> before v3.14 so focusing on that now. (These patches cannot be just reverted as people have fixed other Samsung GPIO issues on top of them, so it needs to be done carefully.)
Yes, that would be good. Maybe <mach/gpio-samsung.h> for the contents rather than putting them back into the common mach/gpio.h?
Quoted 11 lines
Quoted 3 lines
I think it would be worthwhile to go ahead and make all inclusions of the
plat/gpio-cfg.hfile explicit, and remove it frommach/gpio.h, that part should be simple enough and helpful at the same time.<
plat/gpio-cfg.h> is used by S5P as well, but I guess you've checked that.If I take it driver-by-driver it should be possible to get rid of it or most of it I think, reducing it to the
arch/arm/mach-*folder.Certainly I should be attacking S3C and S5P simultaneously.
That makes sense, but note that there is also work going on to make S5P64xx and S5PV210 multiplatform and DT-only and multiplatform, and to deprecate S5PC100. If those things happen first, you no longer have to worry about these platforms as they won't be using this driver any more.
Arnd
PATCH v3 1/2 ARM: s3c24xx: get rid of custom <mach/gpio.h>
In reply to Linus WalleijQuoted 1 line · Linus Walleij
I think the S3C driver is a different piece of hardware unfortunately.
It's not, the IP is basically the same - the difference between s3c, s5p
and Exynos is a marketing one, Samsung have generally just reused IP
where that is reasonable. There's a great deal of continuity in the
platforms.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140108/4a8abf37/attachment.sig>