aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/ttpci
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2006-08-08 08:10:08 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-09-26 10:53:25 -0400
commit2bfe031df6bd5e3b8e503eba8e3b6461d7c2c27e (patch)
tree2d7288c2221fb6f7ef98ef7a1ee3fef3f04cf87e /drivers/media/dvb/ttpci
parentd995506062c974133ba66d0822e58a923d4d74d9 (diff)
V4L/DVB (4386): Convert DVB devices to use dvb_attach()
Only devices using > 1 frontend were ported; ones which did not are left using static binding. Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net> Acked-by: Michael Krufky <mkrufky@linuxtv.org> Acked-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/ttpci')
-rw-r--r--drivers/media/dvb/ttpci/av7110.c39
-rw-r--r--drivers/media/dvb/ttpci/budget-av.c37
-rw-r--r--drivers/media/dvb/ttpci/budget-ci.c25
-rw-r--r--drivers/media/dvb/ttpci/budget-patch.c19
-rw-r--r--drivers/media/dvb/ttpci/budget.c26
5 files changed, 86 insertions, 60 deletions
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index fa0bed6779b5..d195cf591081 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -1383,8 +1383,12 @@ static void dvb_unregister(struct av7110 *av7110)
1383 dvb_dmxdev_release(&av7110->dmxdev); 1383 dvb_dmxdev_release(&av7110->dmxdev);
1384 dvb_dmx_release(&av7110->demux); 1384 dvb_dmx_release(&av7110->demux);
1385 1385
1386 if (av7110->fe != NULL) 1386 if (av7110->fe != NULL) {
1387 dvb_unregister_frontend(av7110->fe); 1387 dvb_unregister_frontend(av7110->fe);
1388 dvb_detach(av7110->fe->ops.release_sec, av7110->fe);
1389 dvb_detach(av7110->fe->ops.tuner_ops.release, av7110->fe);
1390 dvb_detach(av7110->fe->ops.release, av7110->fe);
1391 }
1388 dvb_unregister_device(av7110->osd_dev); 1392 dvb_unregister_device(av7110->osd_dev);
1389 av7110_av_unregister(av7110); 1393 av7110_av_unregister(av7110);
1390 av7110_ca_unregister(av7110); 1394 av7110_ca_unregister(av7110);
@@ -2077,7 +2081,7 @@ static int frontend_init(struct av7110 *av7110)
2077 if (av7110->dev->pci->subsystem_vendor == 0x110a) { 2081 if (av7110->dev->pci->subsystem_vendor == 0x110a) {
2078 switch(av7110->dev->pci->subsystem_device) { 2082 switch(av7110->dev->pci->subsystem_device) {
2079 case 0x0000: // Fujitsu/Siemens DVB-Cable (ves1820/Philips CD1516(??)) 2083 case 0x0000: // Fujitsu/Siemens DVB-Cable (ves1820/Philips CD1516(??))
2080 av7110->fe = ves1820_attach(&philips_cd1516_config, 2084 av7110->fe = dvb_attach(ves1820_attach, &philips_cd1516_config,
2081 &av7110->i2c_adap, read_pwm(av7110)); 2085 &av7110->i2c_adap, read_pwm(av7110));
2082 if (av7110->fe) { 2086 if (av7110->fe) {
2083 av7110->fe->ops.tuner_ops.set_params = philips_cd1516_tuner_set_params; 2087 av7110->fe->ops.tuner_ops.set_params = philips_cd1516_tuner_set_params;
@@ -2092,7 +2096,7 @@ static int frontend_init(struct av7110 *av7110)
2092 case 0x1002: // Hauppauge/TT WinTV DVB-S rev1.3SE 2096 case 0x1002: // Hauppauge/TT WinTV DVB-S rev1.3SE
2093 2097
2094 // try the ALPS BSRV2 first of all 2098 // try the ALPS BSRV2 first of all
2095 av7110->fe = ves1x93_attach(&alps_bsrv2_config, &av7110->i2c_adap); 2099 av7110->fe = dvb_attach(ves1x93_attach, &alps_bsrv2_config, &av7110->i2c_adap);
2096 if (av7110->fe) { 2100 if (av7110->fe) {
2097 av7110->fe->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params; 2101 av7110->fe->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params;
2098 av7110->fe->ops.diseqc_send_master_cmd = av7110_diseqc_send_master_cmd; 2102 av7110->fe->ops.diseqc_send_master_cmd = av7110_diseqc_send_master_cmd;
@@ -2103,7 +2107,7 @@ static int frontend_init(struct av7110 *av7110)
2103 } 2107 }
2104 2108
2105 // try the ALPS BSRU6 now 2109 // try the ALPS BSRU6 now
2106 av7110->fe = stv0299_attach(&alps_bsru6_config, &av7110->i2c_adap); 2110 av7110->fe = dvb_attach(stv0299_attach, &alps_bsru6_config, &av7110->i2c_adap);
2107 if (av7110->fe) { 2111 if (av7110->fe) {
2108 av7110->fe->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; 2112 av7110->fe->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params;
2109 av7110->fe->tuner_priv = &av7110->i2c_adap; 2113 av7110->fe->tuner_priv = &av7110->i2c_adap;
@@ -2116,7 +2120,7 @@ static int frontend_init(struct av7110 *av7110)
2116 } 2120 }
2117 2121
2118 // Try the grundig 29504-451 2122 // Try the grundig 29504-451
2119 av7110->fe = tda8083_attach(&grundig_29504_451_config, &av7110->i2c_adap); 2123 av7110->fe = dvb_attach(tda8083_attach, &grundig_29504_451_config, &av7110->i2c_adap);
2120 if (av7110->fe) { 2124 if (av7110->fe) {
2121 av7110->fe->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params; 2125 av7110->fe->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params;
2122 av7110->fe->ops.diseqc_send_master_cmd = av7110_diseqc_send_master_cmd; 2126 av7110->fe->ops.diseqc_send_master_cmd = av7110_diseqc_send_master_cmd;
@@ -2130,7 +2134,7 @@ static int frontend_init(struct av7110 *av7110)
2130 switch(av7110->dev->pci->subsystem_device) { 2134 switch(av7110->dev->pci->subsystem_device) {
2131 case 0x0000: 2135 case 0x0000:
2132 /* Siemens DVB-C (full-length card) VES1820/Philips CD1516 */ 2136 /* Siemens DVB-C (full-length card) VES1820/Philips CD1516 */
2133 av7110->fe = ves1820_attach(&philips_cd1516_config, &av7110->i2c_adap, 2137 av7110->fe = dvb_attach(ves1820_attach, &philips_cd1516_config, &av7110->i2c_adap,
2134 read_pwm(av7110)); 2138 read_pwm(av7110));
2135 if (av7110->fe) { 2139 if (av7110->fe) {
2136 av7110->fe->ops.tuner_ops.set_params = philips_cd1516_tuner_set_params; 2140 av7110->fe->ops.tuner_ops.set_params = philips_cd1516_tuner_set_params;
@@ -2138,7 +2142,7 @@ static int frontend_init(struct av7110 *av7110)
2138 break; 2142 break;
2139 case 0x0003: 2143 case 0x0003:
2140 /* Hauppauge DVB-C 2.1 VES1820/ALPS TDBE2 */ 2144 /* Hauppauge DVB-C 2.1 VES1820/ALPS TDBE2 */
2141 av7110->fe = ves1820_attach(&alps_tdbe2_config, &av7110->i2c_adap, 2145 av7110->fe = dvb_attach(ves1820_attach, &alps_tdbe2_config, &av7110->i2c_adap,
2142 read_pwm(av7110)); 2146 read_pwm(av7110));
2143 if (av7110->fe) { 2147 if (av7110->fe) {
2144 av7110->fe->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params; 2148 av7110->fe->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params;
@@ -2150,7 +2154,7 @@ static int frontend_init(struct av7110 *av7110)
2150 case 0x0001: // Hauppauge/TT Nexus-T premium rev1.X 2154 case 0x0001: // Hauppauge/TT Nexus-T premium rev1.X
2151 2155
2152 // ALPS TDLB7 2156 // ALPS TDLB7
2153 av7110->fe = sp8870_attach(&alps_tdlb7_config, &av7110->i2c_adap); 2157 av7110->fe = dvb_attach(sp8870_attach, &alps_tdlb7_config, &av7110->i2c_adap);
2154 if (av7110->fe) { 2158 if (av7110->fe) {
2155 av7110->fe->ops.tuner_ops.set_params = alps_tdlb7_tuner_set_params; 2159 av7110->fe->ops.tuner_ops.set_params = alps_tdlb7_tuner_set_params;
2156 } 2160 }
@@ -2158,7 +2162,7 @@ static int frontend_init(struct av7110 *av7110)
2158 2162
2159 case 0x0002: // Hauppauge/TT DVB-C premium rev2.X 2163 case 0x0002: // Hauppauge/TT DVB-C premium rev2.X
2160 2164
2161 av7110->fe = ves1820_attach(&alps_tdbe2_config, &av7110->i2c_adap, read_pwm(av7110)); 2165 av7110->fe = dvb_attach(ves1820_attach, &alps_tdbe2_config, &av7110->i2c_adap, read_pwm(av7110));
2162 if (av7110->fe) { 2166 if (av7110->fe) {
2163 av7110->fe->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params; 2167 av7110->fe->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params;
2164 } 2168 }
@@ -2166,7 +2170,7 @@ static int frontend_init(struct av7110 *av7110)
2166 2170
2167 case 0x0004: // Galaxis DVB-S rev1.3 2171 case 0x0004: // Galaxis DVB-S rev1.3
2168 /* ALPS BSRV2 */ 2172 /* ALPS BSRV2 */
2169 av7110->fe = ves1x93_attach(&alps_bsrv2_config, &av7110->i2c_adap); 2173 av7110->fe = dvb_attach(ves1x93_attach, &alps_bsrv2_config, &av7110->i2c_adap);
2170 if (av7110->fe) { 2174 if (av7110->fe) {
2171 av7110->fe->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params; 2175 av7110->fe->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params;
2172 av7110->fe->ops.diseqc_send_master_cmd = av7110_diseqc_send_master_cmd; 2176 av7110->fe->ops.diseqc_send_master_cmd = av7110_diseqc_send_master_cmd;
@@ -2178,7 +2182,7 @@ static int frontend_init(struct av7110 *av7110)
2178 2182
2179 case 0x0006: /* Fujitsu-Siemens DVB-S rev 1.6 */ 2183 case 0x0006: /* Fujitsu-Siemens DVB-S rev 1.6 */
2180 /* Grundig 29504-451 */ 2184 /* Grundig 29504-451 */
2181 av7110->fe = tda8083_attach(&grundig_29504_451_config, &av7110->i2c_adap); 2185 av7110->fe = dvb_attach(tda8083_attach, &grundig_29504_451_config, &av7110->i2c_adap);
2182 if (av7110->fe) { 2186 if (av7110->fe) {
2183 av7110->fe->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params; 2187 av7110->fe->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params;
2184 av7110->fe->ops.diseqc_send_master_cmd = av7110_diseqc_send_master_cmd; 2188 av7110->fe->ops.diseqc_send_master_cmd = av7110_diseqc_send_master_cmd;
@@ -2190,7 +2194,7 @@ static int frontend_init(struct av7110 *av7110)
2190 2194
2191 case 0x0008: // Hauppauge/TT DVB-T 2195 case 0x0008: // Hauppauge/TT DVB-T
2192 2196
2193 av7110->fe = l64781_attach(&grundig_29504_401_config, &av7110->i2c_adap); 2197 av7110->fe = dvb_attach(l64781_attach, &grundig_29504_401_config, &av7110->i2c_adap);
2194 if (av7110->fe) { 2198 if (av7110->fe) {
2195 av7110->fe->ops.tuner_ops.set_params = grundig_29504_401_tuner_set_params; 2199 av7110->fe->ops.tuner_ops.set_params = grundig_29504_401_tuner_set_params;
2196 } 2200 }
@@ -2198,7 +2202,7 @@ static int frontend_init(struct av7110 *av7110)
2198 2202
2199 case 0x000A: // Hauppauge/TT Nexus-CA rev1.X 2203 case 0x000A: // Hauppauge/TT Nexus-CA rev1.X
2200 2204
2201 av7110->fe = stv0297_attach(&nexusca_stv0297_config, &av7110->i2c_adap); 2205 av7110->fe = dvb_attach(stv0297_attach, &nexusca_stv0297_config, &av7110->i2c_adap);
2202 if (av7110->fe) { 2206 if (av7110->fe) {
2203 av7110->fe->ops.tuner_ops.set_params = nexusca_stv0297_tuner_set_params; 2207 av7110->fe->ops.tuner_ops.set_params = nexusca_stv0297_tuner_set_params;
2204 2208
@@ -2214,12 +2218,12 @@ static int frontend_init(struct av7110 *av7110)
2214 2218
2215 case 0x000E: /* Hauppauge/TT Nexus-S rev 2.3 */ 2219 case 0x000E: /* Hauppauge/TT Nexus-S rev 2.3 */
2216 /* ALPS BSBE1 */ 2220 /* ALPS BSBE1 */
2217 av7110->fe = stv0299_attach(&alps_bsbe1_config, &av7110->i2c_adap); 2221 av7110->fe = dvb_attach(stv0299_attach, &alps_bsbe1_config, &av7110->i2c_adap);
2218 if (av7110->fe) { 2222 if (av7110->fe) {
2219 av7110->fe->ops.tuner_ops.set_params = alps_bsbe1_tuner_set_params; 2223 av7110->fe->ops.tuner_ops.set_params = alps_bsbe1_tuner_set_params;
2220 av7110->fe->tuner_priv = &av7110->i2c_adap; 2224 av7110->fe->tuner_priv = &av7110->i2c_adap;
2221 2225
2222 if (lnbp21_attach(av7110->fe, &av7110->i2c_adap, 0, 0) == NULL) { 2226 if (dvb_attach(lnbp21_attach, av7110->fe, &av7110->i2c_adap, 0, 0) == NULL) {
2223 printk("dvb-ttpci: LNBP21 not found!\n"); 2227 printk("dvb-ttpci: LNBP21 not found!\n");
2224 if (av7110->fe->ops.release) 2228 if (av7110->fe->ops.release)
2225 av7110->fe->ops.release(av7110->fe); 2229 av7110->fe->ops.release(av7110->fe);
@@ -2255,8 +2259,9 @@ static int frontend_init(struct av7110 *av7110)
2255 ret = dvb_register_frontend(&av7110->dvb_adapter, av7110->fe); 2259 ret = dvb_register_frontend(&av7110->dvb_adapter, av7110->fe);
2256 if (ret < 0) { 2260 if (ret < 0) {
2257 printk("av7110: Frontend registration failed!\n"); 2261 printk("av7110: Frontend registration failed!\n");
2258 if (av7110->fe->ops.release) 2262 dvb_detach(av7110->fe->ops.release_sec, av7110->fe);
2259 av7110->fe->ops.release(av7110->fe); 2263 dvb_detach(av7110->fe->ops.tuner_ops.release, av7110->fe);
2264 dvb_detach(av7110->fe->ops.release, av7110->fe);
2260 av7110->fe = NULL; 2265 av7110->fe = NULL;
2261 } 2266 }
2262 } 2267 }
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c
index 2d21fec23b4d..c648c01c8ec5 100644
--- a/drivers/media/dvb/ttpci/budget-av.c
+++ b/drivers/media/dvb/ttpci/budget-av.c
@@ -235,7 +235,7 @@ static int ciintf_slot_reset(struct dvb_ca_en50221 *ca, int slot)
235 235
236 /* set tda10021 back to original clock configuration on reset */ 236 /* set tda10021 back to original clock configuration on reset */
237 if (budget_av->tda10021_poclkp) { 237 if (budget_av->tda10021_poclkp) {
238 tda10021_write_byte(budget_av->budget.dvb_frontend, 0x12, 0xa0); 238 tda10021_writereg(budget_av->budget.dvb_frontend, 0x12, 0xa0);
239 budget_av->tda10021_ts_enabled = 0; 239 budget_av->tda10021_ts_enabled = 0;
240 } 240 }
241 241
@@ -257,7 +257,7 @@ static int ciintf_slot_shutdown(struct dvb_ca_en50221 *ca, int slot)
257 257
258 /* set tda10021 back to original clock configuration when cam removed */ 258 /* set tda10021 back to original clock configuration when cam removed */
259 if (budget_av->tda10021_poclkp) { 259 if (budget_av->tda10021_poclkp) {
260 tda10021_write_byte(budget_av->budget.dvb_frontend, 0x12, 0xa0); 260 tda10021_writereg(budget_av->budget.dvb_frontend, 0x12, 0xa0);
261 budget_av->tda10021_ts_enabled = 0; 261 budget_av->tda10021_ts_enabled = 0;
262 } 262 }
263 return 0; 263 return 0;
@@ -277,7 +277,7 @@ static int ciintf_slot_ts_enable(struct dvb_ca_en50221 *ca, int slot)
277 277
278 /* tda10021 seems to need a different TS clock config when data is routed to the CAM */ 278 /* tda10021 seems to need a different TS clock config when data is routed to the CAM */
279 if (budget_av->tda10021_poclkp) { 279 if (budget_av->tda10021_poclkp) {
280 tda10021_write_byte(budget_av->budget.dvb_frontend, 0x12, 0xa1); 280 tda10021_writereg(budget_av->budget.dvb_frontend, 0x12, 0xa1);
281 budget_av->tda10021_ts_enabled = 1; 281 budget_av->tda10021_ts_enabled = 1;
282 } 282 }
283 283
@@ -1068,9 +1068,9 @@ static int tda10021_set_frontend(struct dvb_frontend *fe,
1068 1068
1069 result = budget_av->tda10021_set_frontend(fe, p); 1069 result = budget_av->tda10021_set_frontend(fe, p);
1070 if (budget_av->tda10021_ts_enabled) { 1070 if (budget_av->tda10021_ts_enabled) {
1071 tda10021_write_byte(budget_av->budget.dvb_frontend, 0x12, 0xa1); 1071 tda10021_writereg(budget_av->budget.dvb_frontend, 0x12, 0xa1);
1072 } else { 1072 } else {
1073 tda10021_write_byte(budget_av->budget.dvb_frontend, 0x12, 0xa0); 1073 tda10021_writereg(budget_av->budget.dvb_frontend, 0x12, 0xa0);
1074 } 1074 }
1075 1075
1076 return result; 1076 return result;
@@ -1098,13 +1098,13 @@ static void frontend_init(struct budget_av *budget_av)
1098 case SUBID_DVBS_KNC1: 1098 case SUBID_DVBS_KNC1:
1099 case SUBID_DVBS_EASYWATCH_1: 1099 case SUBID_DVBS_EASYWATCH_1:
1100 if (saa->pci->subsystem_vendor == 0x1894) { 1100 if (saa->pci->subsystem_vendor == 0x1894) {
1101 fe = stv0299_attach(&cinergy_1200s_1894_0010_config, 1101 fe = dvb_attach(stv0299_attach, &cinergy_1200s_1894_0010_config,
1102 &budget_av->budget.i2c_adap); 1102 &budget_av->budget.i2c_adap);
1103 if (fe) { 1103 if (fe) {
1104 fe->ops.tuner_ops.set_params = philips_su1278sh2_tua6100_tuner_set_params; 1104 fe->ops.tuner_ops.set_params = philips_su1278sh2_tua6100_tuner_set_params;
1105 } 1105 }
1106 } else { 1106 } else {
1107 fe = stv0299_attach(&typhoon_config, 1107 fe = dvb_attach(stv0299_attach, &typhoon_config,
1108 &budget_av->budget.i2c_adap); 1108 &budget_av->budget.i2c_adap);
1109 if (fe) { 1109 if (fe) {
1110 fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params; 1110 fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params;
@@ -1116,7 +1116,7 @@ static void frontend_init(struct budget_av *budget_av)
1116 case SUBID_DVBS_TV_STAR_CI: 1116 case SUBID_DVBS_TV_STAR_CI:
1117 case SUBID_DVBS_CYNERGY1200N: 1117 case SUBID_DVBS_CYNERGY1200N:
1118 case SUBID_DVBS_EASYWATCH: 1118 case SUBID_DVBS_EASYWATCH:
1119 fe = stv0299_attach(&philips_sd1878_config, 1119 fe = dvb_attach(stv0299_attach, &philips_sd1878_config,
1120 &budget_av->budget.i2c_adap); 1120 &budget_av->budget.i2c_adap);
1121 if (fe) { 1121 if (fe) {
1122 fe->ops.tuner_ops.set_params = philips_sd1878_tda8261_tuner_set_params; 1122 fe->ops.tuner_ops.set_params = philips_sd1878_tda8261_tuner_set_params;
@@ -1125,7 +1125,7 @@ static void frontend_init(struct budget_av *budget_av)
1125 1125
1126 case SUBID_DVBS_KNC1_PLUS: 1126 case SUBID_DVBS_KNC1_PLUS:
1127 case SUBID_DVBS_TYPHOON: 1127 case SUBID_DVBS_TYPHOON:
1128 fe = stv0299_attach(&typhoon_config, 1128 fe = dvb_attach(stv0299_attach, &typhoon_config,
1129 &budget_av->budget.i2c_adap); 1129 &budget_av->budget.i2c_adap);
1130 if (fe) { 1130 if (fe) {
1131 fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params; 1131 fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params;
@@ -1133,7 +1133,7 @@ static void frontend_init(struct budget_av *budget_av)
1133 break; 1133 break;
1134 1134
1135 case SUBID_DVBS_CINERGY1200: 1135 case SUBID_DVBS_CINERGY1200:
1136 fe = stv0299_attach(&cinergy_1200s_config, 1136 fe = dvb_attach(stv0299_attach, &cinergy_1200s_config,
1137 &budget_av->budget.i2c_adap); 1137 &budget_av->budget.i2c_adap);
1138 if (fe) { 1138 if (fe) {
1139 fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params; 1139 fe->ops.tuner_ops.set_params = philips_su1278_ty_ci_tuner_set_params;
@@ -1142,7 +1142,7 @@ static void frontend_init(struct budget_av *budget_av)
1142 1142
1143 case SUBID_DVBC_KNC1: 1143 case SUBID_DVBC_KNC1:
1144 budget_av->reinitialise_demod = 1; 1144 budget_av->reinitialise_demod = 1;
1145 fe = tda10021_attach(&philips_cu1216_config, 1145 fe = dvb_attach(tda10021_attach, &philips_cu1216_config,
1146 &budget_av->budget.i2c_adap, 1146 &budget_av->budget.i2c_adap,
1147 read_pwm(budget_av)); 1147 read_pwm(budget_av));
1148 if (fe) { 1148 if (fe) {
@@ -1153,7 +1153,7 @@ static void frontend_init(struct budget_av *budget_av)
1153 case SUBID_DVBC_KNC1_PLUS: 1153 case SUBID_DVBC_KNC1_PLUS:
1154 case SUBID_DVBC_CINERGY1200: 1154 case SUBID_DVBC_CINERGY1200:
1155 budget_av->reinitialise_demod = 1; 1155 budget_av->reinitialise_demod = 1;
1156 fe = tda10021_attach(&philips_cu1216_config, 1156 fe = dvb_attach(tda10021_attach, &philips_cu1216_config,
1157 &budget_av->budget.i2c_adap, 1157 &budget_av->budget.i2c_adap,
1158 read_pwm(budget_av)); 1158 read_pwm(budget_av));
1159 if (fe) { 1159 if (fe) {
@@ -1168,7 +1168,7 @@ static void frontend_init(struct budget_av *budget_av)
1168 case SUBID_DVBT_KNC1_PLUS: 1168 case SUBID_DVBT_KNC1_PLUS:
1169 case SUBID_DVBT_CINERGY1200: 1169 case SUBID_DVBT_CINERGY1200:
1170 budget_av->reinitialise_demod = 1; 1170 budget_av->reinitialise_demod = 1;
1171 fe = tda10046_attach(&philips_tu1216_config, 1171 fe = dvb_attach(tda10046_attach, &philips_tu1216_config,
1172 &budget_av->budget.i2c_adap); 1172 &budget_av->budget.i2c_adap);
1173 if (fe) { 1173 if (fe) {
1174 fe->ops.tuner_ops.init = philips_tu1216_tuner_init; 1174 fe->ops.tuner_ops.init = philips_tu1216_tuner_init;
@@ -1192,8 +1192,9 @@ static void frontend_init(struct budget_av *budget_av)
1192 if (dvb_register_frontend(&budget_av->budget.dvb_adapter, 1192 if (dvb_register_frontend(&budget_av->budget.dvb_adapter,
1193 budget_av->budget.dvb_frontend)) { 1193 budget_av->budget.dvb_frontend)) {
1194 printk(KERN_ERR "budget-av: Frontend registration failed!\n"); 1194 printk(KERN_ERR "budget-av: Frontend registration failed!\n");
1195 if (budget_av->budget.dvb_frontend->ops.release) 1195 dvb_detach(budget_av->budget.dvb_frontend->ops.release_sec, budget_av->budget.dvb_frontend);
1196 budget_av->budget.dvb_frontend->ops.release(budget_av->budget.dvb_frontend); 1196 dvb_detach(budget_av->budget.dvb_frontend->ops.tuner_ops.release, budget_av->budget.dvb_frontend);
1197 dvb_detach(budget_av->budget.dvb_frontend->ops.release, budget_av->budget.dvb_frontend);
1197 budget_av->budget.dvb_frontend = NULL; 1198 budget_av->budget.dvb_frontend = NULL;
1198 } 1199 }
1199} 1200}
@@ -1227,8 +1228,12 @@ static int budget_av_detach(struct saa7146_dev *dev)
1227 if (budget_av->budget.ci_present) 1228 if (budget_av->budget.ci_present)
1228 ciintf_deinit(budget_av); 1229 ciintf_deinit(budget_av);
1229 1230
1230 if (budget_av->budget.dvb_frontend != NULL) 1231 if (budget_av->budget.dvb_frontend != NULL) {
1231 dvb_unregister_frontend(budget_av->budget.dvb_frontend); 1232 dvb_unregister_frontend(budget_av->budget.dvb_frontend);
1233 dvb_detach(budget_av->budget.dvb_frontend->ops.release_sec, budget_av->budget.dvb_frontend);
1234 dvb_detach(budget_av->budget.dvb_frontend->ops.tuner_ops.release, budget_av->budget.dvb_frontend);
1235 dvb_detach(budget_av->budget.dvb_frontend->ops.release, budget_av->budget.dvb_frontend);
1236 }
1232 err = ttpci_budget_deinit(&budget_av->budget); 1237 err = ttpci_budget_deinit(&budget_av->budget);
1233 1238
1234 kfree(budget_av); 1239 kfree(budget_av);
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c
index 8710813668f1..20b5e8dc8739 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -988,7 +988,7 @@ static void frontend_init(struct budget_ci *budget_ci)
988 switch (budget_ci->budget.dev->pci->subsystem_device) { 988 switch (budget_ci->budget.dev->pci->subsystem_device) {
989 case 0x100c: // Hauppauge/TT Nova-CI budget (stv0299/ALPS BSRU6(tsa5059)) 989 case 0x100c: // Hauppauge/TT Nova-CI budget (stv0299/ALPS BSRU6(tsa5059))
990 budget_ci->budget.dvb_frontend = 990 budget_ci->budget.dvb_frontend =
991 stv0299_attach(&alps_bsru6_config, &budget_ci->budget.i2c_adap); 991 dvb_attach(stv0299_attach, &alps_bsru6_config, &budget_ci->budget.i2c_adap);
992 if (budget_ci->budget.dvb_frontend) { 992 if (budget_ci->budget.dvb_frontend) {
993 budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; 993 budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params;
994 budget_ci->budget.dvb_frontend->tuner_priv = &budget_ci->budget.i2c_adap; 994 budget_ci->budget.dvb_frontend->tuner_priv = &budget_ci->budget.i2c_adap;
@@ -998,7 +998,7 @@ static void frontend_init(struct budget_ci *budget_ci)
998 998
999 case 0x100f: // Hauppauge/TT Nova-CI budget (stv0299b/Philips su1278(tsa5059)) 999 case 0x100f: // Hauppauge/TT Nova-CI budget (stv0299b/Philips su1278(tsa5059))
1000 budget_ci->budget.dvb_frontend = 1000 budget_ci->budget.dvb_frontend =
1001 stv0299_attach(&philips_su1278_tt_config, &budget_ci->budget.i2c_adap); 1001 dvb_attach(stv0299_attach, &philips_su1278_tt_config, &budget_ci->budget.i2c_adap);
1002 if (budget_ci->budget.dvb_frontend) { 1002 if (budget_ci->budget.dvb_frontend) {
1003 budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = philips_su1278_tt_tuner_set_params; 1003 budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = philips_su1278_tt_tuner_set_params;
1004 break; 1004 break;
@@ -1008,7 +1008,7 @@ static void frontend_init(struct budget_ci *budget_ci)
1008 case 0x1010: // TT DVB-C CI budget (stv0297/Philips tdm1316l(tda6651tt)) 1008 case 0x1010: // TT DVB-C CI budget (stv0297/Philips tdm1316l(tda6651tt))
1009 budget_ci->tuner_pll_address = 0x61; 1009 budget_ci->tuner_pll_address = 0x61;
1010 budget_ci->budget.dvb_frontend = 1010 budget_ci->budget.dvb_frontend =
1011 stv0297_attach(&dvbc_philips_tdm1316l_config, &budget_ci->budget.i2c_adap); 1011 dvb_attach(stv0297_attach, &dvbc_philips_tdm1316l_config, &budget_ci->budget.i2c_adap);
1012 if (budget_ci->budget.dvb_frontend) { 1012 if (budget_ci->budget.dvb_frontend) {
1013 budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = dvbc_philips_tdm1316l_tuner_set_params; 1013 budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = dvbc_philips_tdm1316l_tuner_set_params;
1014 break; 1014 break;
@@ -1018,7 +1018,7 @@ static void frontend_init(struct budget_ci *budget_ci)
1018 case 0x1011: // Hauppauge/TT Nova-T budget (tda10045/Philips tdm1316l(tda6651tt) + TDA9889) 1018 case 0x1011: // Hauppauge/TT Nova-T budget (tda10045/Philips tdm1316l(tda6651tt) + TDA9889)
1019 budget_ci->tuner_pll_address = 0x63; 1019 budget_ci->tuner_pll_address = 0x63;
1020 budget_ci->budget.dvb_frontend = 1020 budget_ci->budget.dvb_frontend =
1021 tda10045_attach(&philips_tdm1316l_config, &budget_ci->budget.i2c_adap); 1021 dvb_attach(tda10045_attach, &philips_tdm1316l_config, &budget_ci->budget.i2c_adap);
1022 if (budget_ci->budget.dvb_frontend) { 1022 if (budget_ci->budget.dvb_frontend) {
1023 budget_ci->budget.dvb_frontend->ops.tuner_ops.init = philips_tdm1316l_tuner_init; 1023 budget_ci->budget.dvb_frontend->ops.tuner_ops.init = philips_tdm1316l_tuner_init;
1024 budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = philips_tdm1316l_tuner_set_params; 1024 budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = philips_tdm1316l_tuner_set_params;
@@ -1029,7 +1029,7 @@ static void frontend_init(struct budget_ci *budget_ci)
1029 case 0x1012: // TT DVB-T CI budget (tda10046/Philips tdm1316l(tda6651tt)) 1029 case 0x1012: // TT DVB-T CI budget (tda10046/Philips tdm1316l(tda6651tt))
1030 budget_ci->tuner_pll_address = 0x60; 1030 budget_ci->tuner_pll_address = 0x60;
1031 budget_ci->budget.dvb_frontend = 1031 budget_ci->budget.dvb_frontend =
1032 tda10046_attach(&philips_tdm1316l_config, &budget_ci->budget.i2c_adap); 1032 dvb_attach(tda10046_attach, &philips_tdm1316l_config, &budget_ci->budget.i2c_adap);
1033 if (budget_ci->budget.dvb_frontend) { 1033 if (budget_ci->budget.dvb_frontend) {
1034 budget_ci->budget.dvb_frontend->ops.tuner_ops.init = philips_tdm1316l_tuner_init; 1034 budget_ci->budget.dvb_frontend->ops.tuner_ops.init = philips_tdm1316l_tuner_init;
1035 budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = philips_tdm1316l_tuner_set_params; 1035 budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = philips_tdm1316l_tuner_set_params;
@@ -1038,13 +1038,13 @@ static void frontend_init(struct budget_ci *budget_ci)
1038 break; 1038 break;
1039 1039
1040 case 0x1017: // TT S-1500 PCI 1040 case 0x1017: // TT S-1500 PCI
1041 budget_ci->budget.dvb_frontend = stv0299_attach(&alps_bsbe1_config, &budget_ci->budget.i2c_adap); 1041 budget_ci->budget.dvb_frontend = dvb_attach(stv0299_attach, &alps_bsbe1_config, &budget_ci->budget.i2c_adap);
1042 if (budget_ci->budget.dvb_frontend) { 1042 if (budget_ci->budget.dvb_frontend) {
1043 budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = alps_bsbe1_tuner_set_params; 1043 budget_ci->budget.dvb_frontend->ops.tuner_ops.set_params = alps_bsbe1_tuner_set_params;
1044 budget_ci->budget.dvb_frontend->tuner_priv = &budget_ci->budget.i2c_adap; 1044 budget_ci->budget.dvb_frontend->tuner_priv = &budget_ci->budget.i2c_adap;
1045 1045
1046 budget_ci->budget.dvb_frontend->ops.dishnetwork_send_legacy_command = NULL; 1046 budget_ci->budget.dvb_frontend->ops.dishnetwork_send_legacy_command = NULL;
1047 if (lnbp21_attach(budget_ci->budget.dvb_frontend, &budget_ci->budget.i2c_adap, LNBP21_LLC, 0) == NULL) { 1047 if (dvb_attach(lnbp21_attach, budget_ci->budget.dvb_frontend, &budget_ci->budget.i2c_adap, LNBP21_LLC, 0) == NULL) {
1048 printk("%s: No LNBP21 found!\n", __FUNCTION__); 1048 printk("%s: No LNBP21 found!\n", __FUNCTION__);
1049 if (budget_ci->budget.dvb_frontend->ops.release) 1049 if (budget_ci->budget.dvb_frontend->ops.release)
1050 budget_ci->budget.dvb_frontend->ops.release(budget_ci->budget.dvb_frontend); 1050 budget_ci->budget.dvb_frontend->ops.release(budget_ci->budget.dvb_frontend);
@@ -1065,8 +1065,9 @@ static void frontend_init(struct budget_ci *budget_ci)
1065 if (dvb_register_frontend 1065 if (dvb_register_frontend
1066 (&budget_ci->budget.dvb_adapter, budget_ci->budget.dvb_frontend)) { 1066 (&budget_ci->budget.dvb_adapter, budget_ci->budget.dvb_frontend)) {
1067 printk("budget-ci: Frontend registration failed!\n"); 1067 printk("budget-ci: Frontend registration failed!\n");
1068 if (budget_ci->budget.dvb_frontend->ops.release) 1068 dvb_detach(budget_ci->budget.dvb_frontend->ops.release_sec, budget_ci->budget.dvb_frontend);
1069 budget_ci->budget.dvb_frontend->ops.release(budget_ci->budget.dvb_frontend); 1069 dvb_detach(budget_ci->budget.dvb_frontend->ops.tuner_ops.release, budget_ci->budget.dvb_frontend);
1070 dvb_detach(budget_ci->budget.dvb_frontend->ops.release, budget_ci->budget.dvb_frontend);
1070 budget_ci->budget.dvb_frontend = NULL; 1071 budget_ci->budget.dvb_frontend = NULL;
1071 } 1072 }
1072 } 1073 }
@@ -1114,8 +1115,12 @@ static int budget_ci_detach(struct saa7146_dev *dev)
1114 1115
1115 if (budget_ci->budget.ci_present) 1116 if (budget_ci->budget.ci_present)
1116 ciintf_deinit(budget_ci); 1117 ciintf_deinit(budget_ci);
1117 if (budget_ci->budget.dvb_frontend) 1118 if (budget_ci->budget.dvb_frontend) {
1118 dvb_unregister_frontend(budget_ci->budget.dvb_frontend); 1119 dvb_unregister_frontend(budget_ci->budget.dvb_frontend);
1120 dvb_detach(budget_ci->budget.dvb_frontend->ops.release_sec, budget_ci->budget.dvb_frontend);
1121 dvb_detach(budget_ci->budget.dvb_frontend->ops.tuner_ops.release, budget_ci->budget.dvb_frontend);
1122 dvb_detach(budget_ci->budget.dvb_frontend->ops.release, budget_ci->budget.dvb_frontend);
1123 }
1119 err = ttpci_budget_deinit(&budget_ci->budget); 1124 err = ttpci_budget_deinit(&budget_ci->budget);
1120 1125
1121 tasklet_kill(&budget_ci->msp430_irq_tasklet); 1126 tasklet_kill(&budget_ci->msp430_irq_tasklet);
diff --git a/drivers/media/dvb/ttpci/budget-patch.c b/drivers/media/dvb/ttpci/budget-patch.c
index 57227441891e..82dbef863e51 100644
--- a/drivers/media/dvb/ttpci/budget-patch.c
+++ b/drivers/media/dvb/ttpci/budget-patch.c
@@ -325,7 +325,7 @@ static void frontend_init(struct budget_patch* budget)
325 case 0x1013: // SATELCO Multimedia PCI 325 case 0x1013: // SATELCO Multimedia PCI
326 326
327 // try the ALPS BSRV2 first of all 327 // try the ALPS BSRV2 first of all
328 budget->dvb_frontend = ves1x93_attach(&alps_bsrv2_config, &budget->i2c_adap); 328 budget->dvb_frontend = dvb_attach(ves1x93_attach, &alps_bsrv2_config, &budget->i2c_adap);
329 if (budget->dvb_frontend) { 329 if (budget->dvb_frontend) {
330 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params; 330 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params;
331 budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_patch_diseqc_send_master_cmd; 331 budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_patch_diseqc_send_master_cmd;
@@ -335,7 +335,7 @@ static void frontend_init(struct budget_patch* budget)
335 } 335 }
336 336
337 // try the ALPS BSRU6 now 337 // try the ALPS BSRU6 now
338 budget->dvb_frontend = stv0299_attach(&alps_bsru6_config, &budget->i2c_adap); 338 budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsru6_config, &budget->i2c_adap);
339 if (budget->dvb_frontend) { 339 if (budget->dvb_frontend) {
340 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; 340 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params;
341 budget->dvb_frontend->tuner_priv = &budget->i2c_adap; 341 budget->dvb_frontend->tuner_priv = &budget->i2c_adap;
@@ -347,7 +347,7 @@ static void frontend_init(struct budget_patch* budget)
347 } 347 }
348 348
349 // Try the grundig 29504-451 349 // Try the grundig 29504-451
350 budget->dvb_frontend = tda8083_attach(&grundig_29504_451_config, &budget->i2c_adap); 350 budget->dvb_frontend = dvb_attach(tda8083_attach, &grundig_29504_451_config, &budget->i2c_adap);
351 if (budget->dvb_frontend) { 351 if (budget->dvb_frontend) {
352 budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params; 352 budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params;
353 budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd; 353 budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd;
@@ -367,8 +367,9 @@ static void frontend_init(struct budget_patch* budget)
367 } else { 367 } else {
368 if (dvb_register_frontend(&budget->dvb_adapter, budget->dvb_frontend)) { 368 if (dvb_register_frontend(&budget->dvb_adapter, budget->dvb_frontend)) {
369 printk("budget-av: Frontend registration failed!\n"); 369 printk("budget-av: Frontend registration failed!\n");
370 if (budget->dvb_frontend->ops.release) 370 dvb_detach(budget->dvb_frontend->ops.release_sec, budget->dvb_frontend);
371 budget->dvb_frontend->ops.release(budget->dvb_frontend); 371 dvb_detach(budget->dvb_frontend->ops.tuner_ops.release, budget->dvb_frontend);
372 dvb_detach(budget->dvb_frontend->ops.release, budget->dvb_frontend);
372 budget->dvb_frontend = NULL; 373 budget->dvb_frontend = NULL;
373 } 374 }
374 } 375 }
@@ -627,8 +628,12 @@ static int budget_patch_detach (struct saa7146_dev* dev)
627 struct budget_patch *budget = (struct budget_patch*) dev->ext_priv; 628 struct budget_patch *budget = (struct budget_patch*) dev->ext_priv;
628 int err; 629 int err;
629 630
630 if (budget->dvb_frontend) dvb_unregister_frontend(budget->dvb_frontend); 631 if (budget->dvb_frontend) {
631 632 dvb_unregister_frontend(budget->dvb_frontend);
633 dvb_detach(budget->dvb_frontend->ops.release_sec, budget->dvb_frontend);
634 dvb_detach(budget->dvb_frontend->ops.tuner_ops.release, budget->dvb_frontend);
635 dvb_detach(budget->dvb_frontend->ops.release, budget->dvb_frontend);
636 }
632 err = ttpci_budget_deinit (budget); 637 err = ttpci_budget_deinit (budget);
633 638
634 kfree (budget); 639 kfree (budget);
diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c
index c21ee5a05fe8..19beb11f9664 100644
--- a/drivers/media/dvb/ttpci/budget.c
+++ b/drivers/media/dvb/ttpci/budget.c
@@ -361,7 +361,7 @@ static void frontend_init(struct budget *budget)
361 case 0x1003: // Hauppauge/TT Nova budget (stv0299/ALPS BSRU6(tsa5059) OR ves1893/ALPS BSRV2(sp5659)) 361 case 0x1003: // Hauppauge/TT Nova budget (stv0299/ALPS BSRU6(tsa5059) OR ves1893/ALPS BSRV2(sp5659))
362 case 0x1013: 362 case 0x1013:
363 // try the ALPS BSRV2 first of all 363 // try the ALPS BSRV2 first of all
364 budget->dvb_frontend = ves1x93_attach(&alps_bsrv2_config, &budget->i2c_adap); 364 budget->dvb_frontend = dvb_attach(ves1x93_attach, &alps_bsrv2_config, &budget->i2c_adap);
365 if (budget->dvb_frontend) { 365 if (budget->dvb_frontend) {
366 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params; 366 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsrv2_tuner_set_params;
367 budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd; 367 budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd;
@@ -371,7 +371,7 @@ static void frontend_init(struct budget *budget)
371 } 371 }
372 372
373 // try the ALPS BSRU6 now 373 // try the ALPS BSRU6 now
374 budget->dvb_frontend = stv0299_attach(&alps_bsru6_config, &budget->i2c_adap); 374 budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsru6_config, &budget->i2c_adap);
375 if (budget->dvb_frontend) { 375 if (budget->dvb_frontend) {
376 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; 376 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params;
377 budget->dvb_frontend->tuner_priv = &budget->i2c_adap; 377 budget->dvb_frontend->tuner_priv = &budget->i2c_adap;
@@ -381,7 +381,7 @@ static void frontend_init(struct budget *budget)
381 381
382 case 0x1004: // Hauppauge/TT DVB-C budget (ves1820/ALPS TDBE2(sp5659)) 382 case 0x1004: // Hauppauge/TT DVB-C budget (ves1820/ALPS TDBE2(sp5659))
383 383
384 budget->dvb_frontend = ves1820_attach(&alps_tdbe2_config, &budget->i2c_adap, read_pwm(budget)); 384 budget->dvb_frontend = dvb_attach(ves1820_attach, &alps_tdbe2_config, &budget->i2c_adap, read_pwm(budget));
385 if (budget->dvb_frontend) { 385 if (budget->dvb_frontend) {
386 budget->dvb_frontend->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params; 386 budget->dvb_frontend->ops.tuner_ops.set_params = alps_tdbe2_tuner_set_params;
387 break; 387 break;
@@ -390,7 +390,7 @@ static void frontend_init(struct budget *budget)
390 390
391 case 0x1005: // Hauppauge/TT Nova-T budget (L64781/Grundig 29504-401(tsa5060)) 391 case 0x1005: // Hauppauge/TT Nova-T budget (L64781/Grundig 29504-401(tsa5060))
392 392
393 budget->dvb_frontend = l64781_attach(&grundig_29504_401_config, &budget->i2c_adap); 393 budget->dvb_frontend = dvb_attach(l64781_attach, &grundig_29504_401_config, &budget->i2c_adap);
394 if (budget->dvb_frontend) { 394 if (budget->dvb_frontend) {
395 budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_401_tuner_set_params; 395 budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_401_tuner_set_params;
396 break; 396 break;
@@ -398,7 +398,7 @@ static void frontend_init(struct budget *budget)
398 break; 398 break;
399 399
400 case 0x4f60: // Fujitsu Siemens Activy Budget-S PCI rev AL (stv0299/ALPS BSRU6(tsa5059)) 400 case 0x4f60: // Fujitsu Siemens Activy Budget-S PCI rev AL (stv0299/ALPS BSRU6(tsa5059))
401 budget->dvb_frontend = stv0299_attach(&alps_bsru6_config, &budget->i2c_adap); 401 budget->dvb_frontend = dvb_attach(stv0299_attach, &alps_bsru6_config, &budget->i2c_adap);
402 if (budget->dvb_frontend) { 402 if (budget->dvb_frontend) {
403 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; 403 budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params;
404 budget->dvb_frontend->tuner_priv = &budget->i2c_adap; 404 budget->dvb_frontend->tuner_priv = &budget->i2c_adap;
@@ -408,7 +408,7 @@ static void frontend_init(struct budget *budget)
408 break; 408 break;
409 409
410 case 0x4f61: // Fujitsu Siemens Activy Budget-S PCI rev GR (tda8083/Grundig 29504-451(tsa5522)) 410 case 0x4f61: // Fujitsu Siemens Activy Budget-S PCI rev GR (tda8083/Grundig 29504-451(tsa5522))
411 budget->dvb_frontend = tda8083_attach(&grundig_29504_451_config, &budget->i2c_adap); 411 budget->dvb_frontend = dvb_attach(tda8083_attach, &grundig_29504_451_config, &budget->i2c_adap);
412 if (budget->dvb_frontend) { 412 if (budget->dvb_frontend) {
413 budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params; 413 budget->dvb_frontend->ops.tuner_ops.set_params = grundig_29504_451_tuner_set_params;
414 budget->dvb_frontend->ops.set_voltage = siemens_budget_set_voltage; 414 budget->dvb_frontend->ops.set_voltage = siemens_budget_set_voltage;
@@ -417,7 +417,7 @@ static void frontend_init(struct budget *budget)
417 break; 417 break;
418 418
419 case 0x1016: // Hauppauge/TT Nova-S SE (samsung s5h1420/????(tda8260)) 419 case 0x1016: // Hauppauge/TT Nova-S SE (samsung s5h1420/????(tda8260))
420 budget->dvb_frontend = s5h1420_attach(&s5h1420_config, &budget->i2c_adap); 420 budget->dvb_frontend = dvb_attach(s5h1420_attach, &s5h1420_config, &budget->i2c_adap);
421 if (budget->dvb_frontend) { 421 if (budget->dvb_frontend) {
422 budget->dvb_frontend->ops.tuner_ops.set_params = s5h1420_tuner_set_params; 422 budget->dvb_frontend->ops.tuner_ops.set_params = s5h1420_tuner_set_params;
423 if (lnbp21_attach(budget->dvb_frontend, &budget->i2c_adap, 0, 0) == NULL) { 423 if (lnbp21_attach(budget->dvb_frontend, &budget->i2c_adap, 0, 0) == NULL) {
@@ -442,8 +442,9 @@ static void frontend_init(struct budget *budget)
442 442
443error_out: 443error_out:
444 printk("budget: Frontend registration failed!\n"); 444 printk("budget: Frontend registration failed!\n");
445 if (budget->dvb_frontend->ops.release) 445 dvb_detach(budget->dvb_frontend->ops.release_sec, budget->dvb_frontend);
446 budget->dvb_frontend->ops.release(budget->dvb_frontend); 446 dvb_detach(budget->dvb_frontend->ops.tuner_ops.release, budget->dvb_frontend);
447 dvb_detach(budget->dvb_frontend->ops.release, budget->dvb_frontend);
447 budget->dvb_frontend = NULL; 448 budget->dvb_frontend = NULL;
448 return; 449 return;
449} 450}
@@ -481,7 +482,12 @@ static int budget_detach (struct saa7146_dev* dev)
481 struct budget *budget = (struct budget*) dev->ext_priv; 482 struct budget *budget = (struct budget*) dev->ext_priv;
482 int err; 483 int err;
483 484
484 if (budget->dvb_frontend) dvb_unregister_frontend(budget->dvb_frontend); 485 if (budget->dvb_frontend) {
486 dvb_unregister_frontend(budget->dvb_frontend);
487 dvb_detach(budget->dvb_frontend->ops.release_sec, budget->dvb_frontend);
488 dvb_detach(budget->dvb_frontend->ops.tuner_ops.release, budget->dvb_frontend);
489 dvb_detach(budget->dvb_frontend->ops.release, budget->dvb_frontend);
490 }
485 491
486 err = ttpci_budget_deinit (budget); 492 err = ttpci_budget_deinit (budget);
487 493