2.5 support for i2c-i801.c and i2c-piix4.c
PATCH 1/1 2.5 support for i2c-i801.c and i2c-piix4.c
Hi,
Here's a patch against the latest cvs tree that adds proper pci id support and probing for the i2c-i801.c and i2c-piix4.c drivers. I've tested it here on different machines, and it seems to work well. I also cleaned up a few preinitiaized variables and made some functions static that needed to be.
Feel free to commit this if you want.
On a related note, does anyone mind if I submit these drivers (along with the needed build files) for incluson in the 2.5 kernel tree? Same thing goes for my driver model patches I sent out the other day.
As it seems that the listed kernel maintainers for i2c aren't doing anything anymore, the responsible person for getting kernel changes into the mainline seems a bit hard to find right now :)
thanks,
greg k-h
Index: kernel/busses/i2c-i801.c
=================================RCS file: /home/cvs/lm_sensors2/kernel/busses/i2c-i801.c,v retrieving revision 1.30
busses/i2c-i801.c +38 -29
@@ -132,46 +132,25 @@ -static unsigned short i801_smba =0 ; -static struct pci_dev *I801_dev =NULL ; -static int isich4 =0 ; +static unsigned short i801_smba; +static struct pci_dev *I801_dev; +static int isich4;/* Detect whether a I801 can be found, and initialize it, where necessary. Note the differences between kernels with the old PCI BIOS interface and newer kernels with the real PCI interface. In compat.h some things are defined to make the transition easier. */ -int i801_setup (void ) +static int i801_setup (struct pci_dev *dev) {int error_return =0 ;int *num = supported;unsigned char temp; -/* First check whether we can access PCI at all */ -if (pci_present () =0 ) { -printk (KERN_WARNING "i2c-i801.o: Error: No PCI-bus found!\n" ); - error_return = -ENODEV ; - goto END; - } - -/* Look for each chip */ /* Note: we keep on searching until we have found 'function 3' */ - I801_dev =NULL ; -do { -if ((I801_dev =pci_find_device (PCI_VENDOR_ID_INTEL , - *num, I801_dev))) { -if (PCI_FUNC (I801_dev->devfn) !=3 ) -continue ; -break ; - } - num++; - }while (*num !=0 ); +if (PCI_FUNC (dev->devfn) !=3 ) +return -ENODEV ; -if (I801_dev =NULL ) { -printk - (KERN_WARNING "i2c-i801.o: Error: Can't detect I801, function 3!\n" ); - error_return = -ENODEV ; - goto END; - } + I801_dev = dev; isich4 = *num =PCI_DEVICE_ID_INTEL_82801DB_SMBUS ;/* Determine the address of the SMBus areas */
@@ -659,13 +638,43 @@static struct pci_device_id i801_ids[]__devinitdata = { + { + .vendor =PCI_VENDOR_ID_INTEL , + .device =PCI_DEVICE_ID_INTEL_82801AA_3 , + .subvendor =PCI_ANY_ID , + .subdevice =PCI_ANY_ID , + }, + { + .vendor =PCI_VENDOR_ID_INTEL , + .device =PCI_DEVICE_ID_INTEL_82801AB_3 , + .subvendor =PCI_ANY_ID , + .subdevice =PCI_ANY_ID , + }, + { + .vendor =PCI_VENDOR_ID_INTEL , + .device =PCI_DEVICE_ID_INTEL_82801BA_2 , + .subvendor =PCI_ANY_ID , + .subdevice =PCI_ANY_ID , + }, + { + .vendor =PCI_VENDOR_ID_INTEL , + .device =PCI_DEVICE_ID_INTEL_82801CA_SMBUS , + .subvendor =PCI_ANY_ID , + .subdevice =PCI_ANY_ID , + }, + { + .vendor =PCI_VENDOR_ID_INTEL , + .device =PCI_DEVICE_ID_INTEL_82801DB_SMBUS , + .subvendor =PCI_ANY_ID , + .subdevice =PCI_ANY_ID , + }, {0 , } };static int __devinit i801_probe (struct pci_dev *dev,const struct pci_device_id *id) { -if (i801_setup ()) { +if (i801_setup (dev)) {printk (KERN_WARNING "i2c-i801.o: I801 not detected, module not inserted.\n" );return -ENODEV ;
Index: kernel/busses/i2c-piix4.c
=================================RCS file: /home/cvs/lm_sensors2/kernel/busses/i2c-piix4.c,v retrieving revision 1.53
busses/i2c-piix4.c +52 -43
151 lines not on this page · raw message
PATCH 1/1 2.5 support for i2c-i801.c and i2c-piix4.c
Quoted 4 lines · Albert Cranford
One other thought. Watch the BK tree since Christoph H is submitting his versions of i2c to Linus and there may be conflicts.
Will do, as I have to merge with that tree to get the patches in a state that Linus will take them :)
I've also talked with Christoph, and I think the stuff he sent today to lkml is the last of his recent changes.
thanks,
greg k-h
PATCH 1/1 2.5 support for i2c-i801.c and i2c-piix4.c
In reply to Greg KHQuoted 11 lines · Greg KH
Hi,
Here's a patch against the latest cvs tree that adds proper pci id support and probing for the
i2c-i801.candi2c-piix4.cdrivers. I've tested it here on different machines, and it seems to work well. I also cleaned up a few preinitiaized variables and made some functions static that needed to be.Feel free to commit this if you want.
Quoted 7 lines
On a related note, does anyone mind if I submit these drivers (along with the needed build files) for incluson in the 2.5 kernel tree? Same thing goes for my driver model patches I sent out the other day.
As it seems that the listed kernel maintainers for i2c aren't doing anything anymore, the responsible person for getting kernel changes into the mainline seems a bit hard to find right no
One other thought. Watch the BK tree since Christoph H is submitting his versions of i2c to Linus and there may be conflicts.
Albert
Signature · 2 lines
Albert Cranford Deerfield Beach FL USA [email protected]