Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+23 -85
+21
arch/arm/Kconfig
··· 202 202 this feature (eg, building a kernel for a single machine) and 203 203 you need to shrink the kernel to the minimal size. 204 204 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 + 205 212 config NEED_MACH_IO_H 206 213 bool 207 214 help ··· 352 345 select HAVE_CLK 353 346 select CLKDEV_LOOKUP 354 347 select IRQ_DOMAIN 348 + select NEED_MACH_GPIO_H 355 349 select NEED_MACH_IO_H if PCCARD 356 350 help 357 351 This enables support for systems based on Atmel ··· 531 523 bool "IOP32x-based" 532 524 depends on MMU 533 525 select CPU_XSCALE 526 + select NEED_MACH_GPIO_H 534 527 select NEED_MACH_IO_H 535 528 select NEED_RET_TO_USER 536 529 select PLAT_IOP ··· 545 536 bool "IOP33x-based" 546 537 depends on MMU 547 538 select CPU_XSCALE 539 + select NEED_MACH_GPIO_H 548 540 select NEED_MACH_IO_H 549 541 select NEED_RET_TO_USER 550 542 select PLAT_IOP ··· 655 645 select PLAT_PXA 656 646 select SPARSE_IRQ 657 647 select GENERIC_ALLOCATOR 648 + select NEED_MACH_GPIO_H 658 649 help 659 650 Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line. 660 651 ··· 744 733 select MULTI_IRQ_HANDLER 745 734 select ARM_CPU_SUSPEND if PM 746 735 select HAVE_IDE 736 + select NEED_MACH_GPIO_H 747 737 help 748 738 Support for Intel/Marvell's PXA2xx/PXA3xx processor line. 749 739 ··· 807 795 select CLKDEV_LOOKUP 808 796 select ARCH_REQUIRE_GPIOLIB 809 797 select HAVE_IDE 798 + select NEED_MACH_GPIO_H 810 799 select NEED_MACH_MEMORY_H 811 800 select SPARSE_IRQ 812 801 help ··· 823 810 select HAVE_S3C2410_I2C if I2C 824 811 select HAVE_S3C_RTC if RTC_CLASS 825 812 select HAVE_S3C2410_WATCHDOG if WATCHDOG 813 + select NEED_MACH_GPIO_H 826 814 select NEED_MACH_IO_H 827 815 help 828 816 Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443 ··· 851 837 select SAMSUNG_GPIOLIB_4BIT 852 838 select HAVE_S3C2410_I2C if I2C 853 839 select HAVE_S3C2410_WATCHDOG if WATCHDOG 840 + select NEED_MACH_GPIO_H 854 841 help 855 842 Samsung S3C64XX series based systems 856 843 ··· 866 851 select GENERIC_CLOCKEVENTS 867 852 select HAVE_S3C2410_I2C if I2C 868 853 select HAVE_S3C_RTC if RTC_CLASS 854 + select NEED_MACH_GPIO_H 869 855 help 870 856 Samsung S5P64X0 CPU based systems, such as the Samsung SMDK6440, 871 857 SMDK6450. ··· 881 865 select HAVE_S3C2410_I2C if I2C 882 866 select HAVE_S3C_RTC if RTC_CLASS 883 867 select HAVE_S3C2410_WATCHDOG if WATCHDOG 868 + select NEED_MACH_GPIO_H 884 869 help 885 870 Samsung S5PC100 series based systems 886 871 ··· 899 882 select HAVE_S3C2410_I2C if I2C 900 883 select HAVE_S3C_RTC if RTC_CLASS 901 884 select HAVE_S3C2410_WATCHDOG if WATCHDOG 885 + select NEED_MACH_GPIO_H 902 886 select NEED_MACH_MEMORY_H 903 887 help 904 888 Samsung S5PV210/S5PC110 series based systems ··· 917 899 select HAVE_S3C_RTC if RTC_CLASS 918 900 select HAVE_S3C2410_I2C if I2C 919 901 select HAVE_S3C2410_WATCHDOG if WATCHDOG 902 + select NEED_MACH_GPIO_H 920 903 select NEED_MACH_MEMORY_H 921 904 help 922 905 Support for SAMSUNG's EXYNOS SoCs (EXYNOS4/5) ··· 990 971 select GENERIC_ALLOCATOR 991 972 select GENERIC_IRQ_CHIP 992 973 select ARCH_HAS_HOLES_MEMORYMODEL 974 + select NEED_MACH_GPIO_H 993 975 help 994 976 Support for TI's DaVinci platform. 995 977 ··· 1003 983 select CLKSRC_MMIO 1004 984 select GENERIC_CLOCKEVENTS 1005 985 select ARCH_HAS_HOLES_MEMORYMODEL 986 + select NEED_MACH_GPIO_H 1006 987 help 1007 988 Support for TI's OMAP platform (OMAP1/2/3/4). 1008 989
+2
arch/arm/include/asm/gpio.h
··· 6 6 #endif 7 7 8 8 /* not all ARM platforms necessarily support this API ... */ 9 + #ifdef CONFIG_NEED_MACH_GPIO_H 9 10 #include <mach/gpio.h> 11 + #endif 10 12 11 13 #ifndef __ARM_GPIOLIB_COMPLEX 12 14 /* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */
-1
arch/arm/mach-dove/include/mach/gpio.h
··· 1 - /* empty */
-1
arch/arm/mach-ep93xx/include/mach/gpio.h
··· 1 - /* empty */
-1
arch/arm/mach-highbank/include/mach/gpio.h
··· 1 - /* empty */
-2
arch/arm/mach-ixp4xx/include/mach/gpio.h
··· 1 - /* empty */ 2 -
-1
arch/arm/mach-kirkwood/include/mach/gpio.h
··· 1 - /* empty */
-1
arch/arm/mach-msm/include/mach/gpio.h
··· 1 - /* empty */
-1
arch/arm/mach-mxs/include/mach/gpio.h
··· 1 - /* empty */
-4
arch/arm/mach-nomadik/include/mach/gpio.h
··· 1 - #ifndef __ASM_ARCH_GPIO_H 2 - #define __ASM_ARCH_GPIO_H 3 - 4 - #endif /* __ASM_ARCH_GPIO_H */
-1
arch/arm/mach-orion5x/include/mach/gpio.h
··· 1 - /* empty */
-1
arch/arm/mach-picoxcell/include/mach/gpio.h
··· 1 - /* empty */
-1
arch/arm/mach-realview/include/mach/gpio.h
··· 1 - /* empty */
-1
arch/arm/mach-shmobile/include/mach/gpio.h
··· 1 - /* empty */
-19
arch/arm/mach-spear13xx/include/mach/gpio.h
··· 1 - /* 2 - * arch/arm/mach-spear13xx/include/mach/gpio.h 3 - * 4 - * GPIO macros for SPEAr13xx machine family 5 - * 6 - * Copyright (C) 2012 ST Microelectronics 7 - * Viresh Kumar <viresh.linux@gmail.com> 8 - * 9 - * This file is licensed under the terms of the GNU General Public 10 - * License version 2. This program is licensed "as is" without any 11 - * warranty of any kind, whether express or implied. 12 - */ 13 - 14 - #ifndef __MACH_GPIO_H 15 - #define __MACH_GPIO_H 16 - 17 - #include <plat/gpio.h> 18 - 19 - #endif /* __MACH_GPIO_H */
-19
arch/arm/mach-spear3xx/include/mach/gpio.h
··· 1 - /* 2 - * arch/arm/mach-spear3xx/include/mach/gpio.h 3 - * 4 - * GPIO macros for SPEAr3xx machine family 5 - * 6 - * Copyright (C) 2009 ST Microelectronics 7 - * Viresh Kumar<viresh.linux@gmail.com> 8 - * 9 - * This file is licensed under the terms of the GNU General Public 10 - * License version 2. This program is licensed "as is" without any 11 - * warranty of any kind, whether express or implied. 12 - */ 13 - 14 - #ifndef __MACH_GPIO_H 15 - #define __MACH_GPIO_H 16 - 17 - #include <plat/gpio.h> 18 - 19 - #endif /* __MACH_GPIO_H */
-19
arch/arm/mach-spear6xx/include/mach/gpio.h
··· 1 - /* 2 - * arch/arm/mach-spear6xx/include/mach/gpio.h 3 - * 4 - * GPIO macros for SPEAr6xx machine family 5 - * 6 - * Copyright (C) 2009 ST Microelectronics 7 - * Viresh Kumar <viresh.linux@gmail.com> 8 - * 9 - * This file is licensed under the terms of the GNU General Public 10 - * License version 2. This program is licensed "as is" without any 11 - * warranty of any kind, whether express or implied. 12 - */ 13 - 14 - #ifndef __MACH_GPIO_H 15 - #define __MACH_GPIO_H 16 - 17 - #include <plat/gpio.h> 18 - 19 - #endif /* __MACH_GPIO_H */
-1
arch/arm/mach-tegra/include/mach/gpio.h
··· 1 - /* empty */
-1
arch/arm/mach-u300/include/mach/gpio.h
··· 1 - /* empty */
-5
arch/arm/mach-ux500/include/mach/gpio.h
··· 1 - #ifndef __ASM_ARCH_GPIO_H 2 - #define __ASM_ARCH_GPIO_H 3 - 4 - 5 - #endif /* __ASM_ARCH_GPIO_H */
-1
arch/arm/mach-versatile/include/mach/gpio.h
··· 1 - /* empty */
-1
arch/arm/mach-vexpress/include/mach/gpio.h
··· 1 - /* empty */
-1
arch/arm/mach-vt8500/include/mach/gpio.h
··· 1 - /* empty */
-1
arch/arm/plat-mxc/include/mach/gpio.h
··· 1 - /* empty */
-1
arch/arm/plat-spear/include/plat/gpio.h
··· 1 - /* empty */