Nori, Sekhar | 1 Feb 06:57 2010
Picon

RE: [PATCH 6/6] i2c: davinci: bus recovery procedure to clear the bus

Hi Philby,

On Wed, Jan 27, 2010 at 05:11:33, Kevin Hilman wrote:
> From: Philby John <pjohn@...>
>
> Come out of i2c time out condition by following the
> bus recovery procedure outlined in the i2c protocol v3 spec.
> The kernel must be robust enough to gracefully recover
> from i2c bus failure without having to reset the machine.
> This is done by first NACKing the slave, pulsing the SCL
> line 9 times and then sending the stop command.
>
> This patch has been tested on a DM6446 and DM355
>
> Signed-off-by: Philby John <pjohn@...>
> Signed-off-by: Srinivasan, Nageswari <nageswari@...>
> Acked-by: Kevin Hilman <khilman@...>
> ---
>  drivers/i2c/busses/i2c-davinci.c |   57 +++++++++++++++++++++++++++++++++++--
>  1 files changed, 53 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
> index 35f9daa..5459065 100644
> --- a/drivers/i2c/busses/i2c-davinci.c
> +++ b/drivers/i2c/busses/i2c-davinci.c
>  <at>  <at>  -36,6 +36,7  <at>  <at> 
>  #include <linux/platform_device.h>
>  #include <linux/io.h>
>  #include <linux/cpufreq.h>
> +#include <linux/gpio.h>
(Continue reading)

Nori, Sekhar | 1 Feb 07:05 2010
Picon

RE: [PATCH v3 1/2] i2c: Add SDA and SCL pin numbers to i2c platform data

Hi Philby,

On Tue, Jan 12, 2010 at 16:47:11, Philby John wrote:
> >From cb3347e45449ff16a332aa164eae24ef6a2432e6 Mon Sep 17 00:00:00 2001
> From: Philby John <pjohn@...>
> Date: Mon, 11 Jan 2010 15:53:31 +0530
> Subject: [PATCH 1/2] Add SDA and SCL pin numbers to i2c platform data
>
> Patch adds SDA and SCL pin numbers to the i2c platform data
> structure for Davinci DM355 and DM6446. This at present is
> used for i2c bus recovery.
> TODO: Add SDA and SCL pin number information to include all
> Davinci platforms such as dm355-leopard, dm365, dm646x, da8xx etc.
>
> Signed-off-by: Philby John <pjohn@...>
> ---
>  arch/arm/mach-davinci/board-dm355-evm.c  |    2 ++
>  arch/arm/mach-davinci/board-dm644x-evm.c |    2 ++
>  arch/arm/mach-davinci/include/mach/i2c.h |    2 ++
>  3 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
> index 077ecf4..aa48e3f 100644
> --- a/arch/arm/mach-davinci/board-dm355-evm.c
> +++ b/arch/arm/mach-davinci/board-dm355-evm.c
>  <at>  <at>  -111,6 +111,8  <at>  <at>  static struct platform_device davinci_nand_device = {
>  static struct davinci_i2c_platform_data i2c_pdata = {
>       .bus_freq       = 400   /* kHz */,
>       .bus_delay      = 0     /* usec */,
> +     .sda_pin        = 15,
(Continue reading)

Wolfgang Grandegger | 1 Feb 08:37 2010

[PATCH v5 1/3] i2c-mpc: use __devinit[data] for initialization functions and data

From: Wolfgang Grandegger <wg@...>

"__devinit[data]" has not yet been used for all initialization functions
and data. To avoid truncating lines, the struct "mpc_i2c_match_data" has
been renamed to "mpc_i2c_data", which is even the better name.

Signed-off-by: Wolfgang Grandegger <wg@...>
Tested-by: Wolfram Sang <w.sang@...>
---
 drivers/i2c/busses/i2c-mpc.c |  103 +++++++++++++++++++----------------------
 1 files changed, 48 insertions(+), 55 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index f627001..275ebe6 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
 <at>  <at>  -66,7 +66,7  <at>  <at>  struct mpc_i2c_divider {
 	u16 fdr;	/* including dfsrr */
 };

-struct mpc_i2c_match_data {
+struct mpc_i2c_data {
 	void (*setclock)(struct device_node *node,
 			 struct mpc_i2c *i2c,
 			 u32 clock, u32 prescaler);
 <at>  <at>  -165,7 +165,7  <at>  <at>  static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing)
 }

 #ifdef CONFIG_PPC_MPC52xx
-static const struct mpc_i2c_divider mpc_i2c_dividers_52xx[] = {
(Continue reading)

Wolfgang Grandegger | 1 Feb 08:37 2010

[PATCH v5 2/3] i2c-mpc: add support for the MPC512x processors from Freescale

From: Wolfgang Grandegger <wg@...>

The "setclock" initialization functions have been renamed to "setup"
because I2C interrupts must be enabled for the MPC512x. This requires
to handle "fsl,preserve-clocking" in a slighly different way. Also,
the old settings are now reported calling dev_dbg(). For the MPC512x
the clock setup function of the MPC52xx can be re-used. Furthermore,
the Kconfig help has been updated and corrected.

Signed-off-by: Wolfgang Grandegger <wg@...>
Reviewed-by: Wolfram Sang <w.sang@...>
---
 drivers/i2c/busses/Kconfig   |    7 +-
 drivers/i2c/busses/i2c-mpc.c |  131 ++++++++++++++++++++++++++++++------------
 2 files changed, 96 insertions(+), 42 deletions(-)

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 5f318ce..5477e41 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
 <at>  <at>  -418,13 +418,12  <at>  <at>  config I2C_IXP2000
 	  instead.

 config I2C_MPC
-	tristate "MPC107/824x/85xx/52xx/86xx"
+	tristate "MPC107/824x/85xx/512x/52xx/83xx/86xx"
 	depends on PPC32
 	help
 	  If you say yes to this option, support will be included for the
-	  built-in I2C interface on the MPC107/Tsi107/MPC8240/MPC8245 and
(Continue reading)

Wolfgang Grandegger | 1 Feb 08:37 2010

[PATCH v5 0/3] i2c-mpc: add support for the Freescale MPC512x and other fixes

This patch series adds support for the MPC512x from Freescale to the
i2c-mpc driver. At that occasion, issues with  __devinit[data] have
been fixed and the doc of the FSL I2C dts bindings updated. It has
been tested on a MPC5121ADS, TQM5200 and TQM8560 board

Changes since v1:

- use macro MPC_I2C_CLOCK_PRESERVE/SAFE for the special clock settings.
- document the special DTS node "fsl,mpc5121-i2c-ctrl".
- update and correct the Kconfig help.
- some other minor fixes as suggested by Wolfram.

Changes since v2:

- use __init[data] instead of __devinit[data] for this driver.

Changes since v3:

- switch back to __devinit[data] as pointed out by Ben.

Changes since v4:

- check MPC_I2C_CLOCK_SAFE instead of "!clock" as suggested by Wolfram.
- update MODULE_DESCRIPTION().

Wolfgang

Wolfgang Grandegger (3):
  i2c-mpc: use __devinit[data] for initialization functions and data
  i2c-mpc: add support for the MPC512x processors from Freescale
(Continue reading)

Wolfgang Grandegger | 1 Feb 08:37 2010

[PATCH v5 3/3] powerpc: doc/dts-bindings: update doc of FSL I2C bindings

From: Wolfgang Grandegger <wg@...>

This patch adds the MPC5121 to the list of supported devices,
enhances the doc of the "clock-frequency" property and removes
the obsolete "cell-index" property from the example nodes.
Furthermore and example for the MPC5121 has been added.

Signed-off-by: Wolfgang Grandegger <wg@...>
Reviewed-by: Wolfram Sang <w.sang@...>
---
 Documentation/powerpc/dts-bindings/fsl/i2c.txt |   30 +++++++++++++++++++----
 1 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/Documentation/powerpc/dts-bindings/fsl/i2c.txt b/Documentation/powerpc/dts-bindings/fsl/i2c.txt
index b6d2e21..2f62dae 100644
--- a/Documentation/powerpc/dts-bindings/fsl/i2c.txt
+++ b/Documentation/powerpc/dts-bindings/fsl/i2c.txt
 <at>  <at>  -9,8 +9,9  <at>  <at>  Recommended properties :

  - compatible : compatibility list with 2 entries, the first should
    be "fsl,CHIP-i2c" where CHIP is the name of a compatible processor,
-   e.g. mpc8313, mpc8543, mpc8544, mpc5200 or mpc5200b. The second one
-   should be "fsl-i2c".
+   e.g. mpc8313, mpc8543, mpc8544, mpc5121, mpc5200 or mpc5200b. The
+   second one should be "fsl-i2c". For the mpc5121, an additional node
+   "fsl,mpc5121-i2c-ctrl" is required as shown in the example below.
  - interrupts : <a b> where a is the interrupt number and b is a
    field that represents an encoding of the sense and level
    information for the interrupt.  This should be encoded based on
 <at>  <at>  -20,29 +21,46  <at>  <at>  Recommended properties :
(Continue reading)

d binderman | 1 Feb 10:51 2010
Picon

i2c/busses/i2c-highlander.c: using char variable in bit operation


Hello there,

I just ran the sourceforge tool cppcheck over the source code of the
new Linux kernel 2.6.33-rc6

It said

[./i2c/busses/i2c-highlander.c:284]: (style) Warning - using char variable in bit operation

The source code is

static int highlander_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
                                  unsigned short flags, char read_write,
                                  u8 command, int size,
                                  union i2c_smbus_data *data)
{
        struct highlander_i2c_dev *dev = i2c_get_adapdata(adap);
        int read = read_write & I2C_SMBUS_READ;

In C, chars can be signed or unsigned, so the value written into
local variable read by sign extension is not certain.

Suggest new code

static int highlander_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
                                  unsigned short flags, char read_write,
                                  u8 command, int size,
                                  union i2c_smbus_data *data)
{
(Continue reading)

Jean Delvare | 1 Feb 11:07 2010

Re: i2c/busses/i2c-highlander.c: using char variable in bit operation

On Mon, 1 Feb 2010 09:51:42 +0000, d binderman wrote:
> 
> 
> Hello there,
> 
> I just ran the sourceforge tool cppcheck over the source code of the
> new Linux kernel 2.6.33-rc6
> 
> It said
> 
> [./i2c/busses/i2c-highlander.c:284]: (style) Warning - using char variable in bit operation
> 
> The source code is
> 
> static int highlander_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
>                                   unsigned short flags, char read_write,
>                                   u8 command, int size,
>                                   union i2c_smbus_data *data)
> {
>         struct highlander_i2c_dev *dev = i2c_get_adapdata(adap);
>         int read = read_write & I2C_SMBUS_READ;
> 
> In C, chars can be signed or unsigned, so the value written into
> local variable read by sign extension is not certain.
> 
> Suggest new code
> 
> static int highlander_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
>                                   unsigned short flags, char read_write,
>                                   u8 command, int size,
(Continue reading)

Wolfram Sang | 1 Feb 11:15 2010
Picon

Re: i2c/busses/i2c-highlander.c: using char variable in bit operation

On Mon, Feb 01, 2010 at 11:07:21AM +0100, Jean Delvare wrote:
> On Mon, 1 Feb 2010 09:51:42 +0000, d binderman wrote:
> > 
> > 
> > Hello there,
> > 
> > I just ran the sourceforge tool cppcheck over the source code of the
> > new Linux kernel 2.6.33-rc6
> > 
> > It said
> > 
> > [./i2c/busses/i2c-highlander.c:284]: (style) Warning - using char variable in bit operation
> > 
> > The source code is
> > 
> > static int highlander_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
> >                                   unsigned short flags,
char read_write,
> >                                   u8 command, int size,
> >                                   union i2c_smbus_data *data)
> > {
> >         struct highlander_i2c_dev *dev = i2c_get_adapdata(adap);
> >         int read = read_write & I2C_SMBUS_READ;
> > 
> > In C, chars can be signed or unsigned, so the value written into
> > local variable read by sign extension is not certain.
> > 
> > Suggest new code
> > 
> > static int highlander_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
(Continue reading)

srinidhi kasagar | 1 Feb 15:14 2010

[PATCH v3] i2c: Add support for Ux500/Nomadik I2C controller

This adds support for ST-Ericsson's I2C block found
in Ux500 and Nomadik 8815 platforms.

Signed-off-by: srinidhi kasagar <srinidhi.kasagar@...>
Acked-by: Andrea Gallo <andrea.gallo@...>
Acked-by: Linus Walleij <linus.walleij@...>
Reviewed-by: Linus Walleij <linus.walleij@...>
---
 drivers/i2c/busses/Kconfig       |    7 +
 drivers/i2c/busses/Makefile      |    1 +
 drivers/i2c/busses/i2c-nomadik.c |  959 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 967 insertions(+), 0 deletions(-)
 create mode 100644 drivers/i2c/busses/i2c-nomadik.c

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 5f318ce..fbde486 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
 <at>  <at>  -439,6 +439,13  <at>  <at>  config I2C_MV64XXX
 	  This driver can also be built as a module.  If so, the module
 	  will be called i2c-mv64xxx.

+config I2C_NOMADIK
+	tristate "ST-Ericsson Nomadik/Ux500 I2C Controller"
+	depends on PLAT_NOMADIK
+	help
+	  If you say yes to this option, support will be included for the
+	  I2C interface from ST-Ericsson's Nomadik and Ux500 architectures.
+
 config I2C_OCORES
(Continue reading)


Gmane