diff options
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/video/bttv-gpio.c | 14 | ||||
-rw-r--r-- | linux/drivers/media/video/bttv-i2c.c | 15 | ||||
-rw-r--r-- | linux/drivers/media/video/bttv.h | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/bttvp.h | 1 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-video.c | 2 |
5 files changed, 33 insertions, 1 deletions
diff --git a/linux/drivers/media/video/bttv-gpio.c b/linux/drivers/media/video/bttv-gpio.c index 01ce7bc32..585f67dde 100644 --- a/linux/drivers/media/video/bttv-gpio.c +++ b/linux/drivers/media/video/bttv-gpio.c @@ -106,6 +106,20 @@ void bttv_gpio_irq(struct bttv_core *core) } } +void bttv_i2c_info(struct bttv_core *core, struct i2c_client *client, int attach) +{ + struct bttv_sub_driver *drv; + struct bttv_sub_device *dev; + struct list_head *item; + + list_for_each(item,&core->subs) { + dev = list_entry(item,struct bttv_sub_device,list); + drv = to_bttv_sub_drv(dev->dev.driver); + if (drv && drv->i2c_info) + drv->i2c_info(dev,client,attach); + } +} + /* ----------------------------------------------------------------------- */ /* external: sub-driver register/unregister */ diff --git a/linux/drivers/media/video/bttv-i2c.c b/linux/drivers/media/video/bttv-i2c.c index f6557d09a..c7f629ca4 100644 --- a/linux/drivers/media/video/bttv-i2c.c +++ b/linux/drivers/media/video/bttv-i2c.c @@ -40,6 +40,7 @@ static void bttv_inc_use(struct i2c_adapter *adap); static void bttv_dec_use(struct i2c_adapter *adap); #endif static int attach_inform(struct i2c_client *client); +static int detach_inform(struct i2c_client *client); static int i2c_debug = 0; static int i2c_hw = 0; @@ -114,6 +115,7 @@ static struct i2c_adapter bttv_i2c_adap_sw_template = { I2C_DEVNAME("bt848"), .id = I2C_HW_B_BT848, .client_register = attach_inform, + .client_unregister = detach_inform, }; /* ----------------------------------------------------------------------- */ @@ -324,6 +326,9 @@ static int attach_inform(struct i2c_client *client) if (btv->pinnacle_id != UNSET) bttv_call_i2c_clients(btv,AUDC_CONFIG_PINNACLE, &btv->pinnacle_id); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + bttv_i2c_info(&btv->c, client, 1); +#endif if (bttv_debug) printk("bttv%d: i2c attach [client=%s]\n", @@ -331,6 +336,16 @@ static int attach_inform(struct i2c_client *client) return 0; } +static int detach_inform(struct i2c_client *client) +{ + struct bttv *btv = i2c_get_adapdata(client->adapter); + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + bttv_i2c_info(&btv->c, client, 0); +#endif + return 0; +} + void bttv_call_i2c_clients(struct bttv *btv, unsigned int cmd, void *arg) { if (0 != btv->i2c_rc) diff --git a/linux/drivers/media/video/bttv.h b/linux/drivers/media/video/bttv.h index 9ecd89207..9a3af3ec6 100644 --- a/linux/drivers/media/video/bttv.h +++ b/linux/drivers/media/video/bttv.h @@ -306,6 +306,8 @@ struct bttv_sub_driver { struct device_driver drv; char wanted[BUS_ID_SIZE]; void (*gpio_irq)(struct bttv_sub_device *sub); + void (*i2c_info)(struct bttv_sub_device *sub, + struct i2c_client *client, int attach); }; #define to_bttv_sub_drv(x) container_of((x), struct bttv_sub_driver, drv) diff --git a/linux/drivers/media/video/bttvp.h b/linux/drivers/media/video/bttvp.h index 66edc7fd8..58a40841d 100644 --- a/linux/drivers/media/video/bttvp.h +++ b/linux/drivers/media/video/bttvp.h @@ -242,6 +242,7 @@ extern struct bus_type bttv_sub_bus_type; int bttv_sub_add_device(struct bttv_core *core, char *name); int bttv_sub_del_devices(struct bttv_core *core); void bttv_gpio_irq(struct bttv_core *core); +void bttv_i2c_info(struct bttv_core *core, struct i2c_client *client, int attach); #endif diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c index 49e7256ca..c96f97fbd 100644 --- a/linux/drivers/media/video/cx88/cx88-video.c +++ b/linux/drivers/media/video/cx88/cx88-video.c @@ -684,7 +684,7 @@ static int set_scale(struct cx8800_dev *dev, unsigned int width, unsigned int he value |= (1 << 0); // 3-tap interpolation if (width < 193) value |= (1 << 1); // 5-tap interpolation - if (dev->tvnorm.id & V4L2_STD_SECAM) + if (dev->tvnorm->id & V4L2_STD_SECAM) value |= (1 << 16); cx_write(MO_FILTER_EVEN, value); |