|
@@ -29,6 +29,7 @@
|
|
#include <linux/moduleparam.h>
|
|
#include <linux/moduleparam.h>
|
|
#include <linux/init.h>
|
|
#include <linux/init.h>
|
|
#include <linux/delay.h>
|
|
#include <linux/delay.h>
|
|
|
|
+#include <linux/jiffies.h>
|
|
#include <asm/io.h>
|
|
#include <asm/io.h>
|
|
|
|
|
|
#include "bttvp.h"
|
|
#include "bttvp.h"
|
|
@@ -130,17 +131,14 @@ static u32 functionality(struct i2c_adapter *adap)
|
|
static int
|
|
static int
|
|
bttv_i2c_wait_done(struct bttv *btv)
|
|
bttv_i2c_wait_done(struct bttv *btv)
|
|
{
|
|
{
|
|
- DECLARE_WAITQUEUE(wait, current);
|
|
|
|
int rc = 0;
|
|
int rc = 0;
|
|
|
|
|
|
- add_wait_queue(&btv->i2c_queue, &wait);
|
|
|
|
- if (0 == btv->i2c_done)
|
|
|
|
- msleep_interruptible(20);
|
|
|
|
- remove_wait_queue(&btv->i2c_queue, &wait);
|
|
|
|
|
|
+ /* timeout */
|
|
|
|
+ if (wait_event_interruptible_timeout(btv->i2c_queue,
|
|
|
|
+ btv->i2c_done, msecs_to_jiffies(85)) == -ERESTARTSYS)
|
|
|
|
+
|
|
|
|
+ rc = -EIO;
|
|
|
|
|
|
- if (0 == btv->i2c_done)
|
|
|
|
- /* timeout */
|
|
|
|
- rc = -EIO;
|
|
|
|
if (btv->i2c_done & BT848_INT_RACK)
|
|
if (btv->i2c_done & BT848_INT_RACK)
|
|
rc = 1;
|
|
rc = 1;
|
|
btv->i2c_done = 0;
|
|
btv->i2c_done = 0;
|