[pvrusb2] Kernel compilation issues 2.6.17-rc6

Mike Isely isely at isely.net
Tue Jun 6 21:20:45 CDT 2006


On Tue, 6 Jun 2006, Mike Isely wrote:

>
> Obviously I hadn't tried 2.6.17-rcX yet.  Now having done so....
>

    [...]

>
>
> On Tue, 6 Jun 2006, Bill Crowell wrote:
>
>> The include fixed this portion of the compile. Now the driver is
>> complaining about pvrusb2-audio-old.c...
>
> Still looking at this one.  I've already reproduced the error.
>

The problem with pvrusb2-audio-old.c is that it is trying to use a 
structure type which no longer exists in the kernel starting with 2.6.17. 
This is not a "bad" thing because it has to do with an old interface to 
msp3400 which has been obsoleted and removed from v4l.  The module 
pvrusb2-audio-old is the pvrusb2 driver's interface to msp3400 using that 
old interface, and obviously its usefulness is kind of pointless here. 
With older kernels or when paired with (much) older versions of ivtv this 
module makes more sense, but not here.  The solution therefore is just to 
not include it in the driver; the pvrusb2-audio module implements the 
current interface and is already being used.

Attached to this message is a patch which disables pvrusb2-audio-old from 
the build for kernels 2.6.17 or later, by ifdef'ing out the contents of 
pvrusb2-audio-old and removing the one line of code in the pvrusb2 driver 
core which referenced it.

With this patch and the previously mentioned fix I'm getting clean builds 
now when compiled against 2.6.17-rc2 (a kernel build I happened to have 
laying around).  After I verify that the driver still builds with old 
kernels and is basically healthy with these changes, I'll release a new 
snapshot.

   -Mike


-- 
                         |         Mike Isely          |     PGP fingerprint
      Spammers Die!!     |                             | 03 54 43 4D 75 E5 CC 92
                         |   isely @ pobox (dot) com   | 71 16 01 E2 B5 F5 C1 E8
                         |                             |
-------------- next part --------------
Index: ivtv/msp3400.h
===================================================================
--- ivtv/msp3400.h	(revision 1165)
+++ ivtv/msp3400.h	(working copy)
@@ -8,9 +8,9 @@
 	int value;
 };
 
-/* Only needed for kernels < 2.6.16 because anything newer defines
-   this in v4l2-common.h */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16))
+/* NOT needed for kernel == 2.6.16 because that version defines this
+   in v4l2-common.h */
+#if (LINUX_VERSION_CODE != KERNEL_VERSION(2,6,16))
 struct msp_matrix {
 	int input;
 	int output;
Index: driver/pvrusb2-audio-old.c
===================================================================
--- driver/pvrusb2-audio-old.c	(revision 1165)
+++ driver/pvrusb2-audio-old.c	(working copy)
@@ -21,6 +21,9 @@
  */
 
 #include "compat.h"
+
+#ifdef ENABLE_PVRUSB2_AUDIO_OLD
+
 #include "pvrusb2-audio-old.h"
 #include "pvrusb2-hdw-internal.h"
 #include "pvrusb2-debug.h"
@@ -247,6 +250,7 @@
 	return !0;
 }
 
+#endif
 
 /*
   Stuff for Emacs to see, in order to encourage consistent editing style:
Index: driver/pvrusb2-audio-old.h
===================================================================
--- driver/pvrusb2-audio-old.h	(revision 1165)
+++ driver/pvrusb2-audio-old.h	(working copy)
@@ -23,10 +23,16 @@
 #ifndef __PVRUSB2_AUDIO_OLD_H
 #define __PVRUSB2_AUDIO_OLD_H
 
+#include "compat.h"
+
 #include "pvrusb2-i2c-core.h"
 
+#ifdef ENABLE_PVRUSB2_AUDIO_OLD
+
 int pvr2_i2c_msp3400_old_setup(struct pvr2_hdw *,struct pvr2_i2c_client *);
 
+#endif
+
 #endif /* __PVRUSB2_AUDIO_H */
 
 /*
Index: driver/compat.h
===================================================================
--- driver/compat.h	(revision 1166)
+++ driver/compat.h	(working copy)
@@ -148,6 +148,12 @@
        reasonably sure should be available but which are not (yet)
        reported by tveeprom.
 
+     PVR2_ENABLE_PVRUSB2_AUDIO_OLD - When defined, build
+       pvrusb2-audio-old.  This is an integration for msp3400 using an
+       older API.  You don't need this unless you're building with
+       msp3400 from an old kernel or you are trying to play nicely
+       with an old version of ivtv.
+
    MCI <isely at pobox.com> 26-Nov-2005 - About saa7115 vs saa711x...
    These are two different modules but they serve the same purpose.
    The "saa7115" that we have known all along comes from ivtv, while
@@ -202,6 +208,7 @@
 #define PVR2_ENABLE_NEW_ROUTING
 #else
 #define PVR2_ENABLE_CX25840_FWSEND_HACK
+#define ENABLE_PVRUSB2_AUDIO_OLD
 #endif
 
 /* Enable various things if kernel is recent enough or we're in V4L CVS */
Index: driver/pvrusb2-i2c-chips-all.c
===================================================================
--- driver/pvrusb2-i2c-chips-all.c	(revision 1165)
+++ driver/pvrusb2-i2c-chips-all.c	(working copy)
@@ -88,11 +88,13 @@
 	cp->ctl_mask = OP_V4L2_MASK_ALL;
 
 	if (id == I2C_DRIVERID_MSP3400) {
+#ifdef ENABLE_PVRUSB2_AUDIO_OLD
 		cp->ctl_mask = OP_V4L1_MASK_ALL;
 		if (pvr2_i2c_msp3400_old_setup(hdw,cp)) {
 			/* Talking to an older msp3400... */
 			return;
 		}
+#endif
 		cp->ctl_mask = OP_V4L2_MASK_ALL;
 		if (pvr2_i2c_msp3400_setup(hdw,cp)) {
 			/* Talking to a recent v4l2-aware msp3400... */


More information about the pvrusb2 mailing list