22 #include <linux/module.h>
23 #include <linux/slab.h>
25 #include <linux/device.h>
38 #define _AU0828_BULKPIPE 0x83
39 #define _BULKPIPESIZE 0xe522
41 static u8 hauppauge_hvr950q_led_states[] = {
48 .gpio_output = 0x00e0,
49 .gpio_output_enable = 0x6006,
50 .gpio_output_disable = 0x0660,
53 .led_states = hauppauge_hvr950q_led_states,
54 .num_led_states =
sizeof(hauppauge_hvr950q_led_states),
62 .demod_address = 0x8e >> 1,
66 .led_cfg = &hauppauge_hvr950q_led_cfg,
70 .demod_address = 0x8e >> 1,
77 .demod_address = 0x8e >> 1,
107 static void urb_completion(
struct urb *purb)
110 int ptype = usb_pipetype(purb->pipe);
113 dprintk(2,
"%s()\n", __func__);
121 if (ptype != PIPE_BULK) {
129 ptr = purb->transfer_buffer;
130 if (purb->actual_length > 0 && ptr[0] != 0x47) {
131 dprintk(1,
"Need to restart streaming %02x len=%d!\n",
132 ptr[0], purb->actual_length);
139 purb->transfer_buffer, purb->actual_length / 188);
148 static int stop_urb_transfer(
struct au0828_dev *dev)
152 dprintk(2,
"%s()\n", __func__);
164 static int start_urb_transfer(
struct au0828_dev *dev)
169 dprintk(2,
"%s()\n", __func__);
172 dprintk(2,
"%s: bulk xfer already running!\n", __func__);
185 if (!purb->transfer_buffer) {
192 usb_fill_bulk_urb(purb,
194 usb_rcvbulkpipe(dev->
usbdev,
196 purb->transfer_buffer,
206 stop_urb_transfer(dev);
208 "err = %d\n", __func__, ret);
227 dprintk(1,
"%s()\n", __func__);
229 if (!demux->
dmx.frontend)
234 if (
dvb->feeding++ == 0) {
240 ret = start_urb_transfer(dev);
255 dprintk(1,
"%s()\n", __func__);
259 if (--
dvb->feeding == 0) {
261 ret = stop_urb_transfer(dev);
280 dprintk(1,
"Restarting streaming...!\n");
285 ret = stop_urb_transfer(dev);
296 ret = start_urb_transfer(dev);
301 static int dvb_register(
struct au0828_dev *dev)
306 dprintk(1,
"%s()\n", __func__);
312 &dev->
usbdev->dev, adapter_nr);
329 dvb->
demux.dmx.capabilities =
333 dvb->
demux.filternum = 256;
334 dvb->
demux.feednum = 256;
335 dvb->
demux.start_feed = au0828_dvb_start_feed;
336 dvb->
demux.stop_feed = au0828_dvb_stop_feed;
344 dvb->
dmxdev.filternum = 256;
346 dvb->
dmxdev.capabilities = 0;
358 "(DMX_FRONTEND_0, errno = %d)\n",
DRIVER_NAME, result);
366 "(DMX_MEMORY_FE, errno = %d)\n",
DRIVER_NAME, result);
370 result = dvb->
demux.dmx.connect_frontend(&dvb->
demux.dmx, &dvb->
fe_hw);
402 dprintk(1,
"%s()\n", __func__);
426 dprintk(1,
"%s()\n", __func__);
433 &hauppauge_hvr950q_config,
436 switch (dev->
board.tuner_type) {
441 &hauppauge_xc5000a_config);
446 &hauppauge_xc5000c_config);
452 &hauppauge_hvr950q_config,
457 &mxl5007t_hvr950q_config);
461 &hauppauge_woodbury_config,
466 &hauppauge_woodbury_tunerconfig);
470 &fusionhdtv7usb_config,
475 &hauppauge_xc5000a_config);
480 "isn't supported yet\n");
492 ret = dvb_register(dev);