aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/usb/em28xx/em28xx-cards.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab2018-03-01 12:54:06 -0500
committerMauro Carvalho Chehab2018-03-06 04:50:41 -0500
commitcf68c22f106369f6124342c58c4a50f07edd2174 (patch)
tree33c4836505f94a9c3f1e309e6b6471497505773a /drivers/media/usb/em28xx/em28xx-cards.c
parent0108ae7fd2972707cde3fafa6fec555c50c64e28 (diff)
media: em28xx: adjust I2C timeout according with I2C speed
If the I2C speed is too slow, it should wait more for an answer. While here, change disconnected type from char to unsigned int, just like all other bitmask fields there at em28xx struct. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx-cards.c')
-rw-r--r--drivers/media/usb/em28xx/em28xx-cards.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
index 5277f1cda253..fc4654f7eece 100644
--- a/drivers/media/usb/em28xx/em28xx-cards.c
+++ b/drivers/media/usb/em28xx/em28xx-cards.c
@@ -2704,6 +2704,8 @@ static inline void em28xx_set_xclk_i2c_speed(struct em28xx *dev)
i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
EM28XX_I2C_FREQ_100_KHZ;
+ dev->i2c_speed = i2c_speed & 0x03;
+
if (!dev->board.is_em2800)
em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, i2c_speed);
msleep(50);