Lines Matching refs:dvb
173 dvb_dmx_swfilter(&dev->dvb->demux, urb->transfer_buffer, in em28xx_dvb_urb_data_copy()
184 dvb_dmx_swfilter(&dev->dvb->demux, in em28xx_dvb_urb_data_copy()
194 static int em28xx_start_streaming(struct em28xx_dvb *dvb) in em28xx_start_streaming() argument
197 struct em28xx_i2c_bus *i2c_bus = dvb->adapter.priv; in em28xx_start_streaming()
238 static int em28xx_stop_streaming(struct em28xx_dvb *dvb) in em28xx_stop_streaming() argument
240 struct em28xx_i2c_bus *i2c_bus = dvb->adapter.priv; in em28xx_stop_streaming()
251 struct em28xx_dvb *dvb = demux->priv; in em28xx_start_feed() local
257 mutex_lock(&dvb->lock); in em28xx_start_feed()
258 dvb->nfeeds++; in em28xx_start_feed()
259 rc = dvb->nfeeds; in em28xx_start_feed()
261 if (dvb->nfeeds == 1) { in em28xx_start_feed()
262 ret = em28xx_start_streaming(dvb); in em28xx_start_feed()
267 mutex_unlock(&dvb->lock); in em28xx_start_feed()
274 struct em28xx_dvb *dvb = demux->priv; in em28xx_stop_feed() local
277 mutex_lock(&dvb->lock); in em28xx_stop_feed()
278 dvb->nfeeds--; in em28xx_stop_feed()
280 if (!dvb->nfeeds) in em28xx_stop_feed()
281 err = em28xx_stop_streaming(dvb); in em28xx_stop_feed()
283 mutex_unlock(&dvb->lock); in em28xx_stop_feed()
290 struct em28xx_i2c_bus *i2c_bus = fe->dvb->priv; in em28xx_dvb_bus_ctrl()
451 struct em28xx_dvb *dvb = fe->sec_priv; in drxk_gate_ctrl() local
454 if (!dvb) in drxk_gate_ctrl()
458 down(&dvb->pll_mutex); in drxk_gate_ctrl()
459 status = dvb->gate_ctrl(fe, 1); in drxk_gate_ctrl()
461 status = dvb->gate_ctrl(fe, 0); in drxk_gate_ctrl()
462 up(&dvb->pll_mutex); in drxk_gate_ctrl()
728 struct em28xx_i2c_bus *i2c_bus = fe->dvb->priv; in em28xx_pctv_290e_set_lna()
731 struct em28xx_dvb *dvb = dev->dvb; in em28xx_pctv_290e_set_lna() local
740 ret = gpio_request_one(dvb->lna_gpio, flags, NULL); in em28xx_pctv_290e_set_lna()
744 gpio_free(dvb->lna_gpio); in em28xx_pctv_290e_set_lna()
757 struct em28xx_i2c_bus *i2c_bus = fe->dvb->priv; in em28xx_pctv_292e_set_lna()
842 dev->dvb->i2c_client_demod->addr = 0x14; in px_bcud_init()
844 i2c_master_send(dev->dvb->i2c_client_demod, in px_bcud_init()
847 dev->dvb->i2c_client_demod->addr = 0x15; in px_bcud_init()
849 i2c_master_send(dev->dvb->i2c_client_demod, regs2[i].r, in px_bcud_init()
952 if (!dev->dvb->fe[0]) { in em28xx_attach_xc3028()
958 fe = dvb_attach(xc2028_attach, dev->dvb->fe[0], &cfg); in em28xx_attach_xc3028()
961 dvb_frontend_detach(dev->dvb->fe[0]); in em28xx_attach_xc3028()
962 dev->dvb->fe[0] = NULL; in em28xx_attach_xc3028()
973 static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, in em28xx_register_dvb() argument
979 mutex_init(&dvb->lock); in em28xx_register_dvb()
982 result = dvb_register_adapter(&dvb->adapter, in em28xx_register_dvb()
992 dvb->adapter.mdev = dev->media_dev; in em28xx_register_dvb()
996 dvb->fe[0]->ops.ts_bus_ctrl = em28xx_dvb_bus_ctrl; in em28xx_register_dvb()
997 if (dvb->fe[1]) in em28xx_register_dvb()
998 dvb->fe[1]->ops.ts_bus_ctrl = em28xx_dvb_bus_ctrl; in em28xx_register_dvb()
1000 dvb->adapter.priv = &dev->i2c_bus[dev->def_i2c_bus]; in em28xx_register_dvb()
1003 result = dvb_register_frontend(&dvb->adapter, dvb->fe[0]); in em28xx_register_dvb()
1012 if (dvb->fe[1]) { in em28xx_register_dvb()
1013 result = dvb_register_frontend(&dvb->adapter, dvb->fe[1]); in em28xx_register_dvb()
1023 dvb->demux.dmx.capabilities = in em28xx_register_dvb()
1026 dvb->demux.priv = dvb; in em28xx_register_dvb()
1027 dvb->demux.filternum = 256; in em28xx_register_dvb()
1028 dvb->demux.feednum = 256; in em28xx_register_dvb()
1029 dvb->demux.start_feed = em28xx_start_feed; in em28xx_register_dvb()
1030 dvb->demux.stop_feed = em28xx_stop_feed; in em28xx_register_dvb()
1032 result = dvb_dmx_init(&dvb->demux); in em28xx_register_dvb()
1040 dvb->dmxdev.filternum = 256; in em28xx_register_dvb()
1041 dvb->dmxdev.demux = &dvb->demux.dmx; in em28xx_register_dvb()
1042 dvb->dmxdev.capabilities = 0; in em28xx_register_dvb()
1043 result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter); in em28xx_register_dvb()
1051 dvb->fe_hw.source = DMX_FRONTEND_0; in em28xx_register_dvb()
1052 result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw); in em28xx_register_dvb()
1060 dvb->fe_mem.source = DMX_MEMORY_FE; in em28xx_register_dvb()
1061 result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem); in em28xx_register_dvb()
1069 result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw); in em28xx_register_dvb()
1078 dvb_net_init(&dvb->adapter, &dvb->net, &dvb->demux.dmx); in em28xx_register_dvb()
1084 result = dvb_create_media_graph(&dvb->adapter, create_rf_connector); in em28xx_register_dvb()
1091 dvb_net_release(&dvb->net); in em28xx_register_dvb()
1093 dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_mem); in em28xx_register_dvb()
1095 dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_hw); in em28xx_register_dvb()
1097 dvb_dmxdev_release(&dvb->dmxdev); in em28xx_register_dvb()
1099 dvb_dmx_release(&dvb->demux); in em28xx_register_dvb()
1101 if (dvb->fe[1]) in em28xx_register_dvb()
1102 dvb_unregister_frontend(dvb->fe[1]); in em28xx_register_dvb()
1103 dvb_unregister_frontend(dvb->fe[0]); in em28xx_register_dvb()
1105 if (dvb->fe[1]) in em28xx_register_dvb()
1106 dvb_frontend_detach(dvb->fe[1]); in em28xx_register_dvb()
1108 dvb_frontend_detach(dvb->fe[0]); in em28xx_register_dvb()
1109 dvb_unregister_adapter(&dvb->adapter); in em28xx_register_dvb()
1114 static void em28xx_unregister_dvb(struct em28xx_dvb *dvb) in em28xx_unregister_dvb() argument
1116 dvb_net_release(&dvb->net); in em28xx_unregister_dvb()
1117 dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_mem); in em28xx_unregister_dvb()
1118 dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_hw); in em28xx_unregister_dvb()
1119 dvb_dmxdev_release(&dvb->dmxdev); in em28xx_unregister_dvb()
1120 dvb_dmx_release(&dvb->demux); in em28xx_unregister_dvb()
1121 if (dvb->fe[1]) in em28xx_unregister_dvb()
1122 dvb_unregister_frontend(dvb->fe[1]); in em28xx_unregister_dvb()
1123 dvb_unregister_frontend(dvb->fe[0]); in em28xx_unregister_dvb()
1124 if (dvb->fe[1] && !dvb->dont_attach_fe1) in em28xx_unregister_dvb()
1125 dvb_frontend_detach(dvb->fe[1]); in em28xx_unregister_dvb()
1126 dvb_frontend_detach(dvb->fe[0]); in em28xx_unregister_dvb()
1127 dvb_unregister_adapter(&dvb->adapter); in em28xx_unregister_dvb()
1132 struct em28xx_dvb *dvb = dev->dvb; in em28174_dvb_init_pctv_460e() local
1143 dvb->i2c_client_demod = dvb_module_probe("tda10071", "tda10071_cx24118", in em28174_dvb_init_pctv_460e()
1146 if (!dvb->i2c_client_demod) in em28174_dvb_init_pctv_460e()
1149 dvb->fe[0] = tda10071_pdata.get_dvb_frontend(dvb->i2c_client_demod); in em28174_dvb_init_pctv_460e()
1152 a8293_pdata.dvb_frontend = dvb->fe[0]; in em28174_dvb_init_pctv_460e()
1154 dvb->i2c_client_sec = dvb_module_probe("a8293", NULL, in em28174_dvb_init_pctv_460e()
1157 if (!dvb->i2c_client_sec) { in em28174_dvb_init_pctv_460e()
1158 dvb_module_release(dvb->i2c_client_demod); in em28174_dvb_init_pctv_460e()
1167 struct em28xx_dvb *dvb = dev->dvb; in em28178_dvb_init_pctv_461e() local
1181 dvb->i2c_client_demod = dvb_module_probe("m88ds3103", NULL, in em28178_dvb_init_pctv_461e()
1184 if (!dvb->i2c_client_demod) in em28178_dvb_init_pctv_461e()
1187 dvb->fe[0] = m88ds3103_pdata.get_dvb_frontend(dvb->i2c_client_demod); in em28178_dvb_init_pctv_461e()
1188 i2c_adapter = m88ds3103_pdata.get_i2c_adapter(dvb->i2c_client_demod); in em28178_dvb_init_pctv_461e()
1191 ts2020_config.fe = dvb->fe[0]; in em28178_dvb_init_pctv_461e()
1193 dvb->i2c_client_tuner = dvb_module_probe("ts2020", "ts2022", in em28178_dvb_init_pctv_461e()
1196 if (!dvb->i2c_client_tuner) { in em28178_dvb_init_pctv_461e()
1197 dvb_module_release(dvb->i2c_client_demod); in em28178_dvb_init_pctv_461e()
1202 dvb->fe[0]->ops.read_signal_strength = in em28178_dvb_init_pctv_461e()
1203 dvb->fe[0]->ops.tuner_ops.get_rf_strength; in em28178_dvb_init_pctv_461e()
1206 a8293_pdata.dvb_frontend = dvb->fe[0]; in em28178_dvb_init_pctv_461e()
1213 dvb->i2c_client_sec = dvb_module_probe("a8293", NULL, in em28178_dvb_init_pctv_461e()
1216 if (!dvb->i2c_client_sec) { in em28178_dvb_init_pctv_461e()
1217 dvb_module_release(dvb->i2c_client_tuner); in em28178_dvb_init_pctv_461e()
1218 dvb_module_release(dvb->i2c_client_demod); in em28178_dvb_init_pctv_461e()
1227 struct em28xx_dvb *dvb = dev->dvb; in em28178_dvb_init_pctv_461e_v2() local
1242 dvb->i2c_client_demod = dvb_module_probe("m88ds3103", "m88ds3103b", in em28178_dvb_init_pctv_461e_v2()
1246 if (!dvb->i2c_client_demod) in em28178_dvb_init_pctv_461e_v2()
1249 dvb->fe[0] = m88ds3103_pdata.get_dvb_frontend(dvb->i2c_client_demod); in em28178_dvb_init_pctv_461e_v2()
1250 i2c_adapter = m88ds3103_pdata.get_i2c_adapter(dvb->i2c_client_demod); in em28178_dvb_init_pctv_461e_v2()
1253 ts2020_config.fe = dvb->fe[0]; in em28178_dvb_init_pctv_461e_v2()
1254 dvb->i2c_client_tuner = dvb_module_probe("ts2020", "ts2022", in em28178_dvb_init_pctv_461e_v2()
1257 if (!dvb->i2c_client_tuner) { in em28178_dvb_init_pctv_461e_v2()
1258 dvb_module_release(dvb->i2c_client_demod); in em28178_dvb_init_pctv_461e_v2()
1263 dvb->fe[0]->ops.read_signal_strength = in em28178_dvb_init_pctv_461e_v2()
1264 dvb->fe[0]->ops.tuner_ops.get_rf_strength; in em28178_dvb_init_pctv_461e_v2()
1267 a8293_pdata.dvb_frontend = dvb->fe[0]; in em28178_dvb_init_pctv_461e_v2()
1268 dvb->i2c_client_sec = dvb_module_probe("a8293", NULL, in em28178_dvb_init_pctv_461e_v2()
1271 if (!dvb->i2c_client_sec) { in em28178_dvb_init_pctv_461e_v2()
1272 dvb_module_release(dvb->i2c_client_tuner); in em28178_dvb_init_pctv_461e_v2()
1273 dvb_module_release(dvb->i2c_client_demod); in em28178_dvb_init_pctv_461e_v2()
1282 struct em28xx_dvb *dvb = dev->dvb; in em28178_dvb_init_pctv_292e() local
1289 si2168_config.fe = &dvb->fe[0]; in em28178_dvb_init_pctv_292e()
1293 dvb->i2c_client_demod = dvb_module_probe("si2168", NULL, in em28178_dvb_init_pctv_292e()
1296 if (!dvb->i2c_client_demod) in em28178_dvb_init_pctv_292e()
1300 si2157_config.fe = dvb->fe[0]; in em28178_dvb_init_pctv_292e()
1305 dvb->i2c_client_tuner = dvb_module_probe("si2157", NULL, in em28178_dvb_init_pctv_292e()
1308 if (!dvb->i2c_client_tuner) { in em28178_dvb_init_pctv_292e()
1309 dvb_module_release(dvb->i2c_client_demod); in em28178_dvb_init_pctv_292e()
1312 dvb->fe[0]->ops.set_lna = em28xx_pctv_292e_set_lna; in em28178_dvb_init_pctv_292e()
1319 struct em28xx_dvb *dvb = dev->dvb; in em28178_dvb_init_terratec_t2_stick_hd() local
1326 si2168_config.fe = &dvb->fe[0]; in em28178_dvb_init_terratec_t2_stick_hd()
1329 dvb->i2c_client_demod = dvb_module_probe("si2168", NULL, in em28178_dvb_init_terratec_t2_stick_hd()
1332 if (!dvb->i2c_client_demod) in em28178_dvb_init_terratec_t2_stick_hd()
1337 si2157_config.fe = dvb->fe[0]; in em28178_dvb_init_terratec_t2_stick_hd()
1342 dvb->i2c_client_tuner = dvb_module_probe("si2157", "si2146", in em28178_dvb_init_terratec_t2_stick_hd()
1345 if (!dvb->i2c_client_tuner) { in em28178_dvb_init_terratec_t2_stick_hd()
1346 dvb_module_release(dvb->i2c_client_demod); in em28178_dvb_init_terratec_t2_stick_hd()
1355 struct em28xx_dvb *dvb = dev->dvb; in em28178_dvb_init_plex_px_bcud() local
1360 dvb->i2c_client_demod = dvb_module_probe("tc90522", "tc90522sat", in em28178_dvb_init_plex_px_bcud()
1363 if (!dvb->i2c_client_demod) in em28178_dvb_init_plex_px_bcud()
1370 dvb->i2c_client_tuner = dvb_module_probe("qm1d1c0042", NULL, in em28178_dvb_init_plex_px_bcud()
1373 if (!dvb->i2c_client_tuner) { in em28178_dvb_init_plex_px_bcud()
1374 dvb_module_release(dvb->i2c_client_demod); in em28178_dvb_init_plex_px_bcud()
1378 dvb->fe[0] = tc90522_config.fe; in em28178_dvb_init_plex_px_bcud()
1386 struct em28xx_dvb *dvb = dev->dvb; in em28174_dvb_init_hauppauge_wintv_dualhd_dvb() local
1394 si2168_config.fe = &dvb->fe[0]; in em28174_dvb_init_hauppauge_wintv_dualhd_dvb()
1399 dvb->i2c_client_demod = dvb_module_probe("si2168", NULL, in em28174_dvb_init_hauppauge_wintv_dualhd_dvb()
1402 if (!dvb->i2c_client_demod) in em28174_dvb_init_hauppauge_wintv_dualhd_dvb()
1407 si2157_config.fe = dvb->fe[0]; in em28174_dvb_init_hauppauge_wintv_dualhd_dvb()
1414 dvb->i2c_client_tuner = dvb_module_probe("si2157", NULL, in em28174_dvb_init_hauppauge_wintv_dualhd_dvb()
1417 if (!dvb->i2c_client_tuner) { in em28174_dvb_init_hauppauge_wintv_dualhd_dvb()
1418 dvb_module_release(dvb->i2c_client_demod); in em28174_dvb_init_hauppauge_wintv_dualhd_dvb()
1427 struct em28xx_dvb *dvb = dev->dvb; in em28174_dvb_init_hauppauge_wintv_dualhd_01595() local
1435 lgdt3306a_config.fe = &dvb->fe[0]; in em28174_dvb_init_hauppauge_wintv_dualhd_01595()
1439 dvb->i2c_client_demod = dvb_module_probe("lgdt3306a", NULL, in em28174_dvb_init_hauppauge_wintv_dualhd_01595()
1442 if (!dvb->i2c_client_demod) in em28174_dvb_init_hauppauge_wintv_dualhd_01595()
1446 si2157_config.fe = dvb->fe[0]; in em28174_dvb_init_hauppauge_wintv_dualhd_01595()
1454 dvb->i2c_client_tuner = dvb_module_probe("si2157", NULL, in em28174_dvb_init_hauppauge_wintv_dualhd_01595()
1457 if (!dvb->i2c_client_tuner) { in em28174_dvb_init_hauppauge_wintv_dualhd_01595()
1458 dvb_module_release(dvb->i2c_client_demod); in em28174_dvb_init_hauppauge_wintv_dualhd_01595()
1467 struct em28xx_dvb *dvb = dev->dvb; in em2874_dvb_init_hauppauge_usb_quadhd() local
1473 mxl692_config.fe = &dvb->fe[0]; in em2874_dvb_init_hauppauge_usb_quadhd()
1476 dvb->i2c_client_demod = dvb_module_probe("mxl692", NULL, in em2874_dvb_init_hauppauge_usb_quadhd()
1479 if (!dvb->i2c_client_demod) in em2874_dvb_init_hauppauge_usb_quadhd()
1488 struct em28xx_dvb *dvb; in em28xx_dvb_init() local
1503 dvb = kzalloc(sizeof(*dvb), GFP_KERNEL); in em28xx_dvb_init()
1504 if (!dvb) in em28xx_dvb_init()
1507 dev->dvb = dvb; in em28xx_dvb_init()
1508 dvb->fe[0] = NULL; in em28xx_dvb_init()
1509 dvb->fe[1] = NULL; in em28xx_dvb_init()
1528 kfree(dvb); in em28xx_dvb_init()
1529 dev->dvb = NULL; in em28xx_dvb_init()
1538 dvb->fe[0] = dvb_attach(s921_attach, in em28xx_dvb_init()
1542 if (!dvb->fe[0]) { in em28xx_dvb_init()
1552 dvb->fe[0] = dvb_attach(lgdt330x_attach, in em28xx_dvb_init()
1562 dvb->fe[0] = dvb_attach(zl10353_attach, in em28xx_dvb_init()
1574 dvb->fe[0] = dvb_attach(zl10353_attach, in em28xx_dvb_init()
1591 dvb->fe[0] = dvb_attach(zl10353_attach, in em28xx_dvb_init()
1594 if (!dvb->fe[0]) in em28xx_dvb_init()
1595 dvb->fe[0] = dvb_attach(mt352_attach, in em28xx_dvb_init()
1605 dvb->fe[0] = dvb_attach(zl10353_attach, in em28xx_dvb_init()
1608 if (dvb->fe[0]) { in em28xx_dvb_init()
1609 dvb_attach(mt2060_attach, dvb->fe[0], in em28xx_dvb_init()
1615 dvb->fe[0] = dvb_attach(zl10353_attach, in em28xx_dvb_init()
1618 if (dvb->fe[0]) in em28xx_dvb_init()
1619 dvb_attach(qt1010_attach, dvb->fe[0], in em28xx_dvb_init()
1625 dvb->fe[0] = dvb_attach(s5h1409_attach, in em28xx_dvb_init()
1634 dvb->fe[0] = dvb_attach(lgdt330x_attach, in em28xx_dvb_init()
1638 if (dvb->fe[0]) { in em28xx_dvb_init()
1639 if (!dvb_attach(simple_tuner_attach, dvb->fe[0], in em28xx_dvb_init()
1649 dvb->fe[0] = dvb_attach(drxd_attach, &em28xx_drxd, NULL, in em28xx_dvb_init()
1659 dvb->fe[0] = dvb_attach(tda10023_attach, in em28xx_dvb_init()
1663 if (dvb->fe[0]) { in em28xx_dvb_init()
1664 if (!dvb_attach(simple_tuner_attach, dvb->fe[0], in em28xx_dvb_init()
1673 dvb->fe[0] = dvb_attach(lgdt3305_attach, in em28xx_dvb_init()
1676 if (!dvb->fe[0]) { in em28xx_dvb_init()
1680 if (!dvb_attach(tda18271_attach, dvb->fe[0], 0x60, in em28xx_dvb_init()
1683 dvb_frontend_detach(dvb->fe[0]); in em28xx_dvb_init()
1690 dvb->lna_gpio = CXD2820R_GPIO_E | CXD2820R_GPIO_O | in em28xx_dvb_init()
1692 dvb->fe[0] = dvb_attach(cxd2820r_attach, in em28xx_dvb_init()
1695 &dvb->lna_gpio); in em28xx_dvb_init()
1696 if (dvb->fe[0]) { in em28xx_dvb_init()
1699 dvb->fe[0], in em28xx_dvb_init()
1703 dvb_frontend_detach(dvb->fe[0]); in em28xx_dvb_init()
1710 result = gpio_request_one(dvb->lna_gpio, in em28xx_dvb_init()
1717 gpio_free(dvb->lna_gpio); in em28xx_dvb_init()
1721 dvb->fe[0]->ops.set_lna = em28xx_pctv_290e_set_lna; in em28xx_dvb_init()
1731 dvb->fe[0] = dvb_attach(drxk_attach, in em28xx_dvb_init()
1734 if (!dvb->fe[0]) { in em28xx_dvb_init()
1739 dvb->fe[0]->sec_priv = dvb; in em28xx_dvb_init()
1740 sema_init(&dvb->pll_mutex, 1); in em28xx_dvb_init()
1741 dvb->gate_ctrl = dvb->fe[0]->ops.i2c_gate_ctrl; in em28xx_dvb_init()
1742 dvb->fe[0]->ops.i2c_gate_ctrl = drxk_gate_ctrl; in em28xx_dvb_init()
1748 if (dvb->fe[0]->ops.i2c_gate_ctrl) in em28xx_dvb_init()
1749 dvb->fe[0]->ops.i2c_gate_ctrl(dvb->fe[0], 1); in em28xx_dvb_init()
1750 if (!dvb_attach(xc5000_attach, dvb->fe[0], in em28xx_dvb_init()
1755 if (dvb->fe[0]->ops.i2c_gate_ctrl) in em28xx_dvb_init()
1756 dvb->fe[0]->ops.i2c_gate_ctrl(dvb->fe[0], 0); in em28xx_dvb_init()
1763 dvb->fe[0] = dvb_attach(drxk_attach, &terratec_h5_drxk, in em28xx_dvb_init()
1765 if (!dvb->fe[0]) { in em28xx_dvb_init()
1770 dvb->fe[0]->sec_priv = dvb; in em28xx_dvb_init()
1771 sema_init(&dvb->pll_mutex, 1); in em28xx_dvb_init()
1772 dvb->gate_ctrl = dvb->fe[0]->ops.i2c_gate_ctrl; in em28xx_dvb_init()
1773 dvb->fe[0]->ops.i2c_gate_ctrl = drxk_gate_ctrl; in em28xx_dvb_init()
1776 if (dvb->fe[0]->ops.i2c_gate_ctrl) in em28xx_dvb_init()
1777 dvb->fe[0]->ops.i2c_gate_ctrl(dvb->fe[0], 1); in em28xx_dvb_init()
1778 if (!dvb_attach(tda18271c2dd_attach, dvb->fe[0], in em28xx_dvb_init()
1783 if (dvb->fe[0]->ops.i2c_gate_ctrl) in em28xx_dvb_init()
1784 dvb->fe[0]->ops.i2c_gate_ctrl(dvb->fe[0], 0); in em28xx_dvb_init()
1788 dvb->fe[0] = dvb_attach(mb86a20s_attach, in em28xx_dvb_init()
1791 if (dvb->fe[0]) in em28xx_dvb_init()
1792 dvb_attach(tda18271_attach, dvb->fe[0], 0x60, in em28xx_dvb_init()
1804 dvb->fe[0] = dvb_attach(drxk_attach, &maxmedia_ub425_tc_drxk, in em28xx_dvb_init()
1807 if (dvb->fe[0]) { in em28xx_dvb_init()
1809 dvb->fe[0]->ops.i2c_gate_ctrl = NULL; in em28xx_dvb_init()
1812 if (!dvb_attach(tda18271_attach, dvb->fe[0], 0x60, in em28xx_dvb_init()
1815 dvb_frontend_detach(dvb->fe[0]); in em28xx_dvb_init()
1826 dvb->fe[0] = dvb_attach(drxk_attach, &pctv_520e_drxk, in em28xx_dvb_init()
1829 if (dvb->fe[0]) { in em28xx_dvb_init()
1831 if (!dvb_attach(tda18271_attach, dvb->fe[0], 0x60, in em28xx_dvb_init()
1834 dvb_frontend_detach(dvb->fe[0]); in em28xx_dvb_init()
1846 dvb->fe[0] = dvb_attach(drxk_attach, &terratec_htc_stick_drxk, in em28xx_dvb_init()
1848 if (!dvb->fe[0]) { in em28xx_dvb_init()
1854 if (!dvb_attach(tda18271_attach, dvb->fe[0], 0x60, in em28xx_dvb_init()
1865 dvb->fe[0] = dvb_attach(drxk_attach, &terratec_htc_stick_drxk, in em28xx_dvb_init()
1867 if (!dvb->fe[0]) { in em28xx_dvb_init()
1873 if (!dvb_attach(tda18271_attach, dvb->fe[0], 0x60, in em28xx_dvb_init()
1881 dvb->fe[0] = dvb_attach(lgdt3305_attach, in em28xx_dvb_init()
1884 if (!dvb->fe[0]) { in em28xx_dvb_init()
1890 if (!dvb_attach(tda18271_attach, dvb->fe[0], 0x60, in em28xx_dvb_init()
1901 dvb->fe[0] = dvb_attach(lgdt3305_attach, in em28xx_dvb_init()
1904 if (!dvb->fe[0]) { in em28xx_dvb_init()
1910 kworld_ub435q_v3_config.fe = dvb->fe[0]; in em28xx_dvb_init()
1912 dvb->i2c_client_tuner = dvb_module_probe("tda18212", NULL, in em28xx_dvb_init()
1915 if (!dvb->i2c_client_tuner) { in em28xx_dvb_init()
1916 dvb_frontend_detach(dvb->fe[0]); in em28xx_dvb_init()
1923 dvb->fe[0] = dvb_attach(drx39xxj_attach, in em28xx_dvb_init()
1925 if (dvb->fe[0]) { in em28xx_dvb_init()
1926 dvb->fe[0] = dvb_attach(tda18271_attach, dvb->fe[0], in em28xx_dvb_init()
1930 if (!dvb->fe[0]) { in em28xx_dvb_init()
1981 if (!dvb->fe[0]) { in em28xx_dvb_init()
1987 dvb->fe[0]->callback = em28xx_tuner_callback; in em28xx_dvb_init()
1988 if (dvb->fe[1]) in em28xx_dvb_init()
1989 dvb->fe[1]->callback = em28xx_tuner_callback; in em28xx_dvb_init()
1992 result = em28xx_register_dvb(dvb, THIS_MODULE, dev, &dev->intf->dev); in em28xx_dvb_init()
2016 kfree(dvb); in em28xx_dvb_init()
2017 dev->dvb = NULL; in em28xx_dvb_init()
2030 struct em28xx_dvb *dvb; in em28xx_dvb_fini() local
2042 if (!dev->dvb) in em28xx_dvb_fini()
2047 dvb = dev->dvb; in em28xx_dvb_fini()
2056 if (dvb->fe[0]) { in em28xx_dvb_fini()
2057 prevent_sleep(&dvb->fe[0]->ops); in em28xx_dvb_fini()
2058 dvb->fe[0]->exit = DVB_FE_DEVICE_REMOVED; in em28xx_dvb_fini()
2060 if (dvb->fe[1]) { in em28xx_dvb_fini()
2061 prevent_sleep(&dvb->fe[1]->ops); in em28xx_dvb_fini()
2062 dvb->fe[1]->exit = DVB_FE_DEVICE_REMOVED; in em28xx_dvb_fini()
2066 em28xx_unregister_dvb(dvb); in em28xx_dvb_fini()
2069 dvb_module_release(dvb->i2c_client_sec); in em28xx_dvb_fini()
2070 dvb_module_release(dvb->i2c_client_tuner); in em28xx_dvb_fini()
2071 dvb_module_release(dvb->i2c_client_demod); in em28xx_dvb_fini()
2073 kfree(dvb); in em28xx_dvb_fini()
2074 dev->dvb = NULL; in em28xx_dvb_fini()
2091 if (dev->dvb) { in em28xx_dvb_suspend()
2092 struct em28xx_dvb *dvb = dev->dvb; in em28xx_dvb_suspend() local
2094 if (dvb->fe[0]) { in em28xx_dvb_suspend()
2095 ret = dvb_frontend_suspend(dvb->fe[0]); in em28xx_dvb_suspend()
2098 if (dvb->fe[1]) { in em28xx_dvb_suspend()
2099 dvb_frontend_suspend(dvb->fe[1]); in em28xx_dvb_suspend()
2118 if (dev->dvb) { in em28xx_dvb_resume()
2119 struct em28xx_dvb *dvb = dev->dvb; in em28xx_dvb_resume() local
2121 if (dvb->fe[0]) { in em28xx_dvb_resume()
2122 ret = dvb_frontend_resume(dvb->fe[0]); in em28xx_dvb_resume()
2126 if (dvb->fe[1]) { in em28xx_dvb_resume()
2127 ret = dvb_frontend_resume(dvb->fe[1]); in em28xx_dvb_resume()