Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 85757
b: refs/heads/master
c: 27d0fe1
h: refs/heads/master
i:
  85755: bc88dc4
v: v3
  • Loading branch information
Roland Stoll authored and Mauro Carvalho Chehab committed Feb 18, 2008
1 parent f63ac77 commit ae7fa49
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 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: 968fb08912880e34a05a0cca7907392bac920aa2
refs/heads/master: 27d0fe189437803d5ad146d508ec2fd77252c73f
16 changes: 12 additions & 4 deletions trunk/drivers/media/video/cx88/cx88-mpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,13 +609,19 @@ static int cx8802_request_acquire(struct cx8802_driver *drv)
struct cx88_core *core = drv->core;

/* Fail a request for hardware if the device is busy. */
if (core->active_type_id != CX88_BOARD_NONE)
if (core->active_type_id != CX88_BOARD_NONE &&
core->active_type_id != drv->type_id)
return -EBUSY;

if (drv->advise_acquire)
{
core->active_type_id = drv->type_id;
drv->advise_acquire(drv);
core->active_ref++;
mutex_lock(&drv->core->lock);
if (core->active_type_id == CX88_BOARD_NONE) {
core->active_type_id = drv->type_id;
drv->advise_acquire(drv);
}
mutex_unlock(&drv->core->lock);

mpeg_dbg(1,"%s() Post acquire GPIO=%x\n", __FUNCTION__, cx_read(MO_GP0_IO));
}
Expand All @@ -628,10 +634,12 @@ static int cx8802_request_release(struct cx8802_driver *drv)
{
struct cx88_core *core = drv->core;

if (drv->advise_release)
if (drv->advise_release && --core->active_ref == 0)
{
mutex_lock(&drv->core->lock);
drv->advise_release(drv);
core->active_type_id = CX88_BOARD_NONE;
mutex_unlock(&drv->core->lock);
mpeg_dbg(1,"%s() Post release GPIO=%x\n", __FUNCTION__, cx_read(MO_GP0_IO));
}

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/video/cx88/cx88.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ struct cx88_core {
/* cx88-video needs to access cx8802 for hybrid tuner pll access. */
struct cx8802_dev *dvbdev;
enum cx88_board_type active_type_id;
int active_ref;
};

struct cx8800_dev;
Expand Down

0 comments on commit ae7fa49

Please sign in to comment.