summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c')
-rw-r--r--linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c69
1 files changed, 54 insertions, 15 deletions
diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c
index 36aa76da1..031f4bd93 100644
--- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c
+++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c
@@ -80,15 +80,6 @@ int dibusb_interrupt_read_loop(struct usb_dibusb *dib)
return dibusb_write_usb(dib,b,1);
}
-/*
- * ioctl for power control
- */
-int dibusb_hw_sleep(struct usb_dibusb *dib)
-{
- u8 b[1] = { DIBUSB_IOCTL_POWER_SLEEP };
- return dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_POWER_MODE, b,1);
-}
-
#endif
static int dibusb_write_usb(struct usb_dibusb *dib, u8 *buf, u16 len)
{
@@ -112,10 +103,33 @@ static int dibusb_ioctl_cmd(struct usb_dibusb *dib, u8 cmd, u8 *param, int plen)
return dibusb_write_usb(dib,b,34); //2+size);
}
-int dibusb_hw_wakeup(struct usb_dibusb *dib)
+/*
+ * ioctl for power control
+ */
+int dibusb_hw_wakeup(struct dvb_frontend *fe)
{
+ struct usb_dibusb *dib = (struct usb_dibusb *) fe->dvb->priv;
u8 b[1] = { DIBUSB_IOCTL_POWER_WAKEUP };
- return dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_POWER_MODE, b,1);
+ deb_info("dibusb-device is getting up.\n");
+ dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_POWER_MODE, b,1);
+
+ if (dib->fe_init)
+ return dib->fe_init(fe);
+
+ return 0;
+}
+
+int dibusb_hw_sleep(struct dvb_frontend *fe)
+{
+ struct usb_dibusb *dib = (struct usb_dibusb *) fe->dvb->priv;
+ u8 b[1] = { DIBUSB_IOCTL_POWER_SLEEP };
+ deb_info("dibusb-device is going to bed.\n");
+ dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_POWER_MODE, b,1);
+
+ if (dib->fe_sleep)
+ return dib->fe_sleep(fe);
+
+ return 0;
}
int dibusb_set_streaming_mode(struct usb_dibusb *dib,u8 mode)
@@ -126,10 +140,20 @@ int dibusb_set_streaming_mode(struct usb_dibusb *dib,u8 mode)
int dibusb_streaming(struct usb_dibusb *dib,int onoff)
{
- if (onoff)
- return dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_ENABLE_STREAM,NULL,0);
- else
- return dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_DISABLE_STREAM,NULL,0);
+ switch (dib->dibdev->dev_cl->id) {
+ case DIBUSB2_0:
+ if (onoff)
+ return dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_ENABLE_STREAM,NULL,0);
+ else
+ return dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_DISABLE_STREAM,NULL,0);
+ break;
+ case UMT2_0:
+ return dibusb_set_streaming_mode(dib,onoff);
+ break;
+ default:
+ break;
+ }
+ return 0;
}
int dibusb_urb_init(struct usb_dibusb *dib)
@@ -185,6 +209,21 @@ int dibusb_urb_init(struct usb_dibusb *dib)
}
dib->init_state |= DIBUSB_STATE_URB_SUBMIT;
}
+
+
+ dib->pid_parse = 1;
+ switch (dib->dibdev->dev_cl->id) {
+ case DIBUSB2_0:
+ if (dib->udev->speed == USB_SPEED_HIGH && !pid_parse) {
+ dib->pid_parse = 0;
+ info("running at HIGH speed, will deliver the complete TS.");
+ } else
+ info("will use pid_parsing.");
+ break;
+ default:
+ break;
+ }
+
return 0;
}