[PATCH v7] i2c: rk3x: handle dynamic clock rate changes correctly

2014-11-20 Thread Max Schwarz
The i2c input clock can change dynamically, e.g. on the RK3066 where pclk_i2c0 and pclk_i2c1 are connected to the armclk, which changes rate on cpu frequency scaling. Until now, we incorrectly called clk_get_rate() while holding the i2c->lock in rk3x_i2c_xfer() to adapt to clock rate changes. Than

[PATCH 2/5] i2c: davinci: query STP always when NACK is received

2014-11-20 Thread Grygorii Strashko
According to I2C specification the NACK should be handled as folowing: "When SDA remains HIGH during this ninth clock pulse, this is defined as the Not Acknowledge signal. The master can then gene rate either a STOP condition to abort the transfer, or a repeated START condition to start a new trans

[PATCH 5/5] i2c: davinci: use ICPFUNC to toggle I2C as gpio for bus recovery

2014-11-20 Thread Grygorii Strashko
Having a board where the I2C bus locks up occasionally made it clear that the bus recovery in the i2c-davinci driver will only work on some boards, because on regular boards, this will only toggle GPIO lines that aren't muxed to the actual pins. The I2C controller on SoCs like da850 (and da830), K

[PATCH 4/5] i2c: davinci: use bus recovery infrastructure

2014-11-20 Thread Grygorii Strashko
This patch converts Davinci I2C driver to use I2C bus recovery infrastructure, introduced by commit 5f9296ba21b3 ("i2c: Add bus recovery infrastructure"). The i2c_bus_recovery_info is configured for Davinci I2C adapter only in case if scl_pin is provided in Platform data at least. Because the con

[PATCH 3/5] i2c: recovery: change input parameter to i2c_adapter for prepare/unprepare_recovery

2014-11-20 Thread Grygorii Strashko
This patch changes type of input parameter for .prepare/unprepare_recovery() callbacks from struct i2c_bus_recovery_info * to struct i2c_adapter *. This allows to simplify implementation of these callbacks and avoid type conversations from i2c_bus_recovery_info to i2c_adapter. The i2c_bus_recovery_

[PATCH 0/5] i2c: davinci improvements and fixes

2014-11-20 Thread Grygorii Strashko
This series contains some fixes and improvements for Davinci I2C: patch 1 - small improvement patch 2 - fixes "Bus busy" state for some case (was reported long time ago:() patch 3-5 - converts driver to use I2C bus recovery infrastructure and adds Davinci I2C bus recovery mechanizm based on using

[PATCH 1/5] i2c: i2c-davinci: switch to use platform_get_irq

2014-11-20 Thread Grygorii Strashko
Switch Davinci I2C driver to use platform_get_irq(), because - it is not recommened to use platform_get_resource(pdev, IORESOURCE_IRQ, ..) for requesting IRQ's resources any more, as they can be not ready yet in case of DT-booting. - it makes code simpler CC: Sekhar Nori CC: Kevin Hilman CC:

Re: [PATCH] i2c: img-scb: Allow building for MIPS

2014-11-20 Thread Ezequiel Garcia
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/19/2014 06:07 AM, Wolfram Sang wrote: > On Wed, Nov 19, 2014 at 12:03:08AM +, James Hogan wrote: >> On Tue, Nov 18, 2014 at 03:58:33PM -0800, Andrew Bresticker >> wrote: >>> The SCB is present on IMG SoCs other than the META-based >>> TZ109

[PATCH V2] ACPI: Add _DEP(Operation Region Dependencies) support to fix battery issue on the Asus T100TA

2014-11-20 Thread Lan Tianyu
ACPI 5.0 introduces _DEP to designate device objects that OSPM should assign a higher priority in start ordering due to future operation region accesses. On Asus T100TA, ACPI battery info are read from a I2C slave device via I2C operation region. Before I2C operation region handler is installed, b

Re: [PATCH v2] i2c: Driver to expose PowerNV platform i2c busses

2014-11-20 Thread Neelesh Gupta
On 11/16/2014 10:47 PM, Neelesh Gupta wrote: The patch exposes the available i2c busses on the PowerNV platform to the kernel and implements the bus driver to support i2c and smbus commands. The driver uses the platform device infrastructure to probe the busses on the platform and registers them

Re: [PATCH V2] ACPI: Add _DEP(Operation Region Dependencies) support to fix battery issue on the Asus T100TA

2014-11-20 Thread Mika Westerberg
On Thu, Nov 20, 2014 at 10:12:12PM +0800, Lan Tianyu wrote: > ACPI 5.0 introduces _DEP to designate device objects that OSPM should > assign a higher priority in start ordering due to future operation region > accesses. > > On Asus T100TA, ACPI battery info are read from a I2C slave device via > I

Re: [PATCH 2/2] i2c: omap: fix "Too much work in one IRQ" irq handling

2014-11-20 Thread Alexander Kochetkov
Hello, 18 нояб. 2014 г., в 19:12, Wolfram Sang написал(а): > I got confused with all the patches sent out for his issues. Can you ack > them once you are fine and mention if you consider them important for > this or the next release? That would be really helpful! Duplicate/Obsolete (v1): https

Re: [PATCH 2/2] i2c: omap: fix "Too much work in one IRQ" irq handling

2014-11-20 Thread Wolfram Sang
Hi, thanks for the list! > latest, v3 (same as v2, fixed subject line): > https://patchwork.ozlabs.org/patch/412095/ Yes, I have an eye on this one. Only waiting for the test results from older platforms by Aaro. > Sorry, for making so much noise. No problem, this is part of the process. Still

Re: [PATCH V2] ACPI: Add _DEP(Operation Region Dependencies) support to fix battery issue on the Asus T100TA

2014-11-20 Thread Rafael J. Wysocki
On Thursday, November 20, 2014 10:12:12 PM Lan Tianyu wrote: > ACPI 5.0 introduces _DEP to designate device objects that OSPM should > assign a higher priority in start ordering due to future operation region > accesses. > > On Asus T100TA, ACPI battery info are read from a I2C slave device via >

Re: [PATCH] i2c: omap: fix NACK and Arbitration Lost irq handling

2014-11-20 Thread Aaro Koskinen
On Tue, Nov 18, 2014 at 09:00:58PM +0400, Alexander Kochetkov wrote: > commit 1d7afc95946487945cc7f5019b41255b72224b70 (i2c: omap: ack IRQ in parts) > changed the interrupt handler to complete transfers without clearing > XRDY (AL case) and ARDY (NACK case) flags. XRDY or ARDY interrupts will be >

[RFC 0/4] i2c: omap: patch series related to multimaster mode

2014-11-20 Thread Alexander Kochetkov
Here is the patch series intended to improve stability of i2c-omap driver in the i2c multimaster environments. Tested on Beagleboard XM C. For now all fine. No controller timeouts, no data corruptions. Also impelemented i2c bus fault detection during startup and after reset. So, instead of the m

[PATCH 4/4] i2c: omap: add notes related to i2c multimaster mode

2014-11-20 Thread Alexander Kochetkov
No functional changes. Signed-off-by: Alexander Kochetkov --- drivers/i2c/busses/i2c-omap.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 47103e7..4e3642c 100644 --- a/drivers/i2c/busses/i2c-

[PATCH 1/4] i2c: omap: cleanup register definitions

2014-11-20 Thread Alexander Kochetkov
Delete STAT_AD0 mask as unrelated to current IP (omap1?). Delete DEBUG conditional around SYSTEST masks group. Add SYSTEST functional mode masks for SCL and SDA. Add STAT_BF mask. Signed-off-by: Alexander Kochetkov --- drivers/i2c/busses/i2c-omap.c | 10 +++--- 1 file changed, 7 insertions

[PATCH 2/4] i2c: omap: implement workaround for handling invalid BB-bit values

2014-11-20 Thread Alexander Kochetkov
In a multimaster environment, after IP software reset, BB-bit value doesn't correspond to the current bus state. It may happen what BB-bit will be 0, while the bus is busy due to another I2C master activity. Any transfer started when BB=0 and bus is busy wouldn't be completed by IP and results in

[PATCH 3/4] i2c: omap: don't reset controller if Arbitration Lost detected

2014-11-20 Thread Alexander Kochetkov
Arbitration Lost is a expected situation in a multimaster environment. IP correctly detect it. The only reason for reseting IP in the AL case is to be sure to avoid advisory 1.94 (omap3) and errata i595 (omap4): "I2C: After an Arbitration is Lost the Module Incorrectly Starts the Next Transfer" wi

Re: [1/5] i2c: i2c-davinci: switch to use platform_get_irq

2014-11-20 Thread Uwe Kleine-König
Hello Grygorii, On Thu, Nov 20, 2014 at 12:03:04PM +0200, Grygorii Strashko wrote: > Switch Davinci I2C driver to use platform_get_irq(), because > - it is not recommened to use > platform_get_resource(pdev, IORESOURCE_IRQ, ..) for requesting IRQ's > resources any more, as they can be not read

Re: [2/5] i2c: davinci: query STP always when NACK is received

2014-11-20 Thread Uwe Kleine-König
Hello, On Thu, Nov 20, 2014 at 12:03:05PM +0200, Grygorii Strashko wrote: > According to I2C specification the NACK should be handled as folowing: s/folowing/follows/ > "When SDA remains HIGH during this ninth clock pulse, this is defined as the > Not > Acknowledge signal. The master can then ge

Re: [PATCH 2/3] i2c: slave-eeprom: add eeprom simulator driver

2014-11-20 Thread Stijn Devriendt
On Tue, Nov 18, 2014 at 5:04 PM, Wolfram Sang wrote: > From: Wolfram Sang > > The first user of the i2c-slave interface is an eeprom simulator. It is > a shared memory which can be accessed by the remote master via I2C and > locally via sysfs. > > Signed-off-by: Wolfram Sang > --- > > Changes si

[PATCH] i2c: omap: fix i207 errata handling

2014-11-20 Thread Alexander Kochetkov
commit 6d9939f651419a63e091105663821f9c7d3fec37 (i2c: omap: split out [XR]DR and [XR]RDY) changed the way how errata i207 (I2C: RDR Flag May Be Incorrectly Set) get handled. 6d9939f6514 code doesn't correspond to workaround provided by errata. According to errata ISR must filter out spurious RDR b

Re: [PATCH] i2c: omap: fix i207 errata handling

2014-11-20 Thread Alexander Kochetkov
21 нояб. 2014 г., в 3:16, Alexander Kochetkov написал(а): > commit 6d9939f651419a63e091105663821f9c7d3fec37 (i2c: omap: split out [XR]DR > and [XR]RDY) changed the way how errata i207 (I2C: RDR Flag May Be Incorrectly > Set) get handled. It's is seen if open 6d9939f651419a63e09^ and 6d9939f65141

Re: [PATCH v8 5/8] of: i2c: Export single device registration method

2014-11-20 Thread Grant Likely
On Tue, 28 Oct 2014 22:36:02 +0200 , Pantelis Antoniou wrote: > Dynamically inserting i2c client device nodes requires the use > of a single device registration method. Rework and export it. > > Signed-off-by: Pantelis Antoniou Acked-by: Grant Likely Wolfram, this patch and the next one only

Re: [PATCH v8 6/8] OF: i2c: Add OF notifier handler

2014-11-20 Thread Grant Likely
On Tue, 28 Oct 2014 22:36:03 +0200 , Pantelis Antoniou wrote: > Add OF notifier handler needed for creating/destroying i2c devices > according to dynamic runtime changes in the DT live tree. > > Signed-off-by: Pantelis Antoniou > --- > drivers/i2c/i2c-core.c | 79 > +++

Re: [PATCH v8 6/8] OF: i2c: Add OF notifier handler

2014-11-20 Thread Guenter Roeck
On 11/20/2014 05:53 PM, Grant Likely wrote: On Tue, 28 Oct 2014 22:36:03 +0200 , Pantelis Antoniou wrote: Add OF notifier handler needed for creating/destroying i2c devices according to dynamic runtime changes in the DT live tree. Signed-off-by: Pantelis Antoniou --- drivers/i2c/i2c-core.

Re: [PATCH] Fixes: 1d7afc9 i2c: omap: ack IRQ in parts

2014-11-20 Thread Wolfram Sang
> > Tested on Beagleboard XM C. > > > > Signed-off-by: Alexander Kochetkov > > Cc: # v3.7+ > > This is good, but subject is wrong. That fixes line should not be the > subject, it should be here after Cc :-) I'll take this as an Ack unless you protest. signature.asc Description: Digital sign

Re: [PATCH] i2c: omap: fix NACK and Arbitration Lost irq handling

2014-11-20 Thread Wolfram Sang
On Tue, Nov 18, 2014 at 09:00:58PM +0400, Alexander Kochetkov wrote: > commit 1d7afc95946487945cc7f5019b41255b72224b70 (i2c: omap: ack IRQ in parts) > changed the interrupt handler to complete transfers without clearing > XRDY (AL case) and ARDY (NACK case) flags. XRDY or ARDY interrupts will be >

Re: [PATCH] i2c: at91: introduce probe deferring

2014-11-20 Thread Wolfram Sang
On Wed, Nov 19, 2014 at 11:14:03AM +0100, Ludovic Desroches wrote: > On Wed, Nov 19, 2014 at 10:47:15AM +0100, Arnd Bergmann wrote: > > On Wednesday 19 November 2014 10:16:47 Wolfram Sang wrote: > > > On Fri, Nov 14, 2014 at 02:47:59PM +0100, Ludovic Desroches wrote: > > > > Return probe defer if r

Re: [PATCH] i2c: designware: prevent early stop on TX FIFO empty

2014-11-20 Thread Wolfram Sang
On Fri, Nov 07, 2014 at 12:10:44PM +, Andrew Jackson wrote: > If the Designware core is configured with IC_EMPTYFIFO_HOLD_MASTER_EN > set to zero, allowing the TX FIFO to become empty causes a STOP > condition to be generated on the I2C bus. If the transmit FIFO > threshold is set too high, an

Re: [PATCH 2/3] i2c: slave-eeprom: add eeprom simulator driver

2014-11-20 Thread Uwe Kleine-König
Hello Wolfram, this mail is thematically more a reply to patch 1 and maybe just serves my understanding of the slave support. On Tue, Nov 18, 2014 at 05:04:54PM +0100, Wolfram Sang wrote: > From: Wolfram Sang > > The first user of the i2c-slave interface is an eeprom simulator. It is > a shared

Re: [PATCH v4 1/2] i2c: s3c2410: Handle i2c sys_cfg register in i2c driver

2014-11-20 Thread Wolfram Sang
On Thu, Oct 30, 2014 at 01:34:29PM +0530, Pankaj Dubey wrote: > Let's handle i2c interrupt re-configuration in i2c driver. This will > help us in removing some soc specific checks from machine files and > will help in removing static iomapping of SYS register in exynos.c > > Since only Exynos5250,