|
View:
New views
12 Messages
—
Rating Filter:
Alert me
|
|
|
i2c changes in 2.6.15+Attached is an informational (not meant to be applied as-is, but maybe
good for testing) patch for i2c changes in 2.6.15 and later kernels. Compile-tested only on the latest FC5test2/Rawhide 2.6.16-rc1-something kernel (which reports itself as 2.6.15, but that's outside of the scope of this patch and not taken into account). I haven't actually used the patched modules with any kernel. The patch also removes the EM8300_I2C_FORCE_*_API flags for clarity, maybe they can be restored by someone who groks the code and i2c versions better. Notes: i2c_driver.flags is gone in 2.6.16, apparently without a replacement. i2c_driver.{name,owner} have moved to i2c_driver.driver.{name,owner} in 2.6.16. That change could apparently be done on some earlier kernels too; at least many in-kernel drivers were changed like that in 2.6.15. This patch however does that only for >= 2.6.16. Documentation/i2c/writing-clients was changed in 2.6.15 to say this about i2c_driver.name: --- The name field must match the driver name, including the case. It must not contain spaces, and may be up to 31 characters long. --- For simplicity, this patch changes the name accordingly for all kernel versions. [em8300-i2c.patch] Index: modules/adv717x.c =================================================================== RCS file: /cvsroot/dxr3/em8300/modules/adv717x.c,v retrieving revision 1.49 diff -u -r1.49 adv717x.c --- modules/adv717x.c 5 Nov 2005 01:12:13 -0000 1.49 +++ modules/adv717x.c 21 Jan 2006 16:37:57 -0000 @@ -199,12 +199,19 @@ /* This is the driver that will be inserted */ static struct i2c_driver adv717x_driver = { -#if defined(EM8300_I2C_FORCE_NEW_API) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) && !defined(EM8300_I2C_FORCE_OLD_API)) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) + .driver = { + .owner = THIS_MODULE, + .name = "adv717x", + }, +#else .owner = THIS_MODULE, + .name = "adv717x", + .flags = I2C_DF_NOTIFY, +#endif #endif - .name = "ADV717X video encoder driver", .id = I2C_DRIVERID_ADV717X, - .flags = I2C_DF_NOTIFY, .attach_adapter = &adv717x_attach_adapter, .detach_client = &adv717x_detach_client, .command = &adv717x_command Index: modules/bt865.c =================================================================== RCS file: /cvsroot/dxr3/em8300/modules/bt865.c,v retrieving revision 1.40 diff -u -r1.40 bt865.c --- modules/bt865.c 15 Nov 2005 07:15:16 -0000 1.40 +++ modules/bt865.c 21 Jan 2006 16:37:57 -0000 @@ -87,12 +87,19 @@ /* This is the driver that will be inserted */ static struct i2c_driver bt865_driver = { -#if defined(EM8300_I2C_FORCE_NEW_API) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) && !defined(EM8300_I2C_FORCE_OLD_API)) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) + .driver = { + .owner = THIS_MODULE, + .name = "bt865", + }, +#else .owner = THIS_MODULE, + .name = "bt865", + .flags = I2C_DF_NOTIFY, +#endif #endif - .name = "BT865 video encoder driver", .id = I2C_DRIVERID_BT865, - .flags = I2C_DF_NOTIFY, .attach_adapter = &bt865_attach_adapter, .detach_client = &bt865_detach_client, .command = &bt865_command Index: modules/em8300_i2c.c =================================================================== RCS file: /cvsroot/dxr3/em8300/modules/em8300_i2c.c,v retrieving revision 1.24 diff -u -r1.24 em8300_i2c.c --- modules/em8300_i2c.c 18 Nov 2005 23:29:07 -0000 1.24 +++ modules/em8300_i2c.c 21 Jan 2006 16:37:57 -0000 @@ -77,8 +77,12 @@ static int em8300_i2c_lock_client(struct i2c_client *client) { -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) && !defined(EM8300_I2C_FORCE_OLD_API)) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) + if (!try_module_get(client->driver->driver.owner)) { +#else if (!try_module_get(client->driver->owner)) { +#endif printk(KERN_ERR "em8300_i2c: Unable to lock client module\n"); return -ENODEV; } @@ -129,9 +133,13 @@ case I2C_DRIVERID_ADV717X: case I2C_DRIVERID_BT865: em->encoder = NULL; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) && !defined(EM8300_I2C_FORCE_OLD_API)) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) + module_put(client->driver->driver.owner); +#else module_put(client->driver->owner); #endif +#endif break; } |
|
|
Re: i2c changes in 2.6.15+Hi,
Oh, shit... I'm really geting upset with those never-ending i2c changes... :-( Nicolas ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ Dxr3-devel mailing list Dxr3-devel@... https://lists.sourceforge.net/lists/listinfo/dxr3-devel |
|
|
Re: i2c changes in 2.6.15+Hi
this patch works with kernel 2.6.16-rc1. S. ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ Dxr3-devel mailing list Dxr3-devel@... https://lists.sourceforge.net/lists/listinfo/dxr3-devel |
|
|
Re: i2c changes in 2.6.15+On Sat, Jan 21, 2006 at 07:01:02PM +0200, Ville Skyttä wrote:
> Attached is an informational (not meant to be applied as-is, but maybe > good for testing) patch for i2c changes in 2.6.15 and later kernels. > Compile-tested only on the latest FC5test2/Rawhide 2.6.16-rc1-something > kernel (which reports itself as 2.6.15, but that's outside of the scope > of this patch and not taken into account). I haven't actually used the > patched modules with any kernel. The patch also removes the > EM8300_I2C_FORCE_*_API flags for clarity, maybe they can be restored by > someone who groks the code and i2c versions better. > > Notes: > > i2c_driver.flags is gone in 2.6.16, apparently without a replacement. > > i2c_driver.{name,owner} have moved to i2c_driver.driver.{name,owner} in > 2.6.16. That change could apparently be done on some earlier kernels > too; at least many in-kernel drivers were changed like that in 2.6.15. > This patch however does that only for >= 2.6.16. > > Documentation/i2c/writing-clients was changed in 2.6.15 to say this > about i2c_driver.name: > --- > The name field must match the driver name, including the case. It must > not contain spaces, and may be up to 31 characters long. > --- > For simplicity, this patch changes the name accordingly for all kernel > versions. That sounds sane. Anyway, a few comments about your patch: - as far as I can see no in-kernel driver sets the .driver.owner value; it is set in 2.6.16's i2c_add_driver - when LINUX_VERSION_CODE < KERNEL_VERSION(2,5,54), your patch removes the .name and .flags from the structure, which is certainly unexpected... ;-) I just made the corresponding changes. Please see (and try) the attached patch. Ville, thanks a lot for investigating this. Cheers, Nicolas ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 _______________________________________________ Dxr3-devel mailing list Dxr3-devel@... https://lists.sourceforge.net/lists/listinfo/dxr3-devel |
|
|
Re: i2c changes in 2.6.15+On Tue, Jan 24, 2006 at 11:03:35PM +0100, Nicolas Boullis wrote:
> > I just made the corresponding changes. Please see (and try) the attached > patch. Here it is. Nicolas Index: modules/adv717x.c =================================================================== RCS file: /cvsroot/dxr3/em8300/modules/adv717x.c,v retrieving revision 1.49 diff -u -r1.49 adv717x.c --- modules/adv717x.c 5 Nov 2005 01:12:13 -0000 1.49 +++ modules/adv717x.c 24 Jan 2006 22:02:56 -0000 @@ -199,12 +199,18 @@ /* This is the driver that will be inserted */ static struct i2c_driver adv717x_driver = { -#if defined(EM8300_I2C_FORCE_NEW_API) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) && !defined(EM8300_I2C_FORCE_OLD_API)) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) + .driver = { + .name = "adv717x", + }, +#else +#if defined(EM8300_I2C_FORCE_NEW_API) || LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) .owner = THIS_MODULE, #endif - .name = "ADV717X video encoder driver", - .id = I2C_DRIVERID_ADV717X, + .name = "adv717x", .flags = I2C_DF_NOTIFY, +#endif + .id = I2C_DRIVERID_ADV717X, .attach_adapter = &adv717x_attach_adapter, .detach_client = &adv717x_detach_client, .command = &adv717x_command Index: modules/bt865.c =================================================================== RCS file: /cvsroot/dxr3/em8300/modules/bt865.c,v retrieving revision 1.40 diff -u -r1.40 bt865.c --- modules/bt865.c 15 Nov 2005 07:15:16 -0000 1.40 +++ modules/bt865.c 24 Jan 2006 22:02:56 -0000 @@ -87,12 +87,18 @@ /* This is the driver that will be inserted */ static struct i2c_driver bt865_driver = { -#if defined(EM8300_I2C_FORCE_NEW_API) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) && !defined(EM8300_I2C_FORCE_OLD_API)) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) + .driver = { + .name = "bt865", + }, +#else +#if defined(EM8300_I2C_FORCE_NEW_API) || LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) .owner = THIS_MODULE, #endif - .name = "BT865 video encoder driver", - .id = I2C_DRIVERID_BT865, + .name = "bt865", .flags = I2C_DF_NOTIFY, +#endif + .id = I2C_DRIVERID_BT865, .attach_adapter = &bt865_attach_adapter, .detach_client = &bt865_detach_client, .command = &bt865_command Index: modules/em8300_i2c.c =================================================================== RCS file: /cvsroot/dxr3/em8300/modules/em8300_i2c.c,v retrieving revision 1.24 diff -u -r1.24 em8300_i2c.c --- modules/em8300_i2c.c 18 Nov 2005 23:29:07 -0000 1.24 +++ modules/em8300_i2c.c 24 Jan 2006 22:02:56 -0000 @@ -77,8 +77,12 @@ static int em8300_i2c_lock_client(struct i2c_client *client) { -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) && !defined(EM8300_I2C_FORCE_OLD_API)) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) + if (!try_module_get(client->driver->driver.owner)) { +#else if (!try_module_get(client->driver->owner)) { +#endif printk(KERN_ERR "em8300_i2c: Unable to lock client module\n"); return -ENODEV; } @@ -129,9 +133,13 @@ case I2C_DRIVERID_ADV717X: case I2C_DRIVERID_BT865: em->encoder = NULL; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) && !defined(EM8300_I2C_FORCE_OLD_API)) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) + module_put(client->driver->driver.owner); +#else module_put(client->driver->owner); #endif +#endif break; } |
|
|
Re: i2c changes in 2.6.15+On Tue, 2006-01-24 at 23:03 +0100, Nicolas Boullis wrote:
> - as far as I can see no in-kernel driver sets the .driver.owner > value; it is set in 2.6.16's i2c_add_driver Hm, ok. I haven't read much actual code lately but mostly skimmed diffs, so I probably mixed up some generations. > - when LINUX_VERSION_CODE < KERNEL_VERSION(2,5,54), your patch > removes the .name and .flags from the structure, which is certainly > unexpected... ;-) Right, that's an #if thinko. > I just made the corresponding changes. Thanks for catching those. > Please see (and try) the attached patch. What patch? ;) ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ Dxr3-devel mailing list Dxr3-devel@... https://lists.sourceforge.net/lists/listinfo/dxr3-devel |
|
|
Re: i2c changes in 2.6.15+On Tue, 2006-01-24 at 23:46 +0100, Nicolas Boullis wrote:
> On Tue, Jan 24, 2006 at 11:03:35PM +0100, Nicolas Boullis wrote: > > > > I just made the corresponding changes. Please see (and try) the attached > > patch. > > Here it is. Still works for me with kernel 2.6.14, and compiles/installs fine with 2.6.16-rc1. Cannot actually test the latter at the moment. With this patch, EM8300_I2C_FORCE_OLD_API does not seem to do anything any more, so modules/Makefile could be tweaked accordingly. ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ Dxr3-devel mailing list Dxr3-devel@... https://lists.sourceforge.net/lists/listinfo/dxr3-devel |
|
|
Re: i2c changes in 2.6.15+On Thu, Jan 26, 2006 at 08:55:22AM +0200, Ville Skyttä wrote:
> > With this patch, EM8300_I2C_FORCE_OLD_API does not seem to do anything > any more, so modules/Makefile could be tweaked accordingly. You're quite right. A patch would be welcome. (Me? Lazy? ;-) ) Nicolas ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 _______________________________________________ Dxr3-devel mailing list Dxr3-devel@... https://lists.sourceforge.net/lists/listinfo/dxr3-devel |
|
|
Re: i2c changes in 2.6.15+On Thu, 2006-01-26 at 19:53 +0100, Nicolas Boullis wrote:
> On Thu, Jan 26, 2006 at 08:55:22AM +0200, Ville Skyttä wrote: > > > > With this patch, EM8300_I2C_FORCE_OLD_API does not seem to do anything > > any more, so modules/Makefile could be tweaked accordingly. > > You're quite right. A patch would be welcome. (Me? Lazy? ;-) ) Well, I don't even know what the NEW API exactly stands for, but in any case I think it would suffice to just adjust the commentary so that it no longer advertises values != NEW having any effect (and mention that in ChangeLog too). No need to purge the Makefile logic as it may come in handy later again. Maybe just something like the attached patch? [em8300-i2c-Makefile.patch] Index: Makefile =================================================================== RCS file: /cvsroot/dxr3/em8300/modules/Makefile,v retrieving revision 1.72 diff -u -U1 -r1.72 Makefile --- Makefile 25 Jan 2006 22:00:40 -0000 1.72 +++ Makefile 26 Jan 2006 20:01:15 -0000 @@ -26,3 +26,3 @@ # Moreover, if the API of the modules is not properly guessed, you can -# force it by setting EM8300_I2C_FORCE_API to OLD or NEW. (That is +# force it by setting EM8300_I2C_FORCE_API to NEW. (That is # especially for using 2.8.x modules with 2.4.x kernels.) |
|
|
Re: i2c changes in 2.6.15+On Thu, Jan 26, 2006 at 10:10:03PM +0200, Ville Skyttä wrote:
> Well, I don't even know what the NEW API exactly stands for, but in any > case I think it would suffice to just adjust the commentary so that it > no longer advertises values != NEW having any effect (and mention that > in ChangeLog too). No need to purge the Makefile logic as it may come > in handy later again. Maybe just something like the attached patch? Sounds sane. Thanks, applied. Nicolas ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642 _______________________________________________ Dxr3-devel mailing list Dxr3-devel@... https://lists.sourceforge.net/lists/listinfo/dxr3-devel |
|
|
Re: Re: i2c changes in 2.6.15+Ho!
> this patch works with kernel 2.6.16-rc1. But it doesn't with 2.6.15-mm3, wich may not be a real kernel version to bother with anyway... With enabling the 2.6.16 i2c changes it is OK, apparently. And I get upset with this never ending changes in the 2.6 kernels, too (if it was for just adding new drivers like em8300 or my DVB card...)! Greets, Thomas. ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ Dxr3-devel mailing list Dxr3-devel@... https://lists.sourceforge.net/lists/listinfo/dxr3-devel |
|
|
Re: Re: i2c changes in 2.6.15+On Sat, Jan 28, 2006 at 01:04:25PM +0100, Thomas Orgis wrote:
> Ho! > > > this patch works with kernel 2.6.16-rc1. > > But it doesn't with 2.6.15-mm3, wich may not be a real kernel version to bother with anyway... With enabling the 2.6.16 i2c changes it is OK, apparently. I have never tried -mm kernels, but I would have thought that there was no way programmatically to make the make the difference between 2.6.15 and 2.6.15-mm3... > And I get upset with this never ending changes in the 2.6 kernels, too (if it was for just adding new drivers like em8300 or my DVB card...)! If only Linus could come back to reason... Nicolas ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ Dxr3-devel mailing list Dxr3-devel@... https://lists.sourceforge.net/lists/listinfo/dxr3-devel |
| Free embeddable forum powered by Nabble | Forum Help |