Re: [PATCH V4 1/2] i2c/adapter: Add bus recovery infrastructure

2012-05-14 Thread Viresh Kumar
On 5/4/2012 3:10 PM, Viresh KUMAR wrote: > Add i2c bus recovery infrastructure to i2c adapters as specified in the i2c > protocol Rev. 03 section 3.16 titled "Bus clear". > > http://www.nxp.com/documents/user_manual/UM10204.pdf > > Sometimes during operation i2c bus hangs and we need to give dumm

Re: [PATCH 14/15] drivers/regulators: Enable the ab8500 for Device Tree

2012-05-14 Thread Lee Jones
On 14/05/12 19:06, Mark Brown wrote: On Mon, May 14, 2012 at 06:39:00PM +0100, Lee Jones wrote: Okay, so can you suggest a way to marry up the constraints found in DT to the remainder of the settings found in the driver without pointlessly applying it all to the DT itself (which is was some of

Re: [PATCH 14/15] drivers/regulators: Enable the ab8500 for Device Tree

2012-05-14 Thread Mark Brown
On Mon, May 14, 2012 at 06:39:00PM +0100, Lee Jones wrote: > Okay, so can you suggest a way to marry up the constraints found in DT to > the remainder of the settings found in the driver without pointlessly > applying it all to the DT itself (which is was some of the other drives > have done)? Th

Re: [PATCH 14/15] drivers/regulators: Enable the ab8500 for Device Tree

2012-05-14 Thread Mark Brown
On Mon, May 14, 2012 at 04:49:21PM +0100, Lee Jones wrote: > >You should be using of_regulator_match() for this (I think it's supposed > >to do an equivalent job...) rather than open coding. > I've ripped this out completely and the code appears to continue be > fully functional. Happy days! :)

Re: [PATCH 14/15] drivers/regulators: Enable the ab8500 for Device Tree

2012-05-14 Thread Arnd Bergmann
On Monday 14 May 2012, Lee Jones wrote: > > You should be using of_regulator_match() for this (I think it's supposed > > to do an equivalent job...) rather than open coding. > > I've ripped this out completely and the code appears to continue be > fully functional. Happy days! :) Ok, very good!

Re: [PATCH 14/15] drivers/regulators: Enable the ab8500 for Device Tree

2012-05-14 Thread Mark Brown
On Mon, May 14, 2012 at 04:57:39PM +0100, Lee Jones wrote: > >>pdata = dev_get_platdata(ab8500->dev); > >>- if (!pdata) { > >>- dev_err(&pdev->dev, "null pdata\n"); > >>+ if (!pdata&& !np) { > >>+ dev_err(&pdev->dev, "null pdata and no device tree found\n"); > >>

Re: [PATCH 14/15] drivers/regulators: Enable the ab8500 for Device Tree

2012-05-14 Thread Lee Jones
pdata = dev_get_platdata(ab8500->dev); - if (!pdata) { - dev_err(&pdev->dev, "null pdata\n"); + if (!pdata&& !np) { + dev_err(&pdev->dev, "null pdata and no device tree found\n"); return -EINVAL; } Neither should be mandato

Re: [PATCH 14/15] drivers/regulators: Enable the ab8500 for Device Tree

2012-05-14 Thread Lee Jones
Hi Mark, Looking at this now. +static __devinit int +ab8500_regulator_of_probe(struct platform_device *pdev, struct device_node *np) +{ + struct regulator_init_data *ab8500_regulator; + struct device_node *child; + int err, value, i, id = 0; + + /* Initialise regulator r

Re: [PATCHv9 06/10] I2C: OMAP: Fix the crash in i2c remove

2012-05-14 Thread Shubhrajyoti
On Saturday 12 May 2012 11:40 PM, Wolfram Sang wrote: >> Cc: Kevin Hilman >> > Cc: Rajendra Nayak >> > Signed-off-by: Shubhrajyoti D > I'd really like a comment from the PM experts if each and every driver > has to ensure that the clocks are enabled on remove like this? Just resent cc ing linux-

Howto compile py-smbus with python 3.2

2012-05-14 Thread Renz, Bernhard
Hello @All, i try to compile i2c-tools-3.1.0 py-smbus, smbusmodule.c with the following command under Ubuntu 12.04: python3.2 ./setup.py build But it fail with the following errors: running build running build_ext building 'smbus' extension gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-pro

Re: [PATCH 06/15] mfd/ab8500: Remove confusing ab8500-i2c file and merge into ab8500-core

2012-05-14 Thread Linus Walleij
On Mon, May 14, 2012 at 10:41 AM, Lee Jones wrote: > On 09/05/12 13:20, Linus Walleij wrote: >> (...) >> +static int ab8500_i2c_write(struct ab8500 *ab8500, u16 addr, u8 data) >> +static int ab8500_i2c_read(struct ab8500 *ab8500, u16 addr) >> >> As you might have noticed, many people have been co

[PATCHv10 09/10] I2C: OMAP: Do not set the XUDF(Transmit underflow) if the underflow is not reached

2012-05-14 Thread Shubhrajyoti D
Currently in the 1.153 errata handling while waiting for transmitter underflow if NACK is got the XUDF(Transmit underflow) flag is also set. The flag is set after wait for the condition is over. Cc: Alexander Shishkin Acked-by: Moiz Sonasath Signed-off-by: Shubhrajyoti D --- - XUDF is expanded

[PATCHv10 10/10] I2C: OMAP: Rename the 1p153 to the erratum id i462

2012-05-14 Thread Shubhrajyoti D
The section number in the recent errata document has changed. Rename the erratum 1p153 to the unique id i462 instead, so that it is easier to reference. Also change the function name and comments to reflect the same. Cc: Jon Hunter Signed-off-by: Shubhrajyoti D --- drivers/i2c/busses/i2c-omap.c

[PATCHv10 08/10] I2C: OMAP: prevent the overwrite of the errata flags

2012-05-14 Thread Shubhrajyoti D
From: Tasslehoff Kjappfot i2c_probe set the dev->errata flag, but omap_i2c_init cleared the flag again. Prevent the overwrite of the errata flags.Move the errata handling to a unified place in probe to prevent such errors. Thus preventing the overwrite of erratum 1p153. Signed-off-by: Tasslehoff

[PATCHv10 05/10] I2C: OMAP: Don't check if wait_for_completion_timeout() returns less than zero

2012-05-14 Thread Shubhrajyoti D
By definition, wait_for_completion_timeout() returns an unsigned value and therefore, it is not necessary to check if the return value is less than zero as this is not possible. This is based on a patch from Jon Hunter Changes from his patch - Declare a long as the wait_for_completion_timeout ret

[PATCHv10 04/10] I2C: OMAP: Prevent the register access after pm_runtime_put in probe

2012-05-14 Thread Shubhrajyoti D
Currently in probe pm_runtime_put(dev->dev); ... /* i2c device drivers may be active on return from add_adapter() */ adap->nr = pdev->id; r = i2c_add_numbered_adapter(adap); if (r) { dev_err(dev->dev, "failure adding adapter\n"); goto

[PATCHv10 02/10] I2C: OMAP: Fix the mismatch of pm_runtime enable and disable

2012-05-14 Thread Shubhrajyoti D
Currently the i2c driver calls the pm_runtime_enable and never the disable. This causes a warning when pm_runtime_enable checks for the count match.Fix the same by calling pm_runtime_disable in the error and the remove path. Cc: Kevin Hilman Cc: Rajendra Nayak Signed-off-by: Shubhrajyoti D ---

[PATCHv10 06/10] I2C: OMAP: Fix the crash in i2c remove

2012-05-14 Thread Shubhrajyoti D
In omap_i2c_remove we are accessing the I2C_CON register without enabling the clocks. Fix the same by enabling the clocks and disabling it. This fixes the following crash. [ 154.723022] [ cut here ] [ 154.725677] WARNING: at arch/arm/mach-omap2/omap

[PATCHv10 07/10] I2C: OMAP: Handle error check for pm runtime

2012-05-14 Thread Shubhrajyoti D
If PM runtime get_sync fails return with the error so that no further reads/writes goes through the interface. This will avoid possible abort. Add a error message in case of failure with the cause of the failure. Signed-off-by: Shubhrajyoti D --- - Correct the error handling. drivers/i2c/busses

[PATCHv10 01/10] I2C: OMAP: make omap_i2c_unidle/idle functions depend on CONFIG_PM_RUNTIME

2012-05-14 Thread Shubhrajyoti D
The functions omap_i2c_unidle/idle are called from omap_i2c_runtime_resume and omap_i2c_runtime_suspend which is compiled for CONFIG_PM_RUNTIME. This patch removes the omap_i2c_unidle/idle functions and folds them into the runtime callbacks. This fixes the below warn when CONFIG_PM_RUNTIME is not

[PATCHv10 03/10] I2C: OMAP: Fix the interrupt clearing in OMAP4

2012-05-14 Thread Shubhrajyoti D
On OMAP4 we were writing 1 to IRQENABLE_CLR which cleared only the arbitration lost interrupt. The patch intends to fix the same by writing 0 to the IE register clearing all interrupts. This is based on the work done by Vikram Pandita . The changes from the original patch ... - Does not use the

[PATCHv10 00/10] I2C fixes

2012-05-14 Thread Shubhrajyoti D
The patch series does the following - Warn fixes if CONFIG_PM_RUNTIME is not selected. - In case of i2c remove register access was done without any get_sync fix the same. - Folds a patch from Tasslehoff to prevent any merge conflicts. - Prevents the XDUF flag to be set if the underflow condition

Re: [PATCH 11/15] drivers/mfd: Enable Device Tree for ab8500-core driver

2012-05-14 Thread Lee Jones
Hi Sam, On Fri, May 04, 2012 at 07:23:21PM +0100, Lee Jones wrote: This patch will allow the ab8500-core driver to be probed and set up when booting when Device Tree is enabled. This includes platform ID look-up which identifies the machine it is currently running on. If we are undergoing a DT

Re: [PATCH 06/15] mfd/ab8500: Remove confusing ab8500-i2c file and merge into ab8500-core

2012-05-14 Thread Lee Jones
On 09/05/12 13:20, Linus Walleij wrote: On Fri, May 4, 2012 at 8:23 PM, Lee Jones wrote: ab8500-i2c is used as core code to register the ab8500 device. After allocating ab8500 memory, it immediately calls into ab8500-core where the real initialisation takes place. This patch moves all core reg