From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko =?iso-8859-1?q?St=FCbner?= Subject: Re: Problem using S3C2416's HSSPI Date: Tue, 2 Oct 2012 01:47:46 +0200 Message-ID: <201210020147.47512.heiko@sntech.de> References: <5069D39F.5010604@inov.pt> <201210012118.20657.heiko@sntech.de> <5069F1B3.8000203@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from gloria.sntech.de ([95.129.55.99]:54034 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752407Ab2JAXrx (ORCPT ); Mon, 1 Oct 2012 19:47:53 -0400 In-Reply-To: <5069F1B3.8000203@gmail.com> Sender: linux-samsung-soc-owner@vger.kernel.org List-Id: linux-samsung-soc@vger.kernel.org To: Sylwester Nawrocki Cc: =?iso-8859-1?q?Jos=E9_Miguel_Gon=E7alves?= , linux-samsung-soc@vger.kernel.org, Kukjin Kim Am Montag, 1. Oktober 2012, 21:40:35 schrieb Sylwester Nawrocki: > On 10/01/2012 09:18 PM, Heiko St=FCbner wrote: > > Hi Jos=E9, > >=20 > > Am Montag, 1. Oktober 2012, 19:32:15 schrieb Jos=E9 Miguel Gon=E7al= ves: > >> I'm trying to use the HSSPI controller on a S3C2416 based board bu= t I'm > >> having some problems. > >>=20 > >> I've added "&s3c64xx_device_spi0" to my array of platform devices = and > >> added a call to s3c64xx_spi0_set_platdata(NULL, 0, 1) before > >> platform_add_devices(). When the kernel starts I see the following > >> error: > >>=20 > >> s3c64xx-spi s3c6410-spi.0: Unable to acquire clock 'spi' > >> s3c64xx-spi: probe of s3c6410-spi.0 failed with error -2 > >=20 > > what kernel version do you use? > >=20 > > I.e. the clock support for the s3c64xx-spi on s3c2443 and s3c2416 w= as > > added through [1] in march - so it's not this old. >=20 > In this commit >=20 > commit a5238e360b715e9a1bb39d7d3537f78cc9e9e286 > Author: Thomas Abraham > Date: Fri Jul 13 07:15:14 2012 +0900 >=20 > spi: s3c64xx: move controller information into driver data >=20 > Platform data is used to specify controller hardware specific > information such as the tx/rx fifo level mask and bit offset of rx fi= fo > level. Such information is not suitable to be supplied from device tr= ee. > Instead, it can be moved into the driver data and removed from platfo= rm > data. >=20 > Signed-off-by: Thomas Abraham > Acked-by: Jaswinder Singh > Acked-by: Grant Likely > Signed-off-by: Kukjin Kim >=20 > All "s3c64xx-spi.0" devname fields that you added were replaced with > "s3c24xx-spi.0". I wonder if that's not the reason clk_get(..., "spi"= ); > fails in the spi-s3c64xx driver used on mach-s3c24xx. But it of cours= e > depends on the kernel version, we need to first clarify that. >=20 > diff --git a/arch/arm/mach-s3c24xx/common-s3c2443.c > b/arch/arm/mach-s3c24xx/common-s3c2443.c index aeeb2be..aeb4a24 10064= 4 > --- a/arch/arm/mach-s3c24xx/common-s3c2443.c > +++ b/arch/arm/mach-s3c24xx/common-s3c2443.c > @@ -559,7 +559,7 @@ static struct clk hsmmc1_clk =3D { >=20 > static struct clk hsspi_clk =3D { > .name =3D "spi", > - .devname =3D "s3c64xx-spi.0", > + .devname =3D "s3c2443-spi.0", > .parent =3D &clk_p, > .enable =3D s3c2443_clkcon_enable_p, > .ctrlbit =3D S3C2443_PCLKCON_HSSPI, > @@ -633,7 +633,7 @@ static struct clk_lookup s3c2443_clk_lookup[] =3D= { > CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p), > CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_esys_uart.clk), > CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.0", &hsmmc1_clk), > - CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk0", &hsspi_clk), > + CLKDEV_INIT("s3c2443-spi.0", "spi_busclk0", &hsspi_clk), > }; ahaa ... that's the cause. As far as I was able to determine, in the pa= tchset=20 only the clocks were renamed and the different device names introduced. The spi devices did not get a function to set the name, like for the rt= c, adc=20 and nand. The devices are named s3c6410-spi by default, so it seems onl= y the=20 s3c64xx machines should have a working spi currently. I'm working on a patch to fix this for all Samsung arches. Heiko