From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755059AbcIEOhh (ORCPT ); Mon, 5 Sep 2016 10:37:37 -0400 Received: from smtp03.smtpout.orange.fr ([80.12.242.125]:59345 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751245AbcIEOhf (ORCPT ); Mon, 5 Sep 2016 10:37:35 -0400 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 Cc: Daniel Mack , Haojian Zhuang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Robert [1] ---8>--- >>From f8ba8367164056d7a79052b2b10fcecabd8e854d Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 4 Sep 2016 19:59:19 +0200 Subject: [PATCH] ARM: pxa: lubbock: add pcmcia clock Add the clock provided to the PCMCIA block so that sa1111_pcmcia_add() doesn't end up on error while probing "1800" device. [To be confirmed] Signed-off-by: Russell King --- arch/arm/mach-pxa/lubbock.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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); -- 2.1.4