V4L/DVB (9417): DVB_ATTACH for STB0899, STB6100, TDA8261
[safe/jmp/linux-2.6] / drivers / media / dvb / ttpci / budget-ci.c
index e1bbab3..6b77b12 100644 (file)
@@ -1683,7 +1683,8 @@ static struct stb0899_config tt3200_config = {
 };
 
 struct stb6100_config tt3200_stb6100_config = {
-       .tuner_address = 0x60
+       .tuner_address  = 0x60,
+       .refclock       = 27000000,
 };
 
 static void frontend_init(struct budget_ci *budget_ci)
@@ -1767,20 +1768,17 @@ static void frontend_init(struct budget_ci *budget_ci)
                break;
 
        case 0x1019:            // TT S2-3200 PCI
-               budget_ci->budget.dvb_frontend = stb0899_attach(&tt3200_config, &budget_ci->budget.i2c_adap);
+               budget_ci->budget.dvb_frontend = dvb_attach(stb0899_attach, &tt3200_config, &budget_ci->budget.i2c_adap);
                if (budget_ci->budget.dvb_frontend) {
-                       if (stb6100_attach(budget_ci->budget.dvb_frontend, &tt3200_stb6100_config, &budget_ci->budget.i2c_adap)) {
-                               if (!lnbp21_attach(budget_ci->budget.dvb_frontend, &budget_ci->budget.i2c_adap, 0, 0)) {
+                       if (dvb_attach(stb6100_attach, budget_ci->budget.dvb_frontend, &tt3200_stb6100_config, &budget_ci->budget.i2c_adap)) {
+                               if (!dvb_attach(lnbp21_attach, budget_ci->budget.dvb_frontend, &budget_ci->budget.i2c_adap, 0, 0)) {
                                        printk("%s: No LNBP21 found!\n", __FUNCTION__);
-                                       if (budget_ci->budget.dvb_frontend->ops.tuner_ops.release)
-                                               budget_ci->budget.dvb_frontend->ops.tuner_ops.release(budget_ci->budget.dvb_frontend);
-                                       if (budget_ci->budget.dvb_frontend->ops.release)
-                                               budget_ci->budget.dvb_frontend->ops.release(budget_ci->budget.dvb_frontend);
+                                       dvb_frontend_detach(budget_ci->budget.dvb_frontend);
                                        budget_ci->budget.dvb_frontend = NULL;
                                }
                        } else {
-                               if (budget_ci->budget.dvb_frontend->ops.release)
-                                       budget_ci->budget.dvb_frontend->ops.release(budget_ci->budget.dvb_frontend);
+                                       dvb_frontend_detach(budget_ci->budget.dvb_frontend);
+                                       budget_ci->budget.dvb_frontend = NULL;
                        }
                }
                break;