All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <w.sang@pengutronix.de>
To: Andrew Lunn <andrew@lunn.ch>
Cc: jason@lakedaemon.net, devicetree-discuss@lists.ozlabs.org,
	rob.herring@calxeda.com, linux-i2c@vger.kernel.org,
	spi-devel-general@lists.sourceforge.net, machael@walle.cc,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 7/9] I2C: MV64XXX: Add Device Tree support
Date: Mon, 9 Jul 2012 12:25:38 +0200	[thread overview]
Message-ID: <20120709102538.GD1296@pengutronix.de> (raw)
In-Reply-To: <1339324322-29388-8-git-send-email-andrew@lunn.ch>


[-- Attachment #1.1: Type: text/plain, Size: 1896 bytes --]

On Sun, Jun 10, 2012 at 12:31:59PM +0200, Andrew Lunn wrote:
> Extends the driver to get properties from device tree. Also extend the
> kirkwood DT support to supply the needed properties.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  Documentation/devicetree/bindings/i2c/mrvl-i2c.txt |   35 +++++++++++++++++-
>  arch/arm/boot/dts/kirkwood.dtsi                    |   13 +++++++
>  arch/arm/mach-kirkwood/board-dt.c                  |    2 ++
>  drivers/i2c/busses/i2c-mv64xxx.c                   |   38 +++++++++++++++++---
>  4 files changed, 82 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/i2c/mrvl-i2c.txt b/Documentation/devicetree/bindings/i2c/mrvl-i2c.txt
> index b891ee2..89ef899 100644
> --- a/Documentation/devicetree/bindings/i2c/mrvl-i2c.txt
> +++ b/Documentation/devicetree/bindings/i2c/mrvl-i2c.txt
> @@ -1,4 +1,4 @@
> -* I2C
> +* Marvell MMP I2C controller
>  
>  Required properties :
>  
> @@ -32,3 +32,36 @@ Examples:
>  		interrupts = <58>;
>  	};
>  
> +* Marvell MV64XXX I2C controller
> +
> +Required properties :
> +
> + - reg         : Offset and length of the register set for the device
> + - compatible  : should be "marvell,mv64xxx-i2c"
> + - interrupts  : the interrupt number
> + - frequency-m : m factor in baud rate calculation
> +
> +Recommended properties :
> +
> + - frequency-n : n factor in baud rate calculation
> + - timeout-ms  : How long to wait for a transaction to complete

The way we define the bus speed for i2c with DT is using "clock-frequency".
You should be able to derive the dividers from that? Adding custom
properties for every driver will hardly be maintainable.

Thanks,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: w.sang@pengutronix.de (Wolfram Sang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 7/9] I2C: MV64XXX: Add Device Tree support
Date: Mon, 9 Jul 2012 12:25:38 +0200	[thread overview]
Message-ID: <20120709102538.GD1296@pengutronix.de> (raw)
In-Reply-To: <1339324322-29388-8-git-send-email-andrew@lunn.ch>

On Sun, Jun 10, 2012 at 12:31:59PM +0200, Andrew Lunn wrote:
> Extends the driver to get properties from device tree. Also extend the
> kirkwood DT support to supply the needed properties.
> 
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---
>  Documentation/devicetree/bindings/i2c/mrvl-i2c.txt |   35 +++++++++++++++++-
>  arch/arm/boot/dts/kirkwood.dtsi                    |   13 +++++++
>  arch/arm/mach-kirkwood/board-dt.c                  |    2 ++
>  drivers/i2c/busses/i2c-mv64xxx.c                   |   38 +++++++++++++++++---
>  4 files changed, 82 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/i2c/mrvl-i2c.txt b/Documentation/devicetree/bindings/i2c/mrvl-i2c.txt
> index b891ee2..89ef899 100644
> --- a/Documentation/devicetree/bindings/i2c/mrvl-i2c.txt
> +++ b/Documentation/devicetree/bindings/i2c/mrvl-i2c.txt
> @@ -1,4 +1,4 @@
> -* I2C
> +* Marvell MMP I2C controller
>  
>  Required properties :
>  
> @@ -32,3 +32,36 @@ Examples:
>  		interrupts = <58>;
>  	};
>  
> +* Marvell MV64XXX I2C controller
> +
> +Required properties :
> +
> + - reg         : Offset and length of the register set for the device
> + - compatible  : should be "marvell,mv64xxx-i2c"
> + - interrupts  : the interrupt number
> + - frequency-m : m factor in baud rate calculation
> +
> +Recommended properties :
> +
> + - frequency-n : n factor in baud rate calculation
> + - timeout-ms  : How long to wait for a transaction to complete

The way we define the bus speed for i2c with DT is using "clock-frequency".
You should be able to derive the dividers from that? Adding custom
properties for every driver will hardly be maintainable.

Thanks,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120709/36034f52/attachment.sig>

  parent reply	other threads:[~2012-07-09 10:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-10 10:31 [PATCH 7/9] I2C: MV64XXX: Add Device Tree support Andrew Lunn
2012-06-10 10:31 ` Andrew Lunn
     [not found] ` <1339324322-29388-8-git-send-email-andrew-g2DYL2Zd6BY@public.gmane.org>
2012-06-10 17:11   ` Jason Cooper
2012-06-10 17:11     ` Jason Cooper
2012-06-26 14:03   ` Ben Dooks
2012-06-26 14:03     ` Ben Dooks
     [not found]     ` <4FE9C14C.2030804-4yDnlxn2s6sWdaTGBSpHTA@public.gmane.org>
2012-06-26 14:10       ` Andrew Lunn
2012-06-26 14:10         ` Andrew Lunn
     [not found]         ` <20120626141047.GA18804-g2DYL2Zd6BY@public.gmane.org>
2012-06-26 14:13           ` Ben Dooks
2012-06-26 14:13             ` Ben Dooks
2012-07-09 10:25 ` Wolfram Sang [this message]
2012-07-09 10:25   ` Wolfram Sang

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=20120709102538.GD1296@pengutronix.de \
    --to=w.sang@pengutronix.de \
    --cc=andrew@lunn.ch \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=machael@walle.cc \
    --cc=rob.herring@calxeda.com \
    --cc=spi-devel-general@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.