summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorOliver Endriss <devnull@localhost>2004-12-02 17:13:58 +0000
committerOliver Endriss <devnull@localhost>2004-12-02 17:13:58 +0000
commit6d08891a0dde650c1f05dfabbcebc676f371f1a3 (patch)
tree397c195995c1e64d12299b055f97c8e7941f0d0a /linux/drivers/media
parente1cbf7915c2b64872018b2407f4d1887b93065e2 (diff)
downloadmediapointer-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')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c2
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_hw.c31
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_hw.h4
3 files changed, 36 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
index 5641b1622..b4b9bb4e0 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -1732,7 +1732,7 @@ static void av7110_fe_lock_fix(struct av7110* av7110, fe_status_t status)
} else {
SetPIDs(av7110, 0, 0, 0, 0, 0);
av7110_fw_cmd(av7110, COMTYPE_PID_FILTER, FlushTSQueue, 0);
- msleep(50);
+ av7110_wait_msgstate(av7110, GPMQBusy);
}
up(&av7110->pid_mutex);
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;
diff --git a/linux/drivers/media/dvb/ttpci/av7110_hw.h b/linux/drivers/media/dvb/ttpci/av7110_hw.h
index 049f23f2c..bf901c624 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_hw.h
+++ b/linux/drivers/media/dvb/ttpci/av7110_hw.h
@@ -65,6 +65,9 @@ enum av7110_video_output_mode
#define HPQOver 0x0008
#define OSDQFull 0x0010 /* OSD Queue Full */
#define OSDQOver 0x0020
+#define GPMQBusy 0x0040 /* Queue not empty, FW >= 261d */
+#define HPQBusy 0x0080
+#define OSDQBusy 0x0100
/* hw section filter flags */
#define SECTION_EIT 0x01
@@ -368,6 +371,7 @@ extern int av7110_firmversion(struct av7110 *av7110);
#define FW_4M_SDRAM(arm_app) ((arm_app) & 0x40000000)
#define FW_VERSION(arm_app) ((arm_app) & 0x0000FFFF)
+extern int av7110_wait_msgstate(struct av7110 *av7110, u16 flags);
extern int av7110_fw_cmd(struct av7110 *av7110, int type, int com, int num, ...);
extern int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length);
extern int av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length);