From patchwork Fri Dec 13 12:53:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 22329 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A59FA23FBA for ; Fri, 13 Dec 2013 12:54:02 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id i17sf3215130qcy.6 for ; Fri, 13 Dec 2013 04:54:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=lhY+dUHWdQtUU9lPh2ukIn8n8cVmV3XUgqXyICtXvtI=; b=McKhVZm4DekKmzCCvUtpDb86JytDK6CT2slV7ewHRs2ccvIfOW3k95u0DQtWwqoPZS Rf5tnXylZRTjKfMXftmEhF7q8sgkwDqS9xwSkLxf/GiYileW7SWWZznfEAJTLDdVp5cU wuTqhDYSpfUHO3mjrGqh8+Qal4Wyg1m3mHYuqBxOShWpSsxeL+O+HdMwl/G3sV33cGok bxqDAJiTs7Jq4alxo4x7+fyF80ByJQvdvdnl23PsNIY/5484+Djhr7iUs3w5/rgLpGfl Kqyh5Yn7M8ifDlM+0MBjrsivkI4NIuvfbaNMZb/2BYzVbE8f2iwMMGO7Ve5eWhg9MK4C 3DcQ== X-Gm-Message-State: ALoCoQl1iw74G+r6YHaatrZdwr4pLHcCzNz+aB1tJJg8slP07qbzQC1daGLq50w3sCA70lRK7q+j X-Received: by 10.236.43.168 with SMTP id l28mr708155yhb.19.1386939242484; Fri, 13 Dec 2013 04:54:02 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.60.228 with SMTP id k4ls1018876qer.93.gmail; Fri, 13 Dec 2013 04:54:02 -0800 (PST) X-Received: by 10.52.189.139 with SMTP id gi11mr366707vdc.72.1386939242367; Fri, 13 Dec 2013 04:54:02 -0800 (PST) Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com [209.85.212.50]) by mx.google.com with ESMTPS id gq10si698019vdc.95.2013.12.13.04.54.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 04:54:02 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.50; Received: by mail-vb0-f50.google.com with SMTP id w18so1254059vbj.37 for ; Fri, 13 Dec 2013 04:54:02 -0800 (PST) X-Received: by 10.58.118.36 with SMTP id kj4mr1121422veb.2.1386939242240; Fri, 13 Dec 2013 04:54:02 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp34654vcz; Fri, 13 Dec 2013 04:54:01 -0800 (PST) X-Received: by 10.152.234.37 with SMTP id ub5mr1418437lac.51.1386939241010; Fri, 13 Dec 2013 04:54:01 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by mx.google.com with ESMTPS id w6si803641lag.133.2013.12.13.04.54.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 04:54:00 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.41 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.215.41; Received: by mail-la0-f41.google.com with SMTP id eo20so1343488lab.14 for ; Fri, 13 Dec 2013 04:54:00 -0800 (PST) X-Received: by 10.152.115.230 with SMTP id jr6mr1432252lab.45.1386939240352; Fri, 13 Dec 2013 04:54:00 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id m5sm4081633laj.4.2013.12.13.04.53.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Dec 2013 04:53:59 -0800 (PST) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Kukjin Kim , Ben Dooks Cc: Linus Walleij , Mark Brown , Tomasz Figa Subject: [PATCH 2/2 v2] ARM: s3c64xx: get rid of custom Date: Fri, 13 Dec 2013 13:53:54 +0100 Message-Id: <1386939234-12828-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.50 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This isolates the custom S3C64xx GPIO definition table to as this is used in a few different places in the kernel, removing the need to depend on the implicit inclusion of from 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. Cc: Mark Brown Cc: Tomasz Figa Acked-by: Kukjin Kim Signed-off-by: Linus Walleij --- 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 " 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 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 6a26bcb3a63a..103437986684 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -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 diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig index 2cb8dc55b50e..175f01501129 100644 --- a/arch/arm/mach-s3c64xx/Kconfig +++ b/arch/arm/mach-s3c64xx/Kconfig @@ -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. diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c index 7a3ce4c39e5f..64edda37bde3 100644 --- a/arch/arm/mach-s3c64xx/common.c +++ b/arch/arm/mach-s3c64xx/common.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include diff --git a/arch/arm/mach-s3c64xx/crag6410.h b/arch/arm/mach-s3c64xx/crag6410.h index 4c3c9994fc2c..9ef20b8fd36f 100644 --- a/arch/arm/mach-s3c64xx/crag6410.h +++ b/arch/arm/mach-s3c64xx/crag6410.h @@ -11,7 +11,7 @@ #ifndef MACH_CRAG6410_H #define MACH_CRAG6410_H -#include +#include #define GLENFARCLAS_PMIC_IRQ_BASE IRQ_BOARD_START diff --git a/arch/arm/mach-s3c64xx/dev-audio.c b/arch/arm/mach-s3c64xx/dev-audio.c index e367e87bbc29..6f58c80235dc 100644 --- a/arch/arm/mach-s3c64xx/dev-audio.c +++ b/arch/arm/mach-s3c64xx/dev-audio.c @@ -21,6 +21,7 @@ #include #include +#include #include static int s3c64xx_i2s_cfg_gpio(struct platform_device *pdev) diff --git a/arch/arm/mach-s3c64xx/include/mach/gpio.h b/arch/arm/mach-s3c64xx/include/mach/gpio.h deleted file mode 100644 index 8b540c42d5dd..000000000000 --- a/arch/arm/mach-s3c64xx/include/mach/gpio.h +++ /dev/null @@ -1,93 +0,0 @@ -/* arch/arm/mach-s3c6400/include/mach/gpio.h - * - * Copyright 2008 Openmoko, Inc. - * Copyright 2008 Simtec Electronics - * http://armlinux.simtec.co.uk/ - * Ben Dooks - * - * S3C6400 - GPIO lib support - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. -*/ - -/* GPIO bank sizes */ -#define S3C64XX_GPIO_A_NR (8) -#define S3C64XX_GPIO_B_NR (7) -#define S3C64XX_GPIO_C_NR (8) -#define S3C64XX_GPIO_D_NR (5) -#define S3C64XX_GPIO_E_NR (5) -#define S3C64XX_GPIO_F_NR (16) -#define S3C64XX_GPIO_G_NR (7) -#define S3C64XX_GPIO_H_NR (10) -#define S3C64XX_GPIO_I_NR (16) -#define S3C64XX_GPIO_J_NR (12) -#define S3C64XX_GPIO_K_NR (16) -#define S3C64XX_GPIO_L_NR (15) -#define S3C64XX_GPIO_M_NR (6) -#define S3C64XX_GPIO_N_NR (16) -#define S3C64XX_GPIO_O_NR (16) -#define S3C64XX_GPIO_P_NR (15) -#define S3C64XX_GPIO_Q_NR (9) - -/* GPIO bank numbes */ - -/* CONFIG_S3C_GPIO_SPACE allows the user to select extra - * space for debugging purposes so that any accidental - * change from one gpio bank to another can be caught. -*/ - -#define S3C64XX_GPIO_NEXT(__gpio) \ - ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1) - -enum s3c_gpio_number { - S3C64XX_GPIO_A_START = 0, - S3C64XX_GPIO_B_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_A), - S3C64XX_GPIO_C_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_B), - S3C64XX_GPIO_D_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_C), - S3C64XX_GPIO_E_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_D), - S3C64XX_GPIO_F_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_E), - S3C64XX_GPIO_G_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_F), - S3C64XX_GPIO_H_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_G), - S3C64XX_GPIO_I_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_H), - S3C64XX_GPIO_J_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_I), - S3C64XX_GPIO_K_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_J), - S3C64XX_GPIO_L_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_K), - S3C64XX_GPIO_M_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_L), - S3C64XX_GPIO_N_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_M), - S3C64XX_GPIO_O_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_N), - S3C64XX_GPIO_P_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_O), - S3C64XX_GPIO_Q_START = S3C64XX_GPIO_NEXT(S3C64XX_GPIO_P), -}; - -/* S3C64XX GPIO number definitions. */ - -#define S3C64XX_GPA(_nr) (S3C64XX_GPIO_A_START + (_nr)) -#define S3C64XX_GPB(_nr) (S3C64XX_GPIO_B_START + (_nr)) -#define S3C64XX_GPC(_nr) (S3C64XX_GPIO_C_START + (_nr)) -#define S3C64XX_GPD(_nr) (S3C64XX_GPIO_D_START + (_nr)) -#define S3C64XX_GPE(_nr) (S3C64XX_GPIO_E_START + (_nr)) -#define S3C64XX_GPF(_nr) (S3C64XX_GPIO_F_START + (_nr)) -#define S3C64XX_GPG(_nr) (S3C64XX_GPIO_G_START + (_nr)) -#define S3C64XX_GPH(_nr) (S3C64XX_GPIO_H_START + (_nr)) -#define S3C64XX_GPI(_nr) (S3C64XX_GPIO_I_START + (_nr)) -#define S3C64XX_GPJ(_nr) (S3C64XX_GPIO_J_START + (_nr)) -#define S3C64XX_GPK(_nr) (S3C64XX_GPIO_K_START + (_nr)) -#define S3C64XX_GPL(_nr) (S3C64XX_GPIO_L_START + (_nr)) -#define S3C64XX_GPM(_nr) (S3C64XX_GPIO_M_START + (_nr)) -#define S3C64XX_GPN(_nr) (S3C64XX_GPIO_N_START + (_nr)) -#define S3C64XX_GPO(_nr) (S3C64XX_GPIO_O_START + (_nr)) -#define S3C64XX_GPP(_nr) (S3C64XX_GPIO_P_START + (_nr)) -#define S3C64XX_GPQ(_nr) (S3C64XX_GPIO_Q_START + (_nr)) - -/* the end of the S3C64XX specific gpios */ -#define S3C64XX_GPIO_END (S3C64XX_GPQ(S3C64XX_GPIO_Q_NR) + 1) -#define S3C_GPIO_END S3C64XX_GPIO_END - -/* define the number of gpios we need to the one after the GPQ() range */ -#define GPIO_BOARD_START (S3C64XX_GPQ(S3C64XX_GPIO_Q_NR) + 1) - -#define BOARD_NR_GPIOS (16 + CONFIG_SAMSUNG_GPIO_EXTRA) - -#define ARCH_NR_GPIOS (GPIO_BOARD_START + BOARD_NR_GPIOS) diff --git a/arch/arm/mach-s3c64xx/mach-anw6410.c b/arch/arm/mach-s3c64xx/mach-anw6410.c index d266dd5f7060..546f45b59ea1 100644 --- a/arch/arm/mach-s3c64xx/mach-anw6410.c +++ b/arch/arm/mach-s3c64xx/mach-anw6410.c @@ -43,6 +43,7 @@ #include #include +#include #include #include diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c index 758e31b26550..7b913595e4ee 100644 --- a/arch/arm/mach-s3c64xx/mach-crag6410.c +++ b/arch/arm/mach-s3c64xx/mach-crag6410.c @@ -32,6 +32,7 @@ #include #include +#include #include