diff options
author | Darron Broad <darron@kewl.org> | 2008-10-11 16:44:05 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-17 22:24:15 +0200 |
commit | 59b1842da1c6f33ad2e8da82d3dfb3445751d964 (patch) | |
tree | 9a57bcf44df5d76ad845995dcfd5f49e20c68240 /drivers/media/video/cx88 | |
parent | V4L/DVB (9226): MFE: cx88: Reset cx22702 on hvr-3000/4000 (diff) | |
download | linux-59b1842da1c6f33ad2e8da82d3dfb3445751d964.tar.xz linux-59b1842da1c6f33ad2e8da82d3dfb3445751d964.zip |
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/cx88')
-rw-r--r-- | drivers/media/video/cx88/cx88-dvb.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 9bb7bee0da6d..0dd0ff9227fb 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -594,14 +594,9 @@ static struct stv0288_config tevii_tuner_earda_config = { static int dvb_register(struct cx8802_dev *dev) { - //struct cx88_core *core = dev->core; - - ///* init struct videobuf_dvb */ - //fe->dvb.name = core->name; - //dev->ts_gen_cntrl = 0x0c; - struct cx88_core *core = dev->core; struct videobuf_dvb_frontend *fe0, *fe1 = NULL; + int mfe_shared = 0; /* bus not shared by default */ /* Get the first frontend */ fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1); @@ -669,6 +664,7 @@ static int dvb_register(struct cx8802_dev *dev) fe1 = videobuf_dvb_get_frontend(&dev->frontends, 2); if (fe1) { dev->frontends.gate = 2; + mfe_shared = 1; fe1->dvb.frontend = dvb_attach(cx22702_attach, &hauppauge_hvr_config, &dev->core->i2c_adap); @@ -1013,6 +1009,7 @@ static int dvb_register(struct cx8802_dev *dev) fe1 = videobuf_dvb_get_frontend(&dev->frontends, 2); if (fe1) { dev->frontends.gate = 2; + mfe_shared = 1; fe1->dvb.frontend = dvb_attach(cx22702_attach, &hauppauge_hvr_config, &dev->core->i2c_adap); @@ -1110,7 +1107,7 @@ static int dvb_register(struct cx8802_dev *dev) /* register everything */ return videobuf_dvb_register_bus(&dev->frontends, THIS_MODULE, dev, - &dev->pci->dev, adapter_nr); + &dev->pci->dev, adapter_nr, mfe_shared); frontend_detach: if (fe0->dvb.frontend) { |