From patchwork Mon Sep 5 14:37:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Jarzmik X-Patchwork-Id: 9314167 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 C8A07600CA for ; Mon, 5 Sep 2016 14:39:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9EF328A85 for ; Mon, 5 Sep 2016 14:39:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AEA1F28AD3; Mon, 5 Sep 2016 14:39:19 +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.2 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=unavailable 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 42A1428A85 for ; Mon, 5 Sep 2016 14:39:19 +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 1bgv29-0002T6-Tr; Mon, 05 Sep 2016 14:38:01 +0000 Received: from smtp03.smtpout.orange.fr ([80.12.242.125] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bgv22-0002Ic-Nt for linux-arm-kernel@lists.infradead.org; Mon, 05 Sep 2016 14:37:57 +0000 Received: from belgarion ([109.222.86.9]) by mwinf5d38 with ME id fqdQ1t00F0C5QSM03qdRun; Mon, 05 Sep 2016 16:37:32 +0200 X-ME-Helo: belgarion X-ME-Auth: amFyem1pay5yb2JlcnRAb3JhbmdlLmZy X-ME-Date: Mon, 05 Sep 2016 16:37:32 +0200 X-ME-IP: 109.222.86.9 From: Robert Jarzmik To: Russell King - ARM Linux Subject: Re: [PATCH 2/3] ARM: pxa: lubbock: add pcmcia clock References: <1473015587-15589-1-git-send-email-robert.jarzmik@free.fr> <1473015587-15589-2-git-send-email-robert.jarzmik@free.fr> <20160904200827.GL1041@n2100.armlinux.org.uk> X-URL: http://belgarath.falguerolles.org/ Date: Mon, 05 Sep 2016 16:37:23 +0200 Message-ID: <877faqjtuk.fsf@belgarion.home> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160905_073755_178270_158AE383 X-CRM114-Status: GOOD ( 24.09 ) 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: linux-arm-kernel@lists.infradead.org, Haojian Zhuang , Daniel Mack , linux-kernel@vger.kernel.org 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 Russell King - ARM Linux writes: > On Sun, Sep 04, 2016 at 08:59:46PM +0200, Robert Jarzmik wrote: >> Add the clock provided to the PCMCIA block so that sa1111_pcmcia_add() >> doesn't end up on error while probing "1800" device. > > I don't think this is correct - SA1111 is not really the PCMCIA > controller - it's a load of logic which sits between the host > device and the PCMCIA sockets to manage buffers and the PCMCIA > socket control signals. Gah I was naively thinking the SA1111 clock was used in the SA1111 to sample the CF lines, and as a consequence, that the asynchronous nPIOWait, nPIORead, nPIOWrite were derived from it. I suppose the SA1111 takes 2 clocks, one for PS/2 etc ..., and SDCLK<1> for the PCMCIA operations, while I was thinking SDCLK<1> input to SA1111 was only for alternate bus-master operations. > The quick fix here is to add a clock for the SA1111 PCMCIA sub-device, > but it still needs to be the SoC memory clock - iow, what > get_memclk_frequency_10khz() would have returned as that's what > pxa2xx_base.c wants. Right. Would grant your sign-off to your patch in [1], if the commit message is good enough for you (I can fix it up if the wording is too ... french) ? Cheers. diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index cd401546cea8..d7c5fb00da7a 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c @@ -149,6 +149,20 @@ static struct gpiod_lookup_table sa1111_pcmcia_gpio_table = { }, }; +static void lubbock_init_pcmcia(void) +{ + struct clk *clk; + + gpiod_add_lookup_table(&sa1111_pcmcia_gpio_table); + + /* Add an alias for the SA1111 PCMCIA clock */ + clk = clk_get_sys("pxa2xx-pcmcia", NULL); + if (!IS_ERR(clk)) { + clkdev_create(clk, NULL, "1800"); + clk_put(clk); + } +} + static struct resource sa1111_resources[] = { [0] = { .start = 0x10000000, @@ -488,7 +502,7 @@ static void __init lubbock_init(void) pxa_set_btuart_info(NULL); pxa_set_stuart_info(NULL); - gpiod_add_lookup_table(&sa1111_pcmcia_gpio_table); + lubbock_init_pcmcia(); clk_add_alias("SA1111_CLK", NULL, "GPIO11_CLK", NULL); pxa_set_udc_info(&udc_info);