Skip to content

Commit 0146422

Browse files
author
Rob Herring
committed
ARM: make mach/gpio.h headers optional
Most platforms don't need mach/gpio.h and it prevents multi-platform kernel images. Add CONFIG_NEED_MACH_GPIO_H and make platforns select it if they need gpio.h. This is platforms that define __GPIOLIB_COMPLEX or have lots of implicit includes pulled in by mach/gpio.h. at91 and omap have gpio clean-up pending and can drop CONFIG_NEED_MACH_GPIO_H once that is in. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Cc: Russell King <linux@arm.linux.org.uk> Acked-by: Jason Cooper <jason@lakedaemon.net> Acked-by: Linus Walleij <linus.walleij@linaro.org>
1 parent ce91574 commit 0146422

25 files changed

Lines changed: 23 additions & 85 deletions

File tree

‎arch/arm/Kconfig‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,13 @@ config ARM_PATCH_PHYS_VIRT
202202
this feature (eg, building a kernel for a single machine) and
203203
you need to shrink the kernel to the minimal size.
204204

205+
config NEED_MACH_GPIO_H
206+
bool
207+
help
208+
Select this when mach/gpio.h is required to provide special
209+
definitions for this platform. The need for mach/gpio.h should
210+
be avoided when possible.
211+
205212
config NEED_MACH_IO_H
206213
bool
207214
help
@@ -345,6 +352,7 @@ config ARCH_AT91
345352
select HAVE_CLK
346353
select CLKDEV_LOOKUP
347354
select IRQ_DOMAIN
355+
select NEED_MACH_GPIO_H
348356
select NEED_MACH_IO_H if PCCARD
349357
help
350358
This enables support for systems based on Atmel
@@ -523,6 +531,7 @@ config ARCH_IOP32X
523531
bool "IOP32x-based"
524532
depends on MMU
525533
select CPU_XSCALE
534+
select NEED_MACH_GPIO_H
526535
select NEED_MACH_IO_H
527536
select NEED_RET_TO_USER
528537
select PLAT_IOP
@@ -536,6 +545,7 @@ config ARCH_IOP33X
536545
bool "IOP33x-based"
537546
depends on MMU
538547
select CPU_XSCALE
548+
select NEED_MACH_GPIO_H
539549
select NEED_MACH_IO_H
540550
select NEED_RET_TO_USER
541551
select PLAT_IOP
@@ -645,6 +655,7 @@ config ARCH_MMP
645655
select PLAT_PXA
646656
select SPARSE_IRQ
647657
select GENERIC_ALLOCATOR
658+
select NEED_MACH_GPIO_H
648659
help
649660
Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line.
650661

@@ -733,6 +744,7 @@ config ARCH_PXA
733744
select MULTI_IRQ_HANDLER
734745
select ARM_CPU_SUSPEND if PM
735746
select HAVE_IDE
747+
select NEED_MACH_GPIO_H
736748
help
737749
Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
738750

@@ -795,6 +807,7 @@ config ARCH_SA1100
795807
select CLKDEV_LOOKUP
796808
select ARCH_REQUIRE_GPIOLIB
797809
select HAVE_IDE
810+
select NEED_MACH_GPIO_H
798811
select NEED_MACH_MEMORY_H
799812
select SPARSE_IRQ
800813
help
@@ -810,6 +823,7 @@ config ARCH_S3C24XX
810823
select HAVE_S3C2410_I2C if I2C
811824
select HAVE_S3C_RTC if RTC_CLASS
812825
select HAVE_S3C2410_WATCHDOG if WATCHDOG
826+
select NEED_MACH_GPIO_H
813827
select NEED_MACH_IO_H
814828
help
815829
Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443
@@ -837,6 +851,7 @@ config ARCH_S3C64XX
837851
select SAMSUNG_GPIOLIB_4BIT
838852
select HAVE_S3C2410_I2C if I2C
839853
select HAVE_S3C2410_WATCHDOG if WATCHDOG
854+
select NEED_MACH_GPIO_H
840855
help
841856
Samsung S3C64XX series based systems
842857

@@ -851,6 +866,7 @@ config ARCH_S5P64X0
851866
select GENERIC_CLOCKEVENTS
852867
select HAVE_S3C2410_I2C if I2C
853868
select HAVE_S3C_RTC if RTC_CLASS
869+
select NEED_MACH_GPIO_H
854870
help
855871
Samsung S5P64X0 CPU based systems, such as the Samsung SMDK6440,
856872
SMDK6450.
@@ -865,6 +881,7 @@ config ARCH_S5PC100
865881
select HAVE_S3C2410_I2C if I2C
866882
select HAVE_S3C_RTC if RTC_CLASS
867883
select HAVE_S3C2410_WATCHDOG if WATCHDOG
884+
select NEED_MACH_GPIO_H
868885
help
869886
Samsung S5PC100 series based systems
870887

@@ -882,6 +899,7 @@ config ARCH_S5PV210
882899
select HAVE_S3C2410_I2C if I2C
883900
select HAVE_S3C_RTC if RTC_CLASS
884901
select HAVE_S3C2410_WATCHDOG if WATCHDOG
902+
select NEED_MACH_GPIO_H
885903
select NEED_MACH_MEMORY_H
886904
help
887905
Samsung S5PV210/S5PC110 series based systems
@@ -899,6 +917,7 @@ config ARCH_EXYNOS
899917
select HAVE_S3C_RTC if RTC_CLASS
900918
select HAVE_S3C2410_I2C if I2C
901919
select HAVE_S3C2410_WATCHDOG if WATCHDOG
920+
select NEED_MACH_GPIO_H
902921
select NEED_MACH_MEMORY_H
903922
help
904923
Support for SAMSUNG's EXYNOS SoCs (EXYNOS4/5)
@@ -971,6 +990,7 @@ config ARCH_DAVINCI
971990
select GENERIC_ALLOCATOR
972991
select GENERIC_IRQ_CHIP
973992
select ARCH_HAS_HOLES_MEMORYMODEL
993+
select NEED_MACH_GPIO_H
974994
help
975995
Support for TI's DaVinci platform.
976996

@@ -983,6 +1003,7 @@ config ARCH_OMAP
9831003
select CLKSRC_MMIO
9841004
select GENERIC_CLOCKEVENTS
9851005
select ARCH_HAS_HOLES_MEMORYMODEL
1006+
select NEED_MACH_GPIO_H
9861007
help
9871008
Support for TI's OMAP platform (OMAP1/2/3/4).
9881009

‎arch/arm/include/asm/gpio.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
#endif
77

88
/* not all ARM platforms necessarily support this API ... */
9+
#ifdef CONFIG_NEED_MACH_GPIO_H
910
#include <mach/gpio.h>
11+
#endif
1012

1113
#ifndef __ARM_GPIOLIB_COMPLEX
1214
/* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */

‎arch/arm/mach-dove/include/mach/gpio.h‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎arch/arm/mach-ep93xx/include/mach/gpio.h‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎arch/arm/mach-highbank/include/mach/gpio.h‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎arch/arm/mach-ixp4xx/include/mach/gpio.h‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎arch/arm/mach-kirkwood/include/mach/gpio.h‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎arch/arm/mach-msm/include/mach/gpio.h‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎arch/arm/mach-mxs/include/mach/gpio.h‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎arch/arm/mach-nomadik/include/mach/gpio.h‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)