Skip to content

Commit

Permalink
[media] saa7164: Improvements for I2C handling"
Browse files Browse the repository at this point in the history
This reverts commit ad90b6b.

This patch breaks I2C communication towards Si2168. After reverting and
applying the other patch in this series the I2C communication is
correct.

Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  • Loading branch information
Olli Salonen authored and Mauro Carvalho Chehab committed Jun 10, 2015
1 parent d976872 commit 5dce1ee
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions drivers/media/pci/saa7164/saa7164-api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1385,8 +1385,7 @@ int saa7164_api_i2c_read(struct saa7164_i2c *bus, u8 addr, u32 reglen, u8 *reg,
* 08... register address
*/
memset(buf, 0, sizeof(buf));
if (reg)
memcpy((buf + 2 * sizeof(u32) + 0), reg, reglen);
memcpy((buf + 2 * sizeof(u32) + 0), reg, reglen);
*((u32 *)(buf + 0 * sizeof(u32))) = reglen;
*((u32 *)(buf + 1 * sizeof(u32))) = datalen;

Expand Down Expand Up @@ -1475,14 +1474,6 @@ int saa7164_api_i2c_write(struct saa7164_i2c *bus, u8 addr, u32 datalen,
* 04-07 dest bytes to write
* 08... register address
*/
if (datalen == 1) {
/* Workaround for issues with i2c components
* that issue writes with no data. IE: SI2168/2157
* Increase reglen by 1, strobe out an additional byte,
* ignored by SI2168/2157.
*/
datalen++;
}
*((u32 *)(buf + 0 * sizeof(u32))) = reglen;
*((u32 *)(buf + 1 * sizeof(u32))) = datalen - reglen;
memcpy((buf + 2 * sizeof(u32)), data, datalen);
Expand Down

0 comments on commit 5dce1ee

Please sign in to comment.