mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: Frederic LAMBERT <frdrc66@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] at25: DeviceTree support added
Date: Sun, 18 Dec 2011 19:53:29 +0100	[thread overview]
Message-ID: <20111218185329.GA25217@pengutronix.de> (raw)
In-Reply-To: <1324232035-2717-1-git-send-email-frdrc66@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2335 bytes --]

Hi,

please also CC devicetree-discuss@lists.ozlabs.org when adding new bindings.

On Sun, Dec 18, 2011 at 07:13:55PM +0100, Frederic LAMBERT wrote:
> From: Frederic Lambert <frdrc66@gmail.com>
> 
> Signed-off-by: Frederic Lambert <frdrc66@gmail.com>
> Signed-off-by: Frederic LAMBERT <frdrc66@gmail.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/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

      parent reply	other threads:[~2011-12-18 18:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-18 18:13 Frederic LAMBERT
     [not found] ` <CAMVnO+mCHQtyO3xUQJqoPSbBnDB0Avr0EEVKpEF31GpyQS-snw@mail.gmail.com>
2011-12-18 18:27   ` Frederic LAMBERT
2011-12-18 18:53 ` Wolfram Sang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111218185329.GA25217@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=frdrc66@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®