[PATCH-v4 06/11] i2c:pxa: Use devm_ variants in probe function

2015-07-14 Thread Vaibhav Hiremath
This patch cleans up i2c_pxa_probe() function, - Use devm_ variants wherever This will clean both probe exit and i2c_pxa_remove() functions - Check platform resource before parsing any other data from DT/platform - Use dev_err on failure from i2c_add_numbered_adapter() - Use pr_info

[PATCH-v4 05/11] i2c: pxa: Update debug function to dump more info on error

2015-07-14 Thread Vaibhav Hiremath
Update i2c_pxa_scream_blue_murder() fn to print more information in case of error. Also, use dev_err variants instead of printk. Signed-off-by: Jett.Zhou jtz...@marvell.com Signed-off-by: Vaibhav Hiremath vaibhav.hirem...@linaro.org Cc: Wolfram Sang w...@the-dreams.de ---

[PATCH-v4 02/11] i2c: pxa: No need to set slave addr for i2c master mode reset

2015-07-14 Thread Vaibhav Hiremath
Normally i2c controller works as master, so slave addr is not needed, or it will impact some slave device (eg. ST NFC chip) i2c accesses, because it has the same i2c address with controller. For example, On the pxa1928 based platform, where PMIC (88pm860) is present @0x30 address on TWSI0

[PATCH-v4 01/11] i2c: pxa: keep i2c irq ON in suspend

2015-07-14 Thread Vaibhav Hiremath
From: Leilei Shang shan...@marvell.com During suspend there may still be some i2c access happening, as the interrupt is shared between multiple drivers. And if we don't keep i2c irq ON, there may be i2c access timeout if i2c is in irq mode of operation. Signed-off-by: Raul Xiong

[PATCH-v4 03/11] i2c: pxa: Return I2C_RETRY when timeout in pio mode

2015-07-14 Thread Vaibhav Hiremath
From: Shouming Wang wang...@marvell.com In case of timeout in pio mode of operation return I2C_RETRY. This behavior will be same as interrupt mode of operation. Signed-off-by: Shouming Wang wang...@marvell.com [vaibhav.hirem...@linaro.org: Updated changelog] Signed-off-by: Vaibhav Hiremath

[PATCH-v4 04/11] i2c: pxa: Fix compile warning in 64bit mode

2015-07-14 Thread Vaibhav Hiremath
From: Yipeng Yao yp...@marvell.com Fix below warning message, coming from 64 bit toolchain. drivers/i2c/busses/i2c-pxa.c:1237:15: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] Signed-off-by: Yipeng Yao yp...@marvell.com [vaibhav.hirem...@linaro.org: Updated

[PATCH-v4 07/11] i2c: pxa: enable/disable i2c module across msg xfer

2015-07-14 Thread Vaibhav Hiremath
From: Yi Zhang yizh...@marvell.com Enable i2c module/unit before transmission and disable when it finishes. why? It's because the i2c bus may be disturbed if the slave device, typically a touch, powers on. As we do not want to break slave mode support, this patch introduces DT property to

[PATCH-v4 09/11] i2c: pxa: Add support for pxa910/988 new configuration features

2015-07-14 Thread Vaibhav Hiremath
TWSI_ILCR TWSI_IWCR registers are used to adjust clock rate of standard fast mode in pxa910/988; so this patch adds these two new entries to struct pxa_reg_layout and struct pxa_i2c. As discussed in the previous patch-series, the idea here is to add standard DT properties for ilcr and iwcr

[PATCH-v4 10/11] i2c: pxa: Add ILCR (tLow tHigh) configuration support

2015-07-14 Thread Vaibhav Hiremath
With addition of PXA910 family of devices, the TWSI module supports SCL clock adjustment using ILCR register. This patch enables the control and configuration of ICLR through DT properties, i2c-sclk-high-time-ns: SCLK high time (tHigh), for standard/fast/high speed mode i2c-sclk-low-time-ns:

[PATCH-v4 08/11] Documentation: binding: add new property 'disable_after_xfer' to i2c-pxa

2015-07-14 Thread Vaibhav Hiremath
Driver now supports enable/disable across msg xfer, which user can control it by new DT property - i2c-disable-after-xfer : If set, driver will disable I2C module after msg xfer and enable it back before xfer. Signed-off-by: Vaibhav Hiremath vaibhav.hirem...@linaro.org ---

[PATCH-v4 11/11] Documentation: binding: add sclk adjustment properties to i2c-pxa

2015-07-14 Thread Vaibhav Hiremath
With addition of PXA910 family of devices, the TWSI module supports new feature which allows us to adjust SCLK. i2c-pxa driver takes input configuration in nsec and converts it to respective bit-fields, - i2c-sclk-low-time-ns : SCLK low time (tlow) This property is used along with mode

[PATCH-v4 00/11] i2c: pxa: Fixes, cleanup and support for pxa910 family

2015-07-14 Thread Vaibhav Hiremath
This patch series fixes bugs/warnings, cleans up the code and adds support for PXA910 family of devices to PXA I2C bus driver. There has been one attempt made sometime back in 2012 to upstream some of the patches from below list, but did not get follow up later. I have consolidated all the

Re: [Patch v1] i2c: imx: implement bus recovery

2015-07-14 Thread Uwe Kleine-König
Hello Gao, On Tue, Jul 14, 2015 at 10:04:46AM +0800, Gao Pan wrote: Implement bus recovery methods for i2c-imx so we can recover from situations where SCL/SDA are stuck low. Once i2c bus SCL/SDA are stuck low during transfer, config the i2c pinctrl to gpio mode by calling pinctrl sleep set

Re: [PATCH v3] HID: cp2112: support large i2c transfers in hid-cp2112

2015-07-14 Thread Antonio Borneo
On Thu, Jul 9, 2015 at 8:17 PM, Jiri Kosina jkos...@suse.com wrote: On Wed, 8 Jul 2015, Ellen Wang wrote: cp2112_i2c_xfer() only reads up to 61 bytes, returning EIO on longers reads. The fix is to wrap a loop around cp2112_read() to pick up all the returned data. Signed-off-by: Ellen Wang

Re: [PATCH v2] HID: cp2112: support i2c write-read transfers in hid-cp2112

2015-07-14 Thread Antonio Borneo
On Fri, Jul 10, 2015 at 5:21 PM, Jiri Kosina jkos...@suse.com wrote: On Thu, 9 Jul 2015, Ellen Wang wrote: cp2112_i2c_xfer() only supports a single i2c_msg. More than one message at a time just returns EIO. This breaks certain important cases. For example, the at24 eeprom driver generates

Re: [PATCH 1/3] i2c: omap: switch to dev_get_drvdata()

2015-07-14 Thread Wolfram Sang
On Mon, Jul 13, 2015 at 03:38:02PM -0500, Felipe Balbi wrote: there's no need to fetch the platform_device in order to dereference it back to the dev pointer to access drvdata, we can use dev_get_drvdata() instead. Signed-off-by: Felipe Balbi ba...@ti.com All patches applied to for-next,

RE: [Patch v1] i2c: imx: implement bus recovery

2015-07-14 Thread Gao Pandy
From: Uwe Kleine-König mailto:u.kleine-koe...@pengutronix.de Sent: Tuesday, July 14, 2015 2:49 PM To: Gao Pan-B54642 Cc: w...@the-dreams.de; linux-i2c@vger.kernel.org; Li Frank-B20596; Duan Fugang-B38611 Subject: Re: [Patch v1] i2c: imx: implement bus recovery Hello Gao, On Tue, Jul 14,

Re: [PATCH v2] HID: cp2112: fix I2C_SMBUS_BYTE write

2015-07-14 Thread Antonio Borneo
On Tue, Jul 14, 2015 at 6:23 AM, Ellen Wang el...@cumulusnetworks.com wrote: When doing an I2C_SMBUS_BYTE write (one byte write, no address), the data to be written is in command not data-byte. Signed-off-by: Ellen Wang el...@cumulusnetworks.com --- Forgot signed-off-by tag last time,

Re: [PATCH] i2c: omap: fix bus recovery setup

2015-07-14 Thread Wolfram Sang
On Wed, Jul 08, 2015 at 04:35:27PM +0200, Jan Luebbe wrote: At least on the AM335x, enabling OMAP_I2C_SYSTEST_ST_EN is not enough to Felipe: it seems you did not need this; is this AM335x specific? allow direct access to the SCL and SDA pins. In addition to ST_EN, we need to set the TMODE to

Re: [PATCH v2] HID: cp2112: fix I2C_SMBUS_BYTE write

2015-07-14 Thread Wolfram Sang
On Mon, Jul 13, 2015 at 03:23:54PM -0700, Ellen Wang wrote: When doing an I2C_SMBUS_BYTE write (one byte write, no address), the data to be written is in command not data-byte. Signed-off-by: Ellen Wang el...@cumulusnetworks.com Acked-by: Wolfram Sang w...@the-dreams.de Wow, that driver

Re: [PATCH v2 0/5] enable I2C on Renesas EMEV2 and KZM9D board

2015-07-14 Thread Wolfram Sang
On Sat, Jul 11, 2015 at 09:46:21AM +0200, Wolfram Sang wrote: So, I picked up the old series from Ian and reworked it significantly. While his series was already an improvement from the driver found in the BSP, it was still not ready for upstream. It should be now :) My idea was to start simple

Re: [PATCH-v4 06/11] i2c:pxa: Use devm_ variants in probe function

2015-07-14 Thread Wolfram Sang
+ i2c-reg_base = devm_ioremap_resource(dev-dev, res); + if (IS_ERR(i2c-reg_base)) { + dev_err(dev-dev, failed to map resource: %ld\n, + PTR_ERR(i2c-reg_base)); + return PTR_ERR(i2c-reg_base); + } One change I did when applying: removed

Re: [PATCH-v4 00/11] i2c: pxa: Fixes, cleanup and support for pxa910 family

2015-07-14 Thread Vaibhav Hiremath
On Tuesday 14 July 2015 05:04 PM, Wolfram Sang wrote: On Tue, Jul 14, 2015 at 01:06:39PM +0530, Vaibhav Hiremath wrote: This patch series fixes bugs/warnings, cleans up the code and adds support for PXA910 family of devices to PXA I2C bus driver. There has been one attempt made sometime back

Re: [PATCH-v4 06/11] i2c:pxa: Use devm_ variants in probe function

2015-07-14 Thread Wolfram Sang
So this additional error message would print one of, -EINVAL, -EBUSY or -ENOMEM. The driver core can report this; dunno from head if it is verbose output or not. signature.asc Description: Digital signature

[PATCH] i2c: omap: fix cleanup regression

2015-07-14 Thread Wolfram Sang
Patch i2c: omap: abolish variable name confusion triggered a coccinelle warning which we fix here: drivers/i2c/busses/i2c-omap.c:1333:5-24: pm_runtime_get_sync returns 0 as error. Unecessary IS_ERR_VALUE at line 1334 Signed-off-by: Wolfram Sang w...@the-dreams.de ---

Re: [PATCH] i2c: omap: fix bus recovery setup

2015-07-14 Thread Grygorii Strashko
Hi Wolfram, On 07/14/2015 02:10 PM, Wolfram Sang wrote: On Wed, Jul 08, 2015 at 04:35:27PM +0200, Jan Luebbe wrote: At least on the AM335x, enabling OMAP_I2C_SYSTEST_ST_EN is not enough to Felipe: it seems you did not need this; is this AM335x specific? We need it (Felipe's reply can be

Re: [PATCH-v4 06/11] i2c:pxa: Use devm_ variants in probe function

2015-07-14 Thread Vaibhav Hiremath
On Tuesday 14 July 2015 05:05 PM, Wolfram Sang wrote: + i2c-reg_base = devm_ioremap_resource(dev-dev, res); + if (IS_ERR(i2c-reg_base)) { + dev_err(dev-dev, failed to map resource: %ld\n, + PTR_ERR(i2c-reg_base)); + return

Re: [PATCH] i2c: omap: fix bus recovery setup

2015-07-14 Thread Wolfram Sang
On Tue, Jul 14, 2015 at 03:10:01PM +0300, Grygorii Strashko wrote: Hi Wolfram, On 07/14/2015 02:10 PM, Wolfram Sang wrote: On Wed, Jul 08, 2015 at 04:35:27PM +0200, Jan Luebbe wrote: At least on the AM335x, enabling OMAP_I2C_SYSTEST_ST_EN is not enough to Felipe: it seems you did not

Re: [PATCH-v4 00/11] i2c: pxa: Fixes, cleanup and support for pxa910 family

2015-07-14 Thread Wolfram Sang
On Tue, Jul 14, 2015 at 01:06:39PM +0530, Vaibhav Hiremath wrote: This patch series fixes bugs/warnings, cleans up the code and adds support for PXA910 family of devices to PXA I2C bus driver. There has been one attempt made sometime back in 2012 to upstream some of the patches from below

Re: [PATCH v2] HID: cp2112: fix I2C_SMBUS_BYTE write

2015-07-14 Thread Jiri Kosina
On Mon, 13 Jul 2015, Ellen Wang wrote: When doing an I2C_SMBUS_BYTE write (one byte write, no address), the data to be written is in command not data-byte. Signed-off-by: Ellen Wang el...@cumulusnetworks.com --- Forgot signed-off-by tag last time, sorry. Applied to for-4.3/cp2112. On

Re: [PATCH v2] HID: cp2112: fix I2C_SMBUS_BYTE write

2015-07-14 Thread Wolfram Sang
This is a MFD; should be split in GPIO and I2C, then each part moved in its respective tree. Yes, this is the conclusion we drew last time, too. It might seem overkill for such simple devices, still this case shows how much drivers can suffer if missing the expertise of the apropriate

Re: [PATCH v2] HID: cp2112: fix I2C_SMBUS_BYTE write

2015-07-14 Thread Antonio Borneo
On Tue, Jul 14, 2015 at 8:54 PM, Jiri Kosina jkos...@suse.com wrote: On Mon, 13 Jul 2015, Ellen Wang wrote: When doing an I2C_SMBUS_BYTE write (one byte write, no address), the data to be written is in command not data-byte. Signed-off-by: Ellen Wang el...@cumulusnetworks.com --- Forgot

Re: [PATCH v1] HID: cp2112: fix byte order in SMBUS operations

2015-07-14 Thread Jiri Kosina
On Thu, 9 Jul 2015, Ellen Wang wrote: Change all occurrences of be16 to le16 in cp2112_xfer(), because SMBUS words are little endian, not big endian. Signed-off-by: Ellen Wang el...@cumulusnetworks.com I've tagged this for stable and applied to for-4.3/cp2112. -- Jiri Kosina SUSE Labs --

Re: [PATCH v2] HID: cp2112: fix I2C_SMBUS_BYTE write

2015-07-14 Thread Ellen Wang
On 07/14/2015 05:54 AM, Jiri Kosina wrote: On Mon, 13 Jul 2015, Ellen Wang wrote: When doing an I2C_SMBUS_BYTE write (one byte write, no address), the data to be written is in command not data-byte. Signed-off-by: Ellen Wang el...@cumulusnetworks.com --- Forgot signed-off-by tag last time,

Re: [PATCH v2] HID: cp2112: fix I2C_SMBUS_BYTE write

2015-07-14 Thread Ellen Wang
On 07/14/2015 08:49 AM, Wolfram Sang wrote: This is a MFD; should be split in GPIO and I2C, then each part moved in its respective tree. Yes, this is the conclusion we drew last time, too. It might seem overkill for such simple devices, still this case shows how much drivers can suffer if

Re: [PATCH v2 0/5] enable I2C on Renesas EMEV2 and KZM9D board

2015-07-14 Thread Simon Horman
On Tue, Jul 14, 2015 at 01:18:58PM +0200, Wolfram Sang wrote: On Sat, Jul 11, 2015 at 09:46:21AM +0200, Wolfram Sang wrote: So, I picked up the old series from Ian and reworked it significantly. While his series was already an improvement from the driver found in the BSP, it was still