Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164151
b: refs/heads/master
c: 39e469a
h: refs/heads/master
i:
  164149: d221ea7
  164147: f9aadf8
  164143: bf67109
v: v3
  • Loading branch information
Steven Toth authored and Mauro Carvalho Chehab committed Sep 19, 2009
1 parent 3cc0c35 commit 0bbac18
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 068ed40b8fc14cd3d16b5cf2db59ecd735a68ca8
refs/heads/master: 39e469ab6dee0977a6fb632c711fba1ec5fca401
37 changes: 37 additions & 0 deletions trunk/drivers/media/video/saa7164/saa7164-cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,43 @@ u32 saa7164_cmd_timeout_get(struct saa7164_dev *dev, u8 seqno)
return ret;
}

/* Commands to the f/w get marshelled to/from this code then onto the PCI
* -bus/c running buffer. */
int saa7164_irq_dequeue(struct saa7164_dev *dev)
{
int ret = SAA_OK;
u32 timeout;
wait_queue_head_t *q = 0;
dprintk(DBGLVL_CMD, "%s()\n", __func__);

/* While any outstand message on the bus exists... */
do {

/* Peek the msg bus */
tmComResInfo_t tRsp = { 0, 0, 0, 0, 0, 0 };
ret = saa7164_bus_get(dev, &tRsp, NULL, 1);
if (ret != SAA_OK)
break;

q = &dev->cmds[tRsp.seqno].wait;
timeout = saa7164_cmd_timeout_get(dev, tRsp.seqno);
dprintk(DBGLVL_CMD, "%s() timeout = %d\n", __func__, timeout);
if (!timeout) {
dprintk(DBGLVL_CMD,
"%s() signalled seqno(%d) (for dequeue)\n",
__func__, tRsp.seqno);
dev->cmds[tRsp.seqno].signalled = 1;
wake_up(q);
} else {
printk(KERN_ERR
"%s() found timed out command on the bus\n",
__func__);
}
} while (0);

return ret;
}

/* Commands to the f/w get marshelled to/from this code then onto the PCI
* -bus/c running buffer. */
int saa7164_cmd_dequeue(struct saa7164_dev *dev)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/saa7164/saa7164-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static void saa7164_work_cmdhandler(struct work_struct *w)
struct saa7164_dev *dev = container_of(w, struct saa7164_dev, workcmd);

/* Wake up any complete commands */
saa7164_cmd_signal(dev, 0);
saa7164_irq_dequeue(dev);
}

static void saa7164_buffer_deliver(struct saa7164_buffer *buf)
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/video/saa7164/saa7164.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ int saa7164_cmd_send(struct saa7164_dev *dev,
u8 id, tmComResCmd_t command, u16 controlselector,
u16 size, void *buf);
void saa7164_cmd_signal(struct saa7164_dev *dev, u8 seqno);
int saa7164_irq_dequeue(struct saa7164_dev *dev);

/* ----------------------------------------------------------- */
/* saa7164-api.c */
Expand Down

0 comments on commit 0bbac18

Please sign in to comment.