aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-i2c.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-i2c.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/media/video/ivtv/ivtv-i2c.c b/drivers/media/video/ivtv/ivtv-i2c.c
index b9c71e61f7d6..d4cc3365038e 100644
--- a/drivers/media/video/ivtv/ivtv-i2c.c
+++ b/drivers/media/video/ivtv/ivtv-i2c.c
@@ -564,13 +564,15 @@ static struct i2c_adapter ivtv_i2c_adap_template = {
564 .owner = THIS_MODULE, 564 .owner = THIS_MODULE,
565}; 565};
566 566
567#define IVTV_ALGO_BIT_TIMEOUT (2) /* seconds */
568
567static const struct i2c_algo_bit_data ivtv_i2c_algo_template = { 569static const struct i2c_algo_bit_data ivtv_i2c_algo_template = {
568 .setsda = ivtv_setsda_old, 570 .setsda = ivtv_setsda_old,
569 .setscl = ivtv_setscl_old, 571 .setscl = ivtv_setscl_old,
570 .getsda = ivtv_getsda_old, 572 .getsda = ivtv_getsda_old,
571 .getscl = ivtv_getscl_old, 573 .getscl = ivtv_getscl_old,
572 .udelay = 10, 574 .udelay = IVTV_DEFAULT_I2C_CLOCK_PERIOD / 2, /* microseconds */
573 .timeout = 200, 575 .timeout = IVTV_ALGO_BIT_TIMEOUT * HZ, /* jiffies */
574}; 576};
575 577
576static struct i2c_client ivtv_i2c_client_template = { 578static struct i2c_client ivtv_i2c_client_template = {
@@ -602,6 +604,7 @@ int init_ivtv_i2c(struct ivtv *itv)
602 memcpy(&itv->i2c_algo, &ivtv_i2c_algo_template, 604 memcpy(&itv->i2c_algo, &ivtv_i2c_algo_template,
603 sizeof(struct i2c_algo_bit_data)); 605 sizeof(struct i2c_algo_bit_data));
604 } 606 }
607 itv->i2c_algo.udelay = itv->options.i2c_clock_period / 2;
605 itv->i2c_algo.data = itv; 608 itv->i2c_algo.data = itv;
606 itv->i2c_adap.algo_data = &itv->i2c_algo; 609 itv->i2c_adap.algo_data = &itv->i2c_algo;
607 610