[linux-dvb] patch for twinhan-dst card

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dominique Dumont <domi.dumont@xxxxxxx> writes:

> 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?

It still barfs. The required sequence is:

- reset DST (pull gpio 2 (0x04) low, 10ms, then high)
- wait 1 to 3 seconds (during this time, the dst is never
  'ready'. I.e. Gpio 0 (0x01) stays high)
- initialize comm (pull gpio 1 (0x02) low)
- send get_device_id command on i2c bus
- release gpio 1 (three-state mode)
- read dst ack on i2c bus
- wait 5 seconds (lower values often fails)
- read dst reply on i2c bus (the reply that contains 'DST-CI')

The first wait is less critical than the second. Don't ask me
why. This is stuff is closer to voodoo than computer science.


I've enclosed the traces if you want more details.

Cheers


> 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] ??

Normal behavior: this is a leftover from previous setting.  

Here's the trace I get for a succesful reset:

Apr 10 17:00:44 localhost kernel: dst_ca_ioctl: Resetting DST
Apr 10 17:00:44 localhost kernel: rdc_8820_reset: Resetting DST. gpio going low
Apr 10 17:00:44 localhost kernel: dst_gpio_outb: mask=[0004], enbb=[0004], outhigh=[0000]
Apr 10 17:00:44 localhost kernel: dvb_bt8xx: dst enable mask 0x04 enb 0x04 
Apr 10 17:00:44 localhost kernel: bttv0 tracking: gpio: en=00000004, out=00000004 in=00f100f9 [after bttv_gpio_inout]
Apr 10 17:00:44 localhost kernel: bttv0 tracking: gpio: en=00000004, out=00000004 in=00f358f9 [extern enable]
Apr 10 17:00:44 localhost kernel: dvb_bt8xx: dst write gpio mask 0x04 out 0x00
Apr 10 17:00:44 localhost kernel: bttv0 tracking: gpio: en=00000004, out=00000004 in=00f3d1f9 [extern write]
Apr 10 17:00:44 localhost kernel: rdc_8820_reset: Resetting DST. gpio going high
Apr 10 17:00:44 localhost kernel: dst_gpio_outb: mask=[0004], enbb=[0004], outhigh=[0004]
Apr 10 17:00:44 localhost kernel: dvb_bt8xx: dst enable mask 0x04 enb 0x04 
Apr 10 17:00:44 localhost kernel: bttv0 tracking: gpio: en=00000004, out=00000000 in=00f302f9 [after bttv_gpio_inout]
Apr 10 17:00:44 localhost kernel: bttv0 tracking: gpio: en=00000004, out=00000000 in=00f30df9 [extern enable]
Apr 10 17:00:44 localhost kernel: dvb_bt8xx: dst write gpio mask 0x04 out 0x04
Apr 10 17:00:44 localhost kernel: bttv0 tracking: gpio: en=00000004, out=00000000 in=00f3e3f9 [extern write]
Apr 10 17:00:44 localhost kernel: dst_wait_dst_ready: dst_gpio_inb read f9
Apr 10 17:00:44 localhost kernel: dst_wait_dst_ready: dst_gpio_inb read fd
Apr 10 17:00:45 localhost last message repeated 198 times
Apr 10 17:00:45 localhost kernel: dst_wait_dst_ready: dst wait NOT ready after 200
Apr 10 17:00:45 localhost kernel: dst_ca_ioctl: DST still not ready after 1 tries
Apr 10 17:00:45 localhost kernel: dst_comm_init: Initializing DST..
Apr 10 17:00:45 localhost kernel: dst_gpio_outb: mask=[0007], enbb=[0001], outhigh=[0000]
Apr 10 17:00:45 localhost kernel: dvb_bt8xx: dst enable mask 0x07 enb 0x01 
Apr 10 17:00:45 localhost kernel: bttv0 tracking: gpio: en=00000001, out=00000001 in=00f358fc [after bttv_gpio_inout]
Apr 10 17:00:45 localhost kernel: bttv0 tracking: gpio: en=00000001, out=00000001 in=00f315fc [extern enable]
Apr 10 17:00:45 localhost kernel: dvb_bt8xx: dst write gpio mask 0x01 out 0x00
Apr 10 17:00:45 localhost kernel: bttv0 tracking: gpio: en=00000001, out=00000001 in=00f33cfc [extern write]
Apr 10 17:00:45 localhost kernel: rdc_reset_state: Resetting state machine
Apr 10 17:00:45 localhost kernel: dst_gpio_outb: mask=[0002], enbb=[0002], outhigh=[0000]
Apr 10 17:00:45 localhost kernel: dvb_bt8xx: dst enable mask 0x02 enb 0x02 
Apr 10 17:00:45 localhost kernel: bttv0 tracking: gpio: en=00000003, out=00000001 in=00f345fc [after bttv_gpio_inout]
Apr 10 17:00:45 localhost kernel: bttv0 tracking: gpio: en=00000003, out=00000001 in=00f36dfc [extern enable]
Apr 10 17:00:45 localhost kernel: dvb_bt8xx: dst write gpio mask 0x02 out 0x00
Apr 10 17:00:45 localhost kernel: bttv0 tracking: gpio: en=00000003, out=00000001 in=00f346fc [extern write]
Apr 10 17:00:45 localhost kernel: dst_gpio_outb: mask=[0002], enbb=[0002], outhigh=[0002]
Apr 10 17:00:45 localhost kernel: dvb_bt8xx: dst enable mask 0x02 enb 0x02 
Apr 10 17:00:45 localhost kernel: bttv0 tracking: gpio: en=00000003, out=00000001 in=00f3e9fc [after bttv_gpio_inout]
Apr 10 17:00:45 localhost kernel: bttv0 tracking: gpio: en=00000003, out=00000001 in=00f3eefc [extern enable]
Apr 10 17:00:45 localhost kernel: dvb_bt8xx: dst write gpio mask 0x02 out 0x02
Apr 10 17:00:45 localhost kernel: bttv0 tracking: gpio: en=00000003, out=00000003 in=00f368fc [extern write]
Apr 10 17:00:45 localhost kernel: write_dst writing 00 06 00 00 00 00 00 fa
Apr 10 17:00:45 localhost kernel: bt-i2c (1): ERR: -5
Apr 10 17:00:45 localhost kernel: write_dst: _write_dst error (err == -5, len == 0x08, b0 == 0x00)
Apr 10 17:00:45 localhost kernel: dst_error_recovery: Trying to return from previous errors...
Apr 10 17:00:45 localhost kernel: dst_gpio_outb: mask=[0007], enbb=[0000], outhigh=[0000]
Apr 10 17:00:45 localhost kernel: dvb_bt8xx: dst enable mask 0x07 enb 0x00 
Apr 10 17:00:45 localhost kernel: bttv0 tracking: gpio: en=00000000, out=00000000 in=00f3d8fd [after bttv_gpio_inout]
Apr 10 17:00:45 localhost kernel: bttv0 tracking: gpio: en=00000000, out=00000000 in=00f370fd [extern enable]
Apr 10 17:00:45 localhost kernel: dst_gpio_outb: mask=[0007], enbb=[0001], outhigh=[0000]
Apr 10 17:00:45 localhost kernel: dvb_bt8xx: dst enable mask 0x07 enb 0x01 
Apr 10 17:00:45 localhost kernel: bttv0 tracking: gpio: en=00000001, out=00000001 in=00f326fc [after bttv_gpio_inout]
Apr 10 17:00:45 localhost kernel: bttv0 tracking: gpio: en=00000001, out=00000001 in=00f3d6fc [extern enable]
Apr 10 17:00:45 localhost kernel: dvb_bt8xx: dst write gpio mask 0x01 out 0x00
Apr 10 17:00:45 localhost kernel: bttv0 tracking: gpio: en=00000001, out=00000000 in=00f302fc [extern write]
Apr 10 17:00:45 localhost kernel: bt-i2c (1): <W aa 00 06 00 00 00 00 00 fa >
Apr 10 17:00:45 localhost kernel: dst_gpio_outb: mask=[0007], enbb=[0000], outhigh=[0000]
Apr 10 17:00:45 localhost kernel: dvb_bt8xx: dst enable mask 0x07 enb 0x00 
Apr 10 17:00:45 localhost kernel: bttv0 tracking: gpio: en=00000000, out=00000000 in=00f3a8fd [after bttv_gpio_inout]
Apr 10 17:00:45 localhost kernel: bttv0 tracking: gpio: en=00000000, out=00000000 in=00f308fd [extern enable]
Apr 10 17:00:45 localhost kernel: bt-i2c (1): <R ab =ff >
Apr 10 17:00:45 localhost kernel: read_dst reply is 0xff
Apr 10 17:00:49 localhost kernel: dst_wait_dst_ready: dst_gpio_inb read fc
Apr 10 17:00:49 localhost kernel: dst_wait_dst_ready: dst wait ready after 0
Apr 10 17:00:49 localhost kernel: bt-i2c (1): <R ab =00 =44 =53 =54 =2d =43 =49 =5c >
Apr 10 17:00:49 localhost kernel: read_dst reply is 0x0
Apr 10 17:00:49 localhost kernel:  0x44 0x53 0x54 0x2d 0x43 0x49 0x5c
Apr 10 17:00:49 localhost kernel: dst_get_device_id: Recognise [DST-CI]
Apr 10 17:00:49 localhost kernel: DST type : satellite
Apr 10 17:00:49 localhost kernel: DST type flags : 0x1 newtuner 0x2 ts204 0x8 firmware version = 1
Apr 10 17:00:49 localhost kernel: dst_gpio_outb: mask=[0007], enbb=[0000], outhigh=[0000]
Apr 10 17:00:49 localhost kernel: dvb_bt8xx: dst enable mask 0x07 enb 0x00 
Apr 10 17:00:49 localhost kernel: bttv0 tracking: gpio: en=00000000, out=00000000 in=00f301fd [after bttv_gpio_inout]
Apr 10 17:00:49 localhost kernel: bttv0 tracking: gpio: en=00000000, out=00000000 in=00f390fd [extern enable]



[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux