diff options
author | Oliver Endriss <devnull@localhost> | 2004-12-02 17:13:58 +0000 |
---|---|---|
committer | Oliver Endriss <devnull@localhost> | 2004-12-02 17:13:58 +0000 |
commit | 6d08891a0dde650c1f05dfabbcebc676f371f1a3 (patch) | |
tree | 397c195995c1e64d12299b055f97c8e7941f0d0a /linux/drivers/media/dvb/ttpci/av7110_hw.c | |
parent | e1cbf7915c2b64872018b2407f4d1887b93065e2 (diff) | |
download | mediapointer-dvb-s2-6d08891a0dde650c1f05dfabbcebc676f371f1a3.tar.gz mediapointer-dvb-s2-6d08891a0dde650c1f05dfabbcebc676f371f1a3.tar.bz2 |
av7110_fe_lock_fix():
- firmware version 261d: wait for msg queue empty
- firmware <= 261c: wait 50ms
Diffstat (limited to 'linux/drivers/media/dvb/ttpci/av7110_hw.c')
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110_hw.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110_hw.c b/linux/drivers/media/dvb/ttpci/av7110_hw.c index 754bb8140..5a11d3da5 100644 --- a/linux/drivers/media/dvb/ttpci/av7110_hw.c +++ b/linux/drivers/media/dvb/ttpci/av7110_hw.c @@ -293,6 +293,37 @@ int av7110_bootarm(struct av7110 *av7110) * DEBI command polling ****************************************************************************/ +int av7110_wait_msgstate(struct av7110 *av7110, u16 flags) +{ + unsigned long start; + u32 stat; + + if (FW_VERSION(av7110->arm_app) <= 0x261c) { + /* not supported by old firmware */ + msleep(50); + return 0; + } + + /* new firmware */ + start = jiffies; + for (;;) { + if (down_interruptible(&av7110->dcomlock)) + return -ERESTARTSYS; + stat = rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2); + up(&av7110->dcomlock); + if ((stat & flags) == 0) { + break; + } + if (time_after(jiffies, start + ARM_WAIT_FREE)) { + printk(KERN_ERR "%s: timeout waiting for MSGSTATE %04x\n", + __FUNCTION__, stat & flags); + return -1; + } + msleep(1); + } + return 0; +} + int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length) { int i; |