[PATCH 2/2] i2c: mediatek: fix i2c multi transfer issue in high speed mode

2015-10-27 Thread Liguo Zhang
For platform with auto restart support, when doing i2c multi transfer in high speed, for example, doing write-then-read transfer, the master code will occupy the first transfer, and the second transfer will be the read transfer, the write transfer will be discarded. So we should first send the

[PATCH 0/2] Mediatek I2C driver fixup

2015-10-27 Thread Liguo Zhang
This series contain two patches, first is to optimize Mediatek I2C driver to use WRRD if hardware support auto restart. Because auto restart will issue auto restart interrupt, change to use WRRD can reduce interrupt latency. The second is to fix multi transfer error in high speed mode. If

[PATCH 1/2] i2c: mediatek: add i2c first write then read optimization

2015-10-27 Thread Liguo Zhang
For platform with auto restart support, between every transfer, i2c controller will trigger an interrupt and SW need to handle it to start new transfer. When doing write-then-read transfer, instead of restart mechanism, using WRRD mode to have controller send both transfer in one request to reduce

[PATCH v2 9/9] eeprom: at24: readability tweaks

2015-10-27 Thread Bartosz Golaszewski
Move the macro definitions above the struct definitions and add some tabs for better readability. Signed-off-by: Bartosz Golaszewski --- drivers/misc/eeprom/at24.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git

[PATCH v2 3/9] eeprom: at24: tie up an additional address for at24cs series

2015-10-27 Thread Bartosz Golaszewski
The at24cs series EEPROM chips have an additional read-only memory area, that is visible on a different i2c slave address. Tie it up with a dummy device. Signed-off-by: Bartosz Golaszewski --- drivers/misc/eeprom/at24.c | 30 ++ 1 file

[PATCH v2 5/9] eeprom: at24: export the serial number through sysfs

2015-10-27 Thread Bartosz Golaszewski
The at24 driver is now capable of reading the serial number from at24cs EEPROM chips. Export the serial number through sysfs. Signed-off-by: Bartosz Golaszewski --- drivers/misc/eeprom/at24.c | 44 1 file changed, 40

[PATCH v2 0/9] eeprom: at24: at24cs series serial number read

2015-10-27 Thread Bartosz Golaszewski
Chips from the at24cs EEPROM series have an additional read-only memory area containing a factory pre-programmed serial number. In order to access it, a dummy write must be executed before reading the serial number bytes. This series adds support for reading the serial number through a sysfs

[PATCH v2 2/9] eeprom: at24: new flag in platform_data

2015-10-27 Thread Bartosz Golaszewski
In preparation for supporting the at24cs EEPROM series add a new flag to platform data. When set, it should tell the driver that the chip has an additional read-only memory area that holds a factory pre-programmed serial number. Signed-off-by: Bartosz Golaszewski ---

[PATCH v2 4/9] eeprom: at24: support reading of the serial number

2015-10-27 Thread Bartosz Golaszewski
The at24cs series EEPROM chips have an additional read-only memory area containing a factory pre-programmed serial number. In order to access it, one has to perform a dummy write before reading the serial number bytes. Add a function that allows to access the serial number. Signed-off-by:

[PATCH v2 7/9] eeprom: at24: add the at24cs series to the list of supported devices

2015-10-27 Thread Bartosz Golaszewski
The infrastructure for reading of the factory-programmed serial number for at24cs EEPROM series is now in place. Add the chips that are actually equipped with the serial number memory area to the list of supported devices. Signed-off-by: Bartosz Golaszewski ---

[PATCH v2 1/9] eeprom: at24: platform_data: use BIT() macro

2015-10-27 Thread Bartosz Golaszewski
Use BIT() macro to replace the 0xXX constants in platform_data flags definitions. Signed-off-by: Bartosz Golaszewski --- include/linux/platform_data/at24.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/platform_data/at24.h

[PATCH v2 6/9] eeprom: at24: improve the device_id table readability

2015-10-27 Thread Bartosz Golaszewski
Improve the readability of the device table by separating columns with tabs. Signed-off-by: Bartosz Golaszewski --- drivers/misc/eeprom/at24.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/misc/eeprom/at24.c

[PATCH v2 8/9] eeprom: at24: remove a reduntant if

2015-10-27 Thread Bartosz Golaszewski
It seems as if the second check for I2C_FUNC_I2C functionality had been introduced accidentally during a merge. Tt's reduntant, so remove it. Signed-off-by: Bartosz Golaszewski --- drivers/misc/eeprom/at24.c | 3 --- 1 file changed, 3 deletions(-) diff --git

[PATCH 1/4] i2c: added i2c quirk flag for unsupported clock stretching

2015-10-27 Thread Nicola Corna
Added I2C_AQ_NO_CLK_STRETCH, to be used when clock stretching is not supported. Signed-off-by: Nicola Corna --- include/linux/i2c.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 768063b..9697002 100644 ---

Re: [RESEND PATCH 1/3] i2c: added FUNC flag for unsupported clock stretching

2015-10-27 Thread Nicola Corna
October 20 2015 5:35 PM, "Wolfram Sang" wrote: > On Wed, Sep 16, 2015 at 03:32:01PM +0200, Nicola Corna wrote: > >> Added I2C_FUNC_NO_CLK_STRETCH, to be used when clock stretching is not >> supported. >> >> Signed-off-by: Nicola Corna > > I think this

[PATCH 3/4] i2c: added I2C_AQ_NO_CLK_STRETCH to i2c-bcm2835.c

2015-10-27 Thread Nicola Corna
As reported here http://www.advamation.com/knowhow/raspberrypi/rpi-i2c-bug.html the BCM2835 has a bug in its i2c implementation which prevents a correct clock stretching. Signed-off-by: Nicola Corna --- drivers/i2c/busses/i2c-bcm2835.c | 5 + 1 file changed, 5

[PATCH v3 4/4] iio: humidity: si7020: added No Hold read mode

2015-10-27 Thread Nicola Corna
The Si7013/20/21 modules support 2 read modes: * Hold mode (blocking), where the device stretches the clock until the end of the measurement * No Hold mode (non-blocking), where the device replies NACK for every I2C call during the measurement Here the No Hold mode is implemented, selectable

[PATCH 2/4] i2c: added I2C_AQ_NO_CLK_STRETCH to i2c-algo-bit.c

2015-10-27 Thread Nicola Corna
Added I2C_AQ_NO_CLK_STRETCH to drivers/i2c/algos/i2c-algo-bit.c when getscl is not available. Signed-off-by: Nicola Corna --- drivers/i2c/algos/i2c-algo-bit.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/i2c/algos/i2c-algo-bit.c

Re: [PATCH v3 4/4] iio: humidity: si7020: added No Hold read mode

2015-10-27 Thread Wolfram Sang
Not a complete review, I just stumbled over this one: > + if (client->adapter->quirks && > +client->adapter->quirks->flags | '|' should be '&', or? > +I2C_AQ_NO_CLK_STRETCH) > + return -ENODEV;