Lines Matching refs:dev
100 struct au0828_dev *dev = from_timer(dev, t, bulk_timeout); in au0828_bulk_timeout() local
103 dev->bulk_timeout_running = 0; in au0828_bulk_timeout()
104 schedule_work(&dev->restart_streaming); in au0828_bulk_timeout()
110 struct au0828_dev *dev = purb->context; in urb_completion() local
116 if (!dev) { in urb_completion()
121 if (!dev->urb_streaming) { in urb_completion()
138 schedule_work(&dev->restart_streaming); in urb_completion()
140 } else if (dev->bulk_timeout_running == 1) { in urb_completion()
145 dev->bulk_timeout_running = 0; in urb_completion()
146 del_timer(&dev->bulk_timeout); in urb_completion()
150 dvb_dmx_swfilter_packets(&dev->dvb.demux, in urb_completion()
160 static int stop_urb_transfer(struct au0828_dev *dev) in stop_urb_transfer() argument
166 if (!dev->urb_streaming) in stop_urb_transfer()
169 if (dev->bulk_timeout_running == 1) { in stop_urb_transfer()
170 dev->bulk_timeout_running = 0; in stop_urb_transfer()
171 del_timer(&dev->bulk_timeout); in stop_urb_transfer()
174 dev->urb_streaming = false; in stop_urb_transfer()
176 if (dev->urbs[i]) { in stop_urb_transfer()
177 usb_kill_urb(dev->urbs[i]); in stop_urb_transfer()
179 kfree(dev->urbs[i]->transfer_buffer); in stop_urb_transfer()
181 usb_free_urb(dev->urbs[i]); in stop_urb_transfer()
188 static int start_urb_transfer(struct au0828_dev *dev) in start_urb_transfer() argument
195 if (dev->urb_streaming) { in start_urb_transfer()
202 dev->urbs[i] = usb_alloc_urb(0, GFP_KERNEL); in start_urb_transfer()
203 if (!dev->urbs[i]) in start_urb_transfer()
206 purb = dev->urbs[i]; in start_urb_transfer()
209 purb->transfer_buffer = dev->dig_transfer_buffer[i]; in start_urb_transfer()
216 dev->urbs[i] = NULL; in start_urb_transfer()
225 dev->usbdev, in start_urb_transfer()
226 usb_rcvbulkpipe(dev->usbdev, in start_urb_transfer()
231 dev); in start_urb_transfer()
236 ret = usb_submit_urb(dev->urbs[i], GFP_ATOMIC); in start_urb_transfer()
238 stop_urb_transfer(dev); in start_urb_transfer()
245 dev->urb_streaming = true; in start_urb_transfer()
248 mod_timer(&dev->bulk_timeout, jiffies + (HZ)); in start_urb_transfer()
249 dev->bulk_timeout_running = 1; in start_urb_transfer()
254 static void au0828_start_transport(struct au0828_dev *dev) in au0828_start_transport() argument
256 au0828_write(dev, 0x608, 0x90); in au0828_start_transport()
257 au0828_write(dev, 0x609, 0x72); in au0828_start_transport()
258 au0828_write(dev, 0x60a, 0x71); in au0828_start_transport()
259 au0828_write(dev, 0x60b, 0x01); in au0828_start_transport()
263 static void au0828_stop_transport(struct au0828_dev *dev, int full_stop) in au0828_stop_transport() argument
266 au0828_write(dev, 0x608, 0x00); in au0828_stop_transport()
267 au0828_write(dev, 0x609, 0x00); in au0828_stop_transport()
268 au0828_write(dev, 0x60a, 0x00); in au0828_stop_transport()
270 au0828_write(dev, 0x60b, 0x00); in au0828_stop_transport()
276 struct au0828_dev *dev = demux->priv; in au0828_dvb_start_feed() local
277 struct au0828_dvb *dvb = &dev->dvb; in au0828_dvb_start_feed()
292 au0828_start_transport(dev); in au0828_dvb_start_feed()
293 ret = start_urb_transfer(dev); in au0828_dvb_start_feed()
295 au0828_stop_transport(dev, 0); in au0828_dvb_start_feed()
308 struct au0828_dev *dev = demux->priv; in au0828_dvb_stop_feed() local
309 struct au0828_dvb *dvb = &dev->dvb; in au0828_dvb_stop_feed()
315 cancel_work_sync(&dev->restart_streaming); in au0828_dvb_stop_feed()
325 ret = stop_urb_transfer(dev); in au0828_dvb_stop_feed()
326 au0828_stop_transport(dev, 0); in au0828_dvb_stop_feed()
337 struct au0828_dev *dev = container_of(work, struct au0828_dev, in au0828_restart_dvb_streaming() local
339 struct au0828_dvb *dvb = &dev->dvb; in au0828_restart_dvb_streaming()
341 if (!dev->urb_streaming) in au0828_restart_dvb_streaming()
349 stop_urb_transfer(dev); in au0828_restart_dvb_streaming()
350 au0828_stop_transport(dev, 1); in au0828_restart_dvb_streaming()
353 au0828_start_transport(dev); in au0828_restart_dvb_streaming()
354 start_urb_transfer(dev); in au0828_restart_dvb_streaming()
361 struct au0828_dev *dev = fe->dvb->priv; in au0828_set_frontend() local
362 struct au0828_dvb *dvb = &dev->dvb; in au0828_set_frontend()
366 was_streaming = dev->urb_streaming; in au0828_set_frontend()
368 au0828_stop_transport(dev, 1); in au0828_set_frontend()
375 cancel_work_sync(&dev->restart_streaming); in au0828_set_frontend()
378 stop_urb_transfer(dev); in au0828_set_frontend()
386 au0828_start_transport(dev); in au0828_set_frontend()
387 start_urb_transfer(dev); in au0828_set_frontend()
394 static int dvb_register(struct au0828_dev *dev) in dvb_register() argument
396 struct au0828_dvb *dvb = &dev->dvb; in dvb_register()
404 dev->dig_transfer_buffer[i] = kzalloc(URB_BUFSIZE, in dvb_register()
407 if (!dev->dig_transfer_buffer[i]) { in dvb_register()
417 INIT_WORK(&dev->restart_streaming, au0828_restart_dvb_streaming); in dvb_register()
422 &dev->usbdev->dev, adapter_nr); in dvb_register()
430 dvb->adapter.mdev = dev->media_dev; in dvb_register()
433 dvb->adapter.priv = dev; in dvb_register()
451 dvb->demux.priv = dev; in dvb_register()
525 kfree(dev->dig_transfer_buffer[i]); in dvb_register()
531 void au0828_dvb_unregister(struct au0828_dev *dev) in au0828_dvb_unregister() argument
533 struct au0828_dvb *dvb = &dev->dvb; in au0828_dvb_unregister()
540 cancel_work_sync(&dev->restart_streaming); in au0828_dvb_unregister()
554 kfree(dev->dig_transfer_buffer[i]); in au0828_dvb_unregister()
563 int au0828_dvb_register(struct au0828_dev *dev) in au0828_dvb_register() argument
565 struct au0828_dvb *dvb = &dev->dvb; in au0828_dvb_register()
571 switch (dev->boardnr) { in au0828_dvb_register()
576 &dev->i2c_adap); in au0828_dvb_register()
578 switch (dev->board.tuner_type) { in au0828_dvb_register()
582 &dev->i2c_adap, in au0828_dvb_register()
587 &dev->i2c_adap, in au0828_dvb_register()
595 &dev->i2c_adap); in au0828_dvb_register()
598 &dev->i2c_adap, 0x60, in au0828_dvb_register()
604 &dev->i2c_adap); in au0828_dvb_register()
607 0x60, &dev->i2c_adap, in au0828_dvb_register()
613 &dev->i2c_adap); in au0828_dvb_register()
616 &dev->i2c_adap, in au0828_dvb_register()
633 ret = dvb_register(dev); in au0828_dvb_register()
641 timer_setup(&dev->bulk_timeout, au0828_bulk_timeout, 0); in au0828_dvb_register()
646 void au0828_dvb_suspend(struct au0828_dev *dev) in au0828_dvb_suspend() argument
648 struct au0828_dvb *dvb = &dev->dvb; in au0828_dvb_suspend()
652 if (dev->urb_streaming) { in au0828_dvb_suspend()
653 cancel_work_sync(&dev->restart_streaming); in au0828_dvb_suspend()
656 stop_urb_transfer(dev); in au0828_dvb_suspend()
657 au0828_stop_transport(dev, 1); in au0828_dvb_suspend()
659 dev->need_urb_start = true; in au0828_dvb_suspend()
667 void au0828_dvb_resume(struct au0828_dev *dev) in au0828_dvb_resume() argument
669 struct au0828_dvb *dvb = &dev->dvb; in au0828_dvb_resume()
676 if (dev->need_urb_start) { in au0828_dvb_resume()
679 au0828_start_transport(dev); in au0828_dvb_resume()
680 start_urb_transfer(dev); in au0828_dvb_resume()