Exemplo n.º 1
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");
    /* workaround, something is wrong, when dibusb 1.1 device are going to bed too late */
    switch (dib->dibdev->dev_cl->id) {
    case DIBUSB1_1:
    case NOVAT_USB2:
    case DTT200U:
        break;
    // Richard: @FIXME: should we need to power off there???
    // skip it at this first stage
    case CLASS_RTD2830:
    case CLASS_RTL2831U:
    case CLASS_RTL2830_GL861:
        break;
    default:
        dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_POWER_MODE, b,1);
        break;
    }
    if (dib->fe_sleep)
        return dib->fe_sleep(fe);

    return 0;
}
Exemplo n.º 2
0
int dibusb_streaming(struct usb_dibusb *dib,int onoff)
{
	if (onoff)
		dibusb_urb_submit(dib);
	else
		dibusb_urb_kill(dib);

	switch (dib->dibdev->dev_cl->id) {
		case DIBUSB2_0:
		case DIBUSB2_0B:
		case NOVAT_USB2:
		case UMT2_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;
		default:
			break;
	}
	return 0;
}
Exemplo n.º 3
0
/*
 * 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 };
	deb_info("dibusb-device is getting up.\n");

	switch (dib->dibdev->dev_cl->id) {
		case DTT200U:
			break;
		default:
			dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_POWER_MODE, b,1);
			break;
	}

	if (dib->fe_init)
		return dib->fe_init(fe);

	return 0;
}
Exemplo n.º 4
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");
	/* workaround, something is wrong, when dibusb 1.1 device are going to bed too late */
	switch (dib->dibdev->dev_cl->id) {
		case DIBUSB1_1:
		case NOVAT_USB2:
		case DTT200U:
			break;
		default:
			dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_POWER_MODE, b,1);
			break;
	}
	if (dib->fe_sleep)
		return dib->fe_sleep(fe);

	return 0;
}