Re: cx88 and many readers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Roland Stoll wrote:
> Hello,
> 
> with the latest snapshots it isn't possible to open the frontend device
> of cx88-dvb multiple times. I used this to monitor signal quality with
> an external tool (femon).
> With the attached patch it's working again. Is it ok if the same
> hardware on the transport bus is used more than once?
> 
> regards, Roland

Steve,

Roland's patch looks sane to me...  Can you check this as well, to make sure
this wont break the control of cx88-mpeg between cx88-dvb and cx88-blackbird for
dual-functionality devices such as the hvr1300 ?

It's been a few weeks since Roland sent this in, so I've attached the original
patch from Roland just in case you dont have it.


Roland, just a few things...

First off, we will need you to provide a sign-off, in the form:

Signed-off-by: Your Name <email@xxxxxxxx>

...in order for us to be able to apply this changeset to the kernel.

Also, you have broken some whitespace codingstyle.  This is a minor issue, but
we shouldn't insert any extra spaces inside the (parenthesis) like ( this ).

I'd just like to hear confirmation that this doesnt break the cx88-mpeg
switching on the hvr1300 before we apply this.

Cheers,

Michael Krufky
--- v4l-dvb.orig/linux/drivers/media/video/cx88/cx88.h	2007-01-01 14:11:59.000000000 +0100
+++ v4l-dvb/linux/drivers/media/video/cx88/cx88.h	2007-01-02 23:30:54.000000000 +0100
@@ -351,6 +351,7 @@
 	/* 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;
--- v4l-dvb.orig/linux/drivers/media/video/cx88/cx88-mpeg.c	2007-01-02 22:41:56.000000000 +0100
+++ v4l-dvb/linux/drivers/media/video/cx88/cx88-mpeg.c	2007-01-02 23:53:58.000000000 +0100
@@ -639,12 +639,15 @@
 	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)
+	if ( core->active_type_id == CX88_BOARD_NONE && 
+		drv->advise_acquire )
 	{
 		core->active_type_id = drv->type_id;
+		core->active_ref++;
 		drv->advise_acquire(drv);
 
 		mpeg_dbg(1,"%s() Post acquire GPIO=%x\n", __FUNCTION__, cx_read(MO_GP0_IO));
@@ -658,7 +661,7 @@
 {
 	struct cx88_core *core = drv->core;
 
-	if (drv->advise_release)
+	if ( drv->advise_release && --core->active_ref == 0)
 	{
 		drv->advise_release(drv);
 		core->active_type_id = CX88_BOARD_NONE;
_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux