diff mbox

em28xx: PCTV 520e workaround for DRX-K fw loading

Message ID 1348157164-2912-1-git-send-email-crope@iki.fi (mailing list archive)
State New, archived
Headers show

Commit Message

Antti Palosaari Sept. 20, 2012, 4:06 p.m. UTC
This is hack to make device working again.
Looks like we need to wait DRX-K fw loading is ready until tuner
is attached as tuner is behind demod I2C bus.

For some reason it still crash when device is re-plugged without
module unloading...

Signed-off-by: Antti Palosaari <crope@iki.fi>
---
 drivers/media/usb/em28xx/em28xx-dvb.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Mauro Carvalho Chehab Sept. 27, 2012, 6:10 p.m. UTC | #1
Em Thu, 20 Sep 2012 19:06:04 +0300
Antti Palosaari <crope@iki.fi> escreveu:

> This is hack to make device working again.
> Looks like we need to wait DRX-K fw loading is ready until tuner
> is attached as tuner is behind demod I2C bus.
> 
> For some reason it still crash when device is re-plugged without
> module unloading...
> 
> Signed-off-by: Antti Palosaari <crope@iki.fi>
> ---
>  drivers/media/usb/em28xx/em28xx-dvb.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
> index 5b7f2b3..4e46fef 100644
> --- a/drivers/media/usb/em28xx/em28xx-dvb.c
> +++ b/drivers/media/usb/em28xx/em28xx-dvb.c
> @@ -1128,6 +1128,9 @@ static int em28xx_dvb_init(struct em28xx *dev)
>  		dvb->fe[0] = dvb_attach(drxk_attach, &pctv_520e_drxk,
>  				&dev->i2c_adap);
>  
> +		/* FIXME: wait demod fw is loaded, up and running */
> +		msleep(2000);
> +

Gah! that sounds ugly! Also, there's no warranty at all that this would work,
as it will depend on udev good will.

If you need to be sure that the firmware is loaded, you'll need to use wait
queues or some other way for em28xx-dvb to check if the frontend status.

>  		if (dvb->fe[0]) {
>  			/* attach tuner */
>  			if (!dvb_attach(tda18271_attach, dvb->fe[0], 0x60,
diff mbox

Patch

diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index 5b7f2b3..4e46fef 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -1128,6 +1128,9 @@  static int em28xx_dvb_init(struct em28xx *dev)
 		dvb->fe[0] = dvb_attach(drxk_attach, &pctv_520e_drxk,
 				&dev->i2c_adap);
 
+		/* FIXME: wait demod fw is loaded, up and running */
+		msleep(2000);
+
 		if (dvb->fe[0]) {
 			/* attach tuner */
 			if (!dvb_attach(tda18271_attach, dvb->fe[0], 0x60,