I2C: New chip driver: sis5595
PATCH 1/1 I2C: New chip driver: sis5595
Hi Greg,
The following patch against kernel 2.6.11-rc2-mm1 adds the sis5595 driver (sensor part). I have ported it from the 2.4 version
It has been reviewed by Jean Delvare, partly on IRC.
Please apply.
Thanks,
Aurelien
drivers/i2c/chips/Kconfig +12 -0
@@ -262,6 +262,18 @@ This driver can also be built as a module. If so, the module will be called smsc47b397. +config SENSORS_SIS5595 + tristate "Silicon Integrated Systems Corp. SiS5595" + depends on I2C && PCI && EXPERIMENTAL + select I2C_SENSOR + select I2C_ISA + help + If you say yes here you get support for the integrated sensors in + SiS5595 South Bridges. + + This driver can also be built as a module. If so, the module + will be called sis5595. + config SENSORS_SMSC47M1 tristate "SMSC LPC47M10x and compatibles" depends on I2C && EXPERIMENTAL
drivers/i2c/chips/Makefile +1 -0
@@ -31,6 +31,7 @@ obj-$(CONFIG_SENSORS_PCF8574) += pcf8574.o obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o obj-$(CONFIG_SENSORS_RTC8564) += rtc8564.o +obj-$(CONFIG_SENSORS_SIS5595) += sis5595.o obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o obj-$(CONFIG_SENSORS_VIA686A) += via686a.o
drivers/i2c/chips/sis5595.c +772 -0
772 lines not on this page · raw message
Signature · 4 lines
.''`. Aurelien Jarno GPG: 1024D/F1BCDB73 : :' : Debian GNU/Linux developer | Electrical Engineer `. `' [email protected] | [email protected] `- people.debian.org/~aurel32 | www.aurel32.net
drivers/i2c/chips/sis5595.c line 485
Quoted 8 lines · Aur?lien Jarno
drivers/i2c/chips/sis5595.c +8
-0+/* Locate SiS bridge and correct base address for SIS5595 */ +static int sis5595_find_sis (int *address) +{ +u16 val; +int *i; + +if (!(s_bridge = +pci_find_device (PCI_VENDOR_ID_SI ,PCI_DEVICE_ID_SI_503 ,NULL )))
Please use pci_get_device(). It's safer, and not a depreciated function.
drivers/i2c/chips/sis5595.c line 490
Quoted 3 lines
drivers/i2c/chips/sis5595.c +3
-0+/* Look for imposters */ +for (i = blacklist; *i !=0 ; i++) { +if (pci_find_device (PCI_VENDOR_ID_SI , *i,NULL )) {
Same here.
Quoted 1 line
drivers/i2c/chips/sis5595.c +1
-0+printk ("sis5595.ko: Error: Looked for SIS5595 but found unsupported device %.4X\n" , *i);
<snip>
drivers/i2c/chips/sis5595.c line 502
Quoted 1 line
drivers/i2c/chips/sis5595.c +1
-0+printk ("sis5595.ko: base address not set - upgrade BIOS or use force_addr=0xaddr\n" );
These printk() calls need a KERN_ level. Why not use the dev_* calls instead? You have a pci_dev to use here, right?
thanks,
greg k-h
Hi Greg,
Please find below the new version of the patch against kernel 2.6.11-rc2-mm2 to add the sis5595 driver (sensor part).
As you suggested, I have changed pci_find_device by pci_get_device, and replaced the printk() by dev_err(). I have also sorted the blacklist so that the PCI devices are listed in alphanumerical order (as in the 2.4 driver).
Thanks,
Aurelien
drivers/i2c/chips/Kconfig +12 -0
@@ -262,6 +262,18 @@ This driver can also be built as a module. If so, the module will be called smsc47b397. +config SENSORS_SIS5595 + tristate "Silicon Integrated Systems Corp. SiS5595" + depends on I2C && PCI && EXPERIMENTAL + select I2C_SENSOR + select I2C_ISA + help + If you say yes here you get support for the integrated sensors in + SiS5595 South Bridges. + + This driver can also be built as a module. If so, the module + will be called sis5595. + config SENSORS_SMSC47M1 tristate "SMSC LPC47M10x and compatibles" depends on I2C && EXPERIMENTAL
drivers/i2c/chips/Makefile +1 -0
@@ -31,6 +31,7 @@ obj-$(CONFIG_SENSORS_PCF8574) += pcf8574.o obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o obj-$(CONFIG_SENSORS_RTC8564) += rtc8564.o +obj-$(CONFIG_SENSORS_SIS5595) += sis5595.o obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o obj-$(CONFIG_SENSORS_VIA686A) += via686a.o
drivers/i2c/chips/sis5595.c +772 -0
772 lines not on this page · raw message
Signature · 4 lines
.''`. Aurelien Jarno GPG: 1024D/F1BCDB73 : :' : Debian GNU/Linux developer | Electrical Engineer `. `' [email protected] | [email protected] `- people.debian.org/~aurel32 | www.aurel32.net