Kenneth Aafl?y <lists@xxxxxxxxxxxxxxxxxx> writes: > The pcmcia spec allows for up to 5 seconds of initialization time, > and the ready pin in the pcmcia port should tell when the cam is ready. > > What if you do something like in the budget-av driver: > > int timeout = x > while (--timeout > 0 && !dst_wait_ready()) > msleep(y); > > Does that work, or will it still barf? Not tried yet, but there's something wrong in the CAM initialisation: Apr 7 20:44:34 localhost kernel: DVB: registering new adapter (bttv0). Apr 7 20:44:34 localhost kernel: rdc_8820_reset: Resetting DST Apr 7 20:44:34 localhost kernel: dst_gpio_outb: mask=[0004], enbb=[0004], outhigh=[0000] Apr 7 20:44:34 localhost kernel: bttv0 tracking: gpio: en=00000004, out=00000004 in=00f3a3f9 [after bttv_gpio_inout] Apr 7 20:44:34 localhost kernel: dst_gpio_outb: mask=[0004], enbb=[0004], outhigh=[0004] Apr 7 20:44:34 localhost kernel: bttv0 tracking: gpio: en=00000004, out=00000000 in=00f3b9f9 [after bttv_gpio_inout] ---> This is the first 2500 ms wait. Which is waht I wanted Apr 7 20:44:37 localhost kernel: dst_comm_init: Initializing DST.. Apr 7 20:44:37 localhost kernel: dst_gpio_outb: mask=[ffffffff], enbb=[0001], outhigh=[0000] Apr 7 20:44:37 localhost kernel: bttv0 tracking: gpio: en=00000001, out=00000001 in=00f328fc [after bttv_gpio_inout] Apr 7 20:44:37 localhost kernel: rdc_reset_state: Resetting state machine Apr 7 20:44:37 localhost kernel: dst_gpio_outb: mask=[0002], enbb=[0002], outhigh=[0000] Apr 7 20:44:37 localhost kernel: bttv0 tracking: gpio: en=00000003, out=00000001 in=00f3b6fc [after bttv_gpio_inout] ---> Here enable mask (en=00000003) is different from mask=[0002] ?? Apr 7 20:44:37 localhost kernel: dst_gpio_outb: mask=[0002], enbb=[0002], outhigh=[0002] Apr 7 20:44:37 localhost kernel: bttv0 tracking: gpio: en=00000003, out=00000001 in=00f1e7fc [after bttv_gpio_inout] Apr 7 20:44:37 localhost kernel: write_dst writing 00 06 00 00 00 00 00 fa Apr 7 20:44:37 localhost kernel: bt-i2c (1): ERR: -5 ---> Then we get an error. !?! Apr 7 20:44:37 localhost kernel: write_dst: _write_dst error (err == -5, len == 0x08, b0 == 0x00) Apr 7 20:44:37 localhost kernel: dst_error_recovery: Trying to return from previous errors... Apr 7 20:44:37 localhost kernel: dst_gpio_outb: mask=[ffffffff], enbb=[0000], outhigh=[0000] Apr 7 20:44:37 localhost kernel: bttv0 tracking: gpio: en=00000000, out=00000000 in=00f3d2fd [after bttv_gpio_inout] Apr 7 20:44:37 localhost kernel: dst_gpio_outb: mask=[ffffffff], enbb=[0001], outhigh=[0000] Apr 7 20:44:37 localhost kernel: bttv0 tracking: gpio: en=00000001, out=00000001 in=00f392fc [after bttv_gpio_inout] Apr 7 20:44:37 localhost kernel: bt-i2c (1): <W aa 00 06 00 00 00 00 00 fa > ---> The 2nd write is successful Apr 7 20:44:37 localhost kernel: dst_gpio_outb: mask=[ffffffff], enbb=[0000], outhigh=[0000] Apr 7 20:44:37 localhost kernel: bttv0 tracking: gpio: en=00000000, out=00000000 in=00fb47fd [after bttv_gpio_inout] Apr 7 20:44:37 localhost kernel: bt-i2c (1): <R ab =ff > Apr 7 20:44:37 localhost kernel: read_dst reply is 0xff Apr 7 20:44:41 localhost kernel: dst_wait_dst_ready: dst wait ready after 0 Apr 7 20:44:41 localhost kernel: bt-i2c (1): <R ab =00 =44 =53 =54 =2d =43 =49 =5c > Apr 7 20:44:41 localhost kernel: read_dst reply is 0x0 Apr 7 20:44:41 localhost kernel: 0x44 0x53 0x54 0x2d 0x43 0x49 0x5c Apr 7 20:44:41 localhost kernel: dst_gpio_outb: mask=[ffffffff], enbb=[0000], outhigh=[0000] Apr 7 20:44:41 localhost kernel: bttv0 tracking: gpio: en=00000000, out=00000000 in=00f3a4fd [after bttv_gpio_inout] Apr 7 20:44:41 localhost kernel: dst_get_device_id: Recognise [DST-CI] Apr 7 20:44:41 localhost kernel: DST type : satellite Apr 7 20:44:41 localhost kernel: DST type flags : 0x1 newtuner 0x2 ts204 0x8 firmware version = 1 Apr 7 20:44:41 localhost kernel: dst_ca_attach:registering DST-CA device Apr 7 20:44:41 localhost kernel: DVB: registering frontend 0 (DST DVB-S)... At this point the CAM is initialised correctly despite the error: Apr 7 21:03:56 localhost kernel: ca_get_app_info: Application Type=[1], Application Vendor=[1280], Vendor Code=[1280] Apr 7 21:03:56 localhost kernel: ca_get_app_info: Application info=[Viaccess] I'll dig into this bttv gpio issue. Cheers