From patchwork Mon Aug 29 10:25:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 9303505 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8F4FF601C0 for ; Mon, 29 Aug 2016 10:39:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EA222847F for ; Mon, 29 Aug 2016 10:39:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 726DA2883C; Mon, 29 Aug 2016 10:39:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B33B28833 for ; Mon, 29 Aug 2016 10:39:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1beJxF-0000dJ-G0; Mon, 29 Aug 2016 10:38:13 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1beJvn-0007sp-4Z for linux-arm-kernel@lists.infradead.org; Mon, 29 Aug 2016 10:36:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Date:Sender:Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References:In-Reply-To; bh=IuN+AtNg542tY0tL/MrjwEMAYIqIyFEWKdO33kVVoEs=; b=GD5bFgLlgr/bjlzcyldhFlodFRgW6h/jzMjAIFGQz0LoI9ZCnnEdN0c2IlYwnoyg8s/T+hLw3Q1NRvJCgERMKZrRCAasoXxrjg9nHDqKdMbYkkOk4F9ZjbdkrT9GuSaVXXk06e2FVXOmXshxPvPqmqfXjS8DDZBSIr2Hg3fC+G4=; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:58556 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1beJlK-0003fT-0U; Mon, 29 Aug 2016 11:25:54 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1beJlJ-0000nl-3j; Mon, 29 Aug 2016 11:25:53 +0100 In-Reply-To: <20160829102328.GA28796@n2100.armlinux.org.uk> References: <20160829102328.GA28796@n2100.armlinux.org.uk> From: Russell King To: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-pcmcia@lists.infradead.org Subject: [PATCH 21/33] ARM: sa1100: provide infrastructure to support generic CF sockets MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Mon, 29 Aug 2016 11:25:53 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160829_033643_858382_2983CCE6 X-CRM114-Status: GOOD ( 13.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Courbot , Linus Walleij , Haojian Zhuang , Kristoffer Ericson , Robert Jarzmik , Daniel Mack Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Provide the SoC-level infrastructure to support the generic CF sockets. Signed-off-by: Russell King --- arch/arm/mach-sa1100/clock.c | 2 ++ arch/arm/mach-sa1100/generic.c | 14 +++++++++++++- arch/arm/mach-sa1100/generic.h | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-sa1100/clock.c b/arch/arm/mach-sa1100/clock.c index 0db46895c82a..f6f75c9325bf 100644 --- a/arch/arm/mach-sa1100/clock.c +++ b/arch/arm/mach-sa1100/clock.c @@ -137,6 +137,8 @@ static struct clk_lookup sa11xx_clkregs[] = { CLKDEV_INIT("sa1100-rtc", NULL, NULL), CLKDEV_INIT("sa11x0-fb", NULL, &clk_cpu), CLKDEV_INIT("sa11x0-pcmcia", NULL, &clk_cpu), + CLKDEV_INIT("sa11x0-pcmcia.0", NULL, &clk_cpu), + CLKDEV_INIT("sa11x0-pcmcia.1", NULL, &clk_cpu), /* sa1111 names devices using internal offsets, PCMCIA is at 0x1800 */ CLKDEV_INIT("1800", NULL, &clk_cpu), CLKDEV_INIT(NULL, "OSTIMER0", &clk_36864), diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c index 3e09beddb6e8..a005eef1a24e 100644 --- a/arch/arm/mach-sa1100/generic.c +++ b/arch/arm/mach-sa1100/generic.c @@ -10,6 +10,7 @@ * published by the Free Software Foundation. */ #include +#include #include #include #include @@ -232,11 +233,19 @@ void sa11x0_register_lcd(struct sa1100fb_mach_info *inf) sa11x0_register_device(&sa11x0fb_device, inf); } +static bool sa11x0pcmcia_legacy = true; static struct platform_device sa11x0pcmcia_device = { .name = "sa11x0-pcmcia", .id = -1, }; +void sa11x0_register_pcmcia(int socket, struct gpiod_lookup_table *table) +{ + gpiod_add_lookup_table(table); + platform_device_register_simple("sa11x0-pcmcia", socket, NULL, 0); + sa11x0pcmcia_legacy = false; +} + static struct platform_device sa11x0mtd_device = { .name = "sa1100-mtd", .id = -1, @@ -311,7 +320,6 @@ static struct platform_device *sa11x0_devices[] __initdata = { &sa11x0uart1_device, &sa11x0uart3_device, &sa11x0ssp_device, - &sa11x0pcmcia_device, &sa11x0rtc_device, &sa11x0dma_device, }; @@ -319,6 +327,10 @@ static struct platform_device *sa11x0_devices[] __initdata = { static int __init sa1100_init(void) { pm_power_off = sa1100_power_off; + + if (sa11x0pcmcia_legacy) + platform_device_register(&sa11x0pcmcia_device); + return platform_add_devices(sa11x0_devices, ARRAY_SIZE(sa11x0_devices)); } diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h index 68199b603ff7..22c432979150 100644 --- a/arch/arm/mach-sa1100/generic.h +++ b/arch/arm/mach-sa1100/generic.h @@ -46,3 +46,6 @@ static inline int sa11x0_pm_init(void) { return 0; } #endif int sa11xx_clk_init(void); + +struct gpiod_lookup_table; +void sa11x0_register_pcmcia(int socket, struct gpiod_lookup_table *);