diff options
author | Devin Heitmueller <dheitmueller@kernellabs.com> | 2009-09-03 03:23:27 (GMT) |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-19 02:47:42 (GMT) |
commit | 8c873d31af868b4e340defc7053945636c8bd0e1 (patch) | |
tree | f25bc046a8354eaaa40b65b8b775010592657985 /drivers/media/video/em28xx/em28xx.h | |
parent | 91f6dcec929b37a4568ddf55ef84e007d8fccc34 (diff) | |
download | linux-8c873d31af868b4e340defc7053945636c8bd0e1.tar.xz |
V4L/DVB (12744): em28xx: restructure fh/dev locking to handle both video and vbi
The current locking infrastructure didn't support having multiple fds accessing
the device (such as video and vbi). Rework the locking infrastructure,
borrowing the design from cx88.
This work was sponsored by EyeMagnet Limited.
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx.h')
-rw-r--r-- | drivers/media/video/em28xx/em28xx.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h index 8dac50b..b4a6e07 100644 --- a/drivers/media/video/em28xx/em28xx.h +++ b/drivers/media/video/em28xx/em28xx.h @@ -444,6 +444,10 @@ enum em28xx_dev_state { #define EM28XX_AUDIO 0x10 #define EM28XX_DVB 0x20 +/* em28xx resource types (used for res_get/res_lock etc */ +#define EM28XX_RESOURCE_VIDEO 0x01 +#define EM28XX_RESOURCE_VBI 0x02 + struct em28xx_audio { char name[50]; char *transfer_buffer[EM28XX_AUDIO_BUFS]; @@ -464,8 +468,8 @@ struct em28xx; struct em28xx_fh { struct em28xx *dev; - unsigned int stream_on:1; /* Locks streams */ int radio; + unsigned int resources; struct videobuf_queue vb_vidq; struct videobuf_queue vb_vbiq; @@ -495,7 +499,6 @@ struct em28xx { /* Vinmode/Vinctl used at the driver */ int vinmode, vinctl; - unsigned int stream_on:1; /* Locks streams */ unsigned int has_audio_class:1; unsigned int has_alsa_audio:1; @@ -563,6 +566,9 @@ struct em28xx { struct video_device *vbi_dev; struct video_device *radio_dev; + /* resources in use */ + unsigned int resources; + unsigned char eedata[256]; /* Isoc control struct */ |