[PATCH RFT] i2c: au1550: Convert to devm_kzalloc and devm_ioremap_resource

2015-06-09 Thread Axel Lin
Use devm_* APIs to simplify the code. Signed-off-by: Axel Lin axel@ingics.com --- I don't have the h/w for testing, only compile test. drivers/i2c/busses/i2c-au1550.c | 52 +++-- 1 file changed, 13 insertions(+), 39 deletions(-) diff --git

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-09 Thread Mika Westerberg
On Mon, Jun 08, 2015 at 02:50:28PM -0300, lucas.de.mar...@gmail.com wrote: From: Fabio Mello fabio.me...@intel.com According to documentation and tests, initialization is not necessary on module resume, since the controller keeps its state between disable/enable. Change the target address is

Re: [PATCH v3] i2c: davinci: Refactor i2c_davinci_wait_bus_not_busy()

2015-06-09 Thread Alexander Sverdlin
There are several problems in the function: - to_cnt variable does nothing - schedule_timeout() call without setting current state does nothing - allow_sleep parameter is not really used Refactor the function so that it really tries to wait. In case of timeout try to recover the bus.

[PATCH v3] i2c: davinci: Avoid sending to own address

2015-06-09 Thread Alexander Sverdlin
Sending a message to own address locks the controller up in very bizarre state, it behaves as slave even if MDR register clearly states master. The controller remains in this state until reset. To avoid unnecessary timeouts simply avoid sending to own address. The controller cannot do this any

Re: [PATCH v2] i2c: davinci: Refactor i2c_davinci_wait_bus_not_busy()

2015-06-09 Thread Alexander Sverdlin
Hello Wolfram, On 02/06/15 17:53, ext Wolfram Sang wrote: There are several problems in the function: - to_cnt variable does nothing - schedule_timeout() call without setting current state does nothing - allow_sleep parameter is not really used Refactor the function so that it really

[PATCH 1/2] i2c: sh_mobile: add errata workaround

2015-06-09 Thread Wolfram Sang
From: Wolfram Sang wsa+rene...@sang-engineering.com This used to be in platform init code. We want it to do in the driver now. This is basically a code move and a new compatible added. Signed-off-by: Wolfram Sang wsa+rene...@sang-engineering.com --- drivers/i2c/busses/i2c-sh_mobile.c | 40

[PATCH 0/2] ARM: shmobile: r8a7740: move I2C errata handling into the driver

2015-06-09 Thread Wolfram Sang
This series moves the errata handling from the setup function into the driver. It has been tested that this changeset does not cause a regression on the armadillo board we had access to. Unfortunately, this board did not need the workaround at all, only some revisions of the r8a7740 are affected.

[PATCH 2/2] ARM: shmobile: r8a7740: remove I2C errata handling

2015-06-09 Thread Wolfram Sang
From: Wolfram Sang wsa+rene...@sang-engineering.com This is now done in the I2C driver. Signed-off-by: Wolfram Sang wsa+rene...@sang-engineering.com --- arch/arm/mach-shmobile/setup-r8a7740.c | 55 -- 1 file changed, 55 deletions(-) diff --git

Re: [PATCH 0/2] ARM: shmobile: r8a7740: move I2C errata handling into the driver

2015-06-09 Thread Laurent Pinchart
Hi Wolfram, Thank you for the patches. On Tuesday 09 June 2015 16:14:38 Wolfram Sang wrote: This series moves the errata handling from the setup function into the driver. It has been tested that this changeset does not cause a regression on the armadillo board we had access to. Unfortunately,

Re: [PATCH v5 4/6] i2c: at91: add support for new alternative command mode

2015-06-09 Thread Nicolas Ferre
Le 03/06/2015 18:25, Cyrille Pitchen a écrit : The alternative command mode was introduced to simplify the transmission of STOP conditions and to solve timing and latency issues around them. This mode relies on a new register, the Alternative Command Register, which must be set at the same

[PATCH v6 3/6] i2c: at91: update documentation for DT bindings

2015-06-09 Thread Cyrille Pitchen
add a new value atmel,sama5d2-i2c for the compatible property. add a new optional property atmel,fifo-size to enable FIFO support when available. add missing optional properties dmas and dma-names. Signed-off-by: Cyrille Pitchen cyrille.pitc...@atmel.com ---

Re: [PATCH v5 3/6] i2c: at91: update documentation for DT bindings

2015-06-09 Thread Nicolas Ferre
Le 03/06/2015 18:25, Cyrille Pitchen a écrit : add a new value atmel,at91sama5d2-i2c for the compatible property. Well, here I would like atmel,sama5d2-i2c like any other SAMA5 product compatibility string out there... Aka NAK for me ;-) add a new optional property atmel,fifo-size to enable

[PATCH v6 4/6] i2c: at91: add support for new alternative command mode

2015-06-09 Thread Cyrille Pitchen
The alternative command mode was introduced to simplify the transmission of STOP conditions and to solve timing and latency issues around them. This mode relies on a new register, the Alternative Command Register, which must be set at the same time as the Master Mode Register. This new register

[PATCH v6 5/6] i2c: at91: print hardware version

2015-06-09 Thread Cyrille Pitchen
The probe() function now prints the hardware version of the I2C controller. Signed-off-by: Cyrille Pitchen cyrille.pitc...@atmel.com --- drivers/i2c/busses/i2c-at91.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-at91.c

[PATCH v6 6/6] i2c: at91: add support to FIFOs

2015-06-09 Thread Cyrille Pitchen
When FIFOs are available and enabled, the driver now configures the Atmel eXtended DMA Controller to perform word accesses instead of byte accesses when possible. The actual access width depends on the size of the buffer to transmit. To enable FIFO support the atmel,fifo-size property must be set

[PATCH v6 1/6] i2c: at91: fix a race condition when using the DMA controller

2015-06-09 Thread Cyrille Pitchen
For TX transactions, the TXCOMP bit in the Status Register is cleared when the first data is written into the Transmit Holding Register. In the lines from at91_do_twi_transfer(): at91_twi_write_data_dma(dev); at91_twi_write(dev, AT91_TWI_IER, AT91_TWI_TXCOMP); the TXCOMP interrupt may be enabled

[PATCH v6 0/6] i2c: at91: add support to FIFOs and alternative command

2015-06-09 Thread Cyrille Pitchen
ChangeLog v6: - replace at91sama5d2 by sama5d2. v5: - print I2C controller version in an already existing dev_info() instead of adding a new one. v4: - replace 0x%x by %#x when printing I2C controller version - change the order of patches: the race condition bug fix becomes the first patch

[PATCH v6 2/6] i2c: at91: use BIT() macro to define register bits

2015-06-09 Thread Cyrille Pitchen
This patch just fixes typo before applying later patches which will use register bits with index above 16. Signed-off-by: Cyrille Pitchen cyrille.pitc...@atmel.com --- drivers/i2c/busses/i2c-at91.c | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git

Re: [V4, 1/2] i2c: brcmstb: Add Broadcom settop SoC i2c controller driver

2015-06-09 Thread Kamal Dasu
Wolfram, Don't print out, it will spoil the logs. Timeouts can happen on I2C busses, no need to inform the user. If ii is alright with you I will change the dev_err(...)messages to dev_dbg(...) so that they do not spoil the logs. + rc = of_property_read_string(dev-device-of_node,

Re: [PATCH] i2c: designware: use enable on resume instead initialization

2015-06-09 Thread Lucas De Marchi
Hi Mika, On Tue, Jun 9, 2015 at 5:51 AM, Mika Westerberg mika.westerb...@linux.intel.com wrote: On Mon, Jun 08, 2015 at 02:50:28PM -0300, lucas.de.mar...@gmail.com wrote: From: Fabio Mello fabio.me...@intel.com According to documentation and tests, initialization is not necessary on module

[V5, 2/2] dt-bindings: i2c: Add i2c-brcmstb dt bindings

2015-06-09 Thread Kamal Dasu
i2c Device tree binding documentation for brcmstb SoCs. Signed-off-by: Kamal Dasu kdasu.k...@gmail.com --- .../devicetree/bindings/i2c/i2c-brcmstb.txt| 28 ++ 1 file changed, 28 insertions(+) create mode 100644 Documentation/devicetree/bindings/i2c/i2c-brcmstb.txt

[V5, 1/2] i2c: brcmstb: Add Broadcom settop SoC i2c controller driver

2015-06-09 Thread Kamal Dasu
Adding support for i2c controller driver for Broadcom settop SoCs. Signed-off-by: Kamal Dasu kdasu.k...@gmail.com --- V5 Changes: Removed unnecessary dev_err logging Changed intr timeout dev_err(...) to dev_dbg(...) --- drivers/i2c/busses/Kconfig | 10 + drivers/i2c/busses/Makefile

Re: [PATCH v6 5/6] i2c: at91: print hardware version

2015-06-09 Thread Sergei Shtylyov
Hello. On 06/09/2015 07:22 PM, Cyrille Pitchen wrote: The probe() function now prints the hardware version of the I2C controller. Signed-off-by: Cyrille Pitchen cyrille.pitc...@atmel.com --- drivers/i2c/busses/i2c-at91.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

Re: [PATCH v5 4/6] i2c: at91: add support for new alternative command mode

2015-06-09 Thread Wolfram Sang
Nicolas, +static struct at91_twi_pdata at91sama5d2_config = { No, please name it: sama5d2_config Thanks for your input, but please don't quote the whole mail for those tiny comments. Only the relevant parts, please. Otherwise it is too easy to miss things. Thanks, Wolfram

Re: [V4, 1/2] i2c: brcmstb: Add Broadcom settop SoC i2c controller driver

2015-06-09 Thread Wolfram Sang
If ii is alright with you I will change the dev_err(...)messages to dev_dbg(...) so that they do not spoil the logs. OK. + rc = of_property_read_string(dev-device-of_node, interrupt-names, + int_name); I haven't checked but is that really needed?

Re: clock driver

2015-06-09 Thread York Sun
Michael, I have rewritten the driver to use CCF. It will be sent for review when ready. I have some questions, hoping you can shed some light on them. Q1: What does of_clk_add_provider do? I read the code and comment. It registers a clock provider for a node. How is it used after registration?

Re: [PATCH] i2c: Mark instantiated device nodes with OF_POPULATE

2015-06-09 Thread Wolfram Sang
Mark (and unmark) device nodes with the POPULATE flag as appropriate. This is required to avoid multi probing when using I2C and device overlays containing a mux. This patch is also more careful with the release of the adapter device which caused a deadlock with muxes, and does not