diff options
author | Steven Toth <stoth@linuxtv.org> | 2008-09-25 15:51:11 -0400 |
---|---|---|
committer | Steven Toth <stoth@linuxtv.org> | 2008-09-25 15:51:11 -0400 |
commit | 607559123926c97eda4e7f7920ddd392408fd1e3 (patch) | |
tree | 384c8cd89b0290c04358894ac711ffcc5e7db107 | |
parent | 90c4877707444823952b5c1bf995395b73e0c0c4 (diff) | |
download | mediapointer-dvb-s2-607559123926c97eda4e7f7920ddd392408fd1e3.tar.gz mediapointer-dvb-s2-607559123926c97eda4e7f7920ddd392408fd1e3.tar.bz2 |
cx88: Bugfix: all client disconnects put the frontend to sleep.
From: Darron Broad <darron@kewl.org>
From the author:
"This fixes the problem where previously all client disconnects
put the analogue frontend into standby.
In the following example, the first command is succesfully
watching TV but the second command which returns EBUSY
detunes the receiver by entering it into the standby state.
tvtime -d /dev/video0 &
cat /dev/video0
"
Priority: normal
Signed-off-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Darron Broad <darron@kewl.org>
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-video.c | 5 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c index 3a7a9ed17..c4fdb6da2 100644 --- a/linux/drivers/media/video/cx88/cx88-video.c +++ b/linux/drivers/media/video/cx88/cx88-video.c @@ -1065,6 +1065,8 @@ static int video_open(struct inode *inode, struct file *file) } unlock_kernel(); + atomic_inc(&core->users); + return 0; } @@ -1152,7 +1154,8 @@ static int video_release(struct inode *inode, struct file *file) file->private_data = NULL; kfree(fh); - cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL); + if(atomic_dec_and_test(&dev->core->users)) + cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL); return 0; } diff --git a/linux/drivers/media/video/cx88/cx88.h b/linux/drivers/media/video/cx88/cx88.h index 238370681..38702eb4f 100644 --- a/linux/drivers/media/video/cx88/cx88.h +++ b/linux/drivers/media/video/cx88/cx88.h @@ -352,6 +352,7 @@ struct cx88_core { struct mutex lock; /* various v4l controls */ u32 freq; + atomic_t users; /* cx88-video needs to access cx8802 for hybrid tuner pll access. */ struct cx8802_dev *dvbdev; |