Usbvision/i2c-algo-usb port to 2.8.0
Is it possible to put a patch for the usbvision drivers
(http://sourceforge.net/projects/usbvision/) to work with i2c 2.8.0?
Thanks!
---
Jose Bernardo B R Silva | Source Mage GNU/Linux Section Guru
[email protected] | http://www.sourcemage.org
http://counter.li.org #245602
http://cosmos.oninetspeed.pt/jose.bernardo
[email protected]
Thanks! Will do, as soon as I can. I will also email the patch to the author(s) of the usbvision drivers, after I test it, ok?
---
Jose Bernardo B R Silva | Source Mage GNU/Linux Section Guru
[email protected] | http://www.sourcemage.org
http://counter.li.org #245602
http://cosmos.oninetspeed.pt/jose.bernardo
[email protected]
---------- Original Message -----------
From: Jean Delvare <[email protected]>
To: "Jose Bernardo Silva" <[email protected]>
Cc: [email protected]
Sent: Thu, 31 Jul 2003 10:14:44 +0200
Subject: Re: Usbvision/i2c-algo-usb port to 2.8.0
Quoted 9 lines
Quoted 2 lines
Is it possible to put a patch for the usbvision drivers
(http://sourceforge.net/projects/usbvision/) to work with i2c 2.8.0?Done! Not tested however (I don't feel like patching my kernel source tree for a device I don't have). Please let me know how it works.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
------- End of Original Message -------
Quoted 3 lines
Is it possible to put a patch for the usbvision drivers
(http://sourceforge.net/projects/usbvision/) to work with i2c 2.8.0?
Done! Not tested however (I don't feel like patching my kernel source tree for a device I don't have). Please let me know how it works.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Quoted 3 lines
Thanks! Will do, as soon as I can. I will also email the patch to the author(s) of the usbvision drivers, after I test it, ok?
Mhh, not necessarily. The patch is intended for users, not authors. If the author was to apply this patch to his code right now, users that are not using i2c-2.8.0 couldn't use usbvision anymore.
Once the new I2C has made it into the official kernel (should be 2.4.23) we'll submit real patches to the authors that work for both pre-2.4.23 and 2.4.23 kernels.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
I finally managed to test the patch, the following (or something like it) should be added:
--------------------------------------------------------------
--- /usr/src/usbvision-0.3.3-test5/src/i2c-algo-usb.c 2003-06-05
10:34:26.000000000 +0100
+++ /usr/src/linux/drivers/usb/i2c-algo-usb.c 2003-08-03 22:23:20.000000000
+0100
@@ -182,14 +182,11 @@
/* -----exported algorithm data: ------------------------------------- */
static struct i2c_algorithm i2c_usb_algo = {
- "USB algorithm", - I2C_ALGO_BIT, /* FIXME */ - usb_xfer, - NULL, - NULL, /* slave_xmit */ - NULL, /* slave_recv */ - algo_control, /* ioctl */ - usb_func, /* functionality */ + .owner = THIS_MODULE, + .name = "USB algorithm", + .id = I2C_ALGO_BIT, + .master_xfer = usb_xfer, + .functionality = usb_func,
};
/*
--------------------------------------------------------------
Apart from that, it worked fine. Thanks!
---
Jose Bernardo B R Silva | Source Mage GNU/Linux Section Guru
[email protected] | http://www.sourcemage.org
http://counter.li.org #245602
http://cosmos.oninetspeed.pt/jose.bernardo
[email protected]
---------- Original Message -----------
From: Jean Delvare <[email protected]>
To: "Jose Bernardo Silva" <[email protected]>
Cc: [email protected]
Sent: Thu, 31 Jul 2003 11:50:58 +0200
Subject: Re: Usbvision/i2c-algo-usb port to 2.8.0
Quoted 14 lines
Quoted 2 lines
Thanks! Will do, as soon as I can. I will also email the patch to the author(s) of the usbvision drivers, after I test it, ok?
Mhh, not necessarily. The patch is intended for users, not authors. If the author was to apply this patch to his code right now, users that are not using i2c-2.8.0 couldn't use usbvision anymore.
Once the new I2C has made it into the official kernel (should be 2.4.23) we'll submit real patches to the authors that work for both pre-2.4.23 and 2.4.23 kernels.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
------- End of Original Message -------
Quoted 32 lines
I finally managed to test the patch, the following (or something like it) should be added:
--------------------------------------------------------------
---/usr/src/usbvision-0.3.3-test5/src/i2c-algo-usb.c2003-06-05
10:34:26.000000000 +0100
+++/usr/src/linux/drivers/usb/i2c-algo-usb.c2003-08-03
22:23:20.000000000+0100(quoted diff) +5
-8@@ -182,14 +182,11 @@ /* -----exported algorithm data: ------------------------------------- */ static struct i2c_algorithm i2c_usb_algo = { - "USB algorithm", - I2C_ALGO_BIT, /* FIXME */ - usb_xfer, - NULL, - NULL, /* slave_xmit */ - NULL, /* slave_recv */ - algo_control, /* ioctl */ - usb_func, /* functionality */ + .owner = THIS_MODULE, + .name = "USB algorithm", + .id = I2C_ALGO_BIT, + .master_xfer = usb_xfer, + .functionality = usb_func, };/*
--------------------------------------------------------------
Quoted 1 line
Apart from that, it worked fine. Thanks!
You're welcome. I didn't know that the i2c_algorithm struct could require changes too, thanks a lot for pointing this out. I hope I didn't miss such changes for other drivers I have been converting, other than the saa7134 which I just fixed too. Since I had been testing the other drivers (use or at least compilation), I guess it's OK.
I uploaded fixed patches a few minutes ago. My fix for i2c-algo-usb is slightly different, since you forgot the algo_control member. I guess it wasn't intentional and fixed that too.
Thanks for reporting!
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
I picked up most from the kernel patch
(http://www.ensicaen.ismra.fr/~delvare/devel/i2c/linux-2.4.21-i2c-2.8.0.patch),
in which you also leave out algo_control in your patch for i2c-algo-bit.c;
@@ -532,12 +519,9 @@
static struct i2c_algorithm i2c_bit_algo = {
- "Bit-shift algorithm",
- I2C_ALGO_BIT,
- bit_xfer,
- NULL,
- NULL, /* slave_xmit */
- NULL, /* slave_recv */
- algo_control, /* ioctl */
- bit_func, /* functionality */
+ .owner = THIS_MODULE,
+ .name = "Bit-shift algorithm",
+ .id = I2C_ALGO_BIT,
+ .master_xfer = bit_xfer,
+ .functionality = bit_func,
};
As this seems to work, I tried converting i2c-algo-usb.c based on this, and even leaving out algo_control I was able to compile and use the drivers. I'll try your new patch when I get home today (I hope),
Thanks!
---
Jose Bernardo B R Silva | Source Mage GNU/Linux Section Guru
[email protected] | http://www.sourcemage.org
http://counter.li.org #245602
http://cosmos.oninetspeed.pt/jose.bernardo
[email protected]
---------- Original Message -----------
From: Jean Delvare <[email protected]>
To: "Jose Bernardo Silva" <[email protected]>
Cc: [email protected]
Sent: Mon, 4 Aug 2003 14:14:00 +0200
Subject: Re: Usbvision/i2c-algo-usb port to 2.8.0
Quoted 39 lines
Quoted 31 lines
I finally managed to test the patch, the following (or something like it) should be added:
--------------------------------------------------------------
---/usr/src/usbvision-0.3.3-test5/src/i2c-algo-usb.c2003-06-05
10:34:26.000000000 +0100
+++/usr/src/linux/drivers/usb/i2c-algo-usb.c2003-08-03
22:23:20.000000000+0100(quoted diff) +5
-8@@ -182,14 +182,11 @@ /* -----exported algorithm data: ------------------------------------- */ static struct i2c_algorithm i2c_usb_algo = { - "USB algorithm", - I2C_ALGO_BIT, /* FIXME */ - usb_xfer, - NULL, - NULL, /* slave_xmit */ - NULL, /* slave_recv */ - algo_control, /* ioctl */ - usb_func, /* functionality */ + .owner = THIS_MODULE, + .name = "USB algorithm", + .id = I2C_ALGO_BIT, + .master_xfer = usb_xfer, + .functionality = usb_func, };/*
--------------------------------------------------------------Quoted 1 line
Apart from that, it worked fine. Thanks!
You're welcome. I didn't know that the
i2c_algorithmstruct could require changes too, thanks a lot for pointing this out. I hope I didn't miss such changes for other drivers I have been converting, other than the saa7134 which I just fixed too. Since I had been testing the other drivers (use or at least compilation), I guess it's OK.
Quoted 9 lines
I uploaded fixed patches a few minutes ago. My fix for i2c-algo-usb is slightly different, since you forgot the
algo_controlmember. I guess it wasn't intentional and fixed that too.Thanks for reporting!
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
------- End of Original Message -------
Quoted 5 lines
I picked up most from the kernel patch
(http://www.ensicaen.ismra.fr/~delvare/devel/i2c/linux-2.4.21-i2c-2.8
.0.patch), in which you also leave outalgo_controlin your patch fori2c-algo-bit.c;
(Just took a deeper look at the code.)
That's because it was unused for that particular algorithm. But it is still used for two other algorithms: ibm_ocp and iop3xx (not build by default). So if i2c-algo-usb was using it, I think we have to leave it there.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/