diff options
author | Darron Broad <darron@kewl.org> | 2008-10-11 10:44:05 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-17 16:24:15 -0400 |
commit | 59b1842da1c6f33ad2e8da82d3dfb3445751d964 (patch) | |
tree | 9a57bcf44df5d76ad845995dcfd5f49e20c68240 /drivers/media/video/videobuf-dvb.c | |
parent | 2f3af9e64de44743a860fd1eee966222a7accc54 (diff) |
V4L/DVB (9227): MFE: Add multi-frontend mutual exclusion
This add frontend R/W mutual exclusion.
Prior to this point in time it was possible to open both
frontends simultaneously which an MFE card cannot support.
In order to stop this, a delayed open is performed which
has the following function:
- Return EBUSY after a configurable amount of time
if a frontend is unavailable due to the other being
in use.
- Only allow opening of a frontend if the kernel thread
of the other has stopped.
This solution was chosen to allow switching between
frontends to work as seamlessly as possible. When both
frontends are actually opened simultaneously then one
will only open, but if quick switching is performed
between one of many then the new open will succeed in
a clean fashion rather than interrupting a kernel
thread.
Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/videobuf-dvb.c')
-rw-r--r-- | drivers/media/video/videobuf-dvb.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/media/video/videobuf-dvb.c b/drivers/media/video/videobuf-dvb.c index a0a80e1e79e3..af0b75cda6fd 100644 --- a/drivers/media/video/videobuf-dvb.c +++ b/drivers/media/video/videobuf-dvb.c | |||
@@ -140,7 +140,8 @@ int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f, | |||
140 | struct module *module, | 140 | struct module *module, |
141 | void *adapter_priv, | 141 | void *adapter_priv, |
142 | struct device *device, | 142 | struct device *device, |
143 | short *adapter_nr) //NEW | 143 | short *adapter_nr, |
144 | int mfe_shared) | ||
144 | { | 145 | { |
145 | struct list_head *list, *q; | 146 | struct list_head *list, *q; |
146 | struct videobuf_dvb_frontend *fe; | 147 | struct videobuf_dvb_frontend *fe; |
@@ -153,7 +154,7 @@ int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f, | |||
153 | } | 154 | } |
154 | 155 | ||
155 | /* Bring up the adapter */ | 156 | /* Bring up the adapter */ |
156 | res = videobuf_dvb_register_adapter(f, module, adapter_priv, device, fe->dvb.name, adapter_nr); //NEW | 157 | res = videobuf_dvb_register_adapter(f, module, adapter_priv, device, fe->dvb.name, adapter_nr, mfe_shared); |
157 | if (res < 0) { | 158 | if (res < 0) { |
158 | printk(KERN_WARNING "videobuf_dvb_register_adapter failed (errno = %d)\n", res); | 159 | printk(KERN_WARNING "videobuf_dvb_register_adapter failed (errno = %d)\n", res); |
159 | goto err; | 160 | goto err; |
@@ -181,7 +182,8 @@ int videobuf_dvb_register_adapter(struct videobuf_dvb_frontends *fe, | |||
181 | void *adapter_priv, | 182 | void *adapter_priv, |
182 | struct device *device, | 183 | struct device *device, |
183 | char *adapter_name, | 184 | char *adapter_name, |
184 | short *adapter_nr) //NEW | 185 | short *adapter_nr, |
186 | int mfe_shared) | ||
185 | { | 187 | { |
186 | int result; | 188 | int result; |
187 | 189 | ||
@@ -194,6 +196,7 @@ int videobuf_dvb_register_adapter(struct videobuf_dvb_frontends *fe, | |||
194 | adapter_name, result); | 196 | adapter_name, result); |
195 | } | 197 | } |
196 | fe->adapter.priv = adapter_priv; | 198 | fe->adapter.priv = adapter_priv; |
199 | fe->adapter.mfe_shared = mfe_shared; | ||
197 | 200 | ||
198 | return result; | 201 | return result; |
199 | } | 202 | } |