Lines Matching refs:mantis

31 int mantis_frontend_power(struct mantis_pci *mantis, enum mantis_power power)  in mantis_frontend_power()  argument
33 struct mantis_hwconfig *config = mantis->hwconfig; in mantis_frontend_power()
38 mantis_gpio_set_bits(mantis, config->power, POWER_ON); in mantis_frontend_power()
40 mantis_gpio_set_bits(mantis, config->power, POWER_ON); in mantis_frontend_power()
46 mantis_gpio_set_bits(mantis, config->power, POWER_OFF); in mantis_frontend_power()
59 void mantis_frontend_soft_reset(struct mantis_pci *mantis) in mantis_frontend_soft_reset() argument
61 struct mantis_hwconfig *config = mantis->hwconfig; in mantis_frontend_soft_reset()
64 mantis_gpio_set_bits(mantis, config->reset, 0); in mantis_frontend_soft_reset()
66 mantis_gpio_set_bits(mantis, config->reset, 0); in mantis_frontend_soft_reset()
68 mantis_gpio_set_bits(mantis, config->reset, 1); in mantis_frontend_soft_reset()
70 mantis_gpio_set_bits(mantis, config->reset, 1); in mantis_frontend_soft_reset()
77 static int mantis_frontend_shutdown(struct mantis_pci *mantis) in mantis_frontend_shutdown() argument
81 mantis_frontend_soft_reset(mantis); in mantis_frontend_shutdown()
82 err = mantis_frontend_power(mantis, POWER_OFF); in mantis_frontend_shutdown()
94 struct mantis_pci *mantis = dvbdmx->priv; in mantis_dvb_start_feed() local
102 mantis->feeds++; in mantis_dvb_start_feed()
103 dprintk(MANTIS_DEBUG, 1, "mantis start feed, feeds=%d", mantis->feeds); in mantis_dvb_start_feed()
105 if (mantis->feeds == 1) { in mantis_dvb_start_feed()
107 mantis_dma_start(mantis); in mantis_dvb_start_feed()
108 enable_and_queue_work(system_bh_wq, &mantis->bh_work); in mantis_dvb_start_feed()
111 return mantis->feeds; in mantis_dvb_start_feed()
117 struct mantis_pci *mantis = dvbdmx->priv; in mantis_dvb_stop_feed() local
125 mantis->feeds--; in mantis_dvb_stop_feed()
126 if (mantis->feeds == 0) { in mantis_dvb_stop_feed()
128 disable_work_sync(&mantis->bh_work); in mantis_dvb_stop_feed()
129 mantis_dma_stop(mantis); in mantis_dvb_stop_feed()
135 int mantis_dvb_init(struct mantis_pci *mantis) in mantis_dvb_init() argument
137 struct mantis_hwconfig *config = mantis->hwconfig; in mantis_dvb_init()
142 result = dvb_register_adapter(&mantis->dvb_adapter, in mantis_dvb_init()
145 &mantis->pdev->dev, in mantis_dvb_init()
154 mantis->dvb_adapter.priv = mantis; in mantis_dvb_init()
155 mantis->demux.dmx.capabilities = DMX_TS_FILTERING | in mantis_dvb_init()
159 mantis->demux.priv = mantis; in mantis_dvb_init()
160 mantis->demux.filternum = 256; in mantis_dvb_init()
161 mantis->demux.feednum = 256; in mantis_dvb_init()
162 mantis->demux.start_feed = mantis_dvb_start_feed; in mantis_dvb_init()
163 mantis->demux.stop_feed = mantis_dvb_stop_feed; in mantis_dvb_init()
164 mantis->demux.write_to_decoder = NULL; in mantis_dvb_init()
167 result = dvb_dmx_init(&mantis->demux); in mantis_dvb_init()
174 mantis->dmxdev.filternum = 256; in mantis_dvb_init()
175 mantis->dmxdev.demux = &mantis->demux.dmx; in mantis_dvb_init()
176 mantis->dmxdev.capabilities = 0; in mantis_dvb_init()
179 result = dvb_dmxdev_init(&mantis->dmxdev, &mantis->dvb_adapter); in mantis_dvb_init()
186 mantis->fe_hw.source = DMX_FRONTEND_0; in mantis_dvb_init()
187 result = mantis->demux.dmx.add_frontend(&mantis->demux.dmx, &mantis->fe_hw); in mantis_dvb_init()
194 mantis->fe_mem.source = DMX_MEMORY_FE; in mantis_dvb_init()
195 result = mantis->demux.dmx.add_frontend(&mantis->demux.dmx, &mantis->fe_mem); in mantis_dvb_init()
201 result = mantis->demux.dmx.connect_frontend(&mantis->demux.dmx, &mantis->fe_hw); in mantis_dvb_init()
207 dvb_net_init(&mantis->dvb_adapter, &mantis->dvbnet, &mantis->demux.dmx); in mantis_dvb_init()
208 INIT_WORK(&mantis->bh_work, mantis_dma_xfer); in mantis_dvb_init()
209 disable_work_sync(&mantis->bh_work); in mantis_dvb_init()
210 if (mantis->hwconfig) { in mantis_dvb_init()
211 result = config->frontend_init(mantis, mantis->fe); in mantis_dvb_init()
216 if (mantis->fe == NULL) { in mantis_dvb_init()
221 result = dvb_register_frontend(&mantis->dvb_adapter, mantis->fe); in mantis_dvb_init()
225 if (mantis->fe->ops.release) in mantis_dvb_init()
226 mantis->fe->ops.release(mantis->fe); in mantis_dvb_init()
228 mantis->fe = NULL; in mantis_dvb_init()
238 cancel_work_sync(&mantis->bh_work); in mantis_dvb_init()
239 dvb_net_release(&mantis->dvbnet); in mantis_dvb_init()
240 if (mantis->fe) { in mantis_dvb_init()
241 dvb_unregister_frontend(mantis->fe); in mantis_dvb_init()
242 dvb_frontend_detach(mantis->fe); in mantis_dvb_init()
245 mantis->demux.dmx.remove_frontend(&mantis->demux.dmx, &mantis->fe_mem); in mantis_dvb_init()
248 mantis->demux.dmx.remove_frontend(&mantis->demux.dmx, &mantis->fe_hw); in mantis_dvb_init()
251 dvb_dmxdev_release(&mantis->dmxdev); in mantis_dvb_init()
254 dvb_dmx_release(&mantis->demux); in mantis_dvb_init()
257 dvb_unregister_adapter(&mantis->dvb_adapter); in mantis_dvb_init()
263 int mantis_dvb_exit(struct mantis_pci *mantis) in mantis_dvb_exit() argument
267 if (mantis->fe) { in mantis_dvb_exit()
269 err = mantis_frontend_shutdown(mantis); in mantis_dvb_exit()
272 dvb_unregister_frontend(mantis->fe); in mantis_dvb_exit()
273 dvb_frontend_detach(mantis->fe); in mantis_dvb_exit()
276 cancel_work_sync(&mantis->bh_work); in mantis_dvb_exit()
277 dvb_net_release(&mantis->dvbnet); in mantis_dvb_exit()
279 mantis->demux.dmx.remove_frontend(&mantis->demux.dmx, &mantis->fe_mem); in mantis_dvb_exit()
280 mantis->demux.dmx.remove_frontend(&mantis->demux.dmx, &mantis->fe_hw); in mantis_dvb_exit()
282 dvb_dmxdev_release(&mantis->dmxdev); in mantis_dvb_exit()
283 dvb_dmx_release(&mantis->demux); in mantis_dvb_exit()
286 dvb_unregister_adapter(&mantis->dvb_adapter); in mantis_dvb_exit()