]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/media/video/cx88/cx88-i2c.c
V4L/DVB (11300): cx88: convert to v4l2_subdev.
[karo-tx-linux.git] / drivers / media / video / cx88 / cx88-i2c.c
index 1ab691d2069268dc6d2db42ac0b304eef1f69288..996b4ed5a4fc8ae414cd18abc1a6d1cdb44ef092 100644 (file)
@@ -97,51 +97,6 @@ static int cx8800_bit_getsda(void *data)
 
 /* ----------------------------------------------------------------------- */
 
-static int attach_inform(struct i2c_client *client)
-{
-       struct cx88_core *core = i2c_get_adapdata(client->adapter);
-
-       dprintk(1, "%s i2c attach [addr=0x%x,client=%s]\n",
-               client->driver->driver.name, client->addr, client->name);
-       return 0;
-}
-
-static int detach_inform(struct i2c_client *client)
-{
-       struct cx88_core *core = i2c_get_adapdata(client->adapter);
-
-       dprintk(1, "i2c detach [client=%s]\n", client->name);
-       return 0;
-}
-
-void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg)
-{
-#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE)
-       struct videobuf_dvb_frontends *f = &core->dvbdev->frontends;
-       struct videobuf_dvb_frontend *fe = NULL;
-#endif
-       if (0 != core->i2c_rc)
-               return;
-
-#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE)
-       if (core->dvbdev && f) {
-               if(f->gate <= 1) /* undefined or fe0 */
-                       fe = videobuf_dvb_get_frontend(f, 1);
-               else
-                       fe = videobuf_dvb_get_frontend(f, f->gate);
-
-               if (fe && fe->dvb.frontend && fe->dvb.frontend->ops.i2c_gate_ctrl)
-                       fe->dvb.frontend->ops.i2c_gate_ctrl(fe->dvb.frontend, 1);
-
-               i2c_clients_command(&core->i2c_adap, cmd, arg);
-
-               if (fe && fe->dvb.frontend && fe->dvb.frontend->ops.i2c_gate_ctrl)
-                       fe->dvb.frontend->ops.i2c_gate_ctrl(fe->dvb.frontend, 0);
-       } else
-#endif
-               i2c_clients_command(&core->i2c_adap, cmd, arg);
-}
-
 static const struct i2c_algo_bit_data cx8800_i2c_algo_template = {
        .setsda  = cx8800_bit_setsda,
        .setscl  = cx8800_bit_setscl,
@@ -187,20 +142,14 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci)
        memcpy(&core->i2c_algo, &cx8800_i2c_algo_template,
               sizeof(core->i2c_algo));
 
-       if (core->board.tuner_type != TUNER_ABSENT)
-               core->i2c_adap.class |= I2C_CLASS_TV_ANALOG;
-       if (core->board.mpeg & CX88_MPEG_DVB)
-               core->i2c_adap.class |= I2C_CLASS_TV_DIGITAL;
 
        core->i2c_adap.dev.parent = &pci->dev;
        strlcpy(core->i2c_adap.name,core->name,sizeof(core->i2c_adap.name));
        core->i2c_adap.owner = THIS_MODULE;
        core->i2c_adap.id = I2C_HW_B_CX2388x;
-       core->i2c_adap.client_register = attach_inform;
-       core->i2c_adap.client_unregister = detach_inform;
        core->i2c_algo.udelay = i2c_udelay;
        core->i2c_algo.data = core;
-       i2c_set_adapdata(&core->i2c_adap,core);
+       i2c_set_adapdata(&core->i2c_adap, &core->v4l2_dev);
        core->i2c_adap.algo_data = &core->i2c_algo;
        core->i2c_client.adapter = &core->i2c_adap;
        strlcpy(core->i2c_client.name, "cx88xx internal", I2C_NAME_SIZE);
@@ -236,8 +185,6 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci)
 
 /* ----------------------------------------------------------------------- */
 
-EXPORT_SYMBOL(cx88_call_i2c_clients);
-
 /*
  * Local variables:
  * c-basic-offset: 8