summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorPatrick Boettcher <devnull@localhost>2005-01-25 22:46:55 +0000
committerPatrick Boettcher <devnull@localhost>2005-01-25 22:46:55 +0000
commitd6ea024d5c8c35214244f74f05e30c5f362f780e (patch)
tree07baeebab39f5d3cdc0d00619f9a5c0a2e0ff17e /linux
parentf44f610fe73b19f7d395c01313f7ad05a264894d (diff)
downloadmediapointer-dvb-s2-d6ea024d5c8c35214244f74f05e30c5f362f780e.tar.gz
mediapointer-dvb-s2-d6ea024d5c8c35214244f74f05e30c5f362f780e.tar.bz2
- worked around hw_sleep handling fpr usb1.1 devices
- fixed oops when no frontend was attached (because of usb1.1 timeouts in my debugging sessions)
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c26
-rw-r--r--linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c16
2 files changed, 23 insertions, 19 deletions
diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c
index 925c8599f..1978f482c 100644
--- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c
+++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c
@@ -178,19 +178,22 @@ int dibusb_fe_init(struct usb_dibusb* dib)
break;
}
}
- if (dib->fe->ops->sleep != NULL)
- dib->fe_sleep = dib->fe->ops->sleep;
- dib->fe->ops->sleep = dibusb_hw_sleep;
-
- if (dib->fe->ops->init != NULL )
- dib->fe_init = dib->fe->ops->init;
- dib->fe->ops->init = dibusb_hw_wakeup;
+ /* if a frontend was found */
+ if (dib->fe != NULL) {
+ if (dib->fe->ops->sleep != NULL)
+ dib->fe_sleep = dib->fe->ops->sleep;
+ dib->fe->ops->sleep = dibusb_hw_sleep;
+
+ if (dib->fe->ops->init != NULL )
+ dib->fe_init = dib->fe->ops->init;
+ dib->fe->ops->init = dibusb_hw_wakeup;
- /* setting the default tuner */
- dib->tuner = dib->dibdev->dev_cl->tuner;
+ /* setting the default tuner */
+ dib->tuner = dib->dibdev->dev_cl->tuner;
- /* check which tuner is mounted on this device, in case this is unsure */
- dibusb_tuner_quirk(dib);
+ /* check which tuner is mounted on this device, in case this is unsure */
+ dibusb_tuner_quirk(dib);
+ }
}
if (dib->fe == NULL) {
err("A frontend driver was not found for device '%s'.",
@@ -205,6 +208,7 @@ int dibusb_fe_init(struct usb_dibusb* dib)
return -ENODEV;
}
}
+
return 0;
}
diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c
index 467afa52a..3333d1ce1 100644
--- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c
+++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c
@@ -63,13 +63,16 @@ int dibusb_readwrite_usb(struct usb_dibusb *dib, u8 *wbuf, u16 wlen, u8 *rbuf,
/*
* Cypress controls
*/
+static int dibusb_write_usb(struct usb_dibusb *dib, u8 *buf, u16 len)
+{
+ return dibusb_readwrite_usb(dib,buf,len,NULL,0);
+}
#if 0
/*
* #if 0'ing the following functions as they are not in use _now_,
* but probably will be sometime.
*/
-
/*
* do not use this, just a workaround for a bug,
* which will hopefully never occur :).
@@ -79,12 +82,7 @@ int dibusb_interrupt_read_loop(struct usb_dibusb *dib)
u8 b[1] = { DIBUSB_REQ_INTR_READ };
return dibusb_write_usb(dib,b,1);
}
-
-#endif
-static int dibusb_write_usb(struct usb_dibusb *dib, u8 *buf, u16 len)
-{
- return dibusb_readwrite_usb(dib,buf,len,NULL,0);
-}
+#endif
/*
* ioctl for the firmware
@@ -124,7 +122,9 @@ 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);
+ /* workaround, something is wrong, when dibusb 1.1 device are going to bed too late */
+ if (dib->dibdev->dev_cl->id != DIBUSB1_1)
+ dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_POWER_MODE, b,1);
if (dib->fe_sleep)
return dib->fe_sleep(fe);