From patchwork Sat Apr 13 04:21:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 2440091 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 450DE3FD1A for ; Sat, 13 Apr 2013 08:15:44 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UQvcc-0008Cx-PW; Sat, 13 Apr 2013 08:15:43 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UQryj-000093-V0; Sat, 13 Apr 2013 04:22:17 +0000 Received: from smtp53.i.mail.ru ([94.100.177.113]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UQryV-000081-5a for linux-arm-kernel@lists.infradead.org; Sat, 13 Apr 2013 04:22:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Message-Id:Date:Subject:Cc:To:From; bh=DktSEd5TAy+s+jYNIu1Gjwx78M0BzGj5b2d0w4JcZD0=; b=ksJOTh83n7x7A91X3Wq3vojFGn2cuE1Vure+k9CLrsW4Q0zbvM7gms4Jm8imv/XOBOhCr5ASScQYihWZAdCZ5zITnOV97Sg9UTh+M94k27xEPAnRcOkMFGZzooMd/3U85c+dQf4hQnFYCvEvt47LpN2TIIAMDAEb6/ulOlvSsqo=; Received: from [188.134.40.128] (port=40228 helo=shc.zet) by smtp53.i.mail.ru with esmtpa (envelope-from ) id 1UQryQ-0003wq-D6; Sat, 13 Apr 2013 08:21:58 +0400 From: Alexander Shiyan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] GPIO: clps711x: Rewrite driver for using generic GPIO code Date: Sat, 13 Apr 2013 08:21:39 +0400 Message-Id: <1365826900-30136-1-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.1.5 X-Spam: Not detected X-Mras: Ok X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130413_002204_183728_A46E2ED0 X-CRM114-Status: GOOD ( 24.82 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (shc_work[at]mail.ru) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Alexander Shiyan , Arnd Bergmann , devicetree-discuss@lists.ozlabs.org, Rob Herring , Grant Likely , Olof Johansson , Linus Walleij X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch provides rewritten driver for CLPS711X GPIO which uses generic GPIO code. Signed-off-by: Alexander Shiyan --- arch/arm/configs/clps711x_defconfig | 1 + arch/arm/mach-clps711x/Makefile | 5 +- arch/arm/mach-clps711x/board-autcpu12.c | 2 + arch/arm/mach-clps711x/board-cdb89712.c | 2 + arch/arm/mach-clps711x/board-edb7211.c | 7 + arch/arm/mach-clps711x/board-p720t.c | 10 +- arch/arm/mach-clps711x/devices.c | 56 ++++++ arch/arm/mach-clps711x/devices.h | 12 ++ arch/arm/mach-clps711x/include/mach/clps711x.h | 23 +-- drivers/gpio/Kconfig | 5 +- drivers/gpio/gpio-clps711x.c | 228 +++++++------------------ 11 files changed, 164 insertions(+), 187 deletions(-) create mode 100644 arch/arm/mach-clps711x/devices.c create mode 100644 arch/arm/mach-clps711x/devices.h diff --git a/arch/arm/configs/clps711x_defconfig b/arch/arm/configs/clps711x_defconfig index 1cd94c3..e9a1747 100644 --- a/arch/arm/configs/clps711x_defconfig +++ b/arch/arm/configs/clps711x_defconfig @@ -64,6 +64,7 @@ CONFIG_CS89x0_PLATFORM=y CONFIG_SERIAL_CLPS711X_CONSOLE=y # CONFIG_HW_RANDOM is not set CONFIG_SPI=y +CONFIG_GPIO_CLPS711X=y CONFIG_GPIO_GENERIC_PLATFORM=y # CONFIG_HWMON is not set CONFIG_FB=y diff --git a/arch/arm/mach-clps711x/Makefile b/arch/arm/mach-clps711x/Makefile index 992995a..f30ed2b 100644 --- a/arch/arm/mach-clps711x/Makefile +++ b/arch/arm/mach-clps711x/Makefile @@ -4,10 +4,7 @@ # Object file lists. -obj-y := common.o -obj-m := -obj-n := -obj- := +obj-y := common.o devices.o obj-$(CONFIG_ARCH_AUTCPU12) += board-autcpu12.o obj-$(CONFIG_ARCH_CDB89712) += board-cdb89712.o diff --git a/arch/arm/mach-clps711x/board-autcpu12.c b/arch/arm/mach-clps711x/board-autcpu12.c index f385847..1e22cb4 100644 --- a/arch/arm/mach-clps711x/board-autcpu12.c +++ b/arch/arm/mach-clps711x/board-autcpu12.c @@ -43,6 +43,7 @@ #include #include "common.h" +#include "devices.h" #define AUTCPU12_CS8900_BASE (CS2_PHYS_BASE + 0x300) #define AUTCPU12_CS8900_IRQ (IRQ_EINT3) @@ -149,6 +150,7 @@ static struct platform_device autcpu12_mmgpio_pdev __initdata = { static void __init autcpu12_init(void) { + clps711x_devices_init(); platform_device_register_simple("video-clps711x", 0, NULL, 0); platform_device_register_simple("cs89x0", 0, autcpu12_cs8900_resource, ARRAY_SIZE(autcpu12_cs8900_resource)); diff --git a/arch/arm/mach-clps711x/board-cdb89712.c b/arch/arm/mach-clps711x/board-cdb89712.c index baab7da..a80ae57 100644 --- a/arch/arm/mach-clps711x/board-cdb89712.c +++ b/arch/arm/mach-clps711x/board-cdb89712.c @@ -39,6 +39,7 @@ #include #include "common.h" +#include "devices.h" #define CDB89712_CS8900_BASE (CS2_PHYS_BASE + 0x300) #define CDB89712_CS8900_IRQ (IRQ_EINT3) @@ -127,6 +128,7 @@ static struct platform_device cdb89712_sram_pdev __initdata = { static void __init cdb89712_init(void) { + clps711x_devices_init(); platform_device_register(&cdb89712_flash_pdev); platform_device_register(&cdb89712_bootrom_pdev); platform_device_register(&cdb89712_sram_pdev); diff --git a/arch/arm/mach-clps711x/board-edb7211.c b/arch/arm/mach-clps711x/board-edb7211.c index 5f928e9..e1c5573 100644 --- a/arch/arm/mach-clps711x/board-edb7211.c +++ b/arch/arm/mach-clps711x/board-edb7211.c @@ -29,6 +29,7 @@ #include #include "common.h" +#include "devices.h" #define VIDEORAM_SIZE SZ_128K @@ -151,6 +152,11 @@ fixup_edb7211(struct tag *tags, char **cmdline, struct meminfo *mi) static void __init edb7211_init(void) { + clps711x_devices_init(); +} + +static void __init edb7211_init_late(void) +{ gpio_request_array(edb7211_gpios, ARRAY_SIZE(edb7211_gpios)); platform_device_register(&edb7211_flash_pdev); @@ -175,6 +181,7 @@ MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)") .init_irq = clps711x_init_irq, .init_time = clps711x_timer_init, .init_machine = edb7211_init, + .init_late = edb7211_init_late, .handle_irq = clps711x_handle_irq, .restart = clps711x_restart, MACHINE_END diff --git a/arch/arm/mach-clps711x/board-p720t.c b/arch/arm/mach-clps711x/board-p720t.c index 8d3ee67..48d0737 100644 --- a/arch/arm/mach-clps711x/board-p720t.c +++ b/arch/arm/mach-clps711x/board-p720t.c @@ -43,6 +43,7 @@ #include