PATCH - ALI 1535
The enclosed patch adds an adapter class to the ALI1535 bus driver. The patch is against Linux kernel 2.6.1, but is trivial so it should apply to more recent kernels.
Background
The ADM1021 chip driver fails to detect the pair of MAX1617A on one of my ALI1535 equipped systems. The detection never gets performed, as the first thing adm1021_attach_adapter() does is check for I2C_ADAP_CLASS_SMBUS.
I figured the ALI1535 bus driver was probably not popular enough to be thoroughly tested in 2.6, so I looked at the PIIX4 bus driver and noticed that it explictly set the adapter class. Doing the same in the ALI1535 bus driver causes the ADM1021 driver to detect as expected, and appears to be "The right thing to do".
Additional
The ADM1021 chip driver returns success for several error conditions. This should probably be addressed.
Signature · 55 lines
Andrew E. Mileski -------------- next part -------------- From: "Andrew E. Mileski" <[email protected]> To: "Andrew E. Mileski" <[email protected]> Subject: ALI1535 patch MIME-Version: 1.0 Content-type: multipart/mixed; boundary="B_3073578747_26242" This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. B_3073578747_26242 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit The enclosed patch adds an adapter class to the ALI1535 bus driver. The patch is against Linux kernel 2.6.1, but is trivial so it should apply to more recent kernels. Background The ADM1021 chip driver fails to detect the pair of MAX1617A on one of my ALI1535 equipped systems. The detection never gets performed, as the first thing adm1021_attach_adapter() does is check for I2C_ADAP_CLASS_SMBUS. I figured the ALI1535 bus driver was probably not popular enough to be thoroughly tested in 2.6, so I looked at the PIIX4 bus driver and noticed that it explictly set the adapter class. Doing the same in the ALI1535 bus driver causes the ADM1021 driver to detect as expected, and appears to be "the right thing to do". Additional The ADM1021 chip driver returns success for several error conditions. This should probably be addressed. B_3073578747_26242 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Content-disposition: attachment; filename="i2c-ali1535.patch" diff -urN drivers/i2c/busses/i2c-ali1535.c.orig drivers/i2c/busses/i2c-ali1535.c --- drivers/i2c/busses/i2c-ali1535.c.orig 2004-03-11 06:14:37.938198293 -0500 +++ drivers/i2c/busses/i2c-ali1535.c 2004-03-11 06:16:14.190730740 -0500 @@ -481,6 +481,7 @@ static struct i2c_adapter ali1535_adapter = { .owner = THIS_MODULE, + .class = I2C_ADAP_CLASS_SMBUS, .algo = &smbus_algorithm, .name = "unset", }; B_3073578747_26242
Quoting "Andrew E. Mileski" <[email protected]>:
Quoted 3 lines
The enclosed patch adds an adapter class to the ALI1535 bus driver. The patch is against Linux kernel 2.6.1, but is trivial so it should apply to more recent kernels.
This was known and fixed:
http://delvare.nerim.net/i2c/linux-2.6/linux-2.6.4-rc2-i2c-busses-class.diff
And is already in 2.6.4-mm1.
But thanks for reporting though :)
Quoted 3 lines
Additional
The ADM1021 chip driver returns success for several error conditions. This should probably be addressed.
Sure. Care to submit a patch? If you find similar issues in other chip drivers as well, patches are welcome.
Patches are prefered against 2.6.4-mm1.
Thanks.
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/