[PATCH 2/2] i2c-ocores: Use devres for resource allocation

2010-11-24 Thread Jonas Bonn
This patch converts the i2c-cores driver to use devres routines for resource allocation. Signed-off-by: Jonas Bonn jo...@southpole.se --- drivers/i2c/busses/i2c-ocores.c | 46 +- 1 files changed, 11 insertions(+), 35 deletions(-) diff --git

i2c-ocores changes

2010-11-24 Thread Jonas Bonn
Here are a couple of patches that fix up the initialization path of the i2c-cores driver: i) Support for device tree configuration of i2c devices ii) Use devres routines in the resource reservation paths for device initialization This has been tested on an OpenRISC 1200 board; the OpenRISC

[PATCH 1/2] i2c-ocores: Adapt for device tree

2010-11-24 Thread Jonas Bonn
This patch adapts the i2c-ocores driver for being defined and configured via a device tree description. The device tree bits need to be protected by CONFIG_OF guards as this is still an optional feature. Signed-off-by: Jonas Bonn jo...@southpole.se --- drivers/i2c/busses/i2c-ocores.c | 63

Re: [PATCH 1/2] i2c-ocores: Adapt for device tree

2010-11-24 Thread Wolfram Sang
Hi, quick review (hopefully not too quick)... On Wed, Nov 24, 2010 at 03:09:48PM +0100, Jonas Bonn wrote: This patch adapts the i2c-ocores driver for being defined and configured via a device tree description. The device tree bits need to be protected by CONFIG_OF guards as this is still

[PATCH 1/2] i2c_intel_mid: Improve error reporting

2010-11-24 Thread Alan Cox
From: Catalin Popescu catalinx.pope...@intel.com The error messages printed from mrst_i2c_abort() didn't give slave address info. But I2C device driver developers always need this to check which slave device has the problem. This patch enhances the error message format by adding slave address

[PATCH 2/2] i2c-intel-mid: improve timeout handling

2010-11-24 Thread Alan Cox
From: Bin Yang bin.y...@intel.com The old solution for i2c xfer timeout was to set timeout value to one second for all i2c xfers. That's not reasonable for all of the various speed modes and data lengths. This patch sets the xfer_read timeout value based on both bus speed and data length.

Re: [PATCH 1/2] i2c-ocores: Adapt for device tree

2010-11-24 Thread Grant Likely
On Wed, Nov 24, 2010 at 7:09 AM, Jonas Bonn jo...@southpole.se wrote: This patch adapts the i2c-ocores driver for being defined and configured via a device tree description. The device tree bits need to be protected by CONFIG_OF guards as this is still an optional feature. Signed-off-by:

Re: [PATCH 1/2] i2c-ocores: Adapt for device tree

2010-11-24 Thread Jonas Bonn
On Wed, 2010-11-24 at 15:58 +0100, Wolfram Sang wrote: Hi, quick review (hopefully not too quick)... Thanks... see my comments below. + val = (int*) of_get_property(pdev-dev.of_node, regstep, NULL); + if (!val) { + dev_err(pdev-dev, Missing required paramter 'regstep');

Re: [PATCH 1/2] i2c-ocores: Adapt for device tree

2010-11-24 Thread Wolfram Sang
While I agree that these parameters need documentation, I haven't seen that there is an agreed upon place to put such documentation as of yet. I followed your link but didn't find the corresponding document in the kernel tree. Because it has not been applied yet; that was the template patch

[PATCH 3/3] i2c-ocores: add some device tree documentation

2010-11-24 Thread Jonas Bonn
This puts some documentation for the device tree configuration at the head of the driver file. Hopefully this can get moved to a common area for this type of documentation at a later date; unfortunately, there isn't really such a place in the kernel tree at this time. Furthermore, the regstep

i2c-ocores changes (version 2)

2010-11-24 Thread Jonas Bonn
Version 2 of patch series incorporating initial feedback from review. /Jonas -- 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

[PATCH 2/3] i2c-ocores: Use devres for resource allocation

2010-11-24 Thread Jonas Bonn
This patch converts the i2c-cores driver to use devres routines for resource allocation. Signed-off-by: Jonas Bonn jo...@southpole.se --- drivers/i2c/busses/i2c-ocores.c | 46 +- 1 files changed, 11 insertions(+), 35 deletions(-) diff --git

[PATCH 1/3] i2c-ocores: Adapt for device tree

2010-11-24 Thread Jonas Bonn
This patch adapts the i2c-ocores driver for being defined and configured via a device tree description. The device tree bits need to be protected by CONFIG_OF guards as this is still an optional feature. Signed-off-by: Jonas Bonn jo...@southpole.se --- drivers/i2c/busses/i2c-ocores.c | 64

[PATCH 1/7] i2c/pxa2xx: Don't touch ISAR if not in slave mode

2010-11-24 Thread Sebastian Andrzej Siewior
The reset functions sets writes the slave address even in not slave mode. I don't see any reason in writting it if slave mode is not enabled. I have here a PXA-I2C variant where this register is not availbale and as such can not be touched. Signed-off-by: Sebastian Andrzej Siewior

[PATCH 3/7] i2c/pxa2xx: Add PCI support for PXA I2C controller

2010-11-24 Thread Sebastian Andrzej Siewior
The Sodaville I2C controller is almost the same as found on PXA2xx. The difference: - the register are at a different spot - no slave support The PCI probe code adds three platform devices which are probed then by the platform code. The X86 part also adds dummy clock defines because we don't have

[PATCH 4/7] i2c/pxa2xx: add support for shared IRQ handler

2010-11-24 Thread Sebastian Andrzej Siewior
Sodaville has three of them on a single IRQ. IRQF_DISABLED is removed because it is a NOP allready and scheduled for removal. Signed-off-by: Sebastian Andrzej Siewior bige...@linutronix.de Signed-off-by: Dirk Brandewie dirk.brande...@gmail.com --- drivers/i2c/busses/i2c-pxa.c | 10 --

[PATCH 6/7] i2c/pxa2xx: reset the chip if the bus is not free

2010-11-24 Thread Sebastian Andrzej Siewior
I haven't seen this (yet) during a normal transfer but starting i2cdetect seems to hang the bus. On my Sodaville board, i2cdetect runs fine on bus zero and runs into timeouts on bus one and two. The chip never recovers from this condition. The following transfers hang as well. The ISR_UB never

[PATCH 2/7] arm/pxa2xx: reorganize I2C files

2010-11-24 Thread Sebastian Andrzej Siewior
This patch moves the register definitions into include/asm so it can be accessed from X86 the same way as on ARM. This move also alters the unused register offset definitins (IBMR, ...) and uses them in the calculation macros (_IBMR,...). The header file from plat-pxa is moved the include/linux

[PATCH 7/7] i2c/pxa2xx: pass of_node from platform driver to adapter

2010-11-24 Thread Sebastian Andrzej Siewior
the of_node will auto-publish devices which are added to the device tree. Cc: grant.lik...@secretlab.ca Signed-off-by: Sebastian Andrzej Siewior bige...@linutronix.de Signed-off-by: Dirk Brandewie dirk.brande...@gmail.com --- drivers/i2c/busses/i2c-pxa.c |3 +++ 1 files changed, 3

[PATCH] i2c/i2c-dev: use dynamic minor allocation

2010-11-24 Thread Sebastian Andrzej Siewior
Right now i2c adapter 5 becomes minor 5 allocated. This is fine as long as no adapter becomes a number 256 allocated. The Sodavile PCI driver uses (devfn 3 | pci_bar) to come up with an unique adapter number. So the first i2c adapter has the number 720. This patch introduces dynamic minor

Re: [PATCH] i2c/i2c-dev: use dynamic minor allocation

2010-11-24 Thread Jean Delvare
Hi Sebastian, On Wed, 24 Nov 2010 22:23:08 +0100, Sebastian Andrzej Siewior wrote: Right now i2c adapter 5 becomes minor 5 allocated. This is fine as long as no adapter becomes a number 256 allocated. Why would it be a problem to have a minor number 256 (or more likely you meant 255)?

Re: [PATCH 4/7] i2c/pxa2xx: add support for shared IRQ handler

2010-11-24 Thread Haojian Zhuang
On Thu, Nov 25, 2010 at 5:20 AM, Sebastian Andrzej Siewior bige...@linutronix.de wrote: Sodaville has three of them on a single IRQ. IRQF_DISABLED is removed because it is a NOP allready and scheduled for removal. Signed-off-by: Sebastian Andrzej Siewior bige...@linutronix.de Signed-off-by:

Re: [PATCH 6/7] i2c/pxa2xx: reset the chip if the bus is not free

2010-11-24 Thread Haojian Zhuang
On Thu, Nov 25, 2010 at 5:20 AM, Sebastian Andrzej Siewior bige...@linutronix.de wrote: I haven't seen this (yet) during a normal transfer but starting i2cdetect seems to hang the bus. On my Sodaville board, i2cdetect runs fine on bus zero and runs into timeouts on bus one and two. The chip

Re: [PATCH 6/7] i2c/pxa2xx: reset the chip if the bus is not free

2010-11-24 Thread Haojian Zhuang
On Thu, Nov 25, 2010 at 2:43 PM, Igor Grinberg grinb...@compulab.co.il wrote:  Hi, On 11/25/10 04:49, Haojian Zhuang wrote: On Thu, Nov 25, 2010 at 10:30 AM, Haojian Zhuang haojian.zhu...@gmail.com wrote: On Thu, Nov 25, 2010 at 5:20 AM, Sebastian Andrzej Siewior bige...@linutronix.de