i2c driver fixes for 2.6.4
Subsystems (6)
PATCH 1/1 i2c driver fixes for 2.6.4
Hi,
Here are some i2c driver updates for 2.6.4. All of these changes have been in the last few -mm trees. It includes a number of bugfixes, new i2c chip drivers, and a rework of the i2c sysfs file interface. Because of the sysfs changes, a new version of lmsensors will be needed (just like almost all other 2.6 kernel releases...) Hopefully now the lmsensor/sysfs interface changes are resolved so this will not be necessary in the future.
Please pull from: bk://kernel.bkbits.net/gregkh/linux/i2c-2.6
Individual patches will follow, sent to the sensors and linux-kernel lists.
thanks,
greg k-h
Documentation/i2c/sysfs-interface | 272 +++-- drivers/i2c/algos/i2c-algo-bit.c | 2 drivers/i2c/algos/i2c-algo-pcf.c | 2 drivers/i2c/algos/Makefile | 4 drivers/i2c/busses/i2c-ali1535.c | 7 drivers/i2c/busses/i2c-ali15x3.c | 4 drivers/i2c/busses/i2c-amd756.c | 4 drivers/i2c/busses/i2c-amd8111.c | 4 drivers/i2c/busses/i2c-elektor.c | 4 drivers/i2c/busses/i2c-elv.c | 168 --- drivers/i2c/busses/i2c-elv.c | 8 drivers/i2c/busses/i2c-frodo.c | 4 drivers/i2c/busses/i2c-i801.c | 6 drivers/i2c/busses/i2c-i810.c | 4 drivers/i2c/busses/i2c-ibm_iic.c | 4 drivers/i2c/busses/i2c-iop3xx.c | 24 drivers/i2c/busses/i2c-isa.c | 4 drivers/i2c/busses/i2c-ite.c | 4 drivers/i2c/busses/i2c-ixp42x.c | 184 +++ drivers/i2c/busses/i2c-keywest.c | 4 drivers/i2c/busses/i2c-nforce2.c | 4 drivers/i2c/busses/i2c-parport.c | 4 drivers/i2c/busses/i2c-parport-light.c | 4 drivers/i2c/busses/i2c-philips-par.c | 242 ----- drivers/i2c/busses/i2c-philips-par.c | 4 drivers/i2c/busses/i2c-piix4.c | 4 drivers/i2c/busses/i2c-prosavage.c | 8 drivers/i2c/busses/i2c-rpx.c | 4 drivers/i2c/busses/i2c-savage4.c | 4 drivers/i2c/busses/i2c-sis5595.c | 7 drivers/i2c/busses/i2c-sis630.c | 4 drivers/i2c/busses/i2c-sis96x.c | 4 drivers/i2c/busses/i2c-velleman.c | 154 --- drivers/i2c/busses/i2c-velleman.c | 6 drivers/i2c/busses/i2c-via.c | 5 drivers/i2c/busses/i2c-viapro.c | 4 drivers/i2c/busses/i2c-voodoo3.c | 8 drivers/i2c/busses/Kconfig | 43 drivers/i2c/busses/Makefile | 8 drivers/i2c/busses/scx200_acb.c | 4 drivers/i2c/busses/scx200_i2c.c | 4 drivers/i2c/chips/adm1021.c | 65 - drivers/i2c/chips/asb100.c | 60 - drivers/i2c/chips/ds1621.c | 345 +++++++ drivers/i2c/chips/eeprom.c | 4 drivers/i2c/chips/fscher.c | 120 +- drivers/i2c/chips/gl518sm.c | 116 +- drivers/i2c/chips/it87.c | 372 ++------ drivers/i2c/chips/Kconfig | 64 + drivers/i2c/chips/lm75.c | 37 drivers/i2c/chips/lm78.c | 156 +-- drivers/i2c/chips/lm80.c | 730 +++++++++++++-- drivers/i2c/chips/lm83.c | 56 - drivers/i2c/chips/lm85.c | 189 +--- drivers/i2c/chips/lm90.c | 79 - drivers/i2c/chips/Makefile | 7 drivers/i2c/chips/via686a.c | 139 +-- drivers/i2c/chips/w83627hf.c | 1528 +++++++++++++++++++++++++++++++-- drivers/i2c/chips/w83781d.c | 324 +++--- drivers/i2c/chips/w83l785ts.c | 34 drivers/i2c/i2c-core.c | 15 drivers/i2c/i2c-dev.c | 49 - drivers/i2c/i2c-sensor.c | 4 drivers/i2c/Kconfig | 12 drivers/i2c/Makefile | 4 drivers/pci/quirks.c | 25 include/linux/pci_ids.h | 18 67 files changed, 3706 insertions(+), 2092 deletions(-)
-----
<aurelien:aurel32.net>:
o I2C: New chip driver: ds1621
<clemy:clemy.org>:
o I2C: add w83627hf driver
<dave.jiang:intel.com>:
o I2C: IOP3xx i2c driver update
<komoriya:paken.org>:
o I2C: it87 reset option
<perrye:linuxmail.org>:
o I2C: i2c-voodoo3.c needs I2C_ADAP_CLASS_TV_ANALOG
Adrian Bunk:
o I2C: update I2C help text
Deepak Saxena:
o I2C: Support for IXP42x GPIO-based I2C
Greg Kroah-Hartman:
o I2C: delete the i2c_philips-par.c and i2c-veleman.c drivers
o I2C: delete the i2c-elv.c driver as it is obsoleted by the i2c-parport.c driver
o I2C: fix up CONFIG_I2C_DEBUG_CHIP logic to be simpler on the .c files
o I2C: add CONFIG_I2C_DEBUG_ALGO to be consistant
o I2C: fix up CONFIG_I2C_DEBUG_CORE logic to be simpler on the .c files
o I2C: fix up CONFIG_I2C_DEBUG_BUS logic to be simpler on the .c files
o I2C: keep i2c-dev numbers in sync with i2c adapter numbers
o I2C: show adapter name in i2c-dev class directory to make it easier for userspace tools
o I2C: fix compiler warnings in 2 drivers
o I2C: fix oops in i2c-ali1535 driver if no hardware is present
Jean Delvare:
o I2C: Setting w83781d fan_div preserves fan_min
o I2C: Don't handle kind errors that cannot happen
o I2C: fix forced i2c chip drivers have no name
o I2C: Cleanup fan_div in w83781d
o I2c: Kconfig for non-sensors i2c chip drivers
o I2C: fix i2c adapters class for now
o I2C: Prevent i2c-dev oops with debug
o I2C: rename sysfs files, part 2 of 2
o I2C: rename sysfs files, part 1 of 2
o I2C: update for sysfs-interface documentation
o I2C: Remove asb100 support from w83781d
o I2C: fix another oops in i2c-core with debug
o I2C: fix it87 sensor type
o I2C: fix Hangs with w83781d
o I2C: Lowercase chips name
o I2C: fix mor rmmod oopses
o I2C: fix space in message
o I2C: New chip driver ported: lm80
o I2C: Credit James Bolt in w83l785ts
o I2C: Enable debugging in fscher
Mark M. Hoffman:
o I2C: sensor chip driver refactoring
o I2C: sysfs interface update for w83627hf
o PCI: fix i2c quirk for SiS735 chipset SMBus driver
Randy Dunlap:
o I2C: fix i2c-prosavage.c section usage
Russell King:
o I2C: Fix i2c_use_client()
PATCH 1/1 i2c driver fixes for 2.6.4
ChangeSet 1.1557.61.1, 2004/02/17 14:03:35-08:00, [email protected]
[PATCH] I2C: i2c-voodoo3.c needs I2C_ADAP_CLASS_TV_ANALOG
The Voodoo3 i2c bus has either a bt869 tv-out chip, or also a tv tuner, decoder and msp3400. Without I2C_ADAP_CLASS_TV_ANALOG, the i2c clients would have to do a strcmp of the adapter name to distiguish between the i2c and ddc adapters. Yes, they should be able to tell if the chip at a given address is what they are looking for, but in the case of the v3tv module, which is the v4l device, in the 2.4 kerenl I've got it set to create a dummy client, and the strcmp is the only way to distinguish the i2c from the ddc. In the 2.6 kernel, class can be defined, simplifying things for the v3tv module.
drivers/i2c/busses/i2c-voodoo3.c | 2 ++ 1 files changed, 2 insertions(+)
drivers/i2c/busses/i2c-voodoo3.c +2 -0
@@ -171,6 +171,7 @@static struct i2c_adapter voodoo3_i2c_adapter = { .owner =THIS_MODULE , + .class =I2C_ADAP_CLASS_TV_ANALOG , .name ="I2C Voodoo3/Banshee adapter" , .algo_data = &voo_i2c_bit_data, };
@@ -187,6 +188,7 @@static struct i2c_adapter voodoo3_ddc_adapter = { .owner =THIS_MODULE , + .class =I2C_ADAP_CLASS_DDC , .name ="DDC Voodoo3/Banshee adapter" , .algo_data = &voo_ddc_bit_data, };
ChangeSet 1.1557.61.2, 2004/02/17 14:40:59-08:00, [email protected]
[PATCH] I2C: Enable debugging in fscher
I just noticed that I forgot to enable debugging in the new fscher driver. Sorry for that. Here is a patch that fixes this.
drivers/i2c/chips/fscher.c | 5 +++++ 1 files changed, 5 insertions(+)
drivers/i2c/chips/fscher.c +5 -0
@@ -26,6 +26,11 @@* and Philip Edelbrock <[email protected]> */ +#include <linux/config.h> +#ifdef CONFIG_I2C_DEBUG_CHIP +#define DEBUG 1 +#endif +#include <linux/module.h> #include <linux/init.h> #include <linux/slab.h>
ChangeSet 1.1557.61.3, 2004/02/17 14:41:14-08:00, [email protected]
[PATCH] I2C: Credit James Bolt in w83l785ts
I forgot to give the credit he deserves to James Bolt for testing the latest w83l785ts driver changes. Here is a patch that fixes that.
drivers/i2c/chips/w83l785ts.c | 3 +++ 1 files changed, 3 insertions(+)
drivers/i2c/chips/w83l785ts.c +3 -0
@@ -12,6 +12,9 @@* Ported to Linux 2.6 by Wolfgang Ziegler <[email protected]> and Jean Delvare * <[email protected]>. * +* Thanks to James Bolt <[email protected]> for benchmarking the read +* error handling mechanism. +* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or
ChangeSet 1.1557.61.4, 2004/02/17 14:41:42-08:00, [email protected]
[PATCH] I2C: New chip driver ported: lm80
Here is a port for the lm80 driver, which supports LM80 chips by National Semiconductor. The port is mostly the work of Tiago Sousa, which I reviewed and polished as necessary.
drivers/i2c/chips/Kconfig | 11 drivers/i2c/chips/Makefile | 1 drivers/i2c/chips/lm80.c | 567 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 579 insertions(+)
drivers/i2c/chips/Kconfig +11 -0
@@ -102,6 +102,17 @@ This driver can also be built as a module. If so, the module will be called lm78. +config SENSORS_LM80 + tristate "National Semiconductor LM80" + depends on I2C && EXPERIMENTAL + select I2C_SENSOR + help + If you say yes here you get support for National Semiconductor + LM80 sensor chips. + + This driver can also be built as a module. If so, the module + will be called lm80. + config SENSORS_LM83 tristate "National Semiconductor LM83" depends on I2C && EXPERIMENTAL
drivers/i2c/chips/Makefile +1 -0
@@ -13,6 +13,7 @@ obj-$(CONFIG_SENSORS_IT87) += it87.o obj-$(CONFIG_SENSORS_LM75) += lm75.o obj-$(CONFIG_SENSORS_LM78) += lm78.o +obj-$(CONFIG_SENSORS_LM80) += lm80.o obj-$(CONFIG_SENSORS_LM83) += lm83.o obj-$(CONFIG_SENSORS_LM85) += lm85.o obj-$(CONFIG_SENSORS_LM90) += lm90.o
drivers/i2c/chips/lm80.c new file +567 -0
567 lines not on this page · raw message
ChangeSet 1.1557.61.5, 2004/02/17 14:42:07-08:00, [email protected]
[PATCH] I2C: update I2C help text
VIDEO_BT848 selects I2C_ALGOBIT.
drivers/i2c/Kconfig | 3 --- 1 files changed, 3 deletions(-)
drivers/i2c/Kconfig +0 -3
@@ -15,9 +15,6 @@ Both I2C and SMBus are supported here. You will need this for hardware sensors support, and also for Video For Linux support. - Specifically, if you want to use a BT848 based frame grabber/overlay - boards under Linux, say Y here and also to "I2C bit-banging - interfaces", below. If you want I2C support, you should say Y here and also to the specific driver for your bus adapter(s) below.
ChangeSet 1.1557.61.6, 2004/02/17 15:00:40-08:00, [email protected]
[PATCH] I2C: Support for IXP42x GPIO-based I2C
Following is an updated patch to add support for using the GPIO lines on an Intel IXP42x SOC for I2C. Changes since last patch include:
- Cleanups as per Jean Delvare's comments
- Rename functions as 42x instead of 425
- Change the comments at the top of the file to better reflect the purpose of this driver.
This code has been tested with the eeprom client driver and worked w/o any problems.
drivers/i2c/busses/Kconfig | 11 ++ drivers/i2c/busses/Makefile | 1 drivers/i2c/busses/i2c-ixp42x.c | 180 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 192 insertions(+)
drivers/i2c/busses/Kconfig +11 -0
@@ -144,6 +144,17 @@ This support is also available as a module. If so, the module will be called i2c-ite. +config I2C_IXP42X + tristate "IXP42x GPIO-Based I2C Interface" + depends on I2C && ARCH_IXP425 + select I2C_ALGOBIT + help + Say Y here if you have an Intel IXP42x(420,421,422,425) based + system and are using GPIO lines for an I2C bus. + + This support is also available as a module. If so, the module + will be called i2c-ixp42x. + config I2C_KEYWEST tristate "Powermac Keywest I2C interface" depends on I2C && PPC_PMAC
drivers/i2c/busses/Makefile +1 -0
@@ -15,6 +15,7 @@ obj-$(CONFIG_I2C_IOP3XX) += i2c-iop3xx.o obj-$(CONFIG_I2C_ISA) += i2c-isa.o obj-$(CONFIG_I2C_ITE) += i2c-ite.o +obj-$(CONFIG_I2C_IXP42X) += i2c-ixp42x.o obj-$(CONFIG_I2C_KEYWEST) += i2c-keywest.o obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o obj-$(CONFIG_I2C_PHILIPSPAR) += i2c-philips-par.o
drivers/i2c/busses/i2c-ixp42x.c new file +180 -0
180 lines not on this page · raw message
ChangeSet 1.1557.61.7, 2004/02/18 09:39:10-08:00, [email protected]
I2C: fix oops in i2c-ali1535 driver if no hardware is present.
Thanks to Dave Jones for pointing this out.
drivers/i2c/busses/i2c-ali1535.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-ali1535.c +1 -1
@@ -517,6 +517,7 @@ static void __devexit ali1535_remove(struct pci_dev *dev) {i2c_del_adapter (&ali1535_adapter); +release_region (ali1535_smba,ALI1535_SMB_IOSIZE ); }static struct pci_driver ali1535_driver = {
@@ -534,7 +535,6 @@ static void __exit i2c_ali1535_exit(void) {pci_unregister_driver (&ali1535_driver); -release_region (ali1535_smba,ALI1535_SMB_IOSIZE ); } MODULE_AUTHOR("Frodo Looijaard <[email protected]>, "
ChangeSet 1.1557.61.8, 2004/02/23 16:27:03-08:00, [email protected]
[PATCH] I2C: fix space in message
BTW, I found something to be fixed in i2c-core:
drivers/i2c/i2c-core.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/i2c-core.c +1 -1
@@ -175,7 +175,7 @@ driver = list_entry(item, struct i2c_driver, list);if (driver->detach_adapter)if ((res = driver->detach_adapter (adap))) { -dev_warn (&adap->dev,"can't detach adapter" +dev_warn (&adap->dev,"can't detach adapter " "while detaching driver %s: driver not " "detached!" , driver->name); goto out_unlock;
ChangeSet 1.1557.61.9, 2004/02/23 16:27:33-08:00, [email protected]
[PATCH] I2C: fix mor rmmod oopses
Quoted 2 lines
Oh nevermind, that's just a dumb driver. It's doing a
release_regionon memory it didn't get. Stupid, stupid, stupid...
While we're at it, what about fixing two other drivers that obviously have the same problem?
(BTW I didn't get an oops as I tried reproducing the problem, only a "Trying to free nonexistent resource" in dmesg.)
drivers/i2c/busses/i2c-i801.c | 2 +- drivers/i2c/busses/i2c-sis5595.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-i801.c +1 -1
@@ -608,6 +608,7 @@ static void __devexit i801_remove(struct pci_dev *dev) {i2c_del_adapter (&i801_adapter); +release_region (i801_smba, (isich4 ?16 :8 )); }static struct pci_driver i801_driver = {
@@ -625,7 +626,6 @@ static void __exit i2c_i801_exit(void) {pci_unregister_driver (&i801_driver); -release_region (i801_smba, (isich4 ?16 :8 )); } MODULE_AUTHOR ("Frodo Looijaard <[email protected]>, "
drivers/i2c/busses/i2c-sis5595.c +1 -1
@@ -391,6 +391,7 @@ static void __devexit sis5595_remove(struct pci_dev *dev) {i2c_del_adapter (&sis5595_adapter); +release_region (sis5595_base +SMB_INDEX ,2 ); }static struct pci_driver sis5595_driver = {
@@ -408,7 +409,6 @@ static void __exit i2c_sis5595_exit(void) {pci_unregister_driver (&sis5595_driver); -release_region (sis5595_base +SMB_INDEX ,2 ); }MODULE_AUTHOR ("Frodo Looijaard <[email protected]>" );
ChangeSet 1.1557.61.10, 2004/02/23 16:28:17-08:00, [email protected]
[PATCH] I2C: Lowercase chips name
This patch brings the name field of adm1021.c, it87.c and via686a.c in conformance with the defined standard ("all lowercase, as simple as the driver name itself").
drivers/i2c/chips/adm1021.c | 2 +- drivers/i2c/chips/it87.c | 2 +- drivers/i2c/chips/via686a.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/i2c/chips/adm1021.c +1 -1
@@ -148,7 +148,7 @@/* This is the driver that will be inserted */ static struct i2c_driver adm1021_driver = { .owner =THIS_MODULE , - .name ="ADM1021-MAX1617" , + .name ="adm1021" , .id =I2C_DRIVERID_ADM1021 , .flags =I2C_DF_NOTIFY , .attach_adapter = adm1021_attach_adapter,
drivers/i2c/chips/it87.c +1 -1
@@ -231,7 +231,7 @@static struct i2c_driver it87_driver = { .owner =THIS_MODULE , - .name ="IT87xx" , + .name ="it87" , .id =I2C_DRIVERID_IT87 , .flags =I2C_DF_NOTIFY , .attach_adapter = it87_attach_adapter,
drivers/i2c/chips/via686a.c +1 -1
@@ -653,7 +653,7 @@smbus_driver and isa_driver, and clients could be of either kind */ static struct i2c_driver via686a_driver = { .owner =THIS_MODULE , - .name ="VIA686A" , + .name ="via686a" , .id =I2C_DRIVERID_VIA686A , .flags =I2C_DF_NOTIFY , .attach_adapter = via686a_attach_adapter,
ChangeSet 1.1557.61.11, 2004/02/23 16:28:43-08:00, [email protected]
[PATCH] I2C: fix Hangs with w83781d
Here is a patch for the w83781d driver that prevents register bits from being arbitrary changed when we force temp2/3 to comparator mode. Keith Duthie had been reporting various problems with that driver and finally found that this arbitrary change was the cause of them. He also tested this patch, which he confirmed to work.
drivers/i2c/chips/w83781d.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-)
drivers/i2c/chips/w83781d.c +5 -1
@@ -1632,7 +1632,11 @@if (type != w83781d) {/* enable comparator mode for temp2 and temp3 so alarm indication will work correctly */ -w83781d_write_value (client,W83781D_REG_IRQ ,0x41 ); + i =w83781d_read_value (client,W83781D_REG_IRQ ); +if (!(i &0x40 )) +w83781d_write_value (client,W83781D_REG_IRQ , + i |0x40 ); +for (i =0 ; i <3 ; i++) data->pwmenable[i] =1 ; }
ChangeSet 1.1557.61.12, 2004/02/23 16:29:51-08:00, [email protected]
[PATCH] I2C: fix it87 sensor type
Here comes a patch by Takeru Komoriya which fixes the way the it87 driver handles temperature sensor types selection.
* Use the same values as the CVS driver and sensors program.
* Better comments.
* Get rid of the old setting method (already gone in CVS).
* Handle invalid values correctly.
drivers/i2c/chips/it87.c | 25 +++++++++++-------------- 1 files changed, 11 insertions(+), 14 deletions(-)
drivers/i2c/chips/it87.c +11 -14
@@ -6,7 +6,7 @@ IT8712F Super I/O chip w/LPC interface & SMbus Sis950 A clone of the IT8705F - Copyright (c) 2001 Chris Gauthron <[email protected]> + Copyright (C) 2001 Chris Gauthron <[email protected]> Largely inspired by lm78.c of the same package This program is free software; you can redistribute it and/or modify
@@ -57,12 +57,6 @@/* Update battery voltage after every reading if true */ static int update_vbat =0 ; - -/* Enable Temp1 as thermal resistor */ -/* Enable Temp2 as thermal diode */ -/* Enable Temp3 as thermal resistor */ -static int temp_type =0x2a ; -/* Many IT87 constants specified below */ /* Length of ISA address segment */
@@ -422,10 +416,10 @@struct it87_data *data =i2c_get_clientdata (client);it87_update_client (client);if (data->sensor & (1 << nr)) -return sprintf (buf,"1\n" ); +return sprintf (buf,"3\n" );/* thermal diode */ if (data->sensor & (8 << nr)) -return sprintf (buf,"2\n" ); -return sprintf (buf,"0\n" ); +return sprintf (buf,"2\n" );/* thermistor */ +return sprintf (buf,"0\n" );/* disabled */ }static ssize_t set_sensor (struct device *dev,const char *buf,size_t count,int nr)
@@ -436,10 +430,13 @@ data->sensor &= ~(1 << nr); data->sensor &= ~(8 << nr); -if (val ==1 ) +/* 3 = thermal diode; 2 = thermistor; 0 = disabled */ +if (val ==3 ) data->sensor |=1 << nr;else if (val ==2 ) data->sensor |=8 << nr; +else if (val !=0 ) +return -1 ;it87_write_value (client,IT87_REG_TEMP_ENABLE , data->sensor);return count; }
@@ -888,7 +885,7 @@/* Enable Temp1-Temp3 */ data->sensor = (it87_read_value (client,IT87_REG_TEMP_ENABLE ) &0xc0 ); - data->sensor |= temp_type &0x3f ; + data->sensor |=0x2a ;/* Temp1,Temp3=thermistor; Temp2=thermal diode */ it87_write_value (client,IT87_REG_TEMP_ENABLE , data->sensor);/* Enable fans */
@@ -967,6 +964,8 @@ (it87_read_value (client,IT87_REG_ALARM2 ) <<8 ) | (it87_read_value (client,IT87_REG_ALARM3 ) <<16 ); + data->sensor =it87_read_value (client,IT87_REG_TEMP_ENABLE ); + data->last_updated = jiffies; data->valid =1 ; }
@@ -989,8 +988,6 @@MODULE_DESCRIPTION ("IT8705F, IT8712F, Sis950 driver" );MODULE_PARM (update_vbat,"i" );MODULE_PARM_DESC (update_vbat,"Update vbat if set else return powerup value" ); -MODULE_PARM (temp_type,"i" ); -MODULE_PARM_DESC (temp_type,"Temperature sensor type, normally leave unset" );MODULE_LICENSE ("GPL" );module_init (sm_it87_init);
ChangeSet 1.1557.61.13, 2004/02/23 16:31:52-08:00, [email protected]
[PATCH] I2C: fix another oops in i2c-core with debug
Some times ago, you fixed an oops in i2c-core when debugging is enabled:
http://marc.theaimsgroup.com/?l=linux-kernel&m=107585749612115&w=2
Looks like you missed that second one:
drivers/i2c/i2c-core.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/i2c-core.c +1 -1
@@ -618,7 +618,7 @@int ret =0 ;struct i2c_adapter *adap = client->adapter; -dev_dbg (&client->dev,"i2c ioctl, cmd: 0x%x, arg: %#lx\n" , cmd, arg); +dev_dbg (&client->adapter->dev,"i2c ioctl, cmd: 0x%x, arg: %#lx\n" , cmd, arg);switch (cmd) {case I2C_RETRIES : adap->retries = arg;
ChangeSet 1.1557.61.14, 2004/02/23 16:33:50-08:00, [email protected]
[PATCH] I2C: Remove asb100 support from w83781d
Now that we have a separate asb100 driver, we can remove the (bad) support of it from the w83781d driver. Following patch does this. I've already cleaned this up in our CVS repository.
drivers/i2c/chips/w83781d.c | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-)
drivers/i2c/chips/w83781d.c +4 -7
@@ -25,8 +25,7 @@ Chip #vin #fanin #pwm #temp wchipid vendid i2c ISA as99127f 7 3 1? 3 0x31 0x12c3 yes no - as99127f rev.2 (type_name = 1299127f) 0x31 0x5ca3 yes no - asb100 "bach" (type_name = as99127f) 0x31 0x0694 yes no + as99127f rev.2 (type_name = as99127f) 0x31 0x5ca3 yes no w83781d 7 3 0 3 0x10-1 0x5ca3 yes yes w83627hf 9 3 2 3 0x21 0x5ca3 yes yes(LPC) w83627thf 9 3 2 3 0x90 0x5ca3 no yes(LPC)
@@ -1194,10 +1193,8 @@ val2 =w83781d_read_value (new_client,W83781D_REG_CHIPMAN );/* Check for Winbond or Asus ID if in bank 0 */ if ((!(val1 &0x07 )) && - (((!(val1 &0x80 )) && (val2 !=0xa3 ) && (val2 !=0xc3 ) - && (val2 !=0x94 )) - || ((val1 &0x80 ) && (val2 !=0x5c ) && (val2 !=0x12 ) - && (val2 !=0x06 )))) { + (((!(val1 &0x80 )) && (val2 !=0xa3 ) && (val2 !=0xc3 )) + || ((val1 &0x80 ) && (val2 !=0x5c ) && (val2 !=0x12 )))) { err = -ENODEV ; goto ERROR2; }
@@ -1226,7 +1223,7 @@ val2 =w83781d_read_value (new_client,W83781D_REG_CHIPMAN );if (val2 ==0x5c ) vendid = winbond; -else if ((val2 ==0x12 ) || (val2 ==0x06 )) +else if (val2 ==0x12 ) vendid = asus;else { err = -ENODEV ;
ChangeSet 1.1557.61.15, 2004/02/23 16:40:03-08:00, [email protected]
[PATCH] I2C: update for sysfs-interface documentation
Documentation/i2c/sysfs-interface | 192 ++++++++++++++++++++++++-------------- 1 files changed, 123 insertions(+), 69 deletions(-)
Documentation/i2c/sysfs-interface +123 -70
@@ -3,22 +3,44 @@ The libsensors library offers an interface to the raw sensors data through the sysfs interface. See libsensors documentation and source for -more further information. +more further information. As of writing this document, libsensors +(from lm_sensors 2.8.3) is heavily chip-dependant. Adding or updating +support for any given chip requires modifying the library's code. +This is because libsensors was written for the procfs interface +older kernel modules were using, which wasn't standardized enough. +Recent versions of libsensors (from lm_sensors 2.8.2 and later) have +support for the sysfs interface, though. + +The new sysfs interface was designed to be as chip-independant as +possible. + +Note that motherboards vary widely in the connections to sensor chips. +There is no standard that ensures, for example, that the second +temperature sensor is connected to the CPU, or that the second fan is on +the CPU. Also, some values reported by the chips need some computation +before they make full sense. For example, most chips can only measure +voltages between 0 and +4V. Other voltages are scaled back into that +range using external resistors. Since the values of these resistors +can change from motherboard to motherboard, the conversions cannot be +hard coded into the driver and have to be done in user space. + +For this reason, even if we aim at a chip-independant libsensors, it will +still require a configuration file (e.g. /etc/sensors.conf) for proper +values conversion, labeling of inputs and hiding of unused inputs. An alternative method that some programs use is to access the sysfs files directly. This document briefly describes the standards that the drivers follow, so that an application program can scan for entries and -access this data in a simple and consistent way. +access this data in a simple and consistent way. That said, such programs +will have to implement conversion, labeling and hiding of inputs. For +this reason, it is still not recommended to bypass the library. If you are developing a userspace application please send us feedback on this standard. -Note that motherboards vary widely in the connections to sensor chips. -There is no standard that ensures, for example, that the second -temperature sensor is connected to the CPU, or that the second fan is on -the CPU. Therefore, programs must provide a facility for the user to -label or bind /proc entries for display. Sensor chips often have unused -inputs that should be ignored by user programs. +Note that this standard isn't completely established yet, so it is subject +to changes, even important ones. One more reason to use the library instead +of accessing sysfs files directly. Each chip gets its own directory in the sysfs /sys/devices tree. To find all sensor chips, it is easier to follow the symlinks from
@@ -28,6 +50,15 @@ of the values, you should divide by the specified value. There is only one value per file, unlike the older /proc specification. +The common scheme for files naming is: <type>_<item><number>. Usual +types for sensor chips are "in" (voltage), "temp" (temperature) and +"fan" (fan). Usual items are "input" (measured value), "max" (high +threshold, "min" (low threshold). Numbering usually starts from 1, +except for voltages which start from 0 (because most data sheets use +this). A number is always used for elements that can be present more +than once, even if there is a single element of the given type on the +specific chip. Other files do not refer to a specific element, so +they have a simple name, and no number. Alarms are direct indications read from the chips. The drivers do NOT make comparisons of readings to thresholds. This allows violations
@@ -38,59 +69,9 @@ ------------------------------------------------------------------------- -sysfs entries are as follows: - - -Entry Function ------ -------- -alarms Alarm bitmask. - Read only. - Integer representation of one to four bytes. - A '1' bit means an alarm. - Chips should be programmed for 'comparator' mode so that - the alarm will 'come back' after you read the register - if it is still valid. - Generally a direct representation of a chip's internal - alarm registers; there is no standard for the position - of individual bits. - Bits are defined in kernel/include/sensors.h. - -beep_enable Beep/interrupt enable - 0 to disable. - 1 to enable. - Read/Write - -beep_mask Bitmask for beep. - Same format as 'alarms' with the same bit locations. - Read only. - -curr_max[1-n] Current max value - Fixed point XXXXX, divide by 1000 to get Amps. - Read/Write. - -curr_min[1-n] Current min value. - Fixed point XXXXX, divide by 1000 to get Amps. - Read/Write. - -curr_input[1-n] Current input value - Fixed point XXXXX, divide by 1000 to get Amps. - Read only. - -eeprom Raw EEPROM data in binary form. - Read only. - -fan_min[1-3] Fan minimum value - Integer value indicating RPM - Read/Write. - -fan_input[1-3] Fan input value. - Integer value indicating RPM - Read only. - -fan_div[1-3] Fan divisor. - Integers in powers of two (1,2,4,8,16,32,64,128). - Some chips only support values 1,2,4,8. - See doc/fan-divisors for details. +************ +* Voltages * +************ in_min[0-8] Voltage min value. Fixed point value in form XXXX. Divide by 1000 to get
@@ -126,6 +107,37 @@ in_*7 varies in_*8 varies +vid CPU core voltage. + Read only. + Fixed point value in form XXXX corresponding to CPU core + voltage as told to the sensor chip. Divide by 1000 to + get Volts. Not always correct. + +vrm Voltage Regulator Module version number. + Read only. + Two digit number (XX), first is major version, second is + minor version. + Affects the way the driver calculates the core voltage from + the vid pins. See doc/vid for details. + + +******** +* Fans * +******** + +fan_min[1-3] Fan minimum value + Integer value indicating RPM + Read/Write. + +fan_input[1-3] Fan input value. + Integer value indicating RPM + Read only. + +fan_div[1-3] Fan divisor. + Integers in powers of two (1,2,4,8,16,32,64,128). + Some chips only support values 1,2,4,8. + See doc/fan-divisors for details. + pwm[1-3] Pulse width modulation fan control. Integer 0 - 255 Read/Write
@@ -138,6 +150,11 @@ 1 to turn on Read/Write + +**************** +* Temperatures * +**************** + sensor[1-3] Sensor type selection. Integers 1,2,3, or thermistor Beta value (3435) Read/Write.
@@ -177,15 +194,51 @@ itself, for example the thermal diode inside the CPU or a thermistor nearby. -vid CPU core voltage. + +************ +* Currents * +************ + +Note that no known chip provides current measurements as of writing, +so this part is theoretical, so to say. + +curr_max[1-n] Current max value + Fixed point XXXXX, divide by 1000 to get Amps. + Read/Write. + +curr_min[1-n] Current min value. + Fixed point XXXXX, divide by 1000 to get Amps. + Read/Write. + +curr_input[1-n] Current input value + Fixed point XXXXX, divide by 1000 to get Amps. Read only. - Fixed point value in form XXXX corresponding to CPU core - voltage as told to the sensor chip. Divide by 1000 to - get Volts. Not always correct. -vrm Voltage Regulator Module version number. + +********* +* Other * +********* + +alarms Alarm bitmask. + Read only. + Integer representation of one to four bytes. + A '1' bit means an alarm. + Chips should be programmed for 'comparator' mode so that + the alarm will 'come back' after you read the register + if it is still valid. + Generally a direct representation of a chip's internal + alarm registers; there is no standard for the position + of individual bits. + Bits are defined in kernel/include/sensors.h. + +beep_enable Beep/interrupt enable + 0 to disable. + 1 to enable. + Read/Write + +beep_mask Bitmask for beep. + Same format as 'alarms' with the same bit locations. + Read only. + +eeprom Raw EEPROM data in binary form. Read only. - Two digit number (XX), first is major version, second is - minor version. - Affects the way the driver calculates the core voltage from - the vid pins. See doc/vid for details.
ChangeSet 1.1557.61.16, 2004/02/23 16:42:39-08:00, [email protected]
[PATCH] I2C: rename sysfs files, part 1 of 2
Here it is. The associated libsensors patch is here:
http://jdelvare.net1.nerim.net/sensors/libsensors-sysfs-names-1.diff
(not applied yet, on purpose)
Documentation/i2c/sysfs-interface | 54 ++++++++-------- drivers/i2c/chips/adm1021.c | 24 +++---- drivers/i2c/chips/asb100.c | 40 +++++------ drivers/i2c/chips/fscher.c | 92 +++++++++++++-------------- drivers/i2c/chips/gl518sm.c | 88 +++++++++++++------------- drivers/i2c/chips/it87.c | 104 +++++++++++++++--------------- drivers/i2c/chips/lm75.c | 12 +-- drivers/i2c/chips/lm78.c | 88 +++++++++++++------------- drivers/i2c/chips/lm80.c | 128 +++++++++++++++++++------------------- drivers/i2c/chips/lm83.c | 32 ++++----- drivers/i2c/chips/lm85.c | 88 +++++++++++++------------- drivers/i2c/chips/lm90.c | 40 +++++------ drivers/i2c/chips/via686a.c | 78 +++++++++++------------ drivers/i2c/chips/w83781d.c | 36 +++++----- drivers/i2c/chips/w83l785ts.c | 8 +- 15 files changed, 456 insertions(+), 456 deletions(-)
Documentation/i2c/sysfs-interface +27 -27
@@ -50,7 +50,7 @@ of the values, you should divide by the specified value. There is only one value per file, unlike the older /proc specification. -The common scheme for files naming is: <type>_<item><number>. Usual +The common scheme for files naming is: <type><number>_<item>. Usual types for sensor chips are "in" (voltage), "temp" (temperature) and "fan" (fan). Usual items are "input" (measured value), "max" (high threshold, "min" (low threshold). Numbering usually starts from 1,
@@ -73,17 +73,17 @@ * Voltages * ************ -in_min[0-8] Voltage min value. +in[0-8]_min Voltage min value. Fixed point value in form XXXX. Divide by 1000 to get Volts. Read/Write -in_max[0-8] Voltage max value. +in[0-8]_max Voltage max value. Fixed point value in form XXXX. Divide by 1000 to get Volts. Read/Write -in_input[0-8] Voltage input value. +in[0-8]_input Voltage input value. Fixed point value in form XXXX. Divide by 1000 to get Volts. Read only
@@ -97,15 +97,15 @@ These drivers will output the actual voltage. First two values are read/write and third is read only. Typical usage: - in_*0 CPU #1 voltage (not scaled) - in_*1 CPU #1 voltage (not scaled) - in_*2 3.3V nominal (not scaled) - in_*3 5.0V nominal (scaled) - in_*4 12.0V nominal (scaled) - in_*5 -12.0V nominal (scaled) - in_*6 -5.0V nominal (scaled) - in_*7 varies - in_*8 varies + in0_* CPU #1 voltage (not scaled) + in1_* CPU #1 voltage (not scaled) + in2_* 3.3V nominal (not scaled) + in3_* 5.0V nominal (scaled) + in4_* 12.0V nominal (scaled) + in5_* -12.0V nominal (scaled) + in6_* -5.0V nominal (scaled) + in7_* varies + in8_* varies vid CPU core voltage. Read only.
@@ -125,15 +125,15 @@ * Fans * ******** -fan_min[1-3] Fan minimum value +fan[1-3]_min Fan minimum value Integer value indicating RPM Read/Write. -fan_input[1-3] Fan input value. +fan[1-3]_input Fan input value. Integer value indicating RPM Read only. -fan_div[1-3] Fan divisor. +fan[1-3]_div Fan divisor. Integers in powers of two (1,2,4,8,16,32,64,128). Some chips only support values 1,2,4,8. See doc/fan-divisors for details.
@@ -144,7 +144,7 @@ 255 is max or 100%. Corresponds to the fans 1-3. -pwm_enable[1-3] pwm enable +pwm[1-3]_enable pwm enable not always present even if pwm* is. 0 to turn off 1 to turn on
@@ -159,23 +159,23 @@ Integers 1,2,3, or thermistor Beta value (3435) Read/Write. -temp_max[1-4] Temperature max value. +temp[1-4]_max Temperature max value. Fixed point value in form XXXXX and should be divided by 1000 to get degrees Celsius. Read/Write value. -temp_min[1-3] Temperature min value. +temp[1-3]_min Temperature min value. Fixed point value in form XXXXX and should be divided by 1000 to get degrees Celsius. Read/Write value. -temp_hyst[1-3] Temperature hysteresis value. +temp[1-3]_hyst Temperature hysteresis value. Fixed point value in form XXXXX and should be divided by 1000 to get degrees Celsius. Must be reported as an absolute temperature, NOT a delta from the max value. Read/Write value. -temp_input[1-4] Temperature input value. +temp[1-4]_input Temperature input value. Fixed point value in form XXXXX and should be divided by 1000 to get degrees Celsius. Read only value.
@@ -187,10 +187,10 @@ Common to all temperature channels. Read/Write value. - If there are multiple temperature sensors, temp_*1 is + If there are multiple temperature sensors, temp1_* is generally the sensor inside the chip itself, generally - reported as "motherboard temperature". temp_*2 to - temp_*4 are generally sensors external to the chip + reported as "motherboard temperature". temp2_* to + temp4_* are generally sensors external to the chip itself, for example the thermal diode inside the CPU or a thermistor nearby.
@@ -202,15 +202,15 @@ Note that no known chip provides current measurements as of writing, so this part is theoretical, so to say. -curr_max[1-n] Current max value +curr[1-n]_max Current max value Fixed point XXXXX, divide by 1000 to get Amps. Read/Write. -curr_min[1-n] Current min value. +curr[1-n]_min Current min value. Fixed point XXXXX, divide by 1000 to get Amps. Read/Write. -curr_input[1-n] Current input value +curr[1-n]_input Current input value Fixed point XXXXX, divide by 1000 to get Amps. Read only.
drivers/i2c/chips/adm1021.c +12 -12
@@ -206,12 +206,12 @@set (remote_temp_max,ADM1021_REG_REMOTE_TOS_W );set (remote_temp_hyst,ADM1021_REG_REMOTE_THYST_W ); -static DEVICE_ATTR(temp_max1, S_IWUSR | S_IRUGO, show_temp_max, set_temp_max); -static DEVICE_ATTR(temp_min1, S_IWUSR | S_IRUGO, show_temp_hyst, set_temp_hyst); -static DEVICE_ATTR(temp_input1, S_IRUGO, show_temp_input, NULL); -static DEVICE_ATTR(temp_max2, S_IWUSR | S_IRUGO, show_remote_temp_max, set_remote_temp_max); -static DEVICE_ATTR(temp_min2, S_IWUSR | S_IRUGO, show_remote_temp_hyst, set_remote_temp_hyst); -static DEVICE_ATTR(temp_input2, S_IRUGO, show_remote_temp_input, NULL); +static DEVICE_ATTR(temp1_max, S_IWUSR | S_IRUGO, show_temp_max, set_temp_max); +static DEVICE_ATTR(temp1_min, S_IWUSR | S_IRUGO, show_temp_hyst, set_temp_hyst); +static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input, NULL); +static DEVICE_ATTR(temp2_max, S_IWUSR | S_IRUGO, show_remote_temp_max, set_remote_temp_max); +static DEVICE_ATTR(temp2_min, S_IWUSR | S_IRUGO, show_remote_temp_hyst, set_remote_temp_hyst); +static DEVICE_ATTR(temp2_input, S_IRUGO, show_remote_temp_input, NULL); static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); static DEVICE_ATTR(die_code, S_IRUGO, show_die_code, NULL);
@@ -331,12 +331,12 @@adm1021_init_client (new_client);/* Register sysfs hooks */ -device_create_file (&new_client->dev, &dev_attr_temp_max1); -device_create_file (&new_client->dev, &dev_attr_temp_min1); -device_create_file (&new_client->dev, &dev_attr_temp_input1); -device_create_file (&new_client->dev, &dev_attr_temp_max2); -device_create_file (&new_client->dev, &dev_attr_temp_min2); -device_create_file (&new_client->dev, &dev_attr_temp_input2); +device_create_file (&new_client->dev, &dev_attr_temp1_max); +device_create_file (&new_client->dev, &dev_attr_temp1_min); +device_create_file (&new_client->dev, &dev_attr_temp1_input); +device_create_file (&new_client->dev, &dev_attr_temp2_max); +device_create_file (&new_client->dev, &dev_attr_temp2_min); +device_create_file (&new_client->dev, &dev_attr_temp2_input);device_create_file (&new_client->dev, &dev_attr_alarms);if (data->type == adm1021)device_create_file (&new_client->dev, &dev_attr_die_code);
drivers/i2c/chips/asb100.c +20 -20
@@ -274,7 +274,7 @@ { \ return show_in(dev, buf, 0x##offset); \ } \ -static DEVICE_ATTR(in_input##offset, S_IRUGO, \ +static DEVICE_ATTR(in##offset##_input, S_IRUGO, \ show_in##offset, NULL) \ static ssize_t \ show_in##offset##_min (struct device *dev, char *buf) \
@@ -296,9 +296,9 @@ { \ return set_in_max(dev, buf, count, 0x##offset); \ } \ -static DEVICE_ATTR(in_min##offset, S_IRUGO | S_IWUSR, \ +static DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \ show_in##offset##_min, set_in##offset##_min) \ -static DEVICE_ATTR(in_max##offset, S_IRUGO | S_IWUSR, \ +static DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \ show_in##offset##_max, set_in##offset##_max)sysfs_in (0 )
@@ -310,9 +310,9 @@ sysfs_in(6)#define device_create_file_in (client, offset) do { \ - device_create_file(&client->dev, &dev_attr_in_input##offset); \ - device_create_file(&client->dev, &dev_attr_in_min##offset); \ - device_create_file(&client->dev, &dev_attr_in_max##offset); \ + device_create_file(&client->dev, &dev_attr_in##offset##_input); \ + device_create_file(&client->dev, &dev_attr_in##offset##_min); \ + device_create_file(&client->dev, &dev_attr_in##offset##_max); \ } while (0)/* 3 Fans */
@@ -412,11 +412,11 @@ { \return set_fan_div (dev, buf, count, offset -1 ); \ } \ -static DEVICE_ATTR(fan_input##offset, S_IRUGO, \ +static DEVICE_ATTR(fan##offset##_input, S_IRUGO, \ show_fan##offset, NULL) \ -static DEVICE_ATTR(fan_min##offset, S_IRUGO | S_IWUSR, \ +static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ show_fan##offset##_min, set_fan##offset##_min) \ -static DEVICE_ATTR(fan_div##offset, S_IRUGO | S_IWUSR, \ +static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \ show_fan##offset##_div, set_fan##offset##_div)sysfs_fan (1 )
@@ -424,9 +424,9 @@ sysfs_fan(3)#define device_create_file_fan (client, offset) do { \ - device_create_file(&client->dev, &dev_attr_fan_input##offset); \ - device_create_file(&client->dev, &dev_attr_fan_min##offset); \ - device_create_file(&client->dev, &dev_attr_fan_div##offset); \ + device_create_file(&client->dev, &dev_attr_fan##offset##_input); \ + device_create_file(&client->dev, &dev_attr_fan##offset##_min); \ + device_create_file(&client->dev, &dev_attr_fan##offset##_div); \ } while (0)/* 4 Temp. Sensors */
@@ -484,7 +484,7 @@ { \return show_temp (dev, buf, num-1 ); \ } \ -static DEVICE_ATTR(temp_input##num, S_IRUGO, show_temp##num, NULL) \ +static DEVICE_ATTR(temp##num##_input, S_IRUGO, show_temp##num, NULL) \ static ssize_t show_temp_max##num(struct device *dev, char *buf) \ { \ return show_temp_max(dev, buf, num-1); \
@@ -494,7 +494,7 @@ { \return set_temp_max (dev, buf, count, num-1 ); \ } \ -static DEVICE_ATTR(temp_max##num, S_IRUGO | S_IWUSR, \ +static DEVICE_ATTR(temp##num##_max, S_IRUGO | S_IWUSR, \ show_temp_max##num, set_temp_max##num) \ static ssize_t show_temp_hyst##num(struct device *dev, char *buf) \ { \
@@ -505,7 +505,7 @@ { \return set_temp_hyst (dev, buf, count, num-1 ); \ } \ -static DEVICE_ATTR(temp_hyst##num, S_IRUGO | S_IWUSR, \ +static DEVICE_ATTR(temp##num##_hyst, S_IRUGO | S_IWUSR, \ show_temp_hyst##num, set_temp_hyst##num)sysfs_temp (1 )
@@ -515,9 +515,9 @@/* VID */ #define device_create_file_temp (client, num) do { \ - device_create_file(&client->dev, &dev_attr_temp_input##num); \ - device_create_file(&client->dev, &dev_attr_temp_max##num); \ - device_create_file(&client->dev, &dev_attr_temp_hyst##num); \ + device_create_file(&client->dev, &dev_attr_temp##num##_input); \ + device_create_file(&client->dev, &dev_attr_temp##num##_max); \ + device_create_file(&client->dev, &dev_attr_temp##num##_hyst); \ } while (0)static ssize_t show_vid (struct device *dev,char *buf)
@@ -598,11 +598,11 @@ } static DEVICE_ATTR(pwm1, S_IRUGO | S_IWUSR, show_pwm1, set_pwm1) -static DEVICE_ATTR(pwm_enable1, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(pwm1_enable, S_IRUGO | S_IWUSR, show_pwm_enable1, set_pwm_enable1)#define device_create_file_pwm1 (client) do { \ device_create_file(&new_client->dev, &dev_attr_pwm1); \ - device_create_file(&new_client->dev, &dev_attr_pwm_enable1); \ + device_create_file(&new_client->dev, &dev_attr_pwm1_enable); \ } while (0)/* This function is called when:
drivers/i2c/chips/fscher.c +46 -46
138 lines not on this page · raw message
drivers/i2c/chips/gl518sm.c +44 -44
101 lines not on this page · raw message
drivers/i2c/chips/it87.c +52 -52
140 lines not on this page · raw message
drivers/i2c/chips/lm75.c +6 -6
@@ -104,9 +104,9 @@set (temp_max,LM75_REG_TEMP_OS );set (temp_hyst,LM75_REG_TEMP_HYST ); -static DEVICE_ATTR(temp_max1, S_IWUSR | S_IRUGO, show_temp_max, set_temp_max); -static DEVICE_ATTR(temp_hyst1, S_IWUSR | S_IRUGO, show_temp_hyst, set_temp_hyst); -static DEVICE_ATTR(temp_input1, S_IRUGO, show_temp_input, NULL); +static DEVICE_ATTR(temp1_max, S_IWUSR | S_IRUGO, show_temp_max, set_temp_max); +static DEVICE_ATTR(temp1_hyst, S_IWUSR | S_IRUGO, show_temp_hyst, set_temp_hyst); +static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input, NULL);static int lm75_attach_adapter (struct i2c_adapter *adapter) {
@@ -197,9 +197,9 @@lm75_init_client (new_client);/* Register sysfs hooks */ -device_create_file (&new_client->dev, &dev_attr_temp_max1); -device_create_file (&new_client->dev, &dev_attr_temp_hyst1); -device_create_file (&new_client->dev, &dev_attr_temp_input1); +device_create_file (&new_client->dev, &dev_attr_temp1_max); +device_create_file (&new_client->dev, &dev_attr_temp1_hyst); +device_create_file (&new_client->dev, &dev_attr_temp1_input);return 0 ;
drivers/i2c/chips/lm78.c +44 -44
128 lines not on this page · raw message
drivers/i2c/chips/lm80.c +64 -64
145 lines not on this page · raw message
drivers/i2c/chips/lm83.c +16 -16
@@ -201,17 +201,17 @@return sprintf (buf,"%d\n" , data->alarms); } -static DEVICE_ATTR(temp_input1, S_IRUGO, show_temp_input1, NULL); -static DEVICE_ATTR(temp_input2, S_IRUGO, show_temp_input2, NULL); -static DEVICE_ATTR(temp_input3, S_IRUGO, show_temp_input3, NULL); -static DEVICE_ATTR(temp_input4, S_IRUGO, show_temp_input4, NULL); -static DEVICE_ATTR(temp_max1, S_IWUSR | S_IRUGO, show_temp_high1, +static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input1, NULL); +static DEVICE_ATTR(temp2_input, S_IRUGO, show_temp_input2, NULL); +static DEVICE_ATTR(temp3_input, S_IRUGO, show_temp_input3, NULL); +static DEVICE_ATTR(temp4_input, S_IRUGO, show_temp_input4, NULL); +static DEVICE_ATTR(temp1_max, S_IWUSR | S_IRUGO, show_temp_high1, set_temp_high1); -static DEVICE_ATTR(temp_max2, S_IWUSR | S_IRUGO, show_temp_high2, +static DEVICE_ATTR(temp2_max, S_IWUSR | S_IRUGO, show_temp_high2, set_temp_high2); -static DEVICE_ATTR(temp_max3, S_IWUSR | S_IRUGO, show_temp_high3, +static DEVICE_ATTR(temp3_max, S_IWUSR | S_IRUGO, show_temp_high3, set_temp_high3); -static DEVICE_ATTR(temp_max4, S_IWUSR | S_IRUGO, show_temp_high4, +static DEVICE_ATTR(temp4_max, S_IWUSR | S_IRUGO, show_temp_high4, set_temp_high4); static DEVICE_ATTR(temp_crit, S_IWUSR | S_IRUGO, show_temp_crit, set_temp_crit);
@@ -320,14 +320,14 @@*/ /* Register sysfs hooks */ -device_create_file (&new_client->dev, &dev_attr_temp_input1); -device_create_file (&new_client->dev, &dev_attr_temp_input2); -device_create_file (&new_client->dev, &dev_attr_temp_input3); -device_create_file (&new_client->dev, &dev_attr_temp_input4); -device_create_file (&new_client->dev, &dev_attr_temp_max1); -device_create_file (&new_client->dev, &dev_attr_temp_max2); -device_create_file (&new_client->dev, &dev_attr_temp_max3); -device_create_file (&new_client->dev, &dev_attr_temp_max4); +device_create_file (&new_client->dev, &dev_attr_temp1_input); +device_create_file (&new_client->dev, &dev_attr_temp2_input); +device_create_file (&new_client->dev, &dev_attr_temp3_input); +device_create_file (&new_client->dev, &dev_attr_temp4_input); +device_create_file (&new_client->dev, &dev_attr_temp1_max); +device_create_file (&new_client->dev, &dev_attr_temp2_max); +device_create_file (&new_client->dev, &dev_attr_temp3_max); +device_create_file (&new_client->dev, &dev_attr_temp4_max);device_create_file (&new_client->dev, &dev_attr_temp_crit);device_create_file (&new_client->dev, &dev_attr_alarms);
drivers/i2c/chips/lm85.c +44 -44
123 lines not on this page · raw message
drivers/i2c/chips/lm90.c +20 -20
@@ -245,23 +245,23 @@return sprintf (buf,"%d\n" , data->alarms); } -static DEVICE_ATTR(temp_input1, S_IRUGO, show_temp_input1, NULL); -static DEVICE_ATTR(temp_input2, S_IRUGO, show_temp_input2, NULL); -static DEVICE_ATTR(temp_min1, S_IWUSR | S_IRUGO, show_temp_low1, +static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input1, NULL); +static DEVICE_ATTR(temp2_input, S_IRUGO, show_temp_input2, NULL); +static DEVICE_ATTR(temp1_min, S_IWUSR | S_IRUGO, show_temp_low1, set_temp_low1); -static DEVICE_ATTR(temp_min2, S_IWUSR | S_IRUGO, show_temp_low2, +static DEVICE_ATTR(temp2_min, S_IWUSR | S_IRUGO, show_temp_low2, set_temp_low2); -static DEVICE_ATTR(temp_max1, S_IWUSR | S_IRUGO, show_temp_high1, +static DEVICE_ATTR(temp1_max, S_IWUSR | S_IRUGO, show_temp_high1, set_temp_high1); -static DEVICE_ATTR(temp_max2, S_IWUSR | S_IRUGO, show_temp_high2, +static DEVICE_ATTR(temp2_max, S_IWUSR | S_IRUGO, show_temp_high2, set_temp_high2); -static DEVICE_ATTR(temp_crit1, S_IWUSR | S_IRUGO, show_temp_crit1, +static DEVICE_ATTR(temp1_crit, S_IWUSR | S_IRUGO, show_temp_crit1, set_temp_crit1); -static DEVICE_ATTR(temp_crit2, S_IWUSR | S_IRUGO, show_temp_crit2, +static DEVICE_ATTR(temp2_crit, S_IWUSR | S_IRUGO, show_temp_crit2, set_temp_crit2); -static DEVICE_ATTR(temp_hyst1, S_IWUSR | S_IRUGO, show_temp_hyst1, +static DEVICE_ATTR(temp1_hyst, S_IWUSR | S_IRUGO, show_temp_hyst1, set_temp_hyst1); -static DEVICE_ATTR(temp_hyst2, S_IRUGO, show_temp_hyst2, NULL); +static DEVICE_ATTR(temp2_hyst, S_IRUGO, show_temp_hyst2, NULL); static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);/*
@@ -381,16 +381,16 @@lm90_init_client (new_client);/* Register sysfs hooks */ -device_create_file (&new_client->dev, &dev_attr_temp_input1); -device_create_file (&new_client->dev, &dev_attr_temp_input2); -device_create_file (&new_client->dev, &dev_attr_temp_min1); -device_create_file (&new_client->dev, &dev_attr_temp_min2); -device_create_file (&new_client->dev, &dev_attr_temp_max1); -device_create_file (&new_client->dev, &dev_attr_temp_max2); -device_create_file (&new_client->dev, &dev_attr_temp_crit1); -device_create_file (&new_client->dev, &dev_attr_temp_crit2); -device_create_file (&new_client->dev, &dev_attr_temp_hyst1); -device_create_file (&new_client->dev, &dev_attr_temp_hyst2); +device_create_file (&new_client->dev, &dev_attr_temp1_input); +device_create_file (&new_client->dev, &dev_attr_temp2_input); +device_create_file (&new_client->dev, &dev_attr_temp1_min); +device_create_file (&new_client->dev, &dev_attr_temp2_min); +device_create_file (&new_client->dev, &dev_attr_temp1_max); +device_create_file (&new_client->dev, &dev_attr_temp2_max); +device_create_file (&new_client->dev, &dev_attr_temp1_crit); +device_create_file (&new_client->dev, &dev_attr_temp2_crit); +device_create_file (&new_client->dev, &dev_attr_temp1_hyst); +device_create_file (&new_client->dev, &dev_attr_temp2_hyst);device_create_file (&new_client->dev, &dev_attr_alarms);return 0 ;
drivers/i2c/chips/via686a.c +39 -39
105 lines not on this page · raw message
drivers/i2c/chips/w83781d.c +18 -18
@@ -330,7 +330,7 @@ { \ return show_in(dev, buf, 0x##offset); \ } \ -static DEVICE_ATTR(in_input##offset, S_IRUGO, show_regs_in_##offset, NULL) +static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL)#define sysfs_in_reg_offset (reg, offset) \ static ssize_t show_regs_in_##reg##offset (struct device *dev, char *buf) \
@@ -341,7 +341,7 @@ { \ return store_in_##reg (dev, buf, count, 0x##offset); \ } \ -static DEVICE_ATTR(in_##reg##offset, S_IRUGO| S_IWUSR, show_regs_in_##reg##offset, store_regs_in_##reg##offset) +static DEVICE_ATTR(in##offset##_##reg, S_IRUGO| S_IWUSR, show_regs_in_##reg##offset, store_regs_in_##reg##offset)#define sysfs_in_offsets (offset) \ sysfs_in_offset(offset); \
@@ -360,9 +360,9 @@#define device_create_file_in (client, offset) \ do { \ -device_create_file(&client->dev, &dev_attr_in_input##offset); \ -device_create_file(&client->dev, &dev_attr_in_min##offset); \ -device_create_file(&client->dev, &dev_attr_in_max##offset); \ +device_create_file(&client->dev, &dev_attr_in##offset##_input); \ +device_create_file(&client->dev, &dev_attr_in##offset##_min); \ +device_create_file(&client->dev, &dev_attr_in##offset##_max); \ } while (0)#define show_fan_reg (reg) \
@@ -400,7 +400,7 @@ { \ return show_fan(dev, buf, 0x##offset); \ } \ -static DEVICE_ATTR(fan_input##offset, S_IRUGO, show_regs_fan_##offset, NULL) +static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL)#define sysfs_fan_min_offset (offset) \ static ssize_t show_regs_fan_min##offset (struct device *dev, char *buf) \
@@ -411,7 +411,7 @@ { \ return store_fan_min(dev, buf, count, 0x##offset); \ } \ -static DEVICE_ATTR(fan_min##offset, S_IRUGO | S_IWUSR, show_regs_fan_min##offset, store_regs_fan_min##offset) +static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, show_regs_fan_min##offset, store_regs_fan_min##offset)sysfs_fan_offset (1 );sysfs_fan_min_offset (1 );
@@ -422,8 +422,8 @@#define device_create_file_fan (client, offset) \ do { \ -device_create_file(&client->dev, &dev_attr_fan_input##offset); \ -device_create_file(&client->dev, &dev_attr_fan_min##offset); \ +device_create_file(&client->dev, &dev_attr_fan##offset##_input); \ +device_create_file(&client->dev, &dev_attr_fan##offset##_min); \ } while (0)#define show_temp_reg (reg) \
@@ -484,7 +484,7 @@ { \ return show_temp(dev, buf, 0x##offset); \ } \ -static DEVICE_ATTR(temp_input##offset, S_IRUGO, show_regs_temp_##offset, NULL) +static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL)#define sysfs_temp_reg_offset (reg, offset) \ static ssize_t show_regs_temp_##reg##offset (struct device *dev, char *buf) \
@@ -495,7 +495,7 @@ { \ return store_temp_##reg (dev, buf, count, 0x##offset); \ } \ -static DEVICE_ATTR(temp_##reg##offset, S_IRUGO| S_IWUSR, show_regs_temp_##reg##offset, store_regs_temp_##reg##offset) +static DEVICE_ATTR(temp##offset##_##reg, S_IRUGO| S_IWUSR, show_regs_temp_##reg##offset, store_regs_temp_##reg##offset)#define sysfs_temp_offsets (offset) \ sysfs_temp_offset(offset); \
@@ -508,9 +508,9 @@#define device_create_file_temp (client, offset) \ do { \ -device_create_file(&client->dev, &dev_attr_temp_input##offset); \ -device_create_file(&client->dev, &dev_attr_temp_max##offset); \ -device_create_file(&client->dev, &dev_attr_temp_hyst##offset); \ +device_create_file(&client->dev, &dev_attr_temp##offset##_input); \ +device_create_file(&client->dev, &dev_attr_temp##offset##_max); \ +device_create_file(&client->dev, &dev_attr_temp##offset##_hyst); \ } while (0) static ssize_t
@@ -707,7 +707,7 @@ { \return store_fan_div_reg (dev, buf, count, offset); \ } \ -static DEVICE_ATTR(fan_div##offset, S_IRUGO | S_IWUSR, show_regs_fan_div_##offset, store_regs_fan_div_##offset) +static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, show_regs_fan_div_##offset, store_regs_fan_div_##offset)sysfs_fan_div (1 );sysfs_fan_div (2 );
@@ -715,7 +715,7 @@#define device_create_file_fan_div (client, offset) \ do { \ -device_create_file(&client->dev, &dev_attr_fan_div##offset); \ +device_create_file(&client->dev, &dev_attr_fan##offset##_div); \ } while (0)/* w83697hf only has two fans */
@@ -819,7 +819,7 @@ { \return store_pwmenable_reg (dev, buf, count, offset); \ } \ -static DEVICE_ATTR(pwm_enable##offset, S_IRUGO | S_IWUSR, show_regs_pwmenable_##offset, store_regs_pwmenable_##offset) +static DEVICE_ATTR(pwm##offset##_enable, S_IRUGO | S_IWUSR, show_regs_pwmenable_##offset, store_regs_pwmenable_##offset)sysfs_pwm (1 );sysfs_pwm (2 );
@@ -834,7 +834,7 @@#define device_create_file_pwmenable (client, offset) \ do { \ -device_create_file(&client->dev, &dev_attr_pwm_enable##offset); \ +device_create_file(&client->dev, &dev_attr_pwm##offset##_enable); \ } while (0) static ssize_t
drivers/i2c/chips/w83l785ts.c +4 -4
@@ -144,8 +144,8 @@return sprintf (buf,"%d\n" ,TEMP_FROM_REG (data->temp_over)); } -static DEVICE_ATTR(temp_input1, S_IRUGO, show_temp, NULL) -static DEVICE_ATTR (temp_max1, S_IRUGO, show_temp_over, NULL) +static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL) +static DEVICE_ATTR (temp1_max, S_IRUGO, show_temp_over, NULL)/* * Real code
@@ -259,8 +259,8 @@*/ /* Register sysfs hooks */ -device_create_file (&new_client->dev, &dev_attr_temp_input1); -device_create_file (&new_client->dev, &dev_attr_temp_max1); +device_create_file (&new_client->dev, &dev_attr_temp1_input); +device_create_file (&new_client->dev, &dev_attr_temp1_max);return 0 ;
ChangeSet 1.1557.61.17, 2004/02/23 16:43:25-08:00, [email protected]
[PATCH] I2C: rename sysfs files, part 2 of 2
Here is the second step of my sysfs renaming plan.
This one does the following renames (as I already announced on the LKML):
temp<n>_hyst -> temp<n>_max_hyst or temp<n>_crit_hyst sensor<n> -> temp<n>_type pwm<n> -> fan<n>_pwm
pwm<n>_enable -> fan<n>_pwm_enable
vid -> in<n>_ref
The associated libsensors patch is here:
http://jdelvare.net1.nerim.net/sensors/libsensors-sysfs-names-2.diff
(not applied yet, on purpose)
Note that the w83781d part is a bit more complex, not only because it is the only driver to require the 5 changes, but also because at some point the macros assume that the internal variable names match the sysfs names, so I had to change them too (better than rewriting the macros, methinks).
For reference, here is the list of changes, by driver:
asb100:
hyst -> max_hyst (4)
pwm -> fan_pwm (1)
pwm_enable -> fan_pwm_enable (1)
vid -> in_ref (1)
fscher:
pwm -> fan_pwm (3)
gl518sm:
hyst -> max_hyst (1)
it87:
sensor -> temp_type (3)
lm75:
hyst -> max_hyst (1)
lm78:
hyst -> max_hyst (1)
vid -> in_ref (1)
lm85:
pwm -> fan_pwm (3)
pwm_enable -> fan_pwm_enable (3)
vid -> in_ref (1)
lm90:
hyst -> crit_hyst (2)
via686a:
hyst -> max_hyst (3)
w83781d:
hyst -> max_hyst (2)
sensor -> temp_type (3)
pwm -> fan_pwm (4)
pwm_enable -> fan_pwm_enable (1)
vid -> in_ref (1)There's also a documentation update. There will be one more after that (to make it more readable, no contents change), and a patch to lm83.c to bring it to compliance with the (new) standard. (If you wonder why I did not change it with the other drivers: because it was *already* not in compliance with the old standard. There's some real work to do for this one.)
Documentation/i2c/sysfs-interface | 26 +++++++++++++++++--------- drivers/i2c/chips/asb100.c | 16 ++++++++-------- drivers/i2c/chips/fscher.c | 8 ++++---- drivers/i2c/chips/gl518sm.c | 4 ++-- drivers/i2c/chips/it87.c | 8 ++++---- drivers/i2c/chips/lm75.c | 4 ++-- drivers/i2c/chips/lm78.c | 8 ++++---- drivers/i2c/chips/lm85.c | 20 ++++++++++---------- drivers/i2c/chips/lm90.c | 8 ++++---- drivers/i2c/chips/via686a.c | 8 ++++---- drivers/i2c/chips/w83781d.c | 34 +++++++++++++++++----------------- 11 files changed, 76 insertions(+), 68 deletions(-)
Documentation/i2c/sysfs-interface +17 -9
@@ -107,7 +107,7 @@ in7_* varies in8_* varies -vid CPU core voltage. +in0_ref CPU core reference voltage. Read only. Fixed point value in form XXXX corresponding to CPU core voltage as told to the sensor chip. Divide by 1000 to
@@ -138,14 +138,15 @@ Some chips only support values 1,2,4,8. See doc/fan-divisors for details. -pwm[1-3] Pulse width modulation fan control. +fan[1-3]_pwm Pulse width modulation fan control. Integer 0 - 255 Read/Write 255 is max or 100%. Corresponds to the fans 1-3. -pwm[1-3]_enable pwm enable - not always present even if pwm* is. +fan[1-3]_pwm_enable + Switch PWM on and off. + Not always present even if fan*_pwm is. 0 to turn off 1 to turn on Read/Write
@@ -155,7 +156,7 @@ * Temperatures * **************** -sensor[1-3] Sensor type selection. +temp[1-3]_type Sensor type selection. Integers 1,2,3, or thermistor Beta value (3435) Read/Write.
@@ -169,7 +170,8 @@ 1000 to get degrees Celsius. Read/Write value. -temp[1-3]_hyst Temperature hysteresis value. +temp[1-3]_max_hyst + Temperature hysteresis value for max limit. Fixed point value in form XXXXX and should be divided by 1000 to get degrees Celsius. Must be reported as an absolute temperature, NOT a delta from the max value.
@@ -180,11 +182,17 @@ 1000 to get degrees Celsius. Read only value. -temp_crit Temperature critical value, typically greater than all - temp_max values. +temp[1-4]_crit Temperature critical value, typically greater than + corresponding temp_max values. Fixed point value in form XXXXX and should be divided by 1000 to get degrees Celsius. - Common to all temperature channels. + Read/Write value. + +temp[1-2]_crit_hyst + Temperature hysteresis value for critical limit. + Fixed point value in form XXXXX and should be divided by + 1000 to get degrees Celsius. Must be reported as an + absolute temperature, NOT a delta from the critical value. Read/Write value. If there are multiple temperature sensors, temp1_* is
drivers/i2c/chips/asb100.c +8 -8
@@ -505,7 +505,7 @@ { \return set_temp_hyst (dev, buf, count, num-1 ); \ } \ -static DEVICE_ATTR(temp##num##_hyst, S_IRUGO | S_IWUSR, \ +static DEVICE_ATTR(temp##num##_max_hyst, S_IRUGO | S_IWUSR, \ show_temp_hyst##num, set_temp_hyst##num)sysfs_temp (1 )
@@ -517,7 +517,7 @@#define device_create_file_temp (client, num) do { \ device_create_file(&client->dev, &dev_attr_temp##num##_input); \ device_create_file(&client->dev, &dev_attr_temp##num##_max); \ - device_create_file(&client->dev, &dev_attr_temp##num##_hyst); \ + device_create_file(&client->dev, &dev_attr_temp##num##_max_hyst); \ } while (0)static ssize_t show_vid (struct device *dev,char *buf)
@@ -526,9 +526,9 @@return sprintf (buf,"%d\n" ,vid_from_reg (data->vid, data->vrm)); } -static DEVICE_ATTR(vid, S_IRUGO, show_vid, NULL) +static DEVICE_ATTR(in0_ref, S_IRUGO, show_vid, NULL)#define device_create_file_vid (client) \ -device_create_file(&client->dev, &dev_attr_vid) +device_create_file(&client->dev, &dev_attr_in0_ref)/* VRM */ static ssize_t show_vrm (struct device *dev,char *buf)
@@ -597,12 +597,12 @@return count; } -static DEVICE_ATTR(pwm1, S_IRUGO | S_IWUSR, show_pwm1, set_pwm1) -static DEVICE_ATTR(pwm1_enable, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(fan1_pwm, S_IRUGO | S_IWUSR, show_pwm1, set_pwm1) +static DEVICE_ATTR(fan1_pwm_enable, S_IRUGO | S_IWUSR, show_pwm_enable1, set_pwm_enable1)#define device_create_file_pwm1 (client) do { \ - device_create_file(&new_client->dev, &dev_attr_pwm1); \ - device_create_file(&new_client->dev, &dev_attr_pwm1_enable); \ + device_create_file(&new_client->dev, &dev_attr_fan1_pwm); \ + device_create_file(&new_client->dev, &dev_attr_fan1_pwm_enable); \ } while (0)/* This function is called when:
drivers/i2c/chips/fscher.c +4 -4
@@ -205,7 +205,7 @@ static DEVICE_ATTR(kind, S_IRUGO, show_##kind##0##sub, NULL);#define sysfs_fan (offset, reg_status, reg_min, reg_ripple, reg_act) \ -sysfs_rw_n(pwm, , offset, reg_min) \ +sysfs_rw_n(fan, _pwm , offset, reg_min) \ sysfs_rw_n(fan, _status, offset, reg_status) \ sysfs_rw_n(fan, _div , offset, reg_ripple) \ sysfs_ro_n(fan, _input , offset, reg_act)
@@ -254,7 +254,7 @@#define device_create_file_fan (client, offset) \ do { \ device_create_file(&client->dev, &dev_attr_fan##offset##_status); \ - device_create_file(&client->dev, &dev_attr_pwm##offset); \ + device_create_file(&client->dev, &dev_attr_fan##offset##_pwm); \ device_create_file(&client->dev, &dev_attr_fan##offset##_div); \ device_create_file(&client->dev, &dev_attr_fan##offset##_input); \ } while (0)
@@ -489,7 +489,7 @@return sprintf (buf,"%u\n" , data->fan_status[FAN_INDEX_FROM_NUM (nr)] &0x04 ); } -static ssize_t set_pwm (struct i2c_client *client,struct fscher_data *data, +static ssize_t set_fan_pwm (struct i2c_client *client,struct fscher_data *data,const char *buf,size_t count,int nr,int reg) { data->fan_min[FAN_INDEX_FROM_NUM (nr)] =simple_strtoul (buf,NULL ,10 ) &0xff ;
@@ -498,7 +498,7 @@return count; } -static ssize_t show_pwm (struct fscher_data *data,char *buf,int nr) +static ssize_t show_fan_pwm (struct fscher_data *data,char *buf,int nr) {return sprintf (buf,"%u\n" , data->fan_min[FAN_INDEX_FROM_NUM (nr)]); }
drivers/i2c/chips/gl518sm.c +2 -2
@@ -309,7 +309,7 @@ static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input1, NULL); static DEVICE_ATTR(temp1_max, S_IWUSR|S_IRUGO, show_temp_max1, set_temp_max1); -static DEVICE_ATTR(temp1_hyst, S_IWUSR|S_IRUGO, +static DEVICE_ATTR(temp1_max_hyst, S_IWUSR|S_IRUGO, show_temp_hyst1, set_temp_hyst1); static DEVICE_ATTR(fan1_auto, S_IWUSR|S_IRUGO, show_fan_auto1, set_fan_auto1); static DEVICE_ATTR(fan1_input, S_IRUGO, show_fan_input1, NULL);
@@ -445,7 +445,7 @@device_create_file (&new_client->dev, &dev_attr_fan2_div);device_create_file (&new_client->dev, &dev_attr_temp1_input);device_create_file (&new_client->dev, &dev_attr_temp1_max); -device_create_file (&new_client->dev, &dev_attr_temp1_hyst); +device_create_file (&new_client->dev, &dev_attr_temp1_max_hyst);device_create_file (&new_client->dev, &dev_attr_alarms);device_create_file (&new_client->dev, &dev_attr_beep_enable);device_create_file (&new_client->dev, &dev_attr_beep_mask);
drivers/i2c/chips/it87.c +4 -4
@@ -450,7 +450,7 @@ { \ return set_sensor(dev, buf, count, 0x##offset - 1); \ } \ -static DEVICE_ATTR(sensor##offset, S_IRUGO | S_IWUSR, \ +static DEVICE_ATTR(temp##offset##_type, S_IRUGO | S_IWUSR, \ show_sensor_##offset, set_sensor_##offset)show_sensor_offset (1 );
@@ -737,9 +737,9 @@device_create_file (&new_client->dev, &dev_attr_temp1_min);device_create_file (&new_client->dev, &dev_attr_temp2_min);device_create_file (&new_client->dev, &dev_attr_temp3_min); -device_create_file (&new_client->dev, &dev_attr_sensor1); -device_create_file (&new_client->dev, &dev_attr_sensor2); -device_create_file (&new_client->dev, &dev_attr_sensor3); +device_create_file (&new_client->dev, &dev_attr_temp1_type); +device_create_file (&new_client->dev, &dev_attr_temp2_type); +device_create_file (&new_client->dev, &dev_attr_temp3_type);device_create_file (&new_client->dev, &dev_attr_fan1_input);device_create_file (&new_client->dev, &dev_attr_fan2_input);device_create_file (&new_client->dev, &dev_attr_fan3_input);
drivers/i2c/chips/lm75.c +2 -2
@@ -105,7 +105,7 @@set (temp_hyst,LM75_REG_TEMP_HYST ); static DEVICE_ATTR(temp1_max, S_IWUSR | S_IRUGO, show_temp_max, set_temp_max); -static DEVICE_ATTR(temp1_hyst, S_IWUSR | S_IRUGO, show_temp_hyst, set_temp_hyst); +static DEVICE_ATTR(temp1_max_hyst, S_IWUSR | S_IRUGO, show_temp_hyst, set_temp_hyst); static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp_input, NULL);static int lm75_attach_adapter (struct i2c_adapter *adapter)
@@ -198,7 +198,7 @@/* Register sysfs hooks */ device_create_file (&new_client->dev, &dev_attr_temp1_max); -device_create_file (&new_client->dev, &dev_attr_temp1_hyst); +device_create_file (&new_client->dev, &dev_attr_temp1_max_hyst);device_create_file (&new_client->dev, &dev_attr_temp1_input);return 0 ;
drivers/i2c/chips/lm78.c +4 -4
@@ -372,7 +372,7 @@ static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL) static DEVICE_ATTR(temp1_max, S_IRUGO | S_IWUSR, show_temp_over, set_temp_over) -static DEVICE_ATTR(temp1_hyst, S_IRUGO | S_IWUSR, +static DEVICE_ATTR(temp1_max_hyst, S_IRUGO | S_IWUSR, show_temp_hyst, set_temp_hyst)/* 3 Fans */
@@ -495,7 +495,7 @@lm78_update_client (client);return sprintf (buf,"%d\n" ,VID_FROM_REG (data->vid)); } -static DEVICE_ATTR(vid, S_IRUGO, show_vid, NULL); +static DEVICE_ATTR(in0_ref, S_IRUGO, show_vid, NULL);/* Alarms */ static ssize_t show_alarms (struct device *dev,char *buf)
@@ -680,7 +680,7 @@device_create_file (&new_client->dev, &dev_attr_in6_max);device_create_file (&new_client->dev, &dev_attr_temp1_input);device_create_file (&new_client->dev, &dev_attr_temp1_max); -device_create_file (&new_client->dev, &dev_attr_temp1_hyst); +device_create_file (&new_client->dev, &dev_attr_temp1_max_hyst);device_create_file (&new_client->dev, &dev_attr_fan1_input);device_create_file (&new_client->dev, &dev_attr_fan1_min);device_create_file (&new_client->dev, &dev_attr_fan1_div);
@@ -691,7 +691,7 @@device_create_file (&new_client->dev, &dev_attr_fan3_min);device_create_file (&new_client->dev, &dev_attr_fan3_div);device_create_file (&new_client->dev, &dev_attr_alarms); -device_create_file (&new_client->dev, &dev_attr_vid); +device_create_file (&new_client->dev, &dev_attr_in0_ref);return 0 ;
drivers/i2c/chips/lm85.c +10 -10
@@ -480,7 +480,7 @@return sprintf (buf,"%ld\n" , (long )vid_from_reg (data->vid, data->vrm)); } -static DEVICE_ATTR(vid, S_IRUGO, show_vid_reg, NULL) +static DEVICE_ATTR(in0_ref, S_IRUGO, show_vid_reg, NULL) static ssize_t show_vrm_reg(struct device *dev, char *buf) {
@@ -564,9 +564,9 @@ { \ return show_pwm_enable(dev, buf, 0x##offset - 1); \ } \ -static DEVICE_ATTR(pwm##offset, S_IRUGO | S_IWUSR, \ +static DEVICE_ATTR(fan##offset##_pwm, S_IRUGO | S_IWUSR, \ show_pwm_##offset, set_pwm_##offset) \ -static DEVICE_ATTR(pwm##offset##_enable, S_IRUGO, show_pwm_enable##offset, NULL) +static DEVICE_ATTR(fan##offset##_pwm_enable, S_IRUGO, show_pwm_enable##offset, NULL)show_pwm_reg (1 );show_pwm_reg (2 );
@@ -894,12 +894,12 @@device_create_file (&new_client->dev, &dev_attr_fan2_min);device_create_file (&new_client->dev, &dev_attr_fan3_min);device_create_file (&new_client->dev, &dev_attr_fan4_min); -device_create_file (&new_client->dev, &dev_attr_pwm1); -device_create_file (&new_client->dev, &dev_attr_pwm2); -device_create_file (&new_client->dev, &dev_attr_pwm3); -device_create_file (&new_client->dev, &dev_attr_pwm1_enable); -device_create_file (&new_client->dev, &dev_attr_pwm2_enable); -device_create_file (&new_client->dev, &dev_attr_pwm3_enable); +device_create_file (&new_client->dev, &dev_attr_fan1_pwm); +device_create_file (&new_client->dev, &dev_attr_fan2_pwm); +device_create_file (&new_client->dev, &dev_attr_fan3_pwm); +device_create_file (&new_client->dev, &dev_attr_fan1_pwm_enable); +device_create_file (&new_client->dev, &dev_attr_fan2_pwm_enable); +device_create_file (&new_client->dev, &dev_attr_fan3_pwm_enable);device_create_file (&new_client->dev, &dev_attr_in0_input);device_create_file (&new_client->dev, &dev_attr_in1_input);device_create_file (&new_client->dev, &dev_attr_in2_input);
@@ -925,7 +925,7 @@device_create_file (&new_client->dev, &dev_attr_temp2_max);device_create_file (&new_client->dev, &dev_attr_temp3_max);device_create_file (&new_client->dev, &dev_attr_vrm); -device_create_file (&new_client->dev, &dev_attr_vid); +device_create_file (&new_client->dev, &dev_attr_in0_ref);device_create_file (&new_client->dev, &dev_attr_alarms);return 0 ;
drivers/i2c/chips/lm90.c +4 -4
@@ -259,9 +259,9 @@ set_temp_crit1); static DEVICE_ATTR(temp2_crit, S_IWUSR | S_IRUGO, show_temp_crit2, set_temp_crit2); -static DEVICE_ATTR(temp1_hyst, S_IWUSR | S_IRUGO, show_temp_hyst1, +static DEVICE_ATTR(temp1_crit_hyst, S_IWUSR | S_IRUGO, show_temp_hyst1, set_temp_hyst1); -static DEVICE_ATTR(temp2_hyst, S_IRUGO, show_temp_hyst2, NULL); +static DEVICE_ATTR(temp2_crit_hyst, S_IRUGO, show_temp_hyst2, NULL); static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);/*
@@ -389,8 +389,8 @@device_create_file (&new_client->dev, &dev_attr_temp2_max);device_create_file (&new_client->dev, &dev_attr_temp1_crit);device_create_file (&new_client->dev, &dev_attr_temp2_crit); -device_create_file (&new_client->dev, &dev_attr_temp1_hyst); -device_create_file (&new_client->dev, &dev_attr_temp2_hyst); +device_create_file (&new_client->dev, &dev_attr_temp1_crit_hyst); +device_create_file (&new_client->dev, &dev_attr_temp2_crit_hyst);device_create_file (&new_client->dev, &dev_attr_alarms);return 0 ;
drivers/i2c/chips/via686a.c +4 -4
@@ -559,7 +559,7 @@ static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_temp_##offset, NULL) \ static DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \ show_temp_##offset##_over, set_temp_##offset##_over) \ -static DEVICE_ATTR(temp##offset##_hyst, S_IRUGO | S_IWUSR, \ +static DEVICE_ATTR(temp##offset##_max_hyst, S_IRUGO | S_IWUSR, \ show_temp_##offset##_hyst, set_temp_##offset##_hyst)show_temp_offset (1 );
@@ -763,9 +763,9 @@device_create_file (&new_client->dev, &dev_attr_temp1_max);device_create_file (&new_client->dev, &dev_attr_temp2_max);device_create_file (&new_client->dev, &dev_attr_temp3_max); -device_create_file (&new_client->dev, &dev_attr_temp1_hyst); -device_create_file (&new_client->dev, &dev_attr_temp2_hyst); -device_create_file (&new_client->dev, &dev_attr_temp3_hyst); +device_create_file (&new_client->dev, &dev_attr_temp1_max_hyst); +device_create_file (&new_client->dev, &dev_attr_temp2_max_hyst); +device_create_file (&new_client->dev, &dev_attr_temp3_max_hyst);device_create_file (&new_client->dev, &dev_attr_fan1_input);device_create_file (&new_client->dev, &dev_attr_fan2_input);device_create_file (&new_client->dev, &dev_attr_fan1_min);
drivers/i2c/chips/w83781d.c +17 -17
@@ -247,10 +247,10 @@u8 fan_min[3 ];/* Register value */ u8 temp;u8 temp_max;/* Register value */ -u8 temp_hyst;/* Register value */ +u8 temp_max_hyst;/* Register value */ u16 temp_add[2 ];/* Register value */ u16 temp_max_add[2 ];/* Register value */ -u16 temp_hyst_add[2 ];/* Register value */ +u16 temp_max_hyst_add[2 ];/* Register value */ u8 fan_div[3 ];/* Register encoding, shifted right */ u8 vid;/* Register encoding, combined */ u32 alarms;/* Register encoding, combined */
@@ -448,7 +448,7 @@ }show_temp_reg (temp);show_temp_reg (temp_max); -show_temp_reg (temp_hyst); +show_temp_reg (temp_max_hyst);#define store_temp_reg (REG , reg) \ static ssize_t store_temp_##reg (struct device *dev, const char *buf, size_t count, int nr) \
@@ -476,7 +476,7 @@return count; \ }store_temp_reg (OVER , max); -store_temp_reg (HYST , hyst); +store_temp_reg (HYST , max_hyst);#define sysfs_temp_offset (offset) \ static ssize_t \
@@ -500,7 +500,7 @@#define sysfs_temp_offsets (offset) \ sysfs_temp_offset(offset); \ sysfs_temp_reg_offset(max, offset); \ -sysfs_temp_reg_offset(hyst, offset); +sysfs_temp_reg_offset(max_hyst, offset);sysfs_temp_offsets (1 );sysfs_temp_offsets (2 );
@@ -510,7 +510,7 @@ do { \ device_create_file(&client->dev, &dev_attr_temp##offset##_input); \ device_create_file(&client->dev, &dev_attr_temp##offset##_max); \ -device_create_file(&client->dev, &dev_attr_temp##offset##_hyst); \ +device_create_file(&client->dev, &dev_attr_temp##offset##_max_hyst); \ } while (0) static ssize_t
@@ -525,9 +525,9 @@ } static -DEVICE_ATTR(vid, S_IRUGO, show_vid_reg, NULL) +DEVICE_ATTR(in0_ref, S_IRUGO, show_vid_reg, NULL)#define device_create_file_vid (client) \ -device_create_file(&client->dev, &dev_attr_vid); +device_create_file(&client->dev, &dev_attr_in0_ref);static ssize_t show_vrm_reg (struct device *dev,char *buf) {
@@ -808,7 +808,7 @@ { \return store_pwm_reg (dev, buf, count, offset); \ } \ -static DEVICE_ATTR(pwm##offset, S_IRUGO | S_IWUSR, show_regs_pwm_##offset, store_regs_pwm_##offset) +static DEVICE_ATTR(fan##offset##_pwm, S_IRUGO | S_IWUSR, show_regs_pwm_##offset, store_regs_pwm_##offset)#define sysfs_pwmenable (offset) \ static ssize_t show_regs_pwmenable_##offset (struct device *dev, char *buf) \
@@ -819,7 +819,7 @@ { \return store_pwmenable_reg (dev, buf, count, offset); \ } \ -static DEVICE_ATTR(pwm##offset##_enable, S_IRUGO | S_IWUSR, show_regs_pwmenable_##offset, store_regs_pwmenable_##offset) +static DEVICE_ATTR(fan##offset##_pwm_enable, S_IRUGO | S_IWUSR, show_regs_pwmenable_##offset, store_regs_pwmenable_##offset)sysfs_pwm (1 );sysfs_pwm (2 );
@@ -829,12 +829,12 @@#define device_create_file_pwm (client, offset) \ do { \ -device_create_file(&client->dev, &dev_attr_pwm##offset); \ +device_create_file(&client->dev, &dev_attr_fan##offset##_pwm); \ } while (0)#define device_create_file_pwmenable (client, offset) \ do { \ -device_create_file(&client->dev, &dev_attr_pwm##offset##_enable); \ +device_create_file(&client->dev, &dev_attr_fan##offset##_pwm_enable); \ } while (0) static ssize_t
@@ -901,7 +901,7 @@ { \return store_sensor_reg (dev, buf, count, offset); \ } \ -static DEVICE_ATTR(sensor##offset, S_IRUGO | S_IWUSR, show_regs_sensor_##offset, store_regs_sensor_##offset) +static DEVICE_ATTR(temp##offset##_type, S_IRUGO | S_IWUSR, show_regs_sensor_##offset, store_regs_sensor_##offset)sysfs_sensor (1 );sysfs_sensor (2 );
@@ -909,7 +909,7 @@#define device_create_file_sensor (client, offset) \ do { \ -device_create_file(&client->dev, &dev_attr_sensor##offset); \ +device_create_file(&client->dev, &dev_attr_temp##offset##_type); \ } while (0)#ifdef W83781D_RT
@@ -1698,13 +1698,13 @@ data->temp =w83781d_read_value (client,W83781D_REG_TEMP (1 )); data->temp_max =w83781d_read_value (client,W83781D_REG_TEMP_OVER (1 )); - data->temp_hyst = + data->temp_max_hyst =w83781d_read_value (client,W83781D_REG_TEMP_HYST (1 )); data->temp_add[0 ] =w83781d_read_value (client,W83781D_REG_TEMP (2 )); data->temp_max_add[0 ] =w83781d_read_value (client,W83781D_REG_TEMP_OVER (2 )); - data->temp_hyst_add[0 ] = + data->temp_max_hyst_add[0 ] =w83781d_read_value (client,W83781D_REG_TEMP_HYST (2 ));if (data->type != w83783s && data->type != w83697hf) { data->temp_add[1] =
@@ -1712,7 +1712,7 @@ data->temp_max_add[1 ] =w83781d_read_value (client,W83781D_REG_TEMP_OVER (3 )); - data->temp_hyst_add[1 ] = + data->temp_max_hyst_add[1 ] =w83781d_read_value (client,W83781D_REG_TEMP_HYST (3 )); }
ChangeSet 1.1557.61.18, 2004/02/23 16:47:10-08:00, [email protected]
[PATCH] PCI: fix i2c quirk for SiS735 chipset SMBus driver
drivers/pci/quirks.c | 8 +++++--- include/linux/pci_ids.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-)
drivers/pci/quirks.c +5 -3
@@ -757,7 +757,7 @@#define SIS_DETECT_REGISTER 0x40 -static void __init quirk_sis_503_smbus (struct pci_dev *dev) +static void __init quirk_sis_503 (struct pci_dev *dev) {u8 reg;u16 devid;
@@ -765,7 +765,7 @@pci_read_config_byte (dev,SIS_DETECT_REGISTER , ®);pci_write_config_byte (dev,SIS_DETECT_REGISTER , reg | (1 <<6 ));pci_read_config_word (dev,PCI_DEVICE_ID , &devid); -if ((devid &0xfff0 ) !=0x0960 ) { +if (((devid &0xfff0 ) !=0x0960 ) && (devid !=0x0018 )) {pci_write_config_byte (dev,SIS_DETECT_REGISTER , reg);return ; }
@@ -877,12 +877,14 @@ { PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_2, quirk_natoma }, { PCI_FIXUP_FINAL, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5597, quirk_nopcipci }, { PCI_FIXUP_FINAL, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_496, quirk_nopcipci }, - { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503, quirk_sis_503_smbus }, + { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503, quirk_sis_503 }, + { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC, quirk_sis_96x_smbus }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_645, quirk_sis_96x_compatible }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_646, quirk_sis_96x_compatible }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_648, quirk_sis_96x_compatible }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_650, quirk_sis_96x_compatible }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_651, quirk_sis_96x_compatible }, + { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_735, quirk_sis_96x_compatible }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_961, quirk_sis_96x_smbus }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_962, quirk_sis_96x_smbus }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_963, quirk_sis_96x_smbus },
include/linux/pci_ids.h +1 -0
@@ -569,6 +569,7 @@#define PCI_DEVICE_ID_SI_6202 0x0002#define PCI_DEVICE_ID_SI_503 0x0008#define PCI_DEVICE_ID_SI_ACPI 0x0009 +#define PCI_DEVICE_ID_SI_LPC 0x0018#define PCI_DEVICE_ID_SI_5597_VGA 0x0200#define PCI_DEVICE_ID_SI_6205 0x0205#define PCI_DEVICE_ID_SI_501 0x0406
ChangeSet 1.1597.1.8, 2004/02/23 17:23:15-08:00, [email protected]
I2C: fix compiler warnings in 2 drivers.
drivers/i2c/busses/i2c-elv.c | 2 +- drivers/i2c/busses/i2c-velleman.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-elv.c +1 -1
@@ -152,7 +152,7 @@return -ENODEV ; } } -pr_debug ("i2c-elv: found device at %#x.\n" ,base); +pr_debug ("i2c-elv: found device at %p.\n" , (void *)base);return 0 ; }
drivers/i2c/busses/i2c-velleman.c +1 -1
@@ -138,7 +138,7 @@return -ENODEV ; } } -pr_debug ("i2c-velleman: found device at %#x.\n" ,base); +pr_debug ("i2c-velleman: found device at %p.\n" ,(void *)base);return 0 ; }
ChangeSet 1.1597.1.9, 2004/02/27 11:25:01-08:00, [email protected]
[PATCH] I2C: add w83627hf driver
The following patch against kernel 2.6.3 adds the w83627hf driver, I have ported from the 2.4 version.
Jean Delvare has asked me to send this patch to you for applying. I have tested it on w83627thf. Mark Hoffman has reviewed the code and has also tested it on w83627thf.
drivers/i2c/chips/Kconfig | 11 drivers/i2c/chips/Makefile | 1 drivers/i2c/chips/w83627hf.c | 1391 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1403 insertions(+)
drivers/i2c/chips/Kconfig +11 -0
@@ -182,4 +182,15 @@ This driver can also be built as a module. If so, the module will be called w83l785ts. +config SENSORS_W83627HF + tristate "Winbond W83627HF, W83627THF, W83637HF, W83697HF" + depends on I2C && EXPERIMENTAL + select I2C_SENSOR + help + If you say yes here you get support for the Winbond W836X7 series + of sensor chips: the W83627HF, W83627THF, W83637HF, and the W83697HF + + This driver can also be built as a module. If so, the module + will be called w83627hf. + endmenu
drivers/i2c/chips/Makefile +1 -0
@@ -4,6 +4,7 @@ # asb100, then w83781d go first, as they can override other drivers' addresses. obj-$(CONFIG_SENSORS_ASB100) += asb100.o +obj-$(CONFIG_SENSORS_W83627HF) += w83627hf.o obj-$(CONFIG_SENSORS_W83781D) += w83781d.o obj-$(CONFIG_SENSORS_ADM1021) += adm1021.o
drivers/i2c/chips/w83627hf.c new file +1391 -0
1,391 lines not on this page · raw message
ChangeSet 1.1597.1.10, 2004/03/01 11:27:29-08:00, [email protected]
[PATCH] I2C: it87 reset option
I wrote a patch which adds reset option to the it87 driver talking with Jean Delvare.
* Do not reset the registers unless users want to do because resetting registers makes all fans go to full power and we can usually rely on values set by BIOS
* Remove all limit initializations as they should be done from user-space
* Better register mask for start of monitoring
drivers/i2c/chips/it87.c | 162 +++++++++++------------------------------------ 1 files changed, 38 insertions(+), 124 deletions(-)
drivers/i2c/chips/it87.c +38 -124
@@ -55,7 +55,10 @@/* Update battery voltage after every reading if true */ -static int update_vbat =0 ; +static int update_vbat; + +/* Reset the registers on init if true */ +static int reset;/* Many IT87 constants specified below */
@@ -129,61 +132,6 @@ }#define DIV_FROM_REG (val) (1 << (val)) -/* Initial limits. Use the config file to set better limits. */ -#define IT87_INIT_IN_0 170 -#define IT87_INIT_IN_1 250 -#define IT87_INIT_IN_2 (330 / 2) -#define IT87_INIT_IN_3 (((500) * 100)/168) -#define IT87_INIT_IN_4 (((1200) * 10)/38) -#define IT87_INIT_IN_5 (((1200) * 10)/72) -#define IT87_INIT_IN_6 (((500) * 10)/56) -#define IT87_INIT_IN_7 (((500) * 100)/168) - -#define IT87_INIT_IN_PERCENTAGE 10 - -#define IT87_INIT_IN_MIN_0 \ - (IT87_INIT_IN_0 - IT87_INIT_IN_0 * IT87_INIT_IN_PERCENTAGE / 100) -#define IT87_INIT_IN_MAX_0 \ - (IT87_INIT_IN_0 + IT87_INIT_IN_0 * IT87_INIT_IN_PERCENTAGE / 100) -#define IT87_INIT_IN_MIN_1 \ - (IT87_INIT_IN_1 - IT87_INIT_IN_1 * IT87_INIT_IN_PERCENTAGE / 100) -#define IT87_INIT_IN_MAX_1 \ - (IT87_INIT_IN_1 + IT87_INIT_IN_1 * IT87_INIT_IN_PERCENTAGE / 100) -#define IT87_INIT_IN_MIN_2 \ - (IT87_INIT_IN_2 - IT87_INIT_IN_2 * IT87_INIT_IN_PERCENTAGE / 100) -#define IT87_INIT_IN_MAX_2 \ - (IT87_INIT_IN_2 + IT87_INIT_IN_2 * IT87_INIT_IN_PERCENTAGE / 100) -#define IT87_INIT_IN_MIN_3 \ - (IT87_INIT_IN_3 - IT87_INIT_IN_3 * IT87_INIT_IN_PERCENTAGE / 100) -#define IT87_INIT_IN_MAX_3 \ - (IT87_INIT_IN_3 + IT87_INIT_IN_3 * IT87_INIT_IN_PERCENTAGE / 100) -#define IT87_INIT_IN_MIN_4 \ - (IT87_INIT_IN_4 - IT87_INIT_IN_4 * IT87_INIT_IN_PERCENTAGE / 100) -#define IT87_INIT_IN_MAX_4 \ - (IT87_INIT_IN_4 + IT87_INIT_IN_4 * IT87_INIT_IN_PERCENTAGE / 100) -#define IT87_INIT_IN_MIN_5 \ - (IT87_INIT_IN_5 - IT87_INIT_IN_5 * IT87_INIT_IN_PERCENTAGE / 100) -#define IT87_INIT_IN_MAX_5 \ - (IT87_INIT_IN_5 + IT87_INIT_IN_5 * IT87_INIT_IN_PERCENTAGE / 100) -#define IT87_INIT_IN_MIN_6 \ - (IT87_INIT_IN_6 - IT87_INIT_IN_6 * IT87_INIT_IN_PERCENTAGE / 100) -#define IT87_INIT_IN_MAX_6 \ - (IT87_INIT_IN_6 + IT87_INIT_IN_6 * IT87_INIT_IN_PERCENTAGE / 100) -#define IT87_INIT_IN_MIN_7 \ - (IT87_INIT_IN_7 - IT87_INIT_IN_7 * IT87_INIT_IN_PERCENTAGE / 100) -#define IT87_INIT_IN_MAX_7 \ - (IT87_INIT_IN_7 + IT87_INIT_IN_7 * IT87_INIT_IN_PERCENTAGE / 100) - -#define IT87_INIT_FAN_MIN_1 3000 -#define IT87_INIT_FAN_MIN_2 3000 -#define IT87_INIT_FAN_MIN_3 3000 - -#define IT87_INIT_TEMP_HIGH_1 600 -#define IT87_INIT_TEMP_LOW_1 200 -#define IT87_INIT_TEMP_HIGH_2 600 -#define IT87_INIT_TEMP_LOW_2 200 -#define IT87_INIT_TEMP_HIGH_3 600 -#define IT87_INIT_TEMP_LOW_3 200/* For each registered IT87, we need to keep some data in memory. That data is pointed to by it87_list[NR]->data. The structure itself is
@@ -822,80 +770,44 @@return i2c_smbus_write_byte_data (client, reg, value); } -/* Called when we have found a new IT87. It should set limits, etc. */ +/* Called when we have found a new IT87. */ static void it87_init_client (struct i2c_client *client,struct it87_data *data) { -/* Reset all except Watchdog values and last conversion values -This sets fan-divs to 2, among others */ -it87_write_value (client,IT87_REG_CONFIG ,0x80 ); -it87_write_value (client,IT87_REG_VIN_MIN (0 ), -IN_TO_REG (IT87_INIT_IN_MIN_0 )); -it87_write_value (client,IT87_REG_VIN_MAX (0 ), -IN_TO_REG (IT87_INIT_IN_MAX_0 )); -it87_write_value (client,IT87_REG_VIN_MIN (1 ), -IN_TO_REG (IT87_INIT_IN_MIN_1 )); -it87_write_value (client,IT87_REG_VIN_MAX (1 ), -IN_TO_REG (IT87_INIT_IN_MAX_1 )); -it87_write_value (client,IT87_REG_VIN_MIN (2 ), -IN_TO_REG (IT87_INIT_IN_MIN_2 )); -it87_write_value (client,IT87_REG_VIN_MAX (2 ), -IN_TO_REG (IT87_INIT_IN_MAX_2 )); -it87_write_value (client,IT87_REG_VIN_MIN (3 ), -IN_TO_REG (IT87_INIT_IN_MIN_3 )); -it87_write_value (client,IT87_REG_VIN_MAX (3 ), -IN_TO_REG (IT87_INIT_IN_MAX_3 )); -it87_write_value (client,IT87_REG_VIN_MIN (4 ), -IN_TO_REG (IT87_INIT_IN_MIN_4 )); -it87_write_value (client,IT87_REG_VIN_MAX (4 ), -IN_TO_REG (IT87_INIT_IN_MAX_4 )); -it87_write_value (client,IT87_REG_VIN_MIN (5 ), -IN_TO_REG (IT87_INIT_IN_MIN_5 )); -it87_write_value (client,IT87_REG_VIN_MAX (5 ), -IN_TO_REG (IT87_INIT_IN_MAX_5 )); -it87_write_value (client,IT87_REG_VIN_MIN (6 ), -IN_TO_REG (IT87_INIT_IN_MIN_6 )); -it87_write_value (client,IT87_REG_VIN_MAX (6 ), -IN_TO_REG (IT87_INIT_IN_MAX_6 )); -it87_write_value (client,IT87_REG_VIN_MIN (7 ), -IN_TO_REG (IT87_INIT_IN_MIN_7 )); -it87_write_value (client,IT87_REG_VIN_MAX (7 ), -IN_TO_REG (IT87_INIT_IN_MAX_7 )); -/* Note: Battery voltage does not have limit registers */ -it87_write_value (client,IT87_REG_FAN_MIN (0 ), -FAN_TO_REG (IT87_INIT_FAN_MIN_1 ,2 )); -it87_write_value (client,IT87_REG_FAN_MIN (1 ), -FAN_TO_REG (IT87_INIT_FAN_MIN_2 ,2 )); -it87_write_value (client,IT87_REG_FAN_MIN (2 ), -FAN_TO_REG (IT87_INIT_FAN_MIN_3 ,2 )); -it87_write_value (client,IT87_REG_TEMP_HIGH (0 ), -TEMP_TO_REG (IT87_INIT_TEMP_HIGH_1 )); -it87_write_value (client,IT87_REG_TEMP_LOW (0 ), -TEMP_TO_REG (IT87_INIT_TEMP_LOW_1 )); -it87_write_value (client,IT87_REG_TEMP_HIGH (1 ), -TEMP_TO_REG (IT87_INIT_TEMP_HIGH_2 )); -it87_write_value (client,IT87_REG_TEMP_LOW (1 ), -TEMP_TO_REG (IT87_INIT_TEMP_LOW_2 )); -it87_write_value (client,IT87_REG_TEMP_HIGH (2 ), -TEMP_TO_REG (IT87_INIT_TEMP_HIGH_3 )); -it87_write_value (client,IT87_REG_TEMP_LOW (2 ), -TEMP_TO_REG (IT87_INIT_TEMP_LOW_3 )); - -/* Enable voltage monitors */ -it87_write_value (client,IT87_REG_VIN_ENABLE ,0xff ); - -/* Enable Temp1-Temp3 */ - data->sensor = (it87_read_value (client,IT87_REG_TEMP_ENABLE ) &0xc0 ); - data->sensor |=0x2a ;/* Temp1,Temp3=thermistor; Temp2=thermal diode */ -it87_write_value (client,IT87_REG_TEMP_ENABLE , data->sensor); +int tmp; -/* Enable fans */ -it87_write_value (client,IT87_REG_FAN_CTRL , - (it87_read_value (client,IT87_REG_FAN_CTRL ) &0x8f ) - |0x70 ); +if (reset) { +/* Reset all except Watchdog values and last conversion values +This sets fan-divs to 2, among others */ +it87_write_value (client,IT87_REG_CONFIG ,0x80 ); + } + +/* Check if temperature channnels are reset manually or by some reason */ + tmp =it87_read_value (client,IT87_REG_TEMP_ENABLE ); +if ((tmp &0x3f ) ==0 ) { +/* Temp1,Temp3=thermistor; Temp2=thermal diode */ + tmp = (tmp &0xc0 ) |0x2a ; +it87_write_value (client,IT87_REG_TEMP_ENABLE , tmp); + } + data->sensor = tmp; + +/* Check if voltage monitors are reset manually or by some reason */ + tmp =it87_read_value (client,IT87_REG_VIN_ENABLE ); +if ((tmp &0xff ) ==0 ) { +/* Enable all voltage monitors */ +it87_write_value (client,IT87_REG_VIN_ENABLE ,0xff ); + } + +/* Check if tachometers are reset manually or by some reason */ + tmp =it87_read_value (client,IT87_REG_FAN_CTRL ); +if ((tmp &0x70 ) ==0 ) { +/* Enable all fan tachometers */ + tmp = (tmp &0x8f ) |0x70 ; +it87_write_value (client,IT87_REG_FAN_CTRL , tmp); + }/* Start monitoring */ it87_write_value (client,IT87_REG_CONFIG , - (it87_read_value (client,IT87_REG_CONFIG ) &0xb7 ) + (it87_read_value (client,IT87_REG_CONFIG ) &0x36 ) | (update_vbat ?0x41 :0x01 )); }
@@ -988,6 +900,8 @@MODULE_DESCRIPTION ("IT8705F, IT8712F, Sis950 driver" );MODULE_PARM (update_vbat,"i" );MODULE_PARM_DESC (update_vbat,"Update vbat if set else return powerup value" ); +MODULE_PARM (reset,"i" ); +MODULE_PARM_DESC (reset,"Reset the chip's registers, default no" );MODULE_LICENSE ("GPL" );module_init (sm_it87_init);
ChangeSet 1.1597.1.11, 2004/03/03 10:07:50-08:00, [email protected]
[PATCH] I2C: IOP3xx i2c driver update
Here's a small patch update to the i2c-iop3xx.c indrivers/i2c/busses/. It fixes some functions' return value and updated the irq handler to be compatible with kernel 2.6. Thanks!
drivers/i2c/busses/i2c-iop3xx.c | 20 ++++++++++++-------- 1 files changed, 12 insertions(+), 8 deletions(-)
drivers/i2c/busses/i2c-iop3xx.c +12 -8
@@ -129,7 +129,7 @@* NB: the handler has to clear the source of the interrupt! * Then it passes the SR flags of interest to BH via adap data */ -static void iop3xx_i2c_handler (int this_irq, +static irqreturn_t iop3xx_i2c_handler (int this_irq,void *dev_id,struct pt_regs *regs) {
@@ -142,6 +142,7 @@ iop3xx_adap->biu->SR_received |= sr;wake_up_interruptible (&iop3xx_adap->waitq); } +return IRQ_HANDLED ; }/* check all error conditions, clear them , report most important */
@@ -185,7 +186,7 @@unsigned sr =0 ;int interrupted;int done; -int rc; +int rc =0 ; do { interrupted = wait_event_interruptible_timeout (
@@ -198,13 +199,13 @@return rc; }else if (!interrupted) { *status = sr; -return rc = -ETIMEDOUT ; +return -ETIMEDOUT ; } }while (!done); *status = sr; -return rc =0 ; +return 0 ; }/*
@@ -284,7 +285,7 @@ {unsigned cr = *iop3xx_adap->biu->CR;int status; -int rc; +int rc =0 ; *iop3xx_adap->biu->DBR = byte; cr &= ~IOP321_ICR_MSTART ;
@@ -304,7 +305,7 @@ {unsigned cr = *iop3xx_adap->biu->CR;int status; -int rc; +int rc =0 ; cr &= ~IOP321_ICR_MSTART ;
@@ -386,13 +387,16 @@iop3xx_adap_reset (iop3xx_adap);iop3xx_adap_enable (iop3xx_adap); -for (im =0 ; ret ==0 && im != num; ++im) { +for (im =0 ; ret ==0 && im != num; im++) { ret =iop3xx_handle_msg (i2c_adap, &msgs[im]); }iop3xx_adap_transaction_cleanup (iop3xx_adap); + +if (ret) +return ret; -return ret; +return im; } static int algo_control(struct i2c_adapter *adapter, unsigned int cmd,
ChangeSet 1.1597.1.12, 2004/03/03 10:09:09-08:00, [email protected]
[PATCH] I2C: show adapter name in i2c-dev class directory to make it easier for userspace tools.
drivers/i2c/i2c-dev.c | 8 ++++++++ 1 files changed, 8 insertions(+)
drivers/i2c/i2c-dev.c +8 -0
@@ -124,6 +124,13 @@ } static CLASS_DEVICE_ATTR(dev, S_IRUGO, show_dev, NULL); +static ssize_t show_adapter_name (struct class_device *class_dev,char *buf) +{ +struct i2c_dev *i2c_dev =to_i2c_dev (class_dev); +return sprintf (buf,"%s\n" , i2c_dev->adap->name); +} +static CLASS_DEVICE_ATTR(name, S_IRUGO, show_adapter_name, NULL); +static ssize_t i2cdev_read (struct file *file,char __user *buf,size_t count,loff_t *offset) {
@@ -459,6 +466,7 @@if (retval) goto error;class_device_create_file (&i2c_dev->class_dev, &class_device_attr_dev); +class_device_create_file (&i2c_dev->class_dev, &class_device_attr_name);return 0 ; error:return_i2c_dev (i2c_dev);
ChangeSet 1.1597.1.13, 2004/03/03 15:31:01-08:00, [email protected]
[PATCH] I2C: keep i2c-dev numbers in sync with i2c adapter numbers
This makes userspace tools easier to figure out which i2c-dev device is assigned to which i2c adapter.
Yes, we can overflow the i2c dev array right now, but that would take a lot of i2c adapter modprobe/rmmod cycles. That will be fixed up soon.
drivers/i2c/i2c-dev.c | 29 ++++++++++++----------------- 1 files changed, 12 insertions(+), 17 deletions(-)
drivers/i2c/i2c-dev.c +12 -17
@@ -72,24 +72,18 @@struct i2c_dev *i2c_dev_get_by_adapter (struct i2c_adapter *adap) {struct i2c_dev *i2c_dev =NULL ; -int i;spin_lock (&i2c_dev_array_lock); -for (i =0 ; i <I2C_MINORS ; ++i) { -if ((i2c_dev_array[i]) && - (i2c_dev_array[i]->adap == adap)) { - i2c_dev = i2c_dev_array[i]; -break ; - } - } +if ((i2c_dev_array[adap->nr]) && + (i2c_dev_array[adap->nr]->adap == adap)) + i2c_dev = i2c_dev_array[adap->nr];spin_unlock (&i2c_dev_array_lock);return i2c_dev; } -static struct i2c_dev *get_free_i2c_dev (void ) +static struct i2c_dev *get_free_i2c_dev (struct i2c_adapter *adap) {struct i2c_dev *i2c_dev; -unsigned int i; i2c_dev =kmalloc (sizeof (*i2c_dev),GFP_KERNEL );if (!i2c_dev)
@@ -97,15 +91,16 @@memset (i2c_dev,0x00 ,sizeof (*i2c_dev));spin_lock (&i2c_dev_array_lock); -for (i =0 ; i <I2C_MINORS ; ++i) { -if (i2c_dev_array[i]) -continue ; - i2c_dev->minor = i; - i2c_dev_array[i] = i2c_dev; +if (i2c_dev_array[adap->nr]) {spin_unlock (&i2c_dev_array_lock); -return i2c_dev; +dev_err (&adap->dev,"i2c-dev already has a device assigned to this adapter\n" ); + goto error; } + i2c_dev->minor = adap->nr; + i2c_dev_array[adap->nr] = i2c_dev;spin_unlock (&i2c_dev_array_lock); +return i2c_dev; +error:kfree (i2c_dev);return ERR_PTR (-ENODEV ); }
@@ -446,7 +441,7 @@struct i2c_dev *i2c_dev;int retval; - i2c_dev =get_free_i2c_dev (); + i2c_dev =get_free_i2c_dev (adap);if (IS_ERR (i2c_dev))return PTR_ERR (i2c_dev);
ChangeSet 1.1608.74.2, 2004/03/09 14:57:49-08:00, [email protected]
[PATCH] I2C: Prevent i2c-dev oops with debug
Looks like i2c-dev suffers the same problem with dev_dbg as i2c-core did twice. Here is a patch that fixed a oops I and another user were experiencing when running sensors-detect.
drivers/i2c/i2c-dev.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/i2c/i2c-dev.c +4 -4
@@ -189,7 +189,7 @@int i,datasize,res;unsigned long funcs; -dev_dbg (&client->dev,"i2c-%d ioctl, cmd: 0x%x, arg: %lx.\n" , +dev_dbg (&client->adapter->dev,"i2c-%d ioctl, cmd: 0x%x, arg: %lx.\n" ,iminor (inode),cmd, arg);switch ( cmd ) {
@@ -310,7 +310,7 @@ (data_arg.size != I2C_SMBUS_BLOCK_DATA) && (data_arg.size != I2C_SMBUS_I2C_BLOCK_DATA) && (data_arg.size != I2C_SMBUS_BLOCK_PROC_CALL)) { -dev_dbg (&client->dev, +dev_dbg (&client->adapter->dev,"size out of range (%x) in ioctl I2C_SMBUS.\n" , data_arg.size);return -EINVAL ;
@@ -319,7 +319,7 @@so the check is valid if size==I2C_SMBUS_QUICK too. */ if ((data_arg.read_write !=I2C_SMBUS_READ ) && (data_arg.read_write !=I2C_SMBUS_WRITE )) { -dev_dbg (&client->dev, +dev_dbg (&client->adapter->dev,"read_write out of range (%x) in ioctl I2C_SMBUS.\n" , data_arg.read_write);return -EINVAL ;
@@ -338,7 +338,7 @@ data_arg.size, NULL);if (data_arg.data ==NULL ) { -dev_dbg (&client->dev, +dev_dbg (&client->adapter->dev,"data is NULL pointer in ioctl I2C_SMBUS.\n" );return -EINVAL ; }
ChangeSet 1.1608.74.3, 2004/03/09 14:58:25-08:00, [email protected]
[PATCH] I2C: Fix i2c_use_client()
i2c_use_client() contains a bogosity. If i2c_inc_use_client() returns success, i2c_use_client() returns an error. If i2c_inc_use_client() fails, i2c_use_client() might succeed.
Fix it so that (a) we get the correct sense between these two functions, and (b) propagate the error code from i2c_inc_use_client(), rather than making our own one up.
drivers/i2c/i2c-core.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
drivers/i2c/i2c-core.c +5 -2
@@ -437,8 +437,11 @@int i2c_use_client (struct i2c_client *client) { -if (!i2c_inc_use_client (client)) -return -ENODEV ; +int ret; + + ret =i2c_inc_use_client (client); +if (ret) +return ret;if (client->flags &I2C_CLIENT_ALLOW_USE ) {if (client->flags &I2C_CLIENT_ALLOW_MULTIPLE_USE )
ChangeSet 1.1608.74.4, 2004/03/09 14:59:03-08:00, [email protected]
[PATCH] I2C: sysfs interface update for w83627hf
This patch updates the sysfs names of the w83627hf driver to match the new standard. The patch applies on top of one recently applied to your tree [1]. I have tested it using a w83627thf & the latest lm_sensors CVS. Please apply.
[1] http://archives.andrew.net.au/lm-sensors/msg06746.html
drivers/i2c/chips/w83627hf.c | 60 +++++++++++++++++++++---------------------- 1 files changed, 30 insertions(+), 30 deletions(-)
drivers/i2c/chips/w83627hf.c +30 -30
@@ -294,10 +294,10 @@u8 fan_min[3 ];/* Register value */ u8 temp;u8 temp_max;/* Register value */ -u8 temp_hyst;/* Register value */ +u8 temp_max_hyst;/* Register value */ u16 temp_add[2 ];/* Register value */ u16 temp_max_add[2 ];/* Register value */ -u16 temp_hyst_add[2 ];/* Register value */ +u16 temp_max_hyst_add[2 ];/* Register value */ u8 fan_div[3 ];/* Register encoding, shifted right */ u8 vid;/* Register encoding, combined */ u32 alarms;/* Register encoding, combined */
@@ -373,7 +373,7 @@ { \ return show_in(dev, buf, 0x##offset); \ } \ -static DEVICE_ATTR(in_input##offset, S_IRUGO, show_regs_in_##offset, NULL) +static DEVICE_ATTR(in##offset##_input, S_IRUGO, show_regs_in_##offset, NULL)#define sysfs_in_reg_offset (reg, offset) \ static ssize_t show_regs_in_##reg##offset (struct device *dev, char *buf) \
@@ -386,7 +386,7 @@ { \ return store_in_##reg (dev, buf, count, 0x##offset); \ } \ -static DEVICE_ATTR(in_##reg##offset, S_IRUGO| S_IWUSR, \ +static DEVICE_ATTR(in##offset##_##reg, S_IRUGO| S_IWUSR, \ show_regs_in_##reg##offset, store_regs_in_##reg##offset)#define sysfs_in_offsets (offset) \
@@ -406,9 +406,9 @@#define device_create_file_in (client, offset) \ do { \ -device_create_file(&client->dev, &dev_attr_in_input##offset); \ -device_create_file(&client->dev, &dev_attr_in_min##offset); \ -device_create_file(&client->dev, &dev_attr_in_max##offset); \ +device_create_file(&client->dev, &dev_attr_in##offset##_input); \ +device_create_file(&client->dev, &dev_attr_in##offset##_min); \ +device_create_file(&client->dev, &dev_attr_in##offset##_max); \ } while (0)#define show_fan_reg (reg) \
@@ -447,7 +447,7 @@ { \ return show_fan(dev, buf, 0x##offset); \ } \ -static DEVICE_ATTR(fan_input##offset, S_IRUGO, show_regs_fan_##offset, NULL) +static DEVICE_ATTR(fan##offset##_input, S_IRUGO, show_regs_fan_##offset, NULL)#define sysfs_fan_min_offset (offset) \ static ssize_t show_regs_fan_min##offset (struct device *dev, char *buf) \
@@ -459,7 +459,7 @@ { \ return store_fan_min(dev, buf, count, 0x##offset); \ } \ -static DEVICE_ATTR(fan_min##offset, S_IRUGO | S_IWUSR, \ +static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ show_regs_fan_min##offset, store_regs_fan_min##offset)sysfs_fan_offset (1 )
@@ -471,8 +471,8 @@#define device_create_file_fan (client, offset) \ do { \ -device_create_file(&client->dev, &dev_attr_fan_input##offset); \ -device_create_file(&client->dev, &dev_attr_fan_min##offset); \ +device_create_file(&client->dev, &dev_attr_fan##offset##_input); \ +device_create_file(&client->dev, &dev_attr_fan##offset##_min); \ } while (0)#define show_temp_reg (reg) \
@@ -492,7 +492,7 @@ } show_temp_reg(temp) show_temp_reg(temp_max) -show_temp_reg(temp_hyst) +show_temp_reg(temp_max_hyst)#define store_temp_reg (REG , reg) \ static ssize_t \
@@ -517,7 +517,7 @@return count; \ } store_temp_reg(OVER, max) -store_temp_reg(HYST, hyst) +store_temp_reg(HYST, max_hyst)#define sysfs_temp_offset (offset) \ static ssize_t \
@@ -525,7 +525,7 @@ { \ return show_temp(dev, buf, 0x##offset); \ } \ -static DEVICE_ATTR(temp_input##offset, S_IRUGO, show_regs_temp_##offset, NULL) +static DEVICE_ATTR(temp##offset##_input, S_IRUGO, show_regs_temp_##offset, NULL)#define sysfs_temp_reg_offset (reg, offset) \ static ssize_t show_regs_temp_##reg##offset (struct device *dev, char *buf) \
@@ -538,13 +538,13 @@ { \ return store_temp_##reg (dev, buf, count, 0x##offset); \ } \ -static DEVICE_ATTR(temp_##reg##offset, S_IRUGO| S_IWUSR, \ +static DEVICE_ATTR(temp##offset##_##reg, S_IRUGO| S_IWUSR, \ show_regs_temp_##reg##offset, store_regs_temp_##reg##offset)#define sysfs_temp_offsets (offset) \ sysfs_temp_offset(offset) \ sysfs_temp_reg_offset(max, offset) \ -sysfs_temp_reg_offset(hyst, offset) +sysfs_temp_reg_offset(max_hyst, offset) sysfs_temp_offsets(1)sysfs_temp_offsets (2 )
@@ -552,9 +552,9 @@#define device_create_file_temp (client, offset) \ do { \ -device_create_file(&client->dev, &dev_attr_temp_input##offset); \ -device_create_file(&client->dev, &dev_attr_temp_max##offset); \ -device_create_file(&client->dev, &dev_attr_temp_hyst##offset); \ +device_create_file(&client->dev, &dev_attr_temp##offset##_input); \ +device_create_file(&client->dev, &dev_attr_temp##offset##_max); \ +device_create_file(&client->dev, &dev_attr_temp##offset##_max_hyst); \ } while (0) static ssize_t
@@ -567,9 +567,9 @@return sprintf (buf,"%ld\n" , (long )vid_from_reg (data->vid, data->vrm)); } -static DEVICE_ATTR(vid, S_IRUGO, show_vid_reg, NULL) +static DEVICE_ATTR(in0_ref, S_IRUGO, show_vid_reg, NULL)#define device_create_file_vid (client) \ -device_create_file(&client->dev, &dev_attr_vid) +device_create_file(&client->dev, &dev_attr_in0_ref)static ssize_t show_vrm_reg (struct device *dev,char *buf)
@@ -734,7 +734,7 @@ { \return store_fan_div_reg (dev, buf, count, offset); \ } \ -static DEVICE_ATTR(fan_div##offset, S_IRUGO | S_IWUSR, \ +static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \ show_regs_fan_div_##offset, store_regs_fan_div_##offset)sysfs_fan_div (1 )
@@ -743,7 +743,7 @@#define device_create_file_fan_div (client, offset) \ do { \ -device_create_file(&client->dev, &dev_attr_fan_div##offset); \ +device_create_file(&client->dev, &dev_attr_fan##offset##_div); \ } while (0) static ssize_t
@@ -794,7 +794,7 @@ { \return store_pwm_reg (dev, buf, count, offset); \ } \ -static DEVICE_ATTR(pwm##offset, S_IRUGO | S_IWUSR, \ +static DEVICE_ATTR(fan##offset##_pwm, S_IRUGO | S_IWUSR, \ show_regs_pwm_##offset, store_regs_pwm_##offset)sysfs_pwm (1 )
@@ -803,7 +803,7 @@#define device_create_file_pwm (client, offset) \ do { \ -device_create_file(&client->dev, &dev_attr_pwm##offset); \ +device_create_file(&client->dev, &dev_attr_fan##offset##_pwm); \ } while (0) static ssize_t
@@ -871,7 +871,7 @@ { \return store_sensor_reg (dev, buf, count, offset); \ } \ -static DEVICE_ATTR(sensor##offset, S_IRUGO | S_IWUSR, \ +static DEVICE_ATTR(temp##offset##_type, S_IRUGO | S_IWUSR, \ show_regs_sensor_##offset, store_regs_sensor_##offset)sysfs_sensor (1 )
@@ -880,7 +880,7 @@#define device_create_file_sensor (client, offset) \ do { \ -device_create_file(&client->dev, &dev_attr_sensor##offset); \ +device_create_file(&client->dev, &dev_attr_temp##offset##_type); \ } while (0)
@@ -1319,20 +1319,20 @@ data->temp =w83627hf_read_value (client,W83781D_REG_TEMP (1 )); data->temp_max =w83627hf_read_value (client,W83781D_REG_TEMP_OVER (1 )); - data->temp_hyst = + data->temp_max_hyst =w83627hf_read_value (client,W83781D_REG_TEMP_HYST (1 )); data->temp_add[0 ] =w83627hf_read_value (client,W83781D_REG_TEMP (2 )); data->temp_max_add[0 ] =w83627hf_read_value (client,W83781D_REG_TEMP_OVER (2 )); - data->temp_hyst_add[0 ] = + data->temp_max_hyst_add[0 ] =w83627hf_read_value (client,W83781D_REG_TEMP_HYST (2 ));if (data->type != w83697hf) { data->temp_add[1 ] =w83627hf_read_value (client,W83781D_REG_TEMP (3 )); data->temp_max_add[1 ] =w83627hf_read_value (client,W83781D_REG_TEMP_OVER (3 )); - data->temp_hyst_add[1 ] = + data->temp_max_hyst_add[1 ] =w83627hf_read_value (client,W83781D_REG_TEMP_HYST (3 )); }
ChangeSet 1.1608.74.5, 2004/03/09 14:59:37-08:00, [email protected]
[PATCH] I2C: fix i2c-prosavage.c section usage
prosavage_remove() is called during init, so it shouldn't be marked as exit code. (It matters when CONFIG_HOTPLUG=n.)
drivers/i2c/busses/i2c-prosavage.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-prosavage.c +2 -2
@@ -216,7 +216,7 @@/* * Cleanup stuff */ -static void __devexit prosavage_remove(struct pci_dev *dev) +static void prosavage_remove (struct pci_dev *dev) {struct s_i2c_chip *chip;int i, ret;
@@ -321,7 +321,7 @@ .name = "prosavage-smbus", .id_table = prosavage_pci_tbl, .probe = prosavage_probe, - .remove = __devexit_p(prosavage_remove), + .remove = prosavage_remove, };static int __init i2c_prosavage_init (void )
ChangeSet 1.1608.74.6, 2004/03/09 15:29:26-08:00, [email protected]
[PATCH] I2C: fix i2c adapters class for now
Please accept this temporary fix for the class issue. I'd like users of the i2c-ali1535, i2c-sis5595 and i2c-via driver to be able to use sensors as soon as possible, even if we have not yet determined what our policy WRT classes should be.
Thanks.
BTW, don't you think I2C_ADAP_CLASS_SMBUS is a misnomer? It's about hardware monitoring, not the SMBus protocol. I'd say I2C_ADAP_CLASS_HWMON or I2C_ADAP_CLASS_SENSORS would have been more appropriate (although it may be a bit late for a change...)
drivers/i2c/busses/i2c-ali1535.c | 1 + drivers/i2c/busses/i2c-sis5595.c | 1 + drivers/i2c/busses/i2c-via.c | 1 + 3 files changed, 3 insertions(+)
drivers/i2c/busses/i2c-ali1535.c +1 -0
@@ -484,6 +484,7 @@static struct i2c_adapter ali1535_adapter = { .owner =THIS_MODULE , + .class =I2C_ADAP_CLASS_SMBUS , .algo = &smbus_algorithm, .name ="unset" , };
drivers/i2c/busses/i2c-sis5595.c +1 -0
@@ -364,6 +364,7 @@static struct i2c_adapter sis5595_adapter = { .owner =THIS_MODULE , + .class =I2C_ADAP_CLASS_SMBUS , .name ="unset" , .algo = &smbus_algorithm, };
drivers/i2c/busses/i2c-via.c +1 -0
@@ -92,6 +92,7 @@static struct i2c_adapter vt586b_adapter = { .owner =THIS_MODULE , + .class =I2C_ADAP_CLASS_SMBUS , .name ="VIA i2c" , .algo_data = &bit_data, };
ChangeSet 1.1608.74.7, 2004/03/09 15:29:46-08:00, [email protected]
[PATCH] I2c: Kconfig for non-sensors i2c chip drivers
Quoting myself:
Quoted 3 lines
I think that it would make sense to have a specific menu entry for these, separate from the sensors stuff. Looks like an easy thing to do.
Here is a proposed patch that does this. Comments welcome.
drivers/i2c/chips/Kconfig | 31 ++++++++++++++++++------------- 1 files changed, 18 insertions(+), 13 deletions(-)
drivers/i2c/chips/Kconfig +18 -13
@@ -2,7 +2,7 @@ # I2C Sensor device configuration # -menu "I2C Hardware Sensors Chip support" +menu "Hardware Sensors Chip support" depends on I2C config I2C_SENSOR
@@ -33,18 +33,6 @@ This driver can also be built as a module. If so, the module will be called asb100. -config SENSORS_EEPROM - tristate "EEPROM (DIMM) reader" - depends on I2C && EXPERIMENTAL - select I2C_SENSOR - help - If you say yes here you get read-only access to the EEPROM data - available on modern memory DIMMs, and which could theoretically - also be available on other devices. - - This driver can also be built as a module. If so, the module - will be called eeprom. - config SENSORS_FSCHER tristate "FSC Hermes" depends on I2C && EXPERIMENTAL
@@ -192,5 +180,22 @@ This driver can also be built as a module. If so, the module will be called w83627hf. + +endmenu + +menu "Other I2C Chip support" + depends on I2C + +config SENSORS_EEPROM + tristate "EEPROM reader" + depends on I2C && EXPERIMENTAL + select I2C_SENSOR + help + If you say yes here you get read-only access to the EEPROM data + available on modern memory DIMMs and Sony Vaio laptops. Such + EEPROMs could theoretically be available on other devices as well. + + This driver can also be built as a module. If so, the module + will be called eeprom. endmenu
ChangeSet 1.1608.74.8, 2004/03/10 14:34:17-08:00, [email protected]
[PATCH] I2C: Cleanup fan_div in w83781d
Here is a proposed patch that cleanups the fan_div code from w83781d. The original code was obviously taken from the 2.4 driver, but the way things were done in 2.4 do not make any sense anymore (because we now have a single value per interface file).
Since fan divisor bits are spread over three different regs with various bitmask manipulations, I don't think it makes much sense to have a single function as we do in most other cases. Having three different functions makes more sense, although they are of course similar. The size increment is only 581 bytes, I don't think its a problem since it also makes the code much more efficient and readable too IMHO.
I agree that the original code was working - it was simply doing far too much work each time one would want to change a fan divisor.
Originally, I took a look at the code because I wanted to fix the fact that changing fan divisors breaks fan mins. But it looked like a good cleanup before doing that was required. Once this patch will have been accepted, I'll work on the other one.
I've tested my patch successfully on a W83781D and an AS99127F rev.1. Note that this means that one part of the code wasn't tested, because these are the two chips of the family that do not support divisors greater than 8. If anyone can test it, please do.
drivers/i2c/chips/w83781d.c | 91 +++++++++++++++++++++++++++----------------- 1 files changed, 56 insertions(+), 35 deletions(-)
drivers/i2c/chips/w83781d.c +56 -35
@@ -639,7 +639,6 @@device_create_file (&client->dev, &dev_attr_beep_mask); \ }while (0 ) -/* w83697hf only has two fans */ static ssize_tshow_fan_div_reg (struct device *dev,char *buf,int nr) {
@@ -652,47 +651,73 @@ (long) DIV_FROM_REG(data->fan_div[nr - 1])); } -/* w83697hf only has two fans */ static ssize_t -store_fan_div_reg (struct device *dev,const char *buf,size_t count,int nr) +store_regs_fan_div_1 (struct device *dev,const char *buf,size_t count) {struct i2c_client *client =to_i2c_client (dev);struct w83781d_data *data =i2c_get_clientdata (client); -u32 val, old, old2, old3 =0 ; +u32 reg; - val =simple_strtoul (buf,NULL ,10 ); - old =w83781d_read_value (client,W83781D_REG_VID_FANDIV ); + data->fan_div[0 ] =DIV_TO_REG (simple_strtoul (buf,NULL ,10 ), + data->type); - data->fan_div[nr -1 ] =DIV_TO_REG (val, data->type); + reg =w83781d_read_value (client,W83781D_REG_VID_FANDIV ) &0xcf ; + reg |= (data->fan_div[0 ] &0x03 ) <<4 ; +w83781d_write_value (client,W83781D_REG_VID_FANDIV , reg);/* w83781d and as99127f don't have extended divisor bits */ -if ((data->type != w83781d) && data->type != as99127f) { - old3 =w83781d_read_value (client,W83781D_REG_VBAT ); +if (data->type != w83781d && data->type != as99127f) { + reg =w83781d_read_value (client,W83781D_REG_VBAT ) &0xdf ; + reg |= (data->fan_div[0 ] &0x04 ) <<3 ; +w83781d_write_value (client,W83781D_REG_VBAT , reg); } -if (nr >=3 && data->type != w83697hf) { - old2 =w83781d_read_value (client,W83781D_REG_PIN ); - old2 = (old2 &0x3f ) | ((data->fan_div[2 ] &0x03 ) <<6 ); -w83781d_write_value (client,W83781D_REG_PIN , old2); - -if ((data->type != w83781d) && (data->type != as99127f)) { - old3 = (old3 &0x7f ) | ((data->fan_div[2 ] &0x04 ) <<5 ); - } - } -if (nr >=2 ) { - old = (old &0x3f ) | ((data->fan_div[1 ] &0x03 ) <<6 ); -if ((data->type != w83781d) && (data->type != as99127f)) { - old3 = (old3 &0xbf ) | ((data->fan_div[1 ] &0x04 ) <<4 ); - } +return count; +} + +static ssize_t +store_regs_fan_div_2 (struct device *dev,const char *buf,size_t count) +{ +struct i2c_client *client =to_i2c_client (dev); +struct w83781d_data *data =i2c_get_clientdata (client); +u32 reg; + + data->fan_div[1 ] =DIV_TO_REG (simple_strtoul (buf,NULL ,10 ), + data->type); + + reg =w83781d_read_value (client,W83781D_REG_VID_FANDIV ) &0x3f ; + reg |= (data->fan_div[1 ] &0x03 ) <<6 ; +w83781d_write_value (client,W83781D_REG_VID_FANDIV , reg); + +/* w83781d and as99127f don't have extended divisor bits */ +if (data->type != w83781d && data->type != as99127f) { + reg =w83781d_read_value (client,W83781D_REG_VBAT ) &0xbf ; + reg |= (data->fan_div[1 ] &0x04 ) <<4 ; +w83781d_write_value (client,W83781D_REG_VBAT , reg); } -if (nr >=1 ) { - old = (old &0xcf ) | ((data->fan_div[0 ] &0x03 ) <<4 ); -w83781d_write_value (client,W83781D_REG_VID_FANDIV , old); - -if ((data->type != w83781d) && (data->type != as99127f)) { - old3 = (old3 &0xdf ) | ((data->fan_div[0 ] &0x04 ) <<3 ); -w83781d_write_value (client,W83781D_REG_VBAT , old3); - } + +return count; +} + +static ssize_t +store_regs_fan_div_3 (struct device *dev,const char *buf,size_t count) +{ +struct i2c_client *client =to_i2c_client (dev); +struct w83781d_data *data =i2c_get_clientdata (client); +u32 reg; + + data->fan_div[2 ] =DIV_TO_REG (simple_strtoul (buf,NULL ,10 ), + data->type); + + reg =w83781d_read_value (client,W83781D_REG_PIN ) &0x3f ; + reg |= (data->fan_div[2 ] &0x03 ) <<6 ; +w83781d_write_value (client,W83781D_REG_PIN , reg); + +/* w83781d and as99127f don't have extended divisor bits */ +if (data->type != w83781d && data->type != as99127f) { + reg =w83781d_read_value (client,W83781D_REG_VBAT ) &0x7f ; + reg |= (data->fan_div[2 ] &0x04 ) <<5 ; +w83781d_write_value (client,W83781D_REG_VBAT , reg); }return count;
@@ -702,10 +727,6 @@ static ssize_t show_regs_fan_div_##offset (struct device *dev, char *buf) \ { \ return show_fan_div_reg(dev, buf, offset); \ -} \ -static ssize_t store_regs_fan_div_##offset (struct device *dev, const char *buf, size_t count) \ -{ \ - return store_fan_div_reg(dev, buf, count, offset); \ } \ static DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, show_regs_fan_div_##offset, store_regs_fan_div_##offset)
ChangeSet 1.1608.74.9, 2004/03/11 16:53:51-08:00, [email protected]
[PATCH] I2C: sensor chip driver refactoring
This patch is a refactoring of some common code among all sensors chip drivers (except asb100, which was written this way to begin with.) It saves a handful of lines and ~100-300 bytes per module. It compiles ok. I've only tested it against one of the drivers, but the changes are similar across the board and quite mechanical. Please apply.
drivers/i2c/chips/adm1021.c | 31 ++++++---------- drivers/i2c/chips/fscher.c | 11 +++-- drivers/i2c/chips/gl518sm.c | 15 +++---- drivers/i2c/chips/it87.c | 51 ++++++++------------------- drivers/i2c/chips/lm75.c | 11 +++-- drivers/i2c/chips/lm78.c | 51 ++++++++------------------- drivers/i2c/chips/lm80.c | 31 +++++----------- drivers/i2c/chips/lm83.c | 15 +++---- drivers/i2c/chips/lm85.c | 71 +++++++++---------------------------- drivers/i2c/chips/lm90.c | 19 ++++------ drivers/i2c/chips/via686a.c | 47 +++++++----------------- drivers/i2c/chips/w83627hf.c | 67 +++++++---------------------------- drivers/i2c/chips/w83781d.c | 79 +++++++++--------------------------------- drivers/i2c/chips/w83l785ts.c | 15 +++---- 14 files changed, 162 insertions(+), 352 deletions(-)
drivers/i2c/chips/adm1021.c +13 -18
@@ -139,7 +139,7 @@static int adm1021_read_value (struct i2c_client *client,u8 reg);static int adm1021_write_value (struct i2c_client *client,u8 reg,u16 value); -static void adm1021_update_client (struct i2c_client *client); +static struct adm1021_data *adm1021_update_device (struct device *dev);/* (amalysh) read only mode, otherwise any limit's writing confuse BIOS */ static int read_only =0 ;
@@ -161,15 +161,10 @@static int adm1021_id =0 ;#define show (value) \ -static ssize_t show_##value(struct device *dev, char *buf) \ -{ \ - struct i2c_client *client = to_i2c_client(dev); \ - struct adm1021_data *data = i2c_get_clientdata(client); \ - int temp; \ - \ - adm1021_update_client(client); \ - temp = TEMP_FROM_REG(data->value); \ - return sprintf(buf, "%d\n", temp); \ +static ssize_t show_##value(struct device *dev, char *buf) \ +{ \ + struct adm1021_data *data = adm1021_update_device(dev); \ + return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \ }show (temp_max);show (temp_hyst);
@@ -179,13 +174,10 @@show (remote_temp_input);#define show2 (value) \ -static ssize_t show_##value(struct device *dev, char *buf) \ -{ \ - struct i2c_client *client = to_i2c_client(dev); \ - struct adm1021_data *data = i2c_get_clientdata(client); \ - \ - adm1021_update_client(client); \ - return sprintf(buf, "%d\n", data->value); \ +static ssize_t show_##value(struct device *dev, char *buf) \ +{ \ + struct adm1021_data *data = adm1021_update_device(dev); \ + return sprintf(buf, "%d\n", data->value); \ }show2 (alarms);show2 (die_code);
@@ -393,8 +385,9 @@return 0 ; } -static void adm1021_update_client (struct i2c_client *client) +static struct adm1021_data *adm1021_update_device (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);struct adm1021_data *data =i2c_get_clientdata (client);down (&data->update_lock);
@@ -424,6 +417,8 @@ }up (&data->update_lock); + +return data; }static int __init sensors_adm1021_init (void )
drivers/i2c/chips/fscher.c +6 -5
@@ -113,7 +113,7 @@static int fscher_attach_adapter (struct i2c_adapter *adapter);static int fscher_detect (struct i2c_adapter *adapter,int address,int kind);static int fscher_detach_client (struct i2c_client *client); -static void fscher_update_client (struct i2c_client *client); +static struct fscher_data *fscher_update_device (struct device *dev);static void fscher_init_client (struct i2c_client *client);static int fscher_read_value (struct i2c_client *client,u8 reg);
@@ -170,9 +170,7 @@ static ssize_t show_##kind##offset##sub (struct device *, char *); \ static ssize_t show_##kind##offset##sub (struct device *dev, char *buf) \ { \ - struct i2c_client *client = to_i2c_client(dev); \ - struct fscher_data *data = i2c_get_clientdata(client); \ - fscher_update_client(client); \ + struct fscher_data *data = fscher_update_device(dev); \ return show_##kind##sub(data, buf, (offset)); \ }
@@ -420,8 +418,9 @@ data->revision =fscher_read_value (client,FSCHER_REG_REVISION ); } -static void fscher_update_client (struct i2c_client *client) +static struct fscher_data *fscher_update_device (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);struct fscher_data *data =i2c_get_clientdata (client);down (&data->update_lock);
@@ -466,6 +465,8 @@ }up (&data->update_lock); + +return data; }
drivers/i2c/chips/gl518sm.c +7 -8
@@ -151,7 +151,7 @@static int gl518_detach_client (struct i2c_client *client);static int gl518_read_value (struct i2c_client *client,u8 reg);static int gl518_write_value (struct i2c_client *client,u8 reg,u16 value); -static void gl518_update_client (struct i2c_client *client); +static struct gl518_data *gl518_update_device (struct device *dev);/* This is the driver that will be inserted */ static struct i2c_driver gl518_driver = {
@@ -176,18 +176,14 @@#define show (type, suffix, value) \ static ssize_t show_##suffix(struct device *dev, char *buf) \ { \ - struct i2c_client *client = to_i2c_client(dev); \ - struct gl518_data *data = i2c_get_clientdata(client); \ - gl518_update_client(client); \ + struct gl518_data *data = gl518_update_device(dev); \ return sprintf(buf, "%d\n", type##_FROM_REG(data->value)); \ }#define show_fan (suffix, value, index) \ static ssize_t show_##suffix(struct device *dev, char *buf) \ { \ - struct i2c_client *client = to_i2c_client(dev); \ - struct gl518_data *data = i2c_get_clientdata(client); \ - gl518_update_client(client); \ + struct gl518_data *data = gl518_update_device(dev); \ return sprintf(buf, "%d\n", FAN_FROM_REG(data->value[index], \ DIV_FROM_REG(data->fan_div[index]))); \ }
@@ -523,8 +519,9 @@return i2c_smbus_write_byte_data (client, reg, value); } -static void gl518_update_client (struct i2c_client *client) +static struct gl518_data *gl518_update_device (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);struct gl518_data *data =i2c_get_clientdata (client);int val;
@@ -590,6 +587,8 @@ }up (&data->update_lock); + +return data; }static int __init sensors_gl518sm_init (void )
drivers/i2c/chips/it87.c +16 -35
128 lines not on this page · raw message
drivers/i2c/chips/lm75.c +6 -5
@@ -64,7 +64,7 @@static int lm75_detach_client (struct i2c_client *client);static int lm75_read_value (struct i2c_client *client,u8 reg);static int lm75_write_value (struct i2c_client *client,u8 reg,u16 value); -static void lm75_update_client (struct i2c_client *client); +static struct lm75_data *lm75_update_device (struct device *dev);/* This is the driver that will be inserted */
@@ -82,9 +82,7 @@#define show (value) \ static ssize_t show_##value(struct device *dev, char *buf) \ { \ - struct i2c_client *client = to_i2c_client(dev); \ - struct lm75_data *data = i2c_get_clientdata(client); \ - lm75_update_client(client); \ + struct lm75_data *data = lm75_update_device(dev); \ return sprintf(buf, "%d\n", LM75_TEMP_FROM_REG(data->value)); \ }show (temp_max);
@@ -250,8 +248,9 @@lm75_write_value (client,LM75_REG_CONF ,0 ); } -static void lm75_update_client (struct i2c_client *client) +static struct lm75_data *lm75_update_device (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);struct lm75_data *data =i2c_get_clientdata (client);down (&data->update_lock);
@@ -268,6 +267,8 @@ }up (&data->update_lock); + +return data; }static int __init sensors_lm75_init (void )
drivers/i2c/chips/lm78.c +16 -35
133 lines not on this page · raw message
drivers/i2c/chips/lm80.c +11 -20
@@ -141,7 +141,7 @@static int lm80_detect (struct i2c_adapter *adapter,int address,int kind);static void lm80_init_client (struct i2c_client *client);static int lm80_detach_client (struct i2c_client *client); -static void lm80_update_client (struct i2c_client *client); +static struct lm80_data *lm80_update_device (struct device *dev);static int lm80_read_value (struct i2c_client *client,u8 reg);static int lm80_write_value (struct i2c_client *client,u8 reg,u8 value);
@@ -171,9 +171,7 @@#define show_in (suffix, value) \ static ssize_t show_in_##suffix(struct device *dev, char *buf) \ { \ - struct i2c_client *client = to_i2c_client(dev); \ - struct lm80_data *data = i2c_get_clientdata(client); \ - lm80_update_client(client); \ + struct lm80_data *data = lm80_update_device(dev); \ return sprintf(buf, "%d\n", IN_FROM_REG(data->value)); \ }show_in (min0, in_min[0 ]);
@@ -227,9 +225,7 @@#define show_fan (suffix, value, div) \ static ssize_t show_fan_##suffix(struct device *dev, char *buf) \ { \ - struct i2c_client *client = to_i2c_client(dev); \ - struct lm80_data *data = i2c_get_clientdata(client); \ - lm80_update_client(client); \ + struct lm80_data *data = lm80_update_device(dev); \ return sprintf(buf, "%d\n", FAN_FROM_REG(data->value, \ DIV_FROM_REG(data->div))); \ }
@@ -241,9 +237,7 @@#define show_fan_div (suffix, value) \ static ssize_t show_fan_div##suffix(struct device *dev, char *buf) \ { \ - struct i2c_client *client = to_i2c_client(dev); \ - struct lm80_data *data = i2c_get_clientdata(client); \ - lm80_update_client(client); \ + struct lm80_data *data = lm80_update_device(dev); \ return sprintf(buf, "%d\n", DIV_FROM_REG(data->value)); \ }show_fan_div (1 , fan_div[0 ]);
@@ -265,18 +259,14 @@static ssize_t show_temp_input1 (struct device *dev,char *buf) { -struct i2c_client *client =to_i2c_client (dev); -struct lm80_data *data =i2c_get_clientdata (client); -lm80_update_client (client); +struct lm80_data *data =lm80_update_device (dev);return sprintf (buf,"%ld\n" ,TEMP_FROM_REG (data->temp)); }#define show_temp (suffix, value) \ static ssize_t show_temp_##suffix(struct device *dev, char *buf) \ { \ - struct i2c_client *client = to_i2c_client(dev); \ - struct lm80_data *data = i2c_get_clientdata(client); \ - lm80_update_client(client); \ + struct lm80_data *data = lm80_update_device(dev); \ return sprintf(buf, "%d\n", TEMP_LIMIT_FROM_REG(data->value)); \ }show_temp (hot_max, temp_hot_max);
@@ -302,9 +292,7 @@static ssize_t show_alarms (struct device *dev,char *buf) { -struct i2c_client *client =to_i2c_client (dev); -struct lm80_data *data =i2c_get_clientdata (client); -lm80_update_client (client); +struct lm80_data *data =lm80_update_device (dev);return sprintf (buf,"%d\n" ,ALARMS_FROM_REG (data->alarms)); }
@@ -498,8 +486,9 @@lm80_write_value (client,LM80_REG_CONFIG ,0x01 ); } -static void lm80_update_client (struct i2c_client *client) +static struct lm80_data *lm80_update_device (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);struct lm80_data *data =i2c_get_clientdata (client);int i;
@@ -546,6 +535,8 @@ }up (&data->update_lock); + +return data; }static int __init sensors_lm80_init (void )
drivers/i2c/chips/lm83.c +7 -8
@@ -118,7 +118,7 @@static int lm83_attach_adapter (struct i2c_adapter *adapter);static int lm83_detect (struct i2c_adapter *adapter,int address,int kind);static int lm83_detach_client (struct i2c_client *client); -static void lm83_update_client (struct i2c_client *client); +static struct lm83_data *lm83_update_device (struct device *dev);/* * Driver data (common to all clients)
@@ -162,9 +162,7 @@#define show_temp (suffix, value) \ static ssize_t show_temp_##suffix(struct device *dev, char *buf) \ { \ - struct i2c_client *client = to_i2c_client(dev); \ - struct lm83_data *data = i2c_get_clientdata(client); \ - lm83_update_client(client); \ + struct lm83_data *data = lm83_update_device(dev); \ return sprintf(buf, "%d\n", TEMP_FROM_REG(data->value)); \ }show_temp (input1, temp_input[0 ]);
@@ -195,9 +193,7 @@static ssize_t show_alarms (struct device *dev,char *buf) { -struct i2c_client *client =to_i2c_client (dev); -struct lm83_data *data =i2c_get_clientdata (client); -lm83_update_client (client); +struct lm83_data *data =lm83_update_device (dev);return sprintf (buf,"%d\n" , data->alarms); }
@@ -353,8 +349,9 @@return 0 ; } -static void lm83_update_client (struct i2c_client *client) +static struct lm83_data *lm83_update_device (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);struct lm83_data *data =i2c_get_clientdata (client);down (&data->update_lock);
@@ -385,6 +382,8 @@ }up (&data->update_lock); + +return data; }static int __init sensors_lm83_init (void )
drivers/i2c/chips/lm85.c +18 -53
164 lines not on this page · raw message
drivers/i2c/chips/lm90.c +8 -11
@@ -126,7 +126,7 @@ int kind);static void lm90_init_client (struct i2c_client *client);static int lm90_detach_client (struct i2c_client *client); -static void lm90_update_client (struct i2c_client *client); +static struct lm90_data *lm90_update_device (struct device *dev);/* * Driver data (common to all clients)
@@ -171,9 +171,7 @@#define show_temp (value, converter) \ static ssize_t show_##value(struct device *dev, char *buf) \ { \ - struct i2c_client *client = to_i2c_client(dev); \ - struct lm90_data *data = i2c_get_clientdata(client); \ - lm90_update_client(client); \ + struct lm90_data *data = lm90_update_device(dev); \ return sprintf(buf, "%d\n", converter(data->value)); \ }show_temp (temp_input1,TEMP1_FROM_REG );
@@ -216,9 +214,7 @@#define show_temp_hyst (value, basereg) \ static ssize_t show_##value(struct device *dev, char *buf) \ { \ - struct i2c_client *client = to_i2c_client(dev); \ - struct lm90_data *data = i2c_get_clientdata(client); \ - lm90_update_client(client); \ + struct lm90_data *data = lm90_update_device(dev); \ return sprintf(buf, "%d\n", TEMP1_FROM_REG(data->basereg) \ - HYST_FROM_REG(data->temp_hyst)); \ }
@@ -239,9 +235,7 @@static ssize_t show_alarms (struct device *dev,char *buf) { -struct i2c_client *client =to_i2c_client (dev); -struct lm90_data *data =i2c_get_clientdata (client); -lm90_update_client (client); +struct lm90_data *data =lm90_update_device (dev);return sprintf (buf,"%d\n" , data->alarms); }
@@ -430,8 +424,9 @@return 0 ; } -static void lm90_update_client (struct i2c_client *client) +static struct lm90_data *lm90_update_device (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);struct lm90_data *data =i2c_get_clientdata (client);down (&data->update_lock);
@@ -505,6 +500,8 @@ }up (&data->update_lock); + +return data; }static int __init sensors_lm90_init (void )
drivers/i2c/chips/via686a.c +15 -32
112 lines not on this page · raw message
drivers/i2c/chips/w83627hf.c +15 -52
146 lines not on this page · raw message
drivers/i2c/chips/w83781d.c +17 -62
172 lines not on this page · raw message
drivers/i2c/chips/w83l785ts.c +7 -8
@@ -89,7 +89,7 @@ int kind);static int w83l785ts_detach_client (struct i2c_client *client);static u8 w83l785ts_read_value (struct i2c_client *client,u8 reg,u8 defval); -static void w83l785ts_update_client (struct i2c_client *client); +static struct w83l785ts_data *w83l785ts_update_device (struct device *dev);/* * Driver data (common to all clients)
@@ -130,17 +130,13 @@static ssize_t show_temp (struct device *dev,char *buf) { -struct i2c_client *client =to_i2c_client (dev); -struct w83l785ts_data *data =i2c_get_clientdata (client); -w83l785ts_update_client (client); +struct w83l785ts_data *data =w83l785ts_update_device (dev);return sprintf (buf,"%d\n" ,TEMP_FROM_REG (data->temp)); }static ssize_t show_temp_over (struct device *dev,char *buf) { -struct i2c_client *client =to_i2c_client (dev); -struct w83l785ts_data *data =i2c_get_clientdata (client); -w83l785ts_update_client (client); +struct w83l785ts_data *data =w83l785ts_update_device (dev);return sprintf (buf,"%d\n" ,TEMP_FROM_REG (data->temp_over)); }
@@ -304,8 +300,9 @@return defval; } -static void w83l785ts_update_client (struct i2c_client *client) +static struct w83l785ts_data *w83l785ts_update_device (struct device *dev) { +struct i2c_client *client =to_i2c_client (dev);struct w83l785ts_data *data =i2c_get_clientdata (client);down (&data->update_lock);
@@ -324,6 +321,8 @@ }up (&data->update_lock); + +return data; }static int __init sensors_w83l785ts_init (void )
ChangeSet 1.1608.74.10, 2004/03/15 10:27:26-08:00, [email protected]
[PATCH] I2C: fix up CONFIG_I2C_DEBUG_BUS logic to be simpler on the .c files.
drivers/i2c/busses/Makefile | 4 ++++ drivers/i2c/busses/i2c-ali1535.c | 4 ---- drivers/i2c/busses/i2c-ali15x3.c | 4 ---- drivers/i2c/busses/i2c-amd756.c | 4 ---- drivers/i2c/busses/i2c-amd8111.c | 4 ---- drivers/i2c/busses/i2c-elektor.c | 4 ---- drivers/i2c/busses/i2c-elv.c | 4 ---- drivers/i2c/busses/i2c-frodo.c | 4 ---- drivers/i2c/busses/i2c-i801.c | 4 ---- drivers/i2c/busses/i2c-i810.c | 4 ---- drivers/i2c/busses/i2c-ibm_iic.c | 4 ---- drivers/i2c/busses/i2c-iop3xx.c | 4 ---- drivers/i2c/busses/i2c-isa.c | 4 ---- drivers/i2c/busses/i2c-ite.c | 4 ---- drivers/i2c/busses/i2c-ixp42x.c | 4 ---- drivers/i2c/busses/i2c-keywest.c | 4 ---- drivers/i2c/busses/i2c-nforce2.c | 4 ---- drivers/i2c/busses/i2c-parport-light.c | 4 ---- drivers/i2c/busses/i2c-parport.c | 4 ---- drivers/i2c/busses/i2c-philips-par.c | 4 ---- drivers/i2c/busses/i2c-piix4.c | 4 ---- drivers/i2c/busses/i2c-prosavage.c | 4 ---- drivers/i2c/busses/i2c-rpx.c | 4 ---- drivers/i2c/busses/i2c-savage4.c | 4 ---- drivers/i2c/busses/i2c-sis5595.c | 4 ---- drivers/i2c/busses/i2c-sis630.c | 4 ---- drivers/i2c/busses/i2c-sis96x.c | 4 ---- drivers/i2c/busses/i2c-velleman.c | 4 ---- drivers/i2c/busses/i2c-via.c | 4 ---- drivers/i2c/busses/i2c-viapro.c | 4 ---- drivers/i2c/busses/i2c-voodoo3.c | 4 ---- drivers/i2c/busses/scx200_acb.c | 4 ---- drivers/i2c/busses/scx200_i2c.c | 4 ---- 33 files changed, 4 insertions(+), 128 deletions(-)
drivers/i2c/busses/Makefile +4 -0
@@ -34,3 +34,7 @@ obj-$(CONFIG_I2C_VOODOO3) += i2c-voodoo3.o obj-$(CONFIG_SCx200_ACB) += scx200_acb.o obj-$(CONFIG_SCx200_I2C) += scx200_i2c.o + +ifeq ($(CONFIG_I2C_DEBUG_BUS),y) +EXTRA_CFLAGS += -DDEBUG +endif
drivers/i2c/busses/i2c-ali1535.c +0 -4
@@ -54,10 +54,6 @@/* Note: we assume there can only be one ALI1535, with one SMBus interface */ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/pci.h> #include <linux/kernel.h>
drivers/i2c/busses/i2c-ali15x3.c +0 -4
@@ -61,10 +61,6 @@/* Note: we assume there can only be one ALI15X3, with one SMBus interface */ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/pci.h> #include <linux/kernel.h>
drivers/i2c/busses/i2c-amd756.c +0 -4
@@ -38,10 +38,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/pci.h> #include <linux/kernel.h>
drivers/i2c/busses/i2c-amd8111.c +0 -4
@@ -9,10 +9,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/pci.h> #include <linux/kernel.h>
drivers/i2c/busses/i2c-elektor.c +0 -4
@@ -26,10 +26,6 @@for Alpha Processor Inc. UP-2000(+) boards */ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/kernel.h> #include <linux/ioport.h> #include <linux/module.h>
drivers/i2c/busses/i2c-elv.c +0 -4
@@ -22,10 +22,6 @@Frodo Looijaard <[email protected]> */ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/kernel.h> #include <linux/module.h> #include <linux/delay.h>
drivers/i2c/busses/i2c-frodo.c +0 -4
@@ -13,10 +13,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h>
drivers/i2c/busses/i2c-i801.c +0 -4
@@ -39,10 +39,6 @@/* Note: we assume there can only be one I801, with one SMBus interface */ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/pci.h> #include <linux/kernel.h>
drivers/i2c/busses/i2c-i810.c +0 -4
@@ -35,10 +35,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
drivers/i2c/busses/i2c-ibm_iic.c +0 -4
@@ -29,10 +29,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/kernel.h> #include <linux/ioport.h>
drivers/i2c/busses/i2c-iop3xx.c +0 -4
@@ -32,10 +32,6 @@---------------------------------------------------------------------------*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/module.h>
drivers/i2c/busses/i2c-isa.c +0 -4
@@ -25,10 +25,6 @@of this. */ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/init.h> #include <linux/module.h> #include <linux/kernel.h>
drivers/i2c/busses/i2c-ite.c +0 -4
@@ -34,10 +34,6 @@Frodo Looijaard <[email protected]> */ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/kernel.h> #include <linux/ioport.h> #include <linux/module.h>
drivers/i2c/busses/i2c-ixp42x.c +0 -4
@@ -27,10 +27,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/kernel.h> #include <linux/init.h> #include <linux/device.h>
drivers/i2c/busses/i2c-keywest.c +0 -4
@@ -47,10 +47,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/config.h> #include <linux/kernel.h>
drivers/i2c/busses/i2c-nforce2.c +0 -4
@@ -33,10 +33,6 @@/* Note: we assume there can only be one nForce2, with two SMBus interfaces */ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/pci.h> #include <linux/kernel.h>
drivers/i2c/busses/i2c-parport-light.c +0 -4
@@ -25,10 +25,6 @@* ------------------------------------------------------------------------ */ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
drivers/i2c/busses/i2c-parport.c +0 -4
@@ -25,10 +25,6 @@* ------------------------------------------------------------------------ */ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
drivers/i2c/busses/i2c-philips-par.c +0 -4
@@ -22,10 +22,6 @@Frodo Looijaard <[email protected]> */ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
drivers/i2c/busses/i2c-piix4.c +0 -4
@@ -29,10 +29,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/moduleparam.h> #include <linux/config.h>
drivers/i2c/busses/i2c-prosavage.c +0 -4
@@ -55,10 +55,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/init.h> #include <linux/pci.h>
drivers/i2c/busses/i2c-rpx.c +0 -4
@@ -12,10 +12,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
drivers/i2c/busses/i2c-savage4.c +0 -4
@@ -30,10 +30,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
drivers/i2c/busses/i2c-sis5595.c +0 -4
@@ -56,10 +56,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h>
drivers/i2c/busses/i2c-sis630.c +0 -4
@@ -49,10 +49,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h>
drivers/i2c/busses/i2c-sis96x.c +0 -4
@@ -33,10 +33,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/pci.h> #include <linux/kernel.h>
drivers/i2c/busses/i2c-velleman.c +0 -4
@@ -19,10 +19,6 @@/* ------------------------------------------------------------------------- */ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/kernel.h> #include <linux/ioport.h> #include <linux/module.h>
drivers/i2c/busses/i2c-via.c +0 -4
@@ -22,10 +22,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/kernel.h> #include <linux/module.h> #include <linux/pci.h>
drivers/i2c/busses/i2c-viapro.c +0 -4
@@ -34,10 +34,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/pci.h> #include <linux/kernel.h>
drivers/i2c/busses/i2c-voodoo3.c +0 -4
@@ -28,10 +28,6 @@the BT869 and possibly other I2C devices. */ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>
drivers/i2c/busses/scx200_acb.c +0 -4
@@ -25,10 +25,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h>
drivers/i2c/busses/scx200_i2c.c +0 -4
@@ -22,10 +22,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_BUS -#define DEBUG 1 -#endif -#include <linux/config.h> #include <linux/module.h> #include <linux/errno.h>
ChangeSet 1.1608.74.11, 2004/03/15 10:27:53-08:00, [email protected]
[PATCH] I2C: fix up CONFIG_I2C_DEBUG_CORE logic to be simpler on the .c files.
drivers/i2c/Makefile | 4 ++++ drivers/i2c/i2c-core.c | 4 ---- drivers/i2c/i2c-dev.c | 4 ---- drivers/i2c/i2c-sensor.c | 4 ---- 4 files changed, 4 insertions(+), 12 deletions(-)
drivers/i2c/Makefile +4 -0
@@ -6,3 +6,7 @@ obj-$(CONFIG_I2C_CHARDEV) += i2c-dev.o obj-$(CONFIG_I2C_SENSOR) += i2c-sensor.o obj-y += busses/ chips/ algos/ + +ifeq ($(CONFIG_I2C_DEBUG_CORE),y) +EXTRA_CFLAGS += -DDEBUG +endif
drivers/i2c/i2c-core.c +0 -4
@@ -22,10 +22,6 @@SMBus 2.0 support by Mark Studebaker <[email protected]> */ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CORE -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/kernel.h> #include <linux/errno.h>
drivers/i2c/i2c-dev.c +0 -4
@@ -30,10 +30,6 @@<[email protected]> */ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CORE -#define DEBUG 1 -#endif -#include <linux/kernel.h> #include <linux/module.h> #include <linux/fs.h>
drivers/i2c/i2c-sensor.c +0 -4
@@ -20,10 +20,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CORE -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/kernel.h> #include <linux/slab.h>
ChangeSet 1.1608.74.12, 2004/03/15 10:28:32-08:00, [email protected]
[PATCH] I2C: add CONFIG_I2C_DEBUG_ALGO to be consistant.
drivers/i2c/Kconfig | 9 +++++++++ drivers/i2c/algos/Makefile | 4 ++++ drivers/i2c/algos/i2c-algo-bit.c | 2 -- drivers/i2c/algos/i2c-algo-pcf.c | 2 -- 4 files changed, 13 insertions(+), 4 deletions(-)
drivers/i2c/Kconfig +9 -0
@@ -46,6 +46,15 @@ messages to the system log. Select this if you are having a problem with I2C support and want to see more of what is going on. +config I2C_DEBUG_ALGO + bool "I2C Algorithm debugging messages" + depends on I2C + help + Say Y here if you want the I2C algorithm drivers to produce a bunch + of debug messages to the system log. Select this if you are having + a problem with I2C support and want to see more of what is going + on. + config I2C_DEBUG_BUS bool "I2C Bus debugging messages" depends on I2C
drivers/i2c/algos/Makefile +4 -0
@@ -5,3 +5,7 @@ obj-$(CONFIG_I2C_ALGOBIT) += i2c-algo-bit.o obj-$(CONFIG_I2C_ALGOPCF) += i2c-algo-pcf.o obj-$(CONFIG_I2C_ALGOITE) += i2c-algo-ite.o + +ifeq ($(CONFIG_I2C_DEBUG_ALGO),y) +EXTRA_CFLAGS += -DDEBUG +endif
drivers/i2c/algos/i2c-algo-bit.c +0 -2
@@ -21,8 +21,6 @@/* With some changes from Frodo Looijaard <[email protected]>, Kyösti Mälkki <[email protected]> and Jean Delvare <[email protected]> */ -/* #define DEBUG 1 */ -#include <linux/kernel.h> #include <linux/module.h> #include <linux/delay.h>
drivers/i2c/algos/i2c-algo-pcf.c +0 -2
@@ -27,8 +27,6 @@messages, proper stop/repstart signaling during receive, added detect code */ -/* #define DEBUG 1 */ /* to pick up dev_dbg calls */ -#include <linux/kernel.h> #include <linux/module.h> #include <linux/delay.h>
ChangeSet 1.1608.74.13, 2004/03/15 10:45:02-08:00, [email protected]
[PATCH] I2C: fix up CONFIG_I2C_DEBUG_CHIP logic to be simpler on the .c files.
drivers/i2c/chips/Makefile | 4 ++++ drivers/i2c/chips/adm1021.c | 4 ---- drivers/i2c/chips/asb100.c | 4 ---- drivers/i2c/chips/eeprom.c | 4 ---- drivers/i2c/chips/fscher.c | 4 ---- drivers/i2c/chips/gl518sm.c | 4 ---- drivers/i2c/chips/it87.c | 4 ---- drivers/i2c/chips/lm75.c | 4 ---- drivers/i2c/chips/lm78.c | 4 ---- drivers/i2c/chips/lm80.c | 4 ---- drivers/i2c/chips/lm83.c | 4 ---- drivers/i2c/chips/lm85.c | 4 ---- drivers/i2c/chips/lm90.c | 4 ---- drivers/i2c/chips/via686a.c | 4 ---- drivers/i2c/chips/w83781d.c | 4 ---- drivers/i2c/chips/w83l785ts.c | 4 ---- 16 files changed, 4 insertions(+), 60 deletions(-)
drivers/i2c/chips/Makefile +4 -0
@@ -20,3 +20,7 @@ obj-$(CONFIG_SENSORS_LM90) += lm90.o obj-$(CONFIG_SENSORS_VIA686A) += via686a.o obj-$(CONFIG_SENSORS_W83L785TS) += w83l785ts.o + +ifeq ($(CONFIG_I2C_DEBUG_CHIP),y) +EXTRA_CFLAGS += -DDEBUG +endif
drivers/i2c/chips/adm1021.c +0 -4
@@ -20,10 +20,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CHIP -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/init.h> #include <linux/slab.h>
drivers/i2c/chips/asb100.c +0 -4
@@ -37,10 +37,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CHIP -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/slab.h> #include <linux/ioport.h>
drivers/i2c/chips/eeprom.c +0 -4
@@ -27,10 +27,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CHIP -#define DEBUG 1 -#endif -#include <linux/kernel.h> #include <linux/init.h> #include <linux/module.h>
drivers/i2c/chips/fscher.c +0 -4
@@ -27,10 +27,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CHIP -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/init.h> #include <linux/slab.h>
drivers/i2c/chips/gl518sm.c +0 -4
@@ -37,10 +37,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CHIP -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/init.h> #include <linux/slab.h>
drivers/i2c/chips/it87.c +0 -4
@@ -32,10 +32,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CHIP -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/init.h> #include <linux/slab.h>
drivers/i2c/chips/lm75.c +0 -4
@@ -19,10 +19,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CHIP -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/init.h> #include <linux/slab.h>
drivers/i2c/chips/lm78.c +0 -4
@@ -19,10 +19,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CHIP -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/init.h> #include <linux/slab.h>
drivers/i2c/chips/lm80.c +0 -4
@@ -22,10 +22,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CHIP -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/init.h> #include <linux/slab.h>
drivers/i2c/chips/lm83.c +0 -4
@@ -28,10 +28,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CHIP -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/init.h> #include <linux/slab.h>
drivers/i2c/chips/lm85.c +0 -4
@@ -23,10 +23,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CHIP -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/init.h> #include <linux/slab.h>
drivers/i2c/chips/lm90.c +0 -4
@@ -36,10 +36,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CHIP -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/init.h> #include <linux/slab.h>
drivers/i2c/chips/via686a.c +0 -4
@@ -32,10 +32,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CHIP -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/slab.h> #include <linux/pci.h>
drivers/i2c/chips/w83781d.c +0 -4
@@ -36,10 +36,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CHIP -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/init.h> #include <linux/slab.h>
drivers/i2c/chips/w83l785ts.c +0 -4
@@ -31,10 +31,6 @@*/ #include <linux/config.h> -#ifdef CONFIG_I2C_DEBUG_CHIP -#define DEBUG 1 -#endif -#include <linux/module.h> #include <linux/init.h> #include <linux/slab.h>
ChangeSet 1.1608.74.14, 2004/03/15 13:08:29-08:00, [email protected]
[PATCH] I2C: fix forced i2c chip drivers have no name
I just noticed that I am doing something wrong in the i2c chip drivers I ported to Linux 2.6. If these drivers are forced to a specific chip type ("kind" as we call it internally), then the device doesn't have its name set (and defaults to an empty string).
Affected drivers: gl518sm, lm83, lm90, w83l785ts.
I could verify the problem on my ADM1032 chip (lm90 driver). I also verified that the proposed patch fixes the issue.
You may notice that I fix the problem differently for gl518sm and w83l785ts on the one hand, and lm83 and lm90 on the other hand. This is because the first two drivers are not expected to support more a single chip in the future, while lm90 already does and lm83 could someday (for example, support for the LM82 could be added on request).
drivers/i2c/chips/gl518sm.c | 5 +---- drivers/i2c/chips/lm83.c | 5 ++++- drivers/i2c/chips/lm90.c | 8 ++++++-- drivers/i2c/chips/w83l785ts.c | 4 +--- 4 files changed, 12 insertions(+), 10 deletions(-)
drivers/i2c/chips/gl518sm.c +1 -4
@@ -345,7 +345,6 @@struct i2c_client *new_client;struct gl518_data *data;int err =0 ; -const char *name ="" ;if (!i2c_check_functionality (adapter,I2C_FUNC_SMBUS_BYTE_DATA |I2C_FUNC_SMBUS_WORD_DATA ))
@@ -385,10 +384,8 @@ i =gl518_read_value (new_client,GL518_REG_REVISION );if (i ==0x00 ) { kind = gl518sm_r00; - name ="gl518sm" ; }else if (i ==0x80 ) { kind = gl518sm_r80; - name ="gl518sm" ; }else {if (kind <=0 ) dev_info(&adapter->dev,
@@ -400,7 +397,7 @@ }/* Fill in the remaining client fields */ -strlcpy (new_client->name, name,I2C_NAME_SIZE ); +strlcpy (new_client->name,"gl518sm" ,I2C_NAME_SIZE ); new_client->id = gl518_id++; data->type = kind; data->valid =0 ;
drivers/i2c/chips/lm83.c +4 -1
@@ -284,7 +284,6 @@if (man_id ==0x01 ) {/* National Semiconductor */ if (chip_id ==0x03 ) { kind = lm83; - name ="lm83" ; } }
@@ -294,6 +293,10 @@ "chip_id=0x%02X).\n", man_id, chip_id); goto exit_free; } + } + +if (kind == lm83) { + name ="lm83" ; }/* We can fill in the remaining client fields */
drivers/i2c/chips/lm90.c +6 -2
@@ -337,7 +337,6 @@ LM90_REG_R_CONFIG2) & 0xF8) == 0x00 && reg_convrate <= 0x09))) { kind = lm90; - name ="lm90" ; } }else if (man_id ==0x41 ) {/* Analog Devices */
@@ -345,7 +344,6 @@ && (kind == 0 /* skip detection */ || (reg_config1 & 0x3F) == 0x00)) { kind = adm1032; - name ="adm1032" ; } }
@@ -355,6 +353,12 @@ "chip_id=0x%02X).\n", man_id, chip_id); goto exit_free; } + } + +if (kind == lm90) { + name ="lm90" ; + }else if (kind == adm1032) { + name ="adm1032" ; }/* We can fill in the remaining client fields */
drivers/i2c/chips/w83l785ts.c +1 -3
@@ -159,7 +159,6 @@struct i2c_client *new_client;struct w83l785ts_data *data;int err =0 ; -const char *name ="" ;if (!i2c_check_functionality (adapter,I2C_FUNC_SMBUS_BYTE_DATA ))
@@ -220,7 +219,6 @@if (man_id ==0x5CA3 ) {/* Winbond */ if (chip_id ==0x70 ) {/* W83L785TS-S */ kind = w83l785ts; - name ="w83l785ts" ; } }
@@ -233,7 +231,7 @@ }/* We can fill in the remaining client fields. */ -strlcpy (new_client->name, name,I2C_NAME_SIZE ); +strlcpy (new_client->name,"w83l785ts" ,I2C_NAME_SIZE ); new_client->id = w83l785ts_id++; data->valid =0 ;init_MUTEX (&data->update_lock);
ChangeSet 1.1608.74.15, 2004/03/15 13:08:51-08:00, [email protected]
[PATCH] I2C: Don't handle kind errors that cannot happen
A number of chip drivers in 2.6.4-mm1 try to handle an error case that cannot happen when setting the chip name. The following patch changes that.
Affected drivers: adm1021, it87, lm75, lm78, lm85, w83627hf, w83781d.
Note that in any case, the worst that could happen (but then again, it cannot happen) is that the chip name would be set to an empty string, which doesn't hurt much.
The patch also cleans up a few things in it87, w83627hf and w83781d, which are tightly related to the rest of the changes and necessary for them to be safe.
it87: There is only really one "kind" in this driver, so I removed all references to other kinds.
w83627hf: The driver did not handle unknown chips.
w83781d: The user shouldn't be allowed to force a kind that doesn't match the chip's bus type (I2C or ISA). The code was not meant to handle that case, although no check was done so far.
Tested on my AS99127F, works as intended.
drivers/i2c/chips/adm1021.c | 4 ---- drivers/i2c/chips/it87.c | 16 ++-------------- drivers/i2c/chips/lm75.c | 6 +----- drivers/i2c/chips/lm78.c | 5 ----- drivers/i2c/chips/lm85.c | 4 ---- drivers/i2c/chips/w83627hf.c | 10 +++++----- drivers/i2c/chips/w83781d.c | 26 ++++++++++++++++++-------- 7 files changed, 26 insertions(+), 45 deletions(-)
drivers/i2c/chips/adm1021.c +0 -4
@@ -297,10 +297,6 @@ type_name ="gl523sm" ; }else if (kind == mc1066) { type_name ="mc1066" ; - }else { -dev_err (&adapter->dev,"Internal error: unknown kind (%d)?!?" , - kind); - goto error1; }/* Fill in the remaining client fields and put it into the global list */
drivers/i2c/chips/it87.c +2 -14
@@ -47,7 +47,7 @@static unsigned int normal_isa_range[] = {I2C_CLIENT_ISA_END };/* Insmod parameters */ -SENSORS_INSMOD_4 (it87, it8705, it8712, sis950); +SENSORS_INSMOD_1 (it87);/* Update battery voltage after every reading if true */
@@ -600,12 +600,6 @@if (kind == it87) { name ="it87" ; - }/* else if (kind == it8712) { -name = "it8712"; -} */ else { -dev_dbg (&adapter->dev,"Internal error: unknown kind (%d)?!?" , - kind); - goto ERROR1; }/* Fill in the remaining client fields and put it into the global list */
@@ -833,13 +827,7 @@ }/* The 8705 does not have VID capability */ -/*if (data->type == it8712) { -data->vid = it87_read_value(client, IT87_REG_VID); -data->vid &= 0x1f; -} -else */ { - data->vid =0x1f ; - } + data->vid =0x1f ; i =it87_read_value (client,IT87_REG_FAN_DIV ); data->fan_div[0 ] = i &0x07 ;
drivers/i2c/chips/lm75.c +1 -5
@@ -116,7 +116,7 @@struct i2c_client *new_client;struct lm75_data *data;int err =0 ; -const char *name; +const char *name ="" ;/* Make sure we aren't probing the ISA bus!! This is just a safety check at this moment; i2c_detect really won't call us. */
@@ -170,10 +170,6 @@if (kind == lm75) { name ="lm75" ; - }else { -dev_dbg (&adapter->dev,"Internal error: unknown kind (%d)?!?" , - kind); - goto exit_free; }/* Fill in the remaining client fields and put it into the global list */
drivers/i2c/chips/lm78.c +0 -5
@@ -609,11 +609,6 @@ client_name ="lm78-j" ; }else if (kind == lm79) { client_name ="lm79" ; - }else { -dev_dbg (&adapter->dev,"Internal error: unknown kind (%d)?!?" , - kind); - err = -ENODEV ; - goto ERROR2; }/* Fill in the remaining client fields and put into the global list */
drivers/i2c/chips/lm85.c +0 -4
@@ -815,10 +815,6 @@ type_name ="adm1027" ; }else if ( kind == adt7463 ) { type_name ="adt7463" ; - }else { -dev_dbg (&adapter->dev,"Internal error, invalid kind (%d)!" , kind); - err = -EFAULT ; - goto ERROR1; }strlcpy (new_client->name, type_name,I2C_NAME_SIZE );
drivers/i2c/chips/w83627hf.c +5 -5
@@ -923,6 +923,11 @@ kind = w83627thf; else if(val == W637_DEVID) kind = w83637hf; + else { +dev_info (&adapter->dev, +"Unsupported chip (dev_id=0x%02X).\n" , val); + goto ERROR1; + }superio_select (W83627HF_LD_HWM );if ((val =0x01 &superio_inb (WINB_ACT_REG )) ==0 )
@@ -960,11 +965,6 @@ client_name ="w83697hf" ; }else if (kind == w83637hf) { client_name ="w83637hf" ; - }else { -dev_err (&new_client->dev,"Internal error: unknown " -"kind (%d)?!?" , kind); - err = -ENODEV ; - goto ERROR2; }/* Fill in the remaining client fields and put into the global list */
drivers/i2c/chips/w83781d.c +18 -8
@@ -966,7 +966,7 @@ {int i, val1 =0 , id;int err; -const char *client_name; +const char *client_name ="" ;struct w83781d_data *data =i2c_get_clientdata (new_client); data->lm75[0 ] =kmalloc (sizeof (struct i2c_client ),GFP_KERNEL );
@@ -1032,8 +1032,6 @@ client_name ="w83627hf subclient" ; else if (kind == as99127f) client_name ="as99127f subclient" ; - else - client_name ="unknown subclient?" ;for (i =0 ; i <=1 ; i++) {/* store all data in w83781d */
@@ -1087,6 +1085,23 @@ goto ERROR0; } +/* Prevent users from forcing a kind for a bus it isn't supposed +to possibly be on */ +if (is_isa && (kind == as99127f || kind == w83783s)) { +dev_err (&adapter->dev, +"Cannot force I2C-only chip for ISA address 0x%02x.\n" , + address); + err = -EINVAL ; + goto ERROR0; + } +if (!is_isa && kind == w83697hf) { +dev_err (&adapter->dev, +"Cannot force ISA-only chip for I2C address 0x%02x.\n" , + address); + err = -EINVAL ; + goto ERROR0; + } +if (is_isa)if (!request_region (address,W83781D_EXTENT ,"w83781d" )) { err = -EBUSY ;
@@ -1240,11 +1255,6 @@ client_name ="as99127f" ; }else if (kind == w83697hf) { client_name ="w83697hf" ; - }else { -dev_err (&new_client->dev,"Internal error: unknown " -"kind (%d)?!?" , kind); - err = -ENODEV ; - goto ERROR2; }/* Fill in the remaining client fields and put into the global list */
ChangeSet 1.1608.74.16, 2004/03/15 13:09:19-08:00, [email protected]
[PATCH] I2C: Setting w83781d fan_div preserves fan_min
This patch makes the w83781d driver preserve fan_min settings when the user changes fan_divs. This isn't done "by default" because the actual fan min value (in RPMs) depends on both the fan_min register and the fan_div register. Only two drivers handle it properly at the moment as far as I know (lm78 and asb100). Several other drivers would need to be fixed the same way, but well, once at a time ;)
Tested on my AS99127F rev.1.
Credits go to Philip Pokorny, since I think I remember he is the one who introduced the method in the lm78 driver in the first place.
This tends to increase the size of the three set_store_regs_fan_div functions, and I am considering refactoring them at some point. Later though.
drivers/i2c/chips/w83781d.c | 37 ++++++++++++++++++++++++++++++++++--- 1 files changed, 34 insertions(+), 3 deletions(-)
drivers/i2c/chips/w83781d.c +34 -3
@@ -615,12 +615,21 @@ (long) DIV_FROM_REG(data->fan_div[nr - 1])); } +/* Note: we save and restore the fan minimum here, because its value is +determined in part by the fan divisor. This follows the principle of +least suprise; the user doesn't expect the fan minimum to change just +because the divisor changed. */ static ssize_t store_regs_fan_div_1 (struct device *dev,const char *buf,size_t count) {struct i2c_client *client =to_i2c_client (dev);struct w83781d_data *data =i2c_get_clientdata (client); -u32 reg; +unsigned long min; +u8 reg; + +/* Save fan_min */ + min =FAN_FROM_REG (data->fan_min[0 ], +DIV_FROM_REG (data->fan_div[0 ])); data->fan_div[0 ] =DIV_TO_REG (simple_strtoul (buf,NULL ,10 ), data->type);
@@ -636,6 +645,10 @@w83781d_write_value (client,W83781D_REG_VBAT , reg); } +/* Restore fan_min */ + data->fan_min[0 ] =FAN_TO_REG (min,DIV_FROM_REG (data->fan_div[0 ])); +w83781d_write_value (client,W83781D_REG_FAN_MIN (1 ), data->fan_min[0 ]); +return count; }
@@ -644,7 +657,12 @@ {struct i2c_client *client =to_i2c_client (dev);struct w83781d_data *data =i2c_get_clientdata (client); -u32 reg; +unsigned long min; +u8 reg; + +/* Save fan_min */ + min =FAN_FROM_REG (data->fan_min[1 ], +DIV_FROM_REG (data->fan_div[1 ])); data->fan_div[1 ] =DIV_TO_REG (simple_strtoul (buf,NULL ,10 ), data->type);
@@ -660,6 +678,10 @@w83781d_write_value (client,W83781D_REG_VBAT , reg); } +/* Restore fan_min */ + data->fan_min[1 ] =FAN_TO_REG (min,DIV_FROM_REG (data->fan_div[1 ])); +w83781d_write_value (client,W83781D_REG_FAN_MIN (2 ), data->fan_min[1 ]); +return count; }
@@ -668,7 +690,12 @@ {struct i2c_client *client =to_i2c_client (dev);struct w83781d_data *data =i2c_get_clientdata (client); -u32 reg; +unsigned long min; +u8 reg; + +/* Save fan_min */ + min =FAN_FROM_REG (data->fan_min[2 ], +DIV_FROM_REG (data->fan_div[2 ])); data->fan_div[2 ] =DIV_TO_REG (simple_strtoul (buf,NULL ,10 ), data->type);
@@ -683,6 +710,10 @@ reg |= (data->fan_div[2 ] &0x04 ) <<5 ;w83781d_write_value (client,W83781D_REG_VBAT , reg); } + +/* Restore fan_min */ + data->fan_min[2 ] =FAN_TO_REG (min,DIV_FROM_REG (data->fan_div[2 ])); +w83781d_write_value (client,W83781D_REG_FAN_MIN (3 ), data->fan_min[2 ]);return count; }
ChangeSet 1.1608.74.17, 2004/03/15 13:09:45-08:00, [email protected]
[PATCH] I2C: New chip driver: ds1621
The following patch against kernel 2.6.4-mm1 adds the ds1621 driver (an I2C sensor). I have ported it from the 2.4 version.
It has been reviewed by Jean Delvare, partly on IRC, and it is "compliant" with Mark Hoffman's refactoring.
drivers/i2c/chips/Kconfig | 11 + drivers/i2c/chips/Makefile | 1 drivers/i2c/chips/ds1621.c | 345 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 357 insertions(+)
drivers/i2c/chips/Kconfig +11 -0
@@ -33,6 +33,17 @@ This driver can also be built as a module. If so, the module will be called asb100. +config SENSORS_DS1621 + tristate "Dallas Semiconductor DS1621 and DS1625" + depends on I2C && EXPERIMENTAL + select I2C_SENSOR + help + If you say yes here you get support for Dallas Semiconductor + DS1621 and DS1625 sensor chips. + + This driver can also be built as a module. If so, the module + will be called ds1621. + config SENSORS_FSCHER tristate "FSC Hermes" depends on I2C && EXPERIMENTAL
drivers/i2c/chips/Makefile +1 -0
@@ -8,6 +8,7 @@ obj-$(CONFIG_SENSORS_W83781D) += w83781d.o obj-$(CONFIG_SENSORS_ADM1021) += adm1021.o +obj-$(CONFIG_SENSORS_DS1621) += ds1621.o obj-$(CONFIG_SENSORS_EEPROM) += eeprom.o obj-$(CONFIG_SENSORS_FSCHER) += fscher.o obj-$(CONFIG_SENSORS_GL518SM) += gl518sm.o
drivers/i2c/chips/ds1621.c new file +345 -0
345 lines not on this page · raw message
ChangeSet 1.1646, 2004/03/15 14:13:28-08:00, [email protected]
[PATCH] I2C: delete the i2c-elv.c driver as it is obsoleted by the i2c-parport.c driver.
drivers/i2c/busses/i2c-elv.c | 168 ------------------------------------------- drivers/i2c/busses/Kconfig | 11 -- drivers/i2c/busses/Makefile | 1 3 files changed, 180 deletions(-)
drivers/i2c/busses/Kconfig +0 -11
@@ -58,17 +58,6 @@ This support is also available as a module. If so, the module will be called i2c-elektor. -config I2C_ELV - tristate "ELV adapter" - depends on I2C - select I2C_ALGOBIT - help - This supports parallel-port I2C adapters called ELV. Say Y if you - own such an adapter. - - This support is also available as a module. If so, the module - will be called i2c-elv. - config I2C_HYDRA tristate "CHRP Apple Hydra Mac I/O I2C interface" depends on I2C && PCI && PPC_CHRP && EXPERIMENTAL
drivers/i2c/busses/Makefile +0 -1
@@ -7,7 +7,6 @@ obj-$(CONFIG_I2C_AMD756) += i2c-amd756.o obj-$(CONFIG_I2C_AMD8111) += i2c-amd8111.o obj-$(CONFIG_I2C_ELEKTOR) += i2c-elektor.o -obj-$(CONFIG_I2C_ELV) += i2c-elv.o obj-$(CONFIG_I2C_HYDRA) += i2c-hydra.o obj-$(CONFIG_I2C_I801) += i2c-i801.o obj-$(CONFIG_I2C_I810) += i2c-i810.o
drivers/i2c/busses/i2c-elv.c deleted +0 -168
168 lines not on this page · raw message
ChangeSet 1.1647, 2004/03/15 14:14:17-08:00, [email protected]
[PATCH] I2C: delete the i2c_philips-par.c and i2c-veleman.c drivers
They are obsolted by the i2c-parport.c driver.
drivers/i2c/busses/i2c-philips-par.c | 242 ----------------------------------- drivers/i2c/busses/i2c-velleman.c | 154 ---------------------- drivers/i2c/busses/Kconfig | 21 --- drivers/i2c/busses/Makefile | 2 4 files changed, 419 deletions(-)
drivers/i2c/busses/Kconfig +0 -21
@@ -164,16 +164,6 @@ This driver can also be built as a module. If so, the module will be called i2c-nforce2. -config I2C_PHILIPSPAR - tristate "Philips style parallel port adapter" - depends on I2C && PARPORT - select I2C_ALGOBIT - help - This supports parallel-port I2C adapters made by Philips. - - This support is also available as a module. If so, the module - will be called i2c-philips-par. - config I2C_PARPORT tristate "Parallel port adapter" depends on I2C && PARPORT
@@ -342,17 +332,6 @@ This driver can also be built as a module. If so, the module will be called i2c-sis96x. - -config I2C_VELLEMAN - tristate "Velleman K8000 adapter" - depends on I2C - select I2C_ALGOBIT - help - This supports the Velleman K8000 parallel-port I2C adapter. Say Y - if you own such an adapter. - - This support is also available as a module. If so, the module - will be called i2c-velleman. config I2C_VIA tristate "VIA 82C586B"
drivers/i2c/busses/Makefile +0 -2
@@ -17,7 +17,6 @@ obj-$(CONFIG_I2C_IXP42X) += i2c-ixp42x.o obj-$(CONFIG_I2C_KEYWEST) += i2c-keywest.o obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o -obj-$(CONFIG_I2C_PHILIPSPAR) += i2c-philips-par.o obj-$(CONFIG_I2C_PARPORT) += i2c-parport.o obj-$(CONFIG_I2C_PARPORT_LIGHT) += i2c-parport-light.o obj-$(CONFIG_I2C_PIIX4) += i2c-piix4.o
@@ -27,7 +26,6 @@ obj-$(CONFIG_I2C_SIS5595) += i2c-sis5595.o obj-$(CONFIG_I2C_SIS630) += i2c-sis630.o obj-$(CONFIG_I2C_SIS96X) += i2c-sis96x.o -obj-$(CONFIG_I2C_VELLEMAN) += i2c-velleman.o obj-$(CONFIG_I2C_VIA) += i2c-via.o obj-$(CONFIG_I2C_VIAPRO) += i2c-viapro.o obj-$(CONFIG_I2C_VOODOO3) += i2c-voodoo3.o
drivers/i2c/busses/i2c-philips-par.c deleted +0 -242
242 lines not on this page · raw message
drivers/i2c/busses/i2c-velleman.c deleted +0 -154
154 lines not on this page · raw message