]> err.no Git - linux-2.6/blobdiff - drivers/media/video/cx88/cx88-i2c.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
[linux-2.6] / drivers / media / video / cx88 / cx88-i2c.c
index 78bbcfab96700ba9019c20a383db1f5ab5dc5984..566b26af523e74b132113ed968af94782dddc472 100644 (file)
@@ -28,7 +28,6 @@
 */
 
 #include <linux/module.h>
-#include <linux/moduleparam.h>
 #include <linux/init.h>
 
 #include <asm/io.h>
@@ -108,28 +107,34 @@ static int attach_inform(struct i2c_client *client)
        if (!client->driver->command)
                return 0;
 
-       if (core->radio_type != UNSET) {
-               if ((core->radio_addr==ADDR_UNSET)||(core->radio_addr==client->addr)) {
-                       tun_setup.mode_mask = T_RADIO;
-                       tun_setup.type = core->radio_type;
-                       tun_setup.addr = core->radio_addr;
-
+       if (core->board.radio_type != UNSET) {
+               if ((core->board.radio_addr==ADDR_UNSET)||(core->board.radio_addr==client->addr)) {
+                       tun_setup.mode_mask      = T_RADIO;
+                       tun_setup.type           = core->board.radio_type;
+                       tun_setup.addr           = core->board.radio_addr;
+                       tun_setup.tuner_callback = cx88_tuner_callback;
                        client->driver->command (client, TUNER_SET_TYPE_ADDR, &tun_setup);
                }
        }
-       if (core->tuner_type != UNSET) {
-               if ((core->tuner_addr==ADDR_UNSET)||(core->tuner_addr==client->addr)) {
-
-                       tun_setup.mode_mask = T_ANALOG_TV;
-                       tun_setup.type = core->tuner_type;
-                       tun_setup.addr = core->tuner_addr;
+       if (core->board.tuner_type != UNSET) {
+               if ((core->board.tuner_addr==ADDR_UNSET)||(core->board.tuner_addr==client->addr)) {
 
+                       tun_setup.mode_mask      = T_ANALOG_TV;
+                       tun_setup.type           = core->board.tuner_type;
+                       tun_setup.addr           = core->board.tuner_addr;
+                       tun_setup.tuner_callback = cx88_tuner_callback;
                        client->driver->command (client,TUNER_SET_TYPE_ADDR, &tun_setup);
                }
        }
 
-       if (core->tda9887_conf)
-               client->driver->command(client, TDA9887_SET_CONFIG, &core->tda9887_conf);
+       if (core->board.tda9887_conf) {
+               struct v4l2_priv_tun_config tda9887_cfg;
+
+               tda9887_cfg.tuner = TUNER_TDA9887;
+               tda9887_cfg.priv  = &core->board.tda9887_conf;
+
+               client->driver->command(client, TUNER_SET_CONFIG, &tda9887_cfg);
+       }
        return 0;
 }
 
@@ -146,7 +151,7 @@ void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg)
        if (0 != core->i2c_rc)
                return;
 
-#if defined(CONFIG_VIDEO_BUF_DVB) || defined(CONFIG_VIDEO_BUF_DVB_MODULE)
+#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE)
        if ( (core->dvbdev) && (core->dvbdev->dvb.frontend) ) {
                if (core->dvbdev->dvb.frontend->ops.i2c_gate_ctrl)
                        core->dvbdev->dvb.frontend->ops.i2c_gate_ctrl(core->dvbdev->dvb.frontend, 1);
@@ -177,6 +182,7 @@ static char *i2c_devs[128] = {
        [ 0xa0 >> 1 ] = "eeprom",
        [ 0xc0 >> 1 ] = "tuner (analog)",
        [ 0xc2 >> 1 ] = "tuner (analog/dvb)",
+       [ 0xc8 >> 1 ] = "xc5000",
 };
 
 static void do_i2c_scan(char *name, struct i2c_client *c)
@@ -204,9 +210,9 @@ 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->tuner_type != TUNER_ABSENT)
+       if (core->board.tuner_type != TUNER_ABSENT)
                core->i2c_adap.class |= I2C_CLASS_TV_ANALOG;
-       if (cx88_boards[core->board].mpeg & CX88_MPEG_DVB)
+       if (core->board.mpeg & CX88_MPEG_DVB)
                core->i2c_adap.class |= I2C_CLASS_TV_DIGITAL;
 
        core->i2c_adap.dev.parent = &pci->dev;