X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmedia%2Fvideo%2Fbttv-i2c.c;h=5eb88fcadfa3ca7330f58e799e65ff15a0eb0451;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=c07a0d9c0c08d7b744462c6a3a1d6edb7eb9d907;hpb=a2c21200f1c81b08cb55e417b68150bba439b646;p=linux-2.6.git diff --git a/drivers/media/video/bttv-i2c.c b/drivers/media/video/bttv-i2c.c index c07a0d9c0..5eb88fcad 100644 --- a/drivers/media/video/bttv-i2c.c +++ b/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, }; /* ----------------------------------------------------------------------- */ @@ -298,6 +300,7 @@ static struct i2c_adapter bttv_i2c_adap_hw_template = { .id = I2C_ALGO_BIT | I2C_HW_B_BT848 /* FIXME */, .algo = &bttv_algo, .client_register = attach_inform, + .client_unregister = detach_inform, }; /* ----------------------------------------------------------------------- */ @@ -324,6 +327,7 @@ static int attach_inform(struct i2c_client *client) if (btv->pinnacle_id != UNSET) bttv_call_i2c_clients(btv,AUDC_CONFIG_PINNACLE, &btv->pinnacle_id); + bttv_i2c_info(&btv->c, client, 1); if (bttv_debug) printk("bttv%d: i2c attach [client=%s]\n", @@ -331,6 +335,14 @@ 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); + + bttv_i2c_info(&btv->c, client, 0); + return 0; +} + void bttv_call_i2c_clients(struct bttv *btv, unsigned int cmd, void *arg) { if (0 != btv->i2c_rc)