[PULL REQUEST] i2c embedded for 3.4

2012-03-23 Thread Wolfram Sang
Hi Linus,

nothing special from i2c-embedded for this merge window. Two new drivers,
minor feature additions, bugfixes, cleanups.

All patches have been in linux-next for some time, too.

Please pull. Thanks,

   Wolfram


The following changes since commit b01543dfe67bb1d191998e90d20534dc354de059:

  Linux 3.3-rc4 (2012-02-18 15:53:33 -0800)

are available in the git repository at:

  git://git.pengutronix.de/git/wsa/linux.git i2c-embedded/for-3.4

for you to fetch changes up to bbc82ef55c11db0161f4078edd79290e3bcf:

  i2c-eg20t: Remove write-only variables (2012-03-07 19:26:22 +0100)


Alexander Stein (2):
  i2c-eg20t: Rework pch_i2c_wait_for_bus_idle to reduce wait time
  i2c-eg20t: Remove write-only variables

Alok Chauhan (1):
  i2c: tegra: Remove unnecessary write to INT_STATUS

Ganesan Ramalingam (1):
  i2c: Support for Netlogic XLR/XLS I2C controller.

Jayachandran C (1):
  i2c: Move I2C_EG20T option to the right place.

Mark Brown (2):
  i2c-s3c2410: Convert to devm_kzalloc()
  i2c-s3c2410: Add stub runtime power management

Oskar Schirmer (1):
  i2c: imx: fix imx driver to work though signal is pending

Pawel Moll (1):
  i2c: versatile: Add Device Tree support

Pratyush Anand (1):
  i2c: designware: dw_i2c_init_driver as subsys initcall

Tang Yuantian (1):
  i2c: mpc: Add support for SMBUS_READ_BLOCK_DATA

Wolfram Sang (1):
  misc: at24: describe platform_data with kernel_doc

Zhiwu Song (1):
  i2c: add CSR SiRFprimaII on-chip I2C controllers driver

 Documentation/devicetree/bindings/i2c/sirf-i2c.txt |   19 +
 drivers/i2c/busses/Kconfig |   44 ++-
 drivers/i2c/busses/Makefile|4 +-
 drivers/i2c/busses/i2c-designware-platdrv.c|2 +-
 drivers/i2c/busses/i2c-eg20t.c |   44 +-
 drivers/i2c/busses/i2c-imx.c   |5 -
 drivers/i2c/busses/i2c-mpc.c   |   63 ++-
 drivers/i2c/busses/i2c-s3c2410.c   |   14 +-
 drivers/i2c/busses/i2c-sirf.c  |  459 
 drivers/i2c/busses/i2c-tegra.c |1 -
 drivers/i2c/busses/i2c-versatile.c |   10 +
 drivers/i2c/busses/i2c-xlr.c   |  278 
 include/linux/i2c/at24.h   |   35 ++-
 13 files changed, 912 insertions(+), 66 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/i2c/sirf-i2c.txt
 create mode 100644 drivers/i2c/busses/i2c-sirf.c
 create mode 100644 drivers/i2c/busses/i2c-xlr.c

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


signature.asc
Description: Digital signature


[PULL REQUEST] i2c embedded

2012-03-23 Thread Wolfram Sang


Hi Linus,

nothing special from i2c-embedded for this merge window. Two new drivers,
minor feature additions, bugfixes, cleanups.

All patches have been in linux-next for some time, too.

Please pull. Thanks,

   Wolfram


The following changes since commit b01543dfe67bb1d191998e90d20534dc354de059:

  Linux 3.3-rc4 (2012-02-18 15:53:33 -0800)

are available in the git repository at:

  git://git.pengutronix.de/git/wsa/linux.git i2c-embedded/for-3.4

for you to fetch changes up to bbc82ef55c11db0161f4078edd79290e3bcf:

  i2c-eg20t: Remove write-only variables (2012-03-07 19:26:22 +0100)


Alexander Stein (2):
  i2c-eg20t: Rework pch_i2c_wait_for_bus_idle to reduce wait time
  i2c-eg20t: Remove write-only variables

Alok Chauhan (1):
  i2c: tegra: Remove unnecessary write to INT_STATUS

Ganesan Ramalingam (1):
  i2c: Support for Netlogic XLR/XLS I2C controller.

Jayachandran C (1):
  i2c: Move I2C_EG20T option to the right place.

Mark Brown (2):
  i2c-s3c2410: Convert to devm_kzalloc()
  i2c-s3c2410: Add stub runtime power management

Oskar Schirmer (1):
  i2c: imx: fix imx driver to work though signal is pending

Pawel Moll (1):
  i2c: versatile: Add Device Tree support

Pratyush Anand (1):
  i2c: designware: dw_i2c_init_driver as subsys initcall

Tang Yuantian (1):
  i2c: mpc: Add support for SMBUS_READ_BLOCK_DATA

Wolfram Sang (1):
  misc: at24: describe platform_data with kernel_doc

Zhiwu Song (1):
  i2c: add CSR SiRFprimaII on-chip I2C controllers driver

 Documentation/devicetree/bindings/i2c/sirf-i2c.txt |   19 +
 drivers/i2c/busses/Kconfig |   44 ++-
 drivers/i2c/busses/Makefile|4 +-
 drivers/i2c/busses/i2c-designware-platdrv.c|2 +-
 drivers/i2c/busses/i2c-eg20t.c |   44 +-
 drivers/i2c/busses/i2c-imx.c   |5 -
 drivers/i2c/busses/i2c-mpc.c   |   63 ++-
 drivers/i2c/busses/i2c-s3c2410.c   |   14 +-
 drivers/i2c/busses/i2c-sirf.c  |  459 
 drivers/i2c/busses/i2c-tegra.c |1 -
 drivers/i2c/busses/i2c-versatile.c |   10 +
 drivers/i2c/busses/i2c-xlr.c   |  278 
 include/linux/i2c/at24.h   |   35 ++-
 13 files changed, 912 insertions(+), 66 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/i2c/sirf-i2c.txt
 create mode 100644 drivers/i2c/busses/i2c-sirf.c
 create mode 100644 drivers/i2c/busses/i2c-xlr.c
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] i2c: designware: Add support for 16bit register access

2012-03-23 Thread Stefan Roese
Hi Ben,

On Wednesday 14 March 2012 10:05:40 Stefan Roese wrote:
> On Wednesday 14 March 2012 09:19:22 Bhupesh SHARMA wrote:
> > > > > +++ b/drivers/i2c/busses/i2c-designware-core.c
> > > > > @@ -164,7 +164,14 @@ static char *abort_sources[] = {
> > > > > 
> > > > >  u32 dw_readl(struct dw_i2c_dev *dev, int offset)
> > > > >  {
> > > > > 
> > > > > - u32 value = readl(dev->base + offset);
> > > > > + u32 value;
> > > > > +
> > > > > + if (dev->access_16bit) {
> > > > > + value = readw(dev->base + offset) |
> > > > > + (readw(dev->base + offset + 2) << 16);
> > > > > + } else {
> > > > > + value = readl(dev->base + offset);
> > > > > + }
> > > > 
> > > > We can do away with '{' parenthesis as these are single line
> > > > of code inside both the 'if-else' blocks.
> > > 
> > > It's not a single-line statement. The first block extends spans 2
> > > lines. At
> > > least that how I interpret this CodingStyle recommendation.
> > 
> > ???
> > Breaking a single line of code into two for readability does not
> > make them two separate executable statements.
> > 
> > As per CodingStyle recommendation:
> > Do not unnecessarily use braces where a single statement will do.
> > 
> > if (condition)
> > 
> > action();
> > 
> > So, please modify your patch as braces here waste precious screen
> > space and reduce readability.
> 
> I have no strong preferences here. I it helps getting this patch accepted,
> I'll remove those braces.
> 
> > > > >   if (dev->swab)
> > > > >   
> > > > >   return swab32(value);
> > > > > 
> > > > > @@ -177,7 +184,12 @@ void dw_writel(struct dw_i2c_dev *dev, u32 b,
> > > 
> > > int
> > > 
> > > > > offset)
> > > > > 
> > > > >   if (dev->swab)
> > > > >   
> > > > >   b = swab32(b);
> > > > > 
> > > > > - writel(b, dev->base + offset);
> > > > > + if (dev->access_16bit) {
> > > > > + writew((u16)b, dev->base + offset);
> > > > > + writew((u16)(b >> 16), dev->base + offset + 2);
> > > > > + } else {
> > > > > + writel(b, dev->base + offset);
> > > > > + }
> > > > > 
> > > > >  }
> > > > >  
> > > > >  static u32
> > > > > 
> > > > > @@ -258,6 +270,12 @@ int i2c_dw_init(struct dw_i2c_dev *dev)
> > > > > 
> > > > >   reg = DW_IC_COMP_TYPE_VALUE;
> > > > >   
> > > > >   }
> > > > > 
> > > > > + /* Configure register access mode 16bit */
> > > > > + if (reg == (DW_IC_COMP_TYPE_VALUE & 0x)) {
> > > > > + dev->access_16bit = 1;
> > > > 
> > > > Can we use a suitable macro for 0x?
> > > 
> > > Hmmm. Wouldn't that make it more complex? 0x is easy to
> > > understand. A
> > > marco would "hide" this value. I would prefer to keep the value.
> > 
> > Using a macro doesn't make things 'more complex', but more readable.
> > Magic numbers must be avoided at all cost. A better
> > named MACRO is always better (for anyone else reading the code)
> > than a magic number like 0x.
> 
> I really don't share your point of view here. I feel that in this case, the
> number is much better readable than a macro.
> 
> > > > Also, if dev->access_16bit is bool we can simply set:
> > > > dev->access_16bit = true;
> > > > 
> > > > more on that below...
> > > > 
> > > > > + reg = DW_IC_COMP_TYPE_VALUE;
> > > > > + }
> > > > > +
> > > > > 
> > > > >   if (reg != DW_IC_COMP_TYPE_VALUE) {
> > > > >   
> > > > >   dev_err(dev->dev, "Unknown Synopsys component type: "
> > > > >   
> > > > >   "0x%08x\n", reg);
> > > > > 
> > > > > diff --git a/drivers/i2c/busses/i2c-designware-core.h
> > > > > b/drivers/i2c/busses/i2c-designware-core.h
> > > > > index 02d1a2d..f5af101 100644
> > > > > --- a/drivers/i2c/busses/i2c-designware-core.h
> > > > > +++ b/drivers/i2c/busses/i2c-designware-core.h
> > > > > @@ -83,6 +83,7 @@ struct dw_i2c_dev {
> > > > > 
> > > > >   u32 abort_source;
> > > > >   int irq;
> > > > >   int swab;
> > > > > 
> > > > > + int access_16bit;
> > > > 
> > > > ...
> > > > int?? Probably we are better off with making this as bool.
> > > 
> > > I'm not a big fan of bool's. But I have no strong preference here. My
> > > reasoning here was consistency. As we already have "int swab" for a
> > > similar
> > > issue.
> > 
> > If we have not done it earlier, doesn't mean that we repeat the same
> > mistake again. There is no reason to take access_16bit as an int when a
> > bool will suffice.
> > 
> > This wastes storage and on some platforms (which have real crunch of
> > memory), such saving is critical.
> 
> Again, I have no big problem changing this to bool.
> 
> > > So basically, I would prefer to not make the changes you suggested. But
> > > in the
> > > end its the decision of the maintainer(s).
> > 
> > Linux is a

Re: [PATCH 1/2] i2c/busses: Add PM support

2012-03-23 Thread Viresh Kumar
On 2/24/2012 5:01 PM, Viresh KUMAR wrote:
> From: Deepak Sikri 
> 
> This patch adds in support for standby/S2R/hybernate for i2c-designware 
> driver.
> 
> Signed-off-by: Deepak Sikri 
> Signed-off-by: Rajeev Kumar 
> ---
>  drivers/i2c/busses/i2c-designware-platdrv.c |   27 
> +++
>  1 files changed, 27 insertions(+), 0 deletions(-)

Hi Wolfram,

Any inputs of this patch?
You can discard 2/2 of this patchset, as that patch is included in
a separate patchset "I2C: Add bus recovery infrastructure".

-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html