[linux-dvb] I2C changes in 2.6.14-rc1 causes breakage

Mike Krufky mkrufky at linuxtv.org
Thu Sep 15 16:53:17 CEST 2005

Johannes Stezenbach wrote:

>On Thu, Sep 15, 2005 at 03:15:26AM -0700, C.Y.M wrote:
>>Here is a complete patch to fix cvs of dvb-kernel and 2.6.14-rc1.  If the plan
>>is still to keep up with the latest RC, then I guess everyone is going to have
>>to upgrade kernels now. :)
>Two problems:
>- I was talking with Mauro about merging dvb and v4l CVS trees,
>  and they want to keep backwards compatibility; we'll need to sort
>  this out first
Last night, I've finished applying Jean Delvare's changes to the 
video4linux tree.  The I2C_DEVNAME / i2c_clientname --> client.name  
stuff in 2.6.14 is actually backwards compatable with older 2.6 
kernels.  The incompatability exists somewhere in 2.5.X series....  
AFAIK, the only portion of these patches that break kernels older than 
2.6.14-rc1 are changes such as the following:

@@ -408,7 +406,7 @@
 		i2c_adapter->dev.parent    = &dev->pci->dev;
 		i2c_adapter->algo	   = &saa7146_algo;
 		i2c_adapter->algo_data     = NULL;
-		i2c_adapter->id		   = I2C_ALGO_SAA7146;
+		i2c_adapter->id		   = I2C_HW_SAA7146;
 		i2c_adapter->timeout = SAA7146_I2C_TIMEOUT;
 		i2c_adapter->retries = SAA7146_I2C_RETRIES;

This can be handled in one of two ways:

1) either do something like this:

@@ -388,14 +386,18 @@
 	.class         = I2C_CLASS_TV_ANALOG,
-	I2C_DEVNAME("saa7134"),
+	.name          = "saa7134",
+	.id            = I2C_HW_SAA7134,
 	.id            = I2C_ALGO_SAA7134,
 	.algo          = &saa7134_algo,
 	.client_register = attach_inform,

...but I know you don't like these #if's and #ifdef's in dvb-kernel cvs.

2)  An alternative would be to create a "compat.h" , which could assign the value of 
I2C_HW_SAA7146 to be equal to the value of I2C_ALGO_SAA7146, if I2C_HW_SAA7146 
isn't already defined.

>- This patch is incomplete. Full patches were created by
>  Jean Delvare <khali at linux-fr.org> and posted to lkml:
>  Subject: [PATCH] (0/7) I2C: Kill i2c_algorithm.{name,id}
>  Date:   Thu, 11 Aug 2005 23:18:28 +0200
>  From: Jean Delvare <khali at linux-fr.org>
>  ...
>We'll need to get this patch from git and apply the dvb and v4l
>parts when the time has come.
So, I repeat... the v4l portion has already been applied to video4linux 
cvs, without hindering kernel backwards-compatability.  The dvb portion 
can easily be applied with some #if macros / compat.h stuff ..... 
meanwhile, don't let this stop the tree-merging process.... If 
video4linux is backwards compatable and dvb-kernel isn't right away, all 
that means is that we should not attempt to compile dvb-kernel stuff 
when compiling the merged tree against older kernels (until we work out 
the backwards-compat kinks).  We can take care of these decisions in a 
configure script....

Michael Krufky

More information about the linux-dvb mailing list