Skip to contentSkip to conversation

ARM: s3c64xx: get rid of custom <mach/gpio.h>

PATCH New Linus Walleij 3 participants 3 messages Dec 13, 2013 – Dec 18, 2013

Subsystems (4)

v2 of 3 New Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 2/2 ARM: s3c64xx: get rid of custom <mach/gpio.h>

This isolates the custom S3C64xx GPIO definition table to <linux/platform_data/gpio-samsung-s3x64xx.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.

Also delete the CONFIG_SAMSUNG_GPIO_EXTRA stuff. Instead roof the number of GPIOs for this platform:
First sum up all the GPIO banks from A to Q: 187 GPIOs. Add the 16 "board GPIOs" and the roof for SAMSUNG_GPIO_EXTRA, 128, so in total maximum 187+16+128 = 331 GPIOs, so let's take the same roof as for S3C24XX: 512. This way we can do away with the GPIO calculation macros for GPIO_BOARD_START, BOARD_NR_GPIOS and the definition of ARCH_NR_GPIOS.

---
ChangeLog v1->v2:
- Move the movement of the actual gpio.h file into this patch after mistakenly having it end up in the S3C24xx patch.
- Add a missing ifdef for the pm-gpio.c code in plat-samsung.

This patch depends on
"ARM: s3c24xx: get rid of custom <mach/gpio.h>"

I will take this through the GPIO tree.

---
 arch/arm/Kconfig                                   |  3 +-
 arch/arm/mach-s3c64xx/Kconfig                      |  3 -
 arch/arm/mach-s3c64xx/common.c                     |  1 +
 arch/arm/mach-s3c64xx/crag6410.h                   |  2 +-
 arch/arm/mach-s3c64xx/dev-audio.c                  |  1 +
 arch/arm/mach-s3c64xx/include/mach/gpio.h          | 93 ---------------------
 arch/arm/mach-s3c64xx/mach-anw6410.c               |  1 +
 arch/arm/mach-s3c64xx/mach-crag6410.c              |  1 +
 arch/arm/mach-s3c64xx/mach-hmt.c                   |  1 +
 arch/arm/mach-s3c64xx/mach-mini6410.c              |  1 +
 arch/arm/mach-s3c64xx/mach-real6410.c              |  1 +
 arch/arm/mach-s3c64xx/mach-smartq.c                |  1 +
 arch/arm/mach-s3c64xx/mach-smartq5.c               |  1 +
 arch/arm/mach-s3c64xx/mach-smartq7.c               |  1 +
 arch/arm/mach-s3c64xx/mach-smdk6400.c              |  1 +
 arch/arm/mach-s3c64xx/mach-smdk6410.c              |  1 +
 arch/arm/mach-s3c64xx/pm.c                         |  1 +
 arch/arm/mach-s3c64xx/setup-fb-24bpp.c             |  1 +
 arch/arm/mach-s3c64xx/setup-i2c0.c                 |  1 +
 arch/arm/mach-s3c64xx/setup-i2c1.c                 |  1 +
 arch/arm/mach-s3c64xx/setup-ide.c                  |  1 +
 arch/arm/mach-s3c64xx/setup-keypad.c               |  1 +
 arch/arm/mach-s3c64xx/setup-sdhci-gpio.c           |  1 +
 arch/arm/mach-s3c64xx/setup-spi.c                  |  1 +
 arch/arm/plat-samsung/pm-gpio.c                    |  3 +
 drivers/gpio/gpio-samsung.c                        |  3 +
 include/linux/platform_data/gpio-samsung-s3c64xx.h | 94 ++++++++++++++++++++++
 27 files changed, 122 insertions(+), 99 deletions(-)
 delete mode 100644 arch/arm/mach-s3c64xx/include/mach/gpio.h
 create mode 100644 include/linux/platform_data/gpio-samsung-s3c64xx.h
arch/arm/Kconfig +1 -2
index 6a26bcb3a63a..103437986684 100644
@@ -732,7 +732,6 @@ config ARCH_S3C64XX
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
 	select HAVE_TCM
-	select NEED_MACH_GPIO_H
 	select NO_IOPORT
 	select PLAT_SAMSUNG
 	select PM_GENERIC_DOMAINS
@@ -1592,7 +1591,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 || ARCH_S3C24XX
+	default 512 if ARCH_EXYNOS || ARCH_KEYSTONE || SOC_OMAP5 || SOC_DRA7XX || ARCH_S3C24XX || ARCH_S3C64XX
 	default 392 if ARCH_U8500
 	default 352 if ARCH_VT8500
 	default 288 if ARCH_SUNXI
arch/arm/mach-s3c64xx/Kconfig +0 -3
index 2cb8dc55b50e..175f01501129 100644
@@ -192,7 +192,6 @@ config SMDK6410_WM1190_EV1
 	select MFD_WM8350_I2C
 	select REGULATOR
 	select REGULATOR_WM8350
-	select SAMSUNG_GPIO_EXTRA64
 	help
 	  The Wolfson Microelectronics 1190-EV1 is a WM835x based PMIC
 	  and audio daughtercard for the Samsung SMDK6410 reference
@@ -208,7 +207,6 @@ config SMDK6410_WM1192_EV1
 	select MFD_WM831X_I2C
 	select REGULATOR
 	select REGULATOR_WM831X
-	select SAMSUNG_GPIO_EXTRA64
 	help
 	  The Wolfson Microelectronics 1192-EV1 is a WM831x based PMIC
 	  daughtercard for the Samsung SMDK6410 reference platform.
@@ -294,7 +292,6 @@ config MACH_WLF_CRAGG_6410
 	select SAMSUNG_DEV_ADC
 	select SAMSUNG_DEV_KEYPAD
 	select SAMSUNG_DEV_PWM
-	select SAMSUNG_GPIO_EXTRA128
 	help
 	  Machine support for the Wolfson Cragganmore S3C6410 variant.
 
arch/arm/mach-s3c64xx/common.c +1 -0
index 7a3ce4c39e5f..64edda37bde3 100644
@@ -32,6 +32,7 @@
 #include <linux/irq.h>
 #include <linux/gpio.h>
 #include <linux/irqchip/arm-vic.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 #include <clocksource/samsung_pwm.h>
 
 #include <asm/mach/arch.h>
arch/arm/mach-s3c64xx/crag6410.h +1 -1
index 4c3c9994fc2c..9ef20b8fd36f 100644
@@ -11,7 +11,7 @@
 #ifndef MACH_CRAG6410_H
 #define MACH_CRAG6410_H
 
-#include <linux/gpio.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 
 #define GLENFARCLAS_PMIC_IRQ_BASE	IRQ_BOARD_START
 
arch/arm/mach-s3c64xx/dev-audio.c +1 -0
index e367e87bbc29..6f58c80235dc 100644
@@ -21,6 +21,7 @@
 
 #include <plat/devs.h>
 #include <linux/platform_data/asoc-s3c.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 #include <plat/gpio-cfg.h>
 
 static int s3c64xx_i2s_cfg_gpio(struct platform_device *pdev)
arch/arm/mach-s3c64xx/include/mach/gpio.h deleted +0 -93

93 lines not on this page · raw message

arch/arm/mach-s3c64xx/mach-anw6410.c +1 -0
index d266dd5f7060..546f45b59ea1 100644
@@ -43,6 +43,7 @@
 
 #include <plat/regs-serial.h>
 #include <linux/platform_data/i2c-s3c2410.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 #include <plat/fb.h>
 
 #include <plat/clock.h>
arch/arm/mach-s3c64xx/mach-crag6410.c +1 -0
index 758e31b26550..7b913595e4ee 100644
@@ -32,6 +32,7 @@
 
 #include <linux/platform_data/pca953x.h>
 #include <linux/platform_data/s3c-hsotg.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 
 #include <video/platform_lcd.h>
 
arch/arm/mach-s3c64xx/mach-hmt.c +1 -0
index 614a03a92cf7..009b19525cbf 100644
@@ -35,6 +35,7 @@
 
 #include <plat/regs-serial.h>
 #include <linux/platform_data/i2c-s3c2410.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 #include <plat/fb.h>
 #include <linux/platform_data/mtd-nand-s3c2410.h>
 
arch/arm/mach-s3c64xx/mach-mini6410.c +1 -0
index 58d46a3d7b78..14c96ee5a3fe 100644
@@ -38,6 +38,7 @@
 #include <linux/platform_data/mtd-nand-s3c2410.h>
 #include <plat/regs-serial.h>
 #include <linux/platform_data/touchscreen-s3c2410.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 
 #include <video/platform_lcd.h>
 #include <video/samsung_fimd.h>
arch/arm/mach-s3c64xx/mach-real6410.c +1 -0
index 8bed37b3d5ac..af45149a96b3 100644
@@ -39,6 +39,7 @@
 #include <linux/platform_data/mtd-nand-s3c2410.h>
 #include <plat/regs-serial.h>
 #include <linux/platform_data/touchscreen-s3c2410.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 
 #include <video/platform_lcd.h>
 #include <video/samsung_fimd.h>
arch/arm/mach-s3c64xx/mach-smartq.c +1 -0
index a6b338fd0470..0271b3a191e5 100644
@@ -36,6 +36,7 @@
 #include <linux/platform_data/usb-ohci-s3c2410.h>
 #include <plat/sdhci.h>
 #include <linux/platform_data/touchscreen-s3c2410.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 
 #include <video/platform_lcd.h>
 #include <plat/samsung-time.h>
arch/arm/mach-s3c64xx/mach-smartq5.c +1 -0
index 8aca5daf3d05..15b6c2f98086 100644
@@ -16,6 +16,7 @@
 #include <linux/input.h>
 #include <linux/leds.h>
 #include <linux/platform_device.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
arch/arm/mach-s3c64xx/mach-smartq7.c +1 -0
index a052e107c0b4..e3b58942ee68 100644
@@ -16,6 +16,7 @@
 #include <linux/input.h>
 #include <linux/leds.h>
 #include <linux/platform_device.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
arch/arm/mach-s3c64xx/mach-smdk6400.c +1 -0
index 27381cfcabbe..bdbbddb803d5 100644
@@ -35,6 +35,7 @@
 #include <plat/devs.h>
 #include <plat/cpu.h>
 #include <linux/platform_data/i2c-s3c2410.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 #include <plat/samsung-time.h>
 
 #include "common.h"
arch/arm/mach-s3c64xx/mach-smdk6410.c +1 -0
index d5ea938cc9a1..a8977da87eb1 100644
@@ -31,6 +31,7 @@
 #include <linux/regulator/machine.h>
 #include <linux/pwm_backlight.h>
 #include <linux/platform_data/s3c-hsotg.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 
 #ifdef CONFIG_SMDK6410_WM1190_EV1
 #include <linux/mfd/wm8350/core.h>
arch/arm/mach-s3c64xx/pm.c +1 -0
index 8cdb824a3b43..99c778eecab6 100644
@@ -18,6 +18,7 @@
 #include <linux/io.h>
 #include <linux/gpio.h>
 #include <linux/pm_domain.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 
 #include <mach/map.h>
 #include <mach/irqs.h>
arch/arm/mach-s3c64xx/setup-fb-24bpp.c +1 -0
index 2cf80026c58d..222792691b41 100644
@@ -16,6 +16,7 @@
 #include <linux/types.h>
 #include <linux/fb.h>
 #include <linux/gpio.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 
 #include <plat/fb.h>
 #include <plat/gpio-cfg.h>
arch/arm/mach-s3c64xx/setup-i2c0.c +1 -0
index 40666ba8d607..f269dabc9593 100644
@@ -19,6 +19,7 @@
 struct platform_device; /* don't need the contents */
 
 #include <linux/platform_data/i2c-s3c2410.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 #include <plat/gpio-cfg.h>
 
 void s3c_i2c0_cfg_gpio(struct platform_device *dev)
arch/arm/mach-s3c64xx/setup-i2c1.c +1 -0
index 3fdb24c4e62a..aa2bfcd5e818 100644
@@ -19,6 +19,7 @@
 struct platform_device; /* don't need the contents */
 
 #include <linux/platform_data/i2c-s3c2410.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 #include <plat/gpio-cfg.h>
 
 void s3c_i2c1_cfg_gpio(struct platform_device *dev)
arch/arm/mach-s3c64xx/setup-ide.c +1 -0
index 648d8b85bf6b..81dcebeaeb53 100644
@@ -18,6 +18,7 @@
 #include <mach/regs-clock.h>
 #include <plat/gpio-cfg.h>
 #include <linux/platform_data/ata-samsung_cf.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 
 void s3c64xx_ide_setup_gpio(void)
 {
arch/arm/mach-s3c64xx/setup-keypad.c +1 -0
index 1d4d0ee9e870..e236f40c9053 100644
@@ -11,6 +11,7 @@
 */
 
 #include <linux/gpio.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 #include <plat/gpio-cfg.h>
 #include <plat/keypad.h>
 
arch/arm/mach-s3c64xx/setup-sdhci-gpio.c +1 -0
index 6eac071afae2..79192b7217df 100644
@@ -17,6 +17,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/gpio.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 
 #include <plat/gpio-cfg.h>
 #include <plat/sdhci.h>
arch/arm/mach-s3c64xx/setup-spi.c +1 -0
index 4dc53450d715..dad4728ccb52 100644
@@ -9,6 +9,7 @@
  */
 
 #include <linux/gpio.h>
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
 #include <plat/gpio-cfg.h>
 
 #ifdef CONFIG_S3C64XX_DEV_SPI0
arch/arm/plat-samsung/pm-gpio.c +3 -0
index 41fef6980230..c4efa1c2a5d1 100644
@@ -22,6 +22,9 @@
 #ifdef CONFIG_ARCH_S3C24XX
 #include <linux/platform_data/gpio-samsung-s3c24xx.h>
 #endif
+#ifdef CONFIG_ARCH_S3C64XX
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
+#endif
 #include <plat/gpio-core.h>
 #include <plat/pm.h>
 
drivers/gpio/gpio-samsung.c +3 -0
index 268214c57799..be7b0bd4eed4 100644
@@ -30,6 +30,9 @@
 #ifdef CONFIG_ARCH_S3C24XX
 #include <linux/platform_data/gpio-samsung-s3c24xx.h>
 #endif
+#ifdef CONFIG_ARCH_S3C64XX
+#include <linux/platform_data/gpio-samsung-s3c64xx.h>
+#endif
 
 #include <asm/irq.h>
 
include/linux/platform_data/gpio-samsung-s3c64xx.h new file +94 -0

94 lines not on this page · raw message

Signature · 1 line
1.8.3.1
#1 lore raw

PATCH v2 2/2 ARM: s3c64xx: get rid of custom <mach/gpio.h>

Hi Linus,

Quoted 28 lines · On Friday 13 of December 2013 13:53:54 Linus Walleij wrote:

This isolates the custom S3C64xx GPIO definition table to <linux/platform_data/gpio-samsung-s3x64xx.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.

Also delete the CONFIG_SAMSUNG_GPIO_EXTRA stuff. Instead roof the number of GPIOs for this platform:
First sum up all the GPIO banks from A to Q: 187 GPIOs. Add the 16 "board GPIOs" and the roof for SAMSUNG_GPIO_EXTRA, 128, so in total maximum 187+16+128 = 331 GPIOs, so let's take the same roof as for S3C24XX: 512. This way we can do away with the GPIO calculation macros for GPIO_BOARD_START, BOARD_NR_GPIOS and the definition of ARCH_NR_GPIOS.

---
ChangeLog v1->v2:
- Move the movement of the actual gpio.h file into this patch after mistakenly having it end up in the S3C24xx patch.
- Add a missing ifdef for the pm-gpio.c code in plat-samsung.

Quoted 4 lines

This patch depends on
"ARM: s3c24xx: get rid of custom <mach/gpio.h>"

I will take this through the GPIO tree.

[on Mini6410 board]
[for changes in mach-s3c64xx]

Best regards,
Tomasz

#2 lore raw

PATCH v2 2/2 ARM: s3c64xx: get rid of custom <mach/gpio.h>

In reply to Linus Walleij
Quoted 6 lines · Linus Walleij

This isolates the custom S3C64xx GPIO definition table to <linux/platform_data/gpio-samsung-s3x64xx.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.

-------------- 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/20131218/4252177e/attachment.sig>