V4L/DVB (12936): SAA7164: Added waitsecs module parameter
authorSteven Toth <stoth@kernellabs.com>
Thu, 30 Jul 2009 12:09:30 +0000 (09:09 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 19 Sep 2009 03:15:03 +0000 (00:15 -0300)
Signed-off-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/saa7164/saa7164-cmd.c
drivers/media/video/saa7164/saa7164-core.c
drivers/media/video/saa7164/saa7164.h

index 0c3585bb23216f5144744a3a35039db77dfd9719..171ef116f078bf5af58b29a788c110a22fc6577e 100644 (file)
@@ -234,8 +234,8 @@ int saa7164_cmd_wait(struct saa7164_dev *dev, u8 seqno)
                                __func__, seqno, dev->cmds[seqno].signalled);
 
                        /* Wait for signalled to be flagged or timeout */
-                       wait_event_timeout(*q, dev->cmds[seqno].signalled, HZ);
-                       r = time_before(jiffies, stamp + HZ);
+                       wait_event_timeout(*q, dev->cmds[seqno].signalled, (HZ * waitsecs));
+                       r = time_before(jiffies, stamp + (HZ * waitsecs));
                        if (r)
                                ret = SAA_OK;
                        else
index 2fbf4204cd5c8ea1f0f572d3ef3ca46f48f618fc..8f68a5d6533b3e9374e9c22d0f2b5084d89ab78a 100644 (file)
@@ -49,6 +49,10 @@ unsigned int debug;
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "enable debug messages");
 
+unsigned int waitsecs = 1;
+module_param(waitsecs, int, 0644);
+MODULE_PARM_DESC(debug, "timeout on firmware messages");
+
 static unsigned int card[]  = {[0 ... (SAA7164_MAXBOARDS - 1)] = UNSET };
 module_param_array(card,  int, NULL, 0444);
 MODULE_PARM_DESC(card, "card type");
@@ -662,6 +666,7 @@ static int __devinit saa7164_initdev(struct pci_dev *pci_dev,
                printk(KERN_ERR "%s() Unsupported board detected, "
                        "registering without firmware\n", __func__);
 
+       printk(KERN_INFO "%s() waitsecs = %d\n", __func__, waitsecs);
 fail_fw:
        return 0;
 
index e0d8ec0fd95cbb7cfaee1fd075e276171953c01f..93a75e15d211e7f1bdef68ab09033fdbb4e534a4 100644 (file)
@@ -294,6 +294,7 @@ struct saa7164_dev {
 };
 
 extern struct list_head saa7164_devlist;
+extern unsigned int waitsecs;
 
 /* ----------------------------------------------------------- */
 /* saa7164-core.c                                              */