[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20111218185329.GA25217@pengutronix.de>
Date: Sun, 18 Dec 2011 19:53:29 +0100
From: Wolfram Sang <w.sang@...gutronix.de>
To: Frederic LAMBERT <frdrc66@...il.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] at25: DeviceTree support added
Hi,
please also CC devicetree-discuss@...ts.ozlabs.org when adding new bindings.
On Sun, Dec 18, 2011 at 07:13:55PM +0100, Frederic LAMBERT wrote:
> From: Frederic Lambert <frdrc66@...il.com>
>
> Signed-off-by: Frederic Lambert <frdrc66@...il.com>
> Signed-off-by: Frederic LAMBERT <frdrc66@...il.com>
One is enough :)
> ---
> Documentation/devicetree/bindings/spi/spi-bus.txt | 19 ++++++
> drivers/misc/eeprom/at25.c | 62 ++++++++++++++++----
> 2 files changed, 68 insertions(+), 13 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/spi/spi-bus.txt b/Documentation/devicetree/bindings/spi/spi-bus.txt
> index e782add..168ac87 100644
> --- a/Documentation/devicetree/bindings/spi/spi-bus.txt
> +++ b/Documentation/devicetree/bindings/spi/spi-bus.txt
> @@ -33,6 +33,16 @@ contain the following properties.
> shifted clock phase (CPHA) mode
> - spi-cs-high - (optional) Empty property indicating device requires
> chip select active high
> +For SPI eeprom using driver 'at25', slave nodes shall also contain the
> +following properties.
> +- byte_len - device RAM size
> +- dev_name - device name
> +- pagesize - for writes (see at25.c)
> +- flags - adressing mode and R/O flag
> + - bit 0: 8 bits addrs (EE_ADDR1)
> + - bit 1: 16 bits addrs (EE_ADDR2)
> + - bit 2: 24 bits addrs (EE_ADDR3)
> + - bit 3: disallow writes (EE_READONLY)
>
> SPI example for an MPC5200 SPI bus:
> spi@f00 {
> @@ -54,4 +64,13 @@ SPI example for an MPC5200 SPI bus:
> spi-max-frequency = <100000>;
> reg = <1>;
> };
> + at25@0 {
> + compatible = "eeprom,at25";
No, you can't map the platform data 1:1 to the device tree.
The compatible should specify the actual device, for example
"atmel,25320". And from that information you can derive...
> + byte_len = <131072>;
> + dev_name = "CY14B101P";
those two and the EE_ADDR.
> + pagesize = <128>;
This is indeed a valid property, "read-only" would be another one of interest.
Check at24.c and see how it is done there.
Thanks,
Wolfram
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)
Powered by blists - more mailing lists