aboutsummaryrefslogtreecommitdiffstats
path: root/i2c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2006-02-06 17:04:02 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2006-02-06 17:04:02 -0800
commitecc5f0b9d25100402e260fe6126c4631aae38ebc (patch)
tree05b1497618e746bbaf1ab1ae20c08ef8950677cc /i2c
parent8b7b48204c70bfc07ab7def944fdc4ca8e4c39ab (diff)
downloadpatches-ecc5f0b9d25100402e260fe6126c4631aae38ebc.tar.gz
i2c patches added
Diffstat (limited to 'i2c')
-rw-r--r--i2c/hwmon-convert-semaphores-to-mutexes.patch44
-rw-r--r--i2c/hwmon-vid-pentium-m.patch51
-rw-r--r--i2c/hwmon-vt8231-temp-hyst.patch54
-rw-r--r--i2c/hwmon-w83627ehf-use-attr-arrays.patch324
-rw-r--r--i2c/hwmon-w83627hf-document-reset-param.patch30
-rw-r--r--i2c/hwmon-w83781d-document-alarm-bits.patch47
-rw-r--r--i2c/hwmon-w83781d-no-reset-by-default.patch79
-rw-r--r--i2c/hwmon-w83781d-real-time-alarms.patch90
-rw-r--r--i2c/i2c-core-optimize-mutex-use.patch53
-rw-r--r--i2c/i2c-drop-frodo.patch116
-rw-r--r--i2c/i2c-isp1301_omap-driver-cleanups.patch27
-rw-r--r--i2c/i2c-ite-name-init.patch30
12 files changed, 923 insertions, 22 deletions
diff --git a/i2c/hwmon-convert-semaphores-to-mutexes.patch b/i2c/hwmon-convert-semaphores-to-mutexes.patch
index a25e1b76af277..901ffade051df 100644
--- a/i2c/hwmon-convert-semaphores-to-mutexes.patch
+++ b/i2c/hwmon-convert-semaphores-to-mutexes.patch
@@ -4727,7 +4727,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
#include <asm/io.h>
#include "lm75.h"
-@@ -221,10 +222,10 @@ DIV_TO_REG(long val, enum chips type)
+@@ -226,10 +227,10 @@ DIV_TO_REG(long val, enum chips type)
struct w83781d_data {
struct i2c_client client;
struct class_device *class_dev;
@@ -4740,7 +4740,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
char valid; /* !=0 if following fields are valid */
unsigned long last_updated; /* In jiffies */
-@@ -306,11 +307,11 @@ static ssize_t store_in_##reg (struct de
+@@ -311,11 +312,11 @@ static ssize_t store_in_##reg (struct de
\
val = simple_strtoul(buf, NULL, 10) / 10; \
\
@@ -4754,7 +4754,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
return count; \
}
store_in_reg(MIN, min);
-@@ -376,13 +377,13 @@ store_fan_min(struct device *dev, const
+@@ -381,13 +382,13 @@ store_fan_min(struct device *dev, const
val = simple_strtoul(buf, NULL, 10);
@@ -4770,7 +4770,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
return count;
}
-@@ -441,7 +442,7 @@ static ssize_t store_temp_##reg (struct
+@@ -446,7 +447,7 @@ static ssize_t store_temp_##reg (struct
\
val = simple_strtol(buf, NULL, 10); \
\
@@ -4779,7 +4779,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
\
if (nr >= 2) { /* TEMP2 and TEMP3 */ \
data->temp_##reg##_add[nr-2] = LM75_TEMP_TO_REG(val); \
-@@ -453,7 +454,7 @@ static ssize_t store_temp_##reg (struct
+@@ -458,7 +459,7 @@ static ssize_t store_temp_##reg (struct
data->temp_##reg); \
} \
\
@@ -4788,7 +4788,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
return count; \
}
store_temp_reg(OVER, max);
-@@ -566,7 +567,7 @@ store_beep_reg(struct device *dev, const
+@@ -571,7 +572,7 @@ store_beep_reg(struct device *dev, const
val = simple_strtoul(buf, NULL, 10);
@@ -4797,7 +4797,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
if (update_mask == BEEP_MASK) { /* We are storing beep_mask */
data->beep_mask = BEEP_MASK_TO_REG(val, data->type);
-@@ -587,7 +588,7 @@ store_beep_reg(struct device *dev, const
+@@ -592,7 +593,7 @@ store_beep_reg(struct device *dev, const
w83781d_write_value(client, W83781D_REG_BEEP_INTS2,
val2 | data->beep_enable << 7);
@@ -4806,7 +4806,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
return count;
}
-@@ -632,7 +633,7 @@ store_fan_div_reg(struct device *dev, co
+@@ -637,7 +638,7 @@ store_fan_div_reg(struct device *dev, co
u8 reg;
unsigned long val = simple_strtoul(buf, NULL, 10);
@@ -4815,7 +4815,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/* Save fan_min */
min = FAN_FROM_REG(data->fan_min[nr],
-@@ -657,7 +658,7 @@ store_fan_div_reg(struct device *dev, co
+@@ -662,7 +663,7 @@ store_fan_div_reg(struct device *dev, co
data->fan_min[nr] = FAN_TO_REG(min, DIV_FROM_REG(data->fan_div[nr]));
w83781d_write_value(client, W83781D_REG_FAN_MIN(nr+1), data->fan_min[nr]);
@@ -4824,7 +4824,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
return count;
}
-@@ -704,10 +705,10 @@ store_pwm_reg(struct device *dev, const
+@@ -709,10 +710,10 @@ store_pwm_reg(struct device *dev, const
val = simple_strtoul(buf, NULL, 10);
@@ -4837,7 +4837,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
return count;
}
-@@ -720,7 +721,7 @@ store_pwmenable_reg(struct device *dev,
+@@ -725,7 +726,7 @@ store_pwmenable_reg(struct device *dev,
val = simple_strtoul(buf, NULL, 10);
@@ -4846,7 +4846,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
switch (val) {
case 0:
-@@ -737,11 +738,11 @@ store_pwmenable_reg(struct device *dev,
+@@ -742,11 +743,11 @@ store_pwmenable_reg(struct device *dev,
break;
default:
@@ -4860,7 +4860,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
return count;
}
-@@ -803,7 +804,7 @@ store_sensor_reg(struct device *dev, con
+@@ -808,7 +809,7 @@ store_sensor_reg(struct device *dev, con
val = simple_strtoul(buf, NULL, 10);
@@ -4869,7 +4869,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
switch (val) {
case 1: /* PII/Celeron diode */
-@@ -836,7 +837,7 @@ store_sensor_reg(struct device *dev, con
+@@ -841,7 +842,7 @@ store_sensor_reg(struct device *dev, con
break;
}
@@ -4878,7 +4878,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
return count;
}
-@@ -1068,7 +1069,7 @@ w83781d_detect(struct i2c_adapter *adapt
+@@ -1073,7 +1074,7 @@ w83781d_detect(struct i2c_adapter *adapt
new_client = &data->client;
i2c_set_clientdata(new_client, data);
new_client->addr = address;
@@ -4887,7 +4887,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
new_client->adapter = adapter;
new_client->driver = is_isa ? &w83781d_isa_driver : &w83781d_driver;
new_client->flags = 0;
-@@ -1173,7 +1174,7 @@ w83781d_detect(struct i2c_adapter *adapt
+@@ -1178,7 +1179,7 @@ w83781d_detect(struct i2c_adapter *adapt
data->type = kind;
data->valid = 0;
@@ -4896,7 +4896,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
/* Tell the I2C layer a new client has arrived */
if ((err = i2c_attach_client(new_client)))
-@@ -1320,7 +1321,7 @@ w83781d_read_value(struct i2c_client *cl
+@@ -1325,7 +1326,7 @@ w83781d_read_value(struct i2c_client *cl
int res, word_sized, bank;
struct i2c_client *cl;
@@ -4905,7 +4905,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
if (i2c_is_isa_client(client)) {
word_sized = (((reg & 0xff00) == 0x100)
|| ((reg & 0xff00) == 0x200))
-@@ -1378,7 +1379,7 @@ w83781d_read_value(struct i2c_client *cl
+@@ -1383,7 +1384,7 @@ w83781d_read_value(struct i2c_client *cl
if (bank > 2)
i2c_smbus_write_byte_data(client, W83781D_REG_BANK, 0);
}
@@ -4914,7 +4914,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
return res;
}
-@@ -1389,7 +1390,7 @@ w83781d_write_value(struct i2c_client *c
+@@ -1394,7 +1395,7 @@ w83781d_write_value(struct i2c_client *c
int word_sized, bank;
struct i2c_client *cl;
@@ -4923,7 +4923,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
if (i2c_is_isa_client(client)) {
word_sized = (((reg & 0xff00) == 0x100)
|| ((reg & 0xff00) == 0x200))
-@@ -1442,7 +1443,7 @@ w83781d_write_value(struct i2c_client *c
+@@ -1447,7 +1448,7 @@ w83781d_write_value(struct i2c_client *c
if (bank > 2)
i2c_smbus_write_byte_data(client, W83781D_REG_BANK, 0);
}
@@ -4932,7 +4932,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
return 0;
}
-@@ -1537,7 +1538,7 @@ static struct w83781d_data *w83781d_upda
+@@ -1533,7 +1534,7 @@ static struct w83781d_data *w83781d_upda
struct w83781d_data *data = i2c_get_clientdata(client);
int i;
@@ -4941,7 +4941,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
if (time_after(jiffies, data->last_updated + HZ + HZ / 2)
|| !data->valid) {
-@@ -1634,7 +1635,7 @@ static struct w83781d_data *w83781d_upda
+@@ -1641,7 +1642,7 @@ static struct w83781d_data *w83781d_upda
data->valid = 1;
}
diff --git a/i2c/hwmon-vid-pentium-m.patch b/i2c/hwmon-vid-pentium-m.patch
new file mode 100644
index 0000000000000..dd1ceece54b82
--- /dev/null
+++ b/i2c/hwmon-vid-pentium-m.patch
@@ -0,0 +1,51 @@
+From khali@linux-fr.org Sun Feb 5 14:20:20 2006
+Date: Sun, 5 Feb 2006 23:21:05 +0100
+From: Jean Delvare <khali@linux-fr.org>
+To: Greg KH <greg@kroah.com>
+Cc: Rudolf Marek <r.marek@sh.cvut.cz>
+Subject: [PATCH 04/11] hwmon: Support the Pentium M VID code
+Message-Id: <20060205232105.41cbfcac.khali@linux-fr.org>
+Content-Disposition: inline; filename=hwmon-vid-pentium-m.patch
+
+Add support for the Intel Pentium M series to the hwmon-vid driver.
+
+Signed-off-by: Jean Delvare <khali@linux-fr.org>
+Cc: Rudolf Marek <r.marek@sh.cvut.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/hwmon/hwmon-vid.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- gregkh-2.6.orig/drivers/hwmon/hwmon-vid.c
++++ gregkh-2.6/drivers/hwmon/hwmon-vid.c
+@@ -54,6 +54,10 @@
+ (IMVP-II). You can find more information in the datasheet of Max1718
+ http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2452
+
++ The 13 specification corresponds to the Intel Pentium M series. There
++ doesn't seem to be any named specification for these. The conversion
++ tables are detailed directly in the various Pentium M datasheets:
++ http://www.intel.com/design/intarch/pentiumm/docs_pentiumm.htm
+ */
+
+ /* vrm is the VRM/VRD document version multiplied by 10.
+@@ -100,6 +104,8 @@ int vid_from_reg(int val, u8 vrm)
+ case 17: /* Intel IMVP-II */
+ return(val & 0x10 ? 975 - (val & 0xF) * 25 :
+ 1750 - val * 50);
++ case 13:
++ return(1708 - (val & 0x3f) * 16);
+ default: /* report 0 for unknown */
+ printk(KERN_INFO "hwmon-vid: requested unknown VRM version\n");
+ return 0;
+@@ -129,8 +135,9 @@ struct vrm_model {
+ static struct vrm_model vrm_models[] = {
+ {X86_VENDOR_AMD, 0x6, ANY, ANY, 90}, /* Athlon Duron etc */
+ {X86_VENDOR_AMD, 0xF, ANY, ANY, 24}, /* Athlon 64, Opteron and above VRM 24 */
+- {X86_VENDOR_INTEL, 0x6, 0x9, ANY, 85}, /* 0.13um too */
++ {X86_VENDOR_INTEL, 0x6, 0x9, ANY, 13}, /* Pentium M (130 nm) */
+ {X86_VENDOR_INTEL, 0x6, 0xB, ANY, 85}, /* Tualatin */
++ {X86_VENDOR_INTEL, 0x6, 0xD, ANY, 13}, /* Pentium M (90 nm) */
+ {X86_VENDOR_INTEL, 0x6, ANY, ANY, 82}, /* any P6 */
+ {X86_VENDOR_INTEL, 0x7, ANY, ANY, 0}, /* Itanium */
+ {X86_VENDOR_INTEL, 0xF, 0x0, ANY, 90}, /* P4 */
diff --git a/i2c/hwmon-vt8231-temp-hyst.patch b/i2c/hwmon-vt8231-temp-hyst.patch
new file mode 100644
index 0000000000000..76c2f378951c5
--- /dev/null
+++ b/i2c/hwmon-vt8231-temp-hyst.patch
@@ -0,0 +1,54 @@
+From khali@linux-fr.org Sun Feb 5 14:10:35 2006
+Date: Sun, 5 Feb 2006 23:11:16 +0100
+From: Jean Delvare <khali@linux-fr.org>
+To: Greg KH <greg@kroah.com>
+Cc: Roger Lucas <roger@planbit.co.uk>
+Subject: [PATCH 01/11] vt8231: Fix sysfs temperature interface
+Message-Id: <20060205231116.77c054e0.khali@linux-fr.org>
+Content-Disposition: inline; filename=hwmon-vt8231-temp-hyst.patch
+
+The VT8231 low temperature limits are actually hysteresis temperatures
+to the high limits.
+
+Signed-off-by: Jean Delvare <khali@linux-fr.org>
+Cc: Roger Lucas <roger@planbit.co.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/hwmon/vt8231.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- gregkh-2.6.orig/drivers/hwmon/vt8231.c
++++ gregkh-2.6/drivers/hwmon/vt8231.c
+@@ -437,12 +437,12 @@ static SENSOR_DEVICE_ATTR(temp##offset##
+ show_temp, NULL, offset - 1); \
+ static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \
+ show_temp_max, set_temp_max, offset - 1); \
+-static SENSOR_DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \
++static SENSOR_DEVICE_ATTR(temp##offset##_max_hyst, S_IRUGO | S_IWUSR, \
+ show_temp_min, set_temp_min, offset - 1)
+
+ static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp0, NULL);
+ static DEVICE_ATTR(temp1_max, S_IRUGO | S_IWUSR, show_temp0_max, set_temp0_max);
+-static DEVICE_ATTR(temp1_min, S_IRUGO | S_IWUSR, show_temp0_min, set_temp0_min);
++static DEVICE_ATTR(temp1_max_hyst, S_IRUGO | S_IWUSR, show_temp0_min, set_temp0_min);
+
+ define_temperature_sysfs(2);
+ define_temperature_sysfs(3);
+@@ -451,7 +451,7 @@ define_temperature_sysfs(5);
+ define_temperature_sysfs(6);
+
+ #define CFG_INFO_TEMP(id) { &sensor_dev_attr_temp##id##_input.dev_attr, \
+- &sensor_dev_attr_temp##id##_min.dev_attr, \
++ &sensor_dev_attr_temp##id##_max_hyst.dev_attr, \
+ &sensor_dev_attr_temp##id##_max.dev_attr }
+ #define CFG_INFO_VOLT(id) { &sensor_dev_attr_in##id##_input.dev_attr, \
+ &sensor_dev_attr_in##id##_min.dev_attr, \
+@@ -464,7 +464,7 @@ struct str_device_attr_table {
+ };
+
+ static struct str_device_attr_table cfg_info_temp[] = {
+- { &dev_attr_temp1_input, &dev_attr_temp1_min, &dev_attr_temp1_max },
++ { &dev_attr_temp1_input, &dev_attr_temp1_max_hyst, &dev_attr_temp1_max },
+ CFG_INFO_TEMP(2),
+ CFG_INFO_TEMP(3),
+ CFG_INFO_TEMP(4),
diff --git a/i2c/hwmon-w83627ehf-use-attr-arrays.patch b/i2c/hwmon-w83627ehf-use-attr-arrays.patch
new file mode 100644
index 0000000000000..ff0d7a15b536a
--- /dev/null
+++ b/i2c/hwmon-w83627ehf-use-attr-arrays.patch
@@ -0,0 +1,324 @@
+From khali@linux-fr.org Sun Feb 5 14:23:33 2006
+Date: Sun, 5 Feb 2006 23:24:16 +0100
+From: Jean Delvare <khali@linux-fr.org>
+To: Greg KH <greg@kroah.com>
+Cc: Yuan Mu <ymu@winbond.com.tw>
+Subject: [PATCH 05/11] w83627ehf: Refactor the sysfs interface
+Message-Id: <20060205232416.77fe5912.khali@linux-fr.org>
+Content-Disposition: inline; filename=hwmon-w83627ehf-use-attr-arrays.patch
+
+From: Yuan Mu <ymu@winbond.com.tw>
+
+Use dynamic sysfs callbacks and array of attributes to reduce the
+w83627ehf driver size.
+
+Signed-off-by: Jean Delvare <khali@linux-fr.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/hwmon/w83627ehf.c | 208 +++++++++++++++++-----------------------------
+ 1 file changed, 81 insertions(+), 127 deletions(-)
+
+--- gregkh-2.6.orig/drivers/hwmon/w83627ehf.c
++++ gregkh-2.6/drivers/hwmon/w83627ehf.c
+@@ -42,6 +42,7 @@
+ #include <linux/i2c.h>
+ #include <linux/i2c-isa.h>
+ #include <linux/hwmon.h>
++#include <linux/hwmon-sysfs.h>
+ #include <linux/err.h>
+ #include <linux/mutex.h>
+ #include <asm/io.h>
+@@ -408,9 +409,12 @@ static struct w83627ehf_data *w83627ehf_
+
+ #define show_fan_reg(reg) \
+ static ssize_t \
+-show_##reg(struct device *dev, char *buf, int nr) \
++show_##reg(struct device *dev, struct device_attribute *attr, \
++ char *buf) \
+ { \
+ struct w83627ehf_data *data = w83627ehf_update_device(dev); \
++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); \
++ int nr = sensor_attr->index; \
+ return sprintf(buf, "%d\n", \
+ fan_from_reg(data->reg[nr], \
+ div_from_reg(data->fan_div[nr]))); \
+@@ -419,18 +423,23 @@ show_fan_reg(fan);
+ show_fan_reg(fan_min);
+
+ static ssize_t
+-show_fan_div(struct device *dev, char *buf, int nr)
++show_fan_div(struct device *dev, struct device_attribute *attr,
++ char *buf)
+ {
+ struct w83627ehf_data *data = w83627ehf_update_device(dev);
+- return sprintf(buf, "%u\n",
+- div_from_reg(data->fan_div[nr]));
++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
++ int nr = sensor_attr->index;
++ return sprintf(buf, "%u\n", div_from_reg(data->fan_div[nr]));
+ }
+
+ static ssize_t
+-store_fan_min(struct device *dev, const char *buf, size_t count, int nr)
++store_fan_min(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
+ {
+ struct i2c_client *client = to_i2c_client(dev);
+ struct w83627ehf_data *data = i2c_get_clientdata(client);
++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
++ int nr = sensor_attr->index;
+ unsigned int val = simple_strtoul(buf, NULL, 10);
+ unsigned int reg;
+ u8 new_div;
+@@ -488,58 +497,41 @@ store_fan_min(struct device *dev, const
+ return count;
+ }
+
+-#define sysfs_fan_offset(offset) \
+-static ssize_t \
+-show_reg_fan_##offset(struct device *dev, struct device_attribute *attr, \
+- char *buf) \
+-{ \
+- return show_fan(dev, buf, offset-1); \
+-} \
+-static DEVICE_ATTR(fan##offset##_input, S_IRUGO, \
+- show_reg_fan_##offset, NULL);
++static struct sensor_device_attribute sda_fan_input[] = {
++ SENSOR_ATTR(fan1_input, S_IRUGO, show_fan, NULL, 0),
++ SENSOR_ATTR(fan2_input, S_IRUGO, show_fan, NULL, 1),
++ SENSOR_ATTR(fan3_input, S_IRUGO, show_fan, NULL, 2),
++ SENSOR_ATTR(fan4_input, S_IRUGO, show_fan, NULL, 3),
++ SENSOR_ATTR(fan5_input, S_IRUGO, show_fan, NULL, 4),
++};
+
+-#define sysfs_fan_min_offset(offset) \
+-static ssize_t \
+-show_reg_fan##offset##_min(struct device *dev, struct device_attribute *attr, \
+- char *buf) \
+-{ \
+- return show_fan_min(dev, buf, offset-1); \
+-} \
+-static ssize_t \
+-store_reg_fan##offset##_min(struct device *dev, struct device_attribute *attr, \
+- const char *buf, size_t count) \
+-{ \
+- return store_fan_min(dev, buf, count, offset-1); \
+-} \
+-static DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
+- show_reg_fan##offset##_min, \
+- store_reg_fan##offset##_min);
++static struct sensor_device_attribute sda_fan_min[] = {
++ SENSOR_ATTR(fan1_min, S_IWUSR | S_IRUGO, show_fan_min,
++ store_fan_min, 0),
++ SENSOR_ATTR(fan2_min, S_IWUSR | S_IRUGO, show_fan_min,
++ store_fan_min, 1),
++ SENSOR_ATTR(fan3_min, S_IWUSR | S_IRUGO, show_fan_min,
++ store_fan_min, 2),
++ SENSOR_ATTR(fan4_min, S_IWUSR | S_IRUGO, show_fan_min,
++ store_fan_min, 3),
++ SENSOR_ATTR(fan5_min, S_IWUSR | S_IRUGO, show_fan_min,
++ store_fan_min, 4),
++};
+
+-#define sysfs_fan_div_offset(offset) \
+-static ssize_t \
+-show_reg_fan##offset##_div(struct device *dev, struct device_attribute *attr, \
+- char *buf) \
+-{ \
+- return show_fan_div(dev, buf, offset - 1); \
+-} \
+-static DEVICE_ATTR(fan##offset##_div, S_IRUGO, \
+- show_reg_fan##offset##_div, NULL);
+-
+-sysfs_fan_offset(1);
+-sysfs_fan_min_offset(1);
+-sysfs_fan_div_offset(1);
+-sysfs_fan_offset(2);
+-sysfs_fan_min_offset(2);
+-sysfs_fan_div_offset(2);
+-sysfs_fan_offset(3);
+-sysfs_fan_min_offset(3);
+-sysfs_fan_div_offset(3);
+-sysfs_fan_offset(4);
+-sysfs_fan_min_offset(4);
+-sysfs_fan_div_offset(4);
+-sysfs_fan_offset(5);
+-sysfs_fan_min_offset(5);
+-sysfs_fan_div_offset(5);
++static struct sensor_device_attribute sda_fan_div[] = {
++ SENSOR_ATTR(fan1_div, S_IRUGO, show_fan_div, NULL, 0),
++ SENSOR_ATTR(fan2_div, S_IRUGO, show_fan_div, NULL, 1),
++ SENSOR_ATTR(fan3_div, S_IRUGO, show_fan_div, NULL, 2),
++ SENSOR_ATTR(fan4_div, S_IRUGO, show_fan_div, NULL, 3),
++ SENSOR_ATTR(fan5_div, S_IRUGO, show_fan_div, NULL, 4),
++};
++
++static void device_create_file_fan(struct device *dev, int i)
++{
++ device_create_file(dev, &sda_fan_input[i].dev_attr);
++ device_create_file(dev, &sda_fan_div[i].dev_attr);
++ device_create_file(dev, &sda_fan_min[i].dev_attr);
++}
+
+ #define show_temp1_reg(reg) \
+ static ssize_t \
+@@ -572,17 +564,14 @@ store_temp1_##reg(struct device *dev, st
+ store_temp1_reg(OVER, max);
+ store_temp1_reg(HYST, max_hyst);
+
+-static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp1, NULL);
+-static DEVICE_ATTR(temp1_max, S_IRUGO| S_IWUSR,
+- show_temp1_max, store_temp1_max);
+-static DEVICE_ATTR(temp1_max_hyst, S_IRUGO| S_IWUSR,
+- show_temp1_max_hyst, store_temp1_max_hyst);
+-
+ #define show_temp_reg(reg) \
+ static ssize_t \
+-show_##reg (struct device *dev, char *buf, int nr) \
++show_##reg(struct device *dev, struct device_attribute *attr, \
++ char *buf) \
+ { \
+ struct w83627ehf_data *data = w83627ehf_update_device(dev); \
++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); \
++ int nr = sensor_attr->index; \
+ return sprintf(buf, "%d\n", \
+ LM75_TEMP_FROM_REG(data->reg[nr])); \
+ }
+@@ -592,10 +581,13 @@ show_temp_reg(temp_max_hyst);
+
+ #define store_temp_reg(REG, reg) \
+ static ssize_t \
+-store_##reg (struct device *dev, const char *buf, size_t count, int nr) \
++store_##reg(struct device *dev, struct device_attribute *attr, \
++ const char *buf, size_t count) \
+ { \
+ struct i2c_client *client = to_i2c_client(dev); \
+ struct w83627ehf_data *data = i2c_get_clientdata(client); \
++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); \
++ int nr = sensor_attr->index; \
+ u32 val = simple_strtoul(buf, NULL, 10); \
+ \
+ mutex_lock(&data->update_lock); \
+@@ -608,39 +600,23 @@ store_##reg (struct device *dev, const c
+ store_temp_reg(OVER, temp_max);
+ store_temp_reg(HYST, temp_max_hyst);
+
+-#define sysfs_temp_offset(offset) \
+-static ssize_t \
+-show_reg_temp##offset (struct device *dev, struct device_attribute *attr, \
+- char *buf) \
+-{ \
+- return show_temp(dev, buf, offset - 2); \
+-} \
+-static DEVICE_ATTR(temp##offset##_input, S_IRUGO, \
+- show_reg_temp##offset, NULL);
+-
+-#define sysfs_temp_reg_offset(reg, offset) \
+-static ssize_t \
+-show_reg_temp##offset##_##reg(struct device *dev, struct device_attribute *attr, \
+- char *buf) \
+-{ \
+- return show_temp_##reg(dev, buf, offset - 2); \
+-} \
+-static ssize_t \
+-store_reg_temp##offset##_##reg(struct device *dev, struct device_attribute *attr, \
+- const char *buf, size_t count) \
+-{ \
+- return store_temp_##reg(dev, buf, count, offset - 2); \
+-} \
+-static DEVICE_ATTR(temp##offset##_##reg, S_IRUGO| S_IWUSR, \
+- show_reg_temp##offset##_##reg, \
+- store_reg_temp##offset##_##reg);
+-
+-sysfs_temp_offset(2);
+-sysfs_temp_reg_offset(max, 2);
+-sysfs_temp_reg_offset(max_hyst, 2);
+-sysfs_temp_offset(3);
+-sysfs_temp_reg_offset(max, 3);
+-sysfs_temp_reg_offset(max_hyst, 3);
++static struct sensor_device_attribute sda_temp[] = {
++ SENSOR_ATTR(temp1_input, S_IRUGO, show_temp1, NULL, 0),
++ SENSOR_ATTR(temp2_input, S_IRUGO, show_temp, NULL, 0),
++ SENSOR_ATTR(temp3_input, S_IRUGO, show_temp, NULL, 1),
++ SENSOR_ATTR(temp1_max, S_IRUGO | S_IWUSR, show_temp1_max,
++ store_temp1_max, 0),
++ SENSOR_ATTR(temp2_max, S_IRUGO | S_IWUSR, show_temp_max,
++ store_temp_max, 0),
++ SENSOR_ATTR(temp3_max, S_IRUGO | S_IWUSR, show_temp_max,
++ store_temp_max, 1),
++ SENSOR_ATTR(temp1_max_hyst, S_IRUGO | S_IWUSR, show_temp1_max_hyst,
++ store_temp1_max_hyst, 0),
++ SENSOR_ATTR(temp2_max_hyst, S_IRUGO | S_IWUSR, show_temp_max_hyst,
++ store_temp_max_hyst, 0),
++ SENSOR_ATTR(temp3_max_hyst, S_IRUGO | S_IWUSR, show_temp_max_hyst,
++ store_temp_max_hyst, 1),
++};
+
+ /*
+ * Driver and client management
+@@ -674,6 +650,7 @@ static int w83627ehf_detect(struct i2c_a
+ {
+ struct i2c_client *client;
+ struct w83627ehf_data *data;
++ struct device *dev;
+ int i, err = 0;
+
+ if (!request_region(address + REGION_OFFSET, REGION_LENGTH,
+@@ -694,6 +671,7 @@ static int w83627ehf_detect(struct i2c_a
+ client->adapter = adapter;
+ client->driver = &w83627ehf_driver;
+ client->flags = 0;
++ dev = &client->dev;
+
+ strlcpy(client->name, "w83627ehf", I2C_NAME_SIZE);
+ data->valid = 0;
+@@ -721,42 +699,18 @@ static int w83627ehf_detect(struct i2c_a
+ data->has_fan |= (1 << 4);
+
+ /* Register sysfs hooks */
+- data->class_dev = hwmon_device_register(&client->dev);
++ data->class_dev = hwmon_device_register(dev);
+ if (IS_ERR(data->class_dev)) {
+ err = PTR_ERR(data->class_dev);
+ goto exit_detach;
+ }
+
+- device_create_file(&client->dev, &dev_attr_fan1_input);
+- device_create_file(&client->dev, &dev_attr_fan1_min);
+- device_create_file(&client->dev, &dev_attr_fan1_div);
+- device_create_file(&client->dev, &dev_attr_fan2_input);
+- device_create_file(&client->dev, &dev_attr_fan2_min);
+- device_create_file(&client->dev, &dev_attr_fan2_div);
+- device_create_file(&client->dev, &dev_attr_fan3_input);
+- device_create_file(&client->dev, &dev_attr_fan3_min);
+- device_create_file(&client->dev, &dev_attr_fan3_div);
+-
+- if (data->has_fan & (1 << 3)) {
+- device_create_file(&client->dev, &dev_attr_fan4_input);
+- device_create_file(&client->dev, &dev_attr_fan4_min);
+- device_create_file(&client->dev, &dev_attr_fan4_div);
+- }
+- if (data->has_fan & (1 << 4)) {
+- device_create_file(&client->dev, &dev_attr_fan5_input);
+- device_create_file(&client->dev, &dev_attr_fan5_min);
+- device_create_file(&client->dev, &dev_attr_fan5_div);
+- }
+-
+- device_create_file(&client->dev, &dev_attr_temp1_input);
+- device_create_file(&client->dev, &dev_attr_temp1_max);
+- device_create_file(&client->dev, &dev_attr_temp1_max_hyst);
+- device_create_file(&client->dev, &dev_attr_temp2_input);
+- device_create_file(&client->dev, &dev_attr_temp2_max);
+- device_create_file(&client->dev, &dev_attr_temp2_max_hyst);
+- device_create_file(&client->dev, &dev_attr_temp3_input);
+- device_create_file(&client->dev, &dev_attr_temp3_max);
+- device_create_file(&client->dev, &dev_attr_temp3_max_hyst);
++ for (i = 0; i < 5; i++) {
++ if (data->has_fan & (1 << i))
++ device_create_file_fan(dev, i);
++ }
++ for (i = 0; i < ARRAY_SIZE(sda_temp); i++)
++ device_create_file(dev, &sda_temp[i].dev_attr);
+
+ return 0;
+
diff --git a/i2c/hwmon-w83627hf-document-reset-param.patch b/i2c/hwmon-w83627hf-document-reset-param.patch
new file mode 100644
index 0000000000000..033a39302da4f
--- /dev/null
+++ b/i2c/hwmon-w83627hf-document-reset-param.patch
@@ -0,0 +1,30 @@
+From khali@linux-fr.org Sun Feb 5 14:16:49 2006
+Date: Sun, 5 Feb 2006 23:17:34 +0100
+From: Jean Delvare <khali@linux-fr.org>
+To: Greg KH <greg@kroah.com>
+Subject: [PATCH 03/11] w83627hf: Document the reset module parameter
+Message-Id: <20060205231734.3ec8f2e6.khali@linux-fr.org>
+Content-Disposition: inline; filename=hwmon-w83627hf-document-reset-param.patch
+
+Document the reset module parameter which was recently added to the
+w83627hf driver.
+
+Signed-off-by: Jean Delvare <khali@linux-fr.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ Documentation/hwmon/w83627hf | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- gregkh-2.6.orig/Documentation/hwmon/w83627hf
++++ gregkh-2.6/Documentation/hwmon/w83627hf
+@@ -36,6 +36,10 @@ Module Parameters
+ (default is 1)
+ Use 'init=0' to bypass initializing the chip.
+ Try this if your computer crashes when you load the module.
++* reset: int
++ (default is 0)
++ The driver used to reset the chip on load, but does no more. Use
++ 'reset=1' to restore the old behavior. Report if you need to do this.
+
+ Description
+ -----------
diff --git a/i2c/hwmon-w83781d-document-alarm-bits.patch b/i2c/hwmon-w83781d-document-alarm-bits.patch
new file mode 100644
index 0000000000000..193a3abed9151
--- /dev/null
+++ b/i2c/hwmon-w83781d-document-alarm-bits.patch
@@ -0,0 +1,47 @@
+From khali@linux-fr.org Sun Feb 5 14:24:40 2006
+Date: Sun, 5 Feb 2006 23:25:25 +0100
+From: Jean Delvare <khali@linux-fr.org>
+To: Greg KH <greg@kroah.com>
+Subject: [PATCH 06/11] w83781d: Document the alarm and beep bits
+Message-Id: <20060205232525.4a6377e1.khali@linux-fr.org>
+Content-Disposition: inline; filename=hwmon-w83781d-document-alarm-bits.patch
+
+Document the individual alarm and beep bits of the w83781d driver.
+Ideally we would offer a chip-independant interface for them, but
+until it's done, it's only fair that we document the current
+interface.
+
+Signed-off-by: Jean Delvare <khali@linux-fr.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ Documentation/hwmon/w83781d | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+--- gregkh-2.6.orig/Documentation/hwmon/w83781d
++++ gregkh-2.6/Documentation/hwmon/w83781d
+@@ -123,6 +123,25 @@ When an alarm goes off, you can be warne
+ your computer speaker. It is possible to enable all beeping globally,
+ or only the beeping for some alarms.
+
++Individual alarm and beep bits:
++
++0x000001: in0
++0x000002: in1
++0x000004: in2
++0x000008: in3
++0x000010: temp1
++0x000020: temp2 (+temp3 on W83781D)
++0x000040: fan1
++0x000080: fan2
++0x000100: in4
++0x000200: in5
++0x000400: in6
++0x000800: fan3
++0x001000: chassis
++0x002000: temp3 (W83782D and W83627HF only)
++0x010000: in7 (W83782D and W83627HF only)
++0x020000: in8 (W83782D and W83627HF only)
++
+ If an alarm triggers, it will remain triggered until the hardware register
+ is read at least once. This means that the cause for the alarm may
+ already have disappeared! Note that in the current implementation, all
diff --git a/i2c/hwmon-w83781d-no-reset-by-default.patch b/i2c/hwmon-w83781d-no-reset-by-default.patch
new file mode 100644
index 0000000000000..352bcef763723
--- /dev/null
+++ b/i2c/hwmon-w83781d-no-reset-by-default.patch
@@ -0,0 +1,79 @@
+From khali@linux-fr.org Sun Feb 5 14:26:07 2006
+Date: Sun, 5 Feb 2006 23:26:51 +0100
+From: Jean Delvare <khali@linux-fr.org>
+To: Greg KH <greg@kroah.com>
+Subject: [PATCH 07/11] w83781d: Don't reset the chip by default
+Message-Id: <20060205232651.5a0be1e4.khali@linux-fr.org>
+Content-Disposition: inline; filename=hwmon-w83781d-no-reset-by-default.patch
+
+Stop resetting the chip on load by default, so as to preserve the BIOS
+initializations. Same was done in the w83627hf driver some times ago
+for the same reasons.
+
+Signed-off-by: Jean Delvare <khali@linux-fr.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ Documentation/hwmon/w83781d | 5 +++++
+ drivers/hwmon/w83781d.c | 22 +++++++++++++++++++++-
+ 2 files changed, 26 insertions(+), 1 deletion(-)
+
+--- gregkh-2.6.orig/drivers/hwmon/w83781d.c
++++ gregkh-2.6/drivers/hwmon/w83781d.c
+@@ -57,6 +57,10 @@ I2C_CLIENT_INSMOD_5(w83781d, w83782d, w8
+ I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: "
+ "{bus, clientaddr, subclientaddr1, subclientaddr2}");
+
++static int reset;
++module_param(reset, bool, 0);
++MODULE_PARM_DESC(reset, "Set to one to reset chip on load");
++
+ static int init = 1;
+ module_param(init, bool, 0);
+ MODULE_PARM_DESC(init, "Set to zero to bypass chip initialization");
+@@ -1460,8 +1464,17 @@ w83781d_init_client(struct i2c_client *c
+ int type = data->type;
+ u8 tmp;
+
+- if (init && type != as99127f) { /* this resets registers we don't have
++ if (reset && type != as99127f) { /* this resets registers we don't have
+ documentation for on the as99127f */
++ /* Resetting the chip has been the default for a long time,
++ but it causes the BIOS initializations (fan clock dividers,
++ thermal sensor types...) to be lost, so it is now optional.
++ It might even go away if nobody reports it as being useful,
++ as I see very little reason why this would be needed at
++ all. */
++ dev_info(&client->dev, "If reset=1 solved a problem you were "
++ "having, please report!\n");
++
+ /* save these registers */
+ i = w83781d_read_value(client, W83781D_REG_BEEP_CONFIG);
+ p = w83781d_read_value(client, W83781D_REG_PWMCLK12);
+@@ -1478,6 +1491,13 @@ w83781d_init_client(struct i2c_client *c
+ w83781d_write_value(client, W83781D_REG_BEEP_INTS2, 0);
+ }
+
++ /* Disable power-on abnormal beep, as advised by the datasheet.
++ Already done if reset=1. */
++ if (init && !reset && type != as99127f) {
++ i = w83781d_read_value(client, W83781D_REG_BEEP_CONFIG);
++ w83781d_write_value(client, W83781D_REG_BEEP_CONFIG, i | 0x80);
++ }
++
+ data->vrm = vid_which_vrm();
+
+ if ((type != w83781d) && (type != as99127f)) {
+--- gregkh-2.6.orig/Documentation/hwmon/w83781d
++++ gregkh-2.6/Documentation/hwmon/w83781d
+@@ -36,6 +36,11 @@ Module parameters
+ Use 'init=0' to bypass initializing the chip.
+ Try this if your computer crashes when you load the module.
+
++* reset int
++ (default 0)
++ The driver used to reset the chip on load, but does no more. Use
++ 'reset=1' to restore the old behavior. Report if you need to do this.
++
+ force_subclients=bus,caddr,saddr,saddr
+ This is used to force the i2c addresses for subclients of
+ a certain chip. Typical usage is `force_subclients=0,0x2d,0x4a,0x4b'
diff --git a/i2c/hwmon-w83781d-real-time-alarms.patch b/i2c/hwmon-w83781d-real-time-alarms.patch
new file mode 100644
index 0000000000000..21c25cf7d44f1
--- /dev/null
+++ b/i2c/hwmon-w83781d-real-time-alarms.patch
@@ -0,0 +1,90 @@
+From khali@linux-fr.org Sun Feb 5 14:13:04 2006
+Date: Sun, 5 Feb 2006 23:13:48 +0100
+From: Jean Delvare <khali@linux-fr.org>
+To: Greg KH <greg@kroah.com>
+Subject: [PATCH 02/11] w83781d: Use real-time status registers
+Message-Id: <20060205231348.1e273c69.khali@linux-fr.org>
+Content-Disposition: inline; filename=hwmon-w83781d-real-time-alarms.patch
+
+Use the real-time status registers of the Winbond W83782D, W83783S and
+W83627HF chips, instead of the interrupt status registers. Interrupts
+cannot be trusted at least for voltage inputs, as they are two-times
+triggers (as opposed to comparator mode, which we want.) The w83627hf
+driver was fixed in a similar way some times ago.
+
+Signed-off-by: Jean Delvare <khali@linux-fr.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/hwmon/w83781d.c | 43 +++++++++++++++++++++++++------------------
+ 1 file changed, 25 insertions(+), 18 deletions(-)
+
+--- gregkh-2.6.orig/drivers/hwmon/w83781d.c
++++ gregkh-2.6/drivers/hwmon/w83781d.c
+@@ -95,11 +95,16 @@ MODULE_PARM_DESC(init, "Set to zero to b
+ (0x39)))
+
+ #define W83781D_REG_CONFIG 0x40
++
++/* Interrupt status (W83781D, AS99127F) */
+ #define W83781D_REG_ALARM1 0x41
+ #define W83781D_REG_ALARM2 0x42
+-#define W83781D_REG_ALARM3 0x450 /* not on W83781D */
+
+-#define W83781D_REG_IRQ 0x4C
++/* Real-time status (W83782D, W83783S, W83627HF) */
++#define W83782D_REG_ALARM1 0x459
++#define W83782D_REG_ALARM2 0x45A
++#define W83782D_REG_ALARM3 0x45B
++
+ #define W83781D_REG_BEEP_CONFIG 0x4D
+ #define W83781D_REG_BEEP_INTS1 0x56
+ #define W83781D_REG_BEEP_INTS2 0x57
+@@ -1513,15 +1518,6 @@ w83781d_init_client(struct i2c_client *c
+ W83781D_REG_TEMP3_CONFIG, tmp & 0xfe);
+ }
+ }
+-
+- if (type != w83781d) {
+- /* enable comparator mode for temp2 and temp3 so
+- alarm indication will work correctly */
+- i = w83781d_read_value(client, W83781D_REG_IRQ);
+- if (!(i & 0x40))
+- w83781d_write_value(client, W83781D_REG_IRQ,
+- i | 0x40);
+- }
+ }
+
+ /* Start monitoring */
+@@ -1612,14 +1608,25 @@ static struct w83781d_data *w83781d_upda
+ data->fan_div[1] |= (i >> 4) & 0x04;
+ data->fan_div[2] |= (i >> 5) & 0x04;
+ }
+- data->alarms =
+- w83781d_read_value(client,
+- W83781D_REG_ALARM1) +
+- (w83781d_read_value(client, W83781D_REG_ALARM2) << 8);
+ if ((data->type == w83782d) || (data->type == w83627hf)) {
+- data->alarms |=
+- w83781d_read_value(client,
+- W83781D_REG_ALARM3) << 16;
++ data->alarms = w83781d_read_value(client,
++ W83782D_REG_ALARM1)
++ | (w83781d_read_value(client,
++ W83782D_REG_ALARM2) << 8)
++ | (w83781d_read_value(client,
++ W83782D_REG_ALARM3) << 16);
++ } else if (data->type == w83783s) {
++ data->alarms = w83781d_read_value(client,
++ W83782D_REG_ALARM1)
++ | (w83781d_read_value(client,
++ W83782D_REG_ALARM2) << 8);
++ } else {
++ /* No real-time status registers, fall back to
++ interrupt status registers */
++ data->alarms = w83781d_read_value(client,
++ W83781D_REG_ALARM1)
++ | (w83781d_read_value(client,
++ W83781D_REG_ALARM2) << 8);
+ }
+ i = w83781d_read_value(client, W83781D_REG_BEEP_INTS2);
+ data->beep_enable = i >> 7;
diff --git a/i2c/i2c-core-optimize-mutex-use.patch b/i2c/i2c-core-optimize-mutex-use.patch
new file mode 100644
index 0000000000000..7beba551790da
--- /dev/null
+++ b/i2c/i2c-core-optimize-mutex-use.patch
@@ -0,0 +1,53 @@
+From khali@linux-fr.org Sun Feb 5 14:27:37 2006
+Date: Sun, 5 Feb 2006 23:28:21 +0100
+From: Jean Delvare <khali@linux-fr.org>
+To: Greg KH <greg@kroah.com>
+Cc: Ingo Molnar <mingo@elte.hu>
+Subject: [PATCH 08/11] i2c: Optimize core_lists mutex usage
+Message-Id: <20060205232821.25bd8615.khali@linux-fr.org>
+Content-Disposition: inline; filename=i2c-core-optimize-mutex-use.patch
+
+Stop holding the core_lists mutex when we don't actually need it.
+
+Signed-off-by: Jean Delvare <khali@linux-fr.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/i2c/i2c-core.c | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+--- gregkh-2.6.orig/drivers/i2c/i2c-core.c
++++ gregkh-2.6/drivers/i2c/i2c-core.c
+@@ -288,9 +288,7 @@ int i2c_register_driver(struct module *o
+ {
+ struct list_head *item;
+ struct i2c_adapter *adapter;
+- int res = 0;
+-
+- mutex_lock(&core_lists);
++ int res;
+
+ /* add the driver to the list of i2c drivers in the driver core */
+ driver->driver.owner = owner;
+@@ -298,8 +296,10 @@ int i2c_register_driver(struct module *o
+
+ res = driver_register(&driver->driver);
+ if (res)
+- goto out_unlock;
++ return res;
+
++ mutex_lock(&core_lists);
++
+ list_add_tail(&driver->list,&drivers);
+ pr_debug("i2c-core: driver [%s] registered\n", driver->driver.name);
+
+@@ -311,9 +311,8 @@ int i2c_register_driver(struct module *o
+ }
+ }
+
+- out_unlock:
+ mutex_unlock(&core_lists);
+- return res;
++ return 0;
+ }
+ EXPORT_SYMBOL(i2c_register_driver);
+
diff --git a/i2c/i2c-drop-frodo.patch b/i2c/i2c-drop-frodo.patch
new file mode 100644
index 0000000000000..b4920dad31290
--- /dev/null
+++ b/i2c/i2c-drop-frodo.patch
@@ -0,0 +1,116 @@
+From khali@linux-fr.org Sun Feb 5 14:28:34 2006
+Date: Sun, 5 Feb 2006 23:29:18 +0100
+From: Jean Delvare <khali@linux-fr.org>
+To: Greg KH <greg@kroah.com>
+Subject: [PATCH 09/11] i2c: Drop the i2c-frodo bus driver
+Message-Id: <20060205232918.3e58e54c.khali@linux-fr.org>
+Content-Disposition: inline; filename=i2c-drop-frodo.patch
+
+Drop the i2c-frodo bus driver. It isn't referenced by the build
+system, and depends on code which was never included in 2.6 kernels.
+
+Signed-off-by: Jean Delvare <khali@linux-fr.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/i2c/busses/i2c-frodo.c | 85 -----------------------------------------
+ include/linux/i2c-id.h | 1
+ 2 files changed, 86 deletions(-)
+
+--- gregkh-2.6.orig/drivers/i2c/busses/i2c-frodo.c
++++ /dev/null
+@@ -1,85 +0,0 @@
+-
+-/*
+- * linux/drivers/i2c/i2c-frodo.c
+- *
+- * Author: Abraham van der Merwe <abraham@2d3d.co.za>
+- *
+- * An I2C adapter driver for the 2d3D, Inc. StrongARM SA-1110
+- * Development board (Frodo).
+- *
+- * This source code is free software; you can redistribute it and/or
+- * modify it under the terms of the GNU General Public License
+- * version 2 as published by the Free Software Foundation.
+- */
+-
+-#include <linux/module.h>
+-#include <linux/kernel.h>
+-#include <linux/init.h>
+-#include <linux/delay.h>
+-#include <linux/i2c.h>
+-#include <linux/i2c-algo-bit.h>
+-#include <asm/hardware.h>
+-
+-
+-static void frodo_setsda (void *data,int state)
+-{
+- if (state)
+- FRODO_CPLD_I2C |= FRODO_I2C_SDA_OUT;
+- else
+- FRODO_CPLD_I2C &= ~FRODO_I2C_SDA_OUT;
+-}
+-
+-static void frodo_setscl (void *data,int state)
+-{
+- if (state)
+- FRODO_CPLD_I2C |= FRODO_I2C_SCL_OUT;
+- else
+- FRODO_CPLD_I2C &= ~FRODO_I2C_SCL_OUT;
+-}
+-
+-static int frodo_getsda (void *data)
+-{
+- return ((FRODO_CPLD_I2C & FRODO_I2C_SDA_IN) != 0);
+-}
+-
+-static int frodo_getscl (void *data)
+-{
+- return ((FRODO_CPLD_I2C & FRODO_I2C_SCL_IN) != 0);
+-}
+-
+-static struct i2c_algo_bit_data bit_frodo_data = {
+- .setsda = frodo_setsda,
+- .setscl = frodo_setscl,
+- .getsda = frodo_getsda,
+- .getscl = frodo_getscl,
+- .udelay = 80,
+- .mdelay = 80,
+- .timeout = HZ
+-};
+-
+-static struct i2c_adapter frodo_ops = {
+- .owner = THIS_MODULE,
+- .id = I2C_HW_B_FRODO,
+- .algo_data = &bit_frodo_data,
+- .dev = {
+- .name = "Frodo adapter driver",
+- },
+-};
+-
+-static int __init i2c_frodo_init (void)
+-{
+- return i2c_bit_add_bus(&frodo_ops);
+-}
+-
+-static void __exit i2c_frodo_exit (void)
+-{
+- i2c_bit_del_bus(&frodo_ops);
+-}
+-
+-MODULE_AUTHOR ("Abraham van der Merwe <abraham@2d3d.co.za>");
+-MODULE_DESCRIPTION ("I2C-Bus adapter routines for Frodo");
+-MODULE_LICENSE ("GPL");
+-
+-module_init (i2c_frodo_init);
+-module_exit (i2c_frodo_exit);
+-
+--- gregkh-2.6.orig/include/linux/i2c-id.h
++++ gregkh-2.6/include/linux/i2c-id.h
+@@ -172,7 +172,6 @@
+ #define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */
+ #define I2C_HW_B_IOC 0x010011 /* IOC bit-wiggling */
+ #define I2C_HW_B_TSUNA 0x010012 /* DEC Tsunami chipset */
+-#define I2C_HW_B_FRODO 0x010013 /* 2d3D SA-1110 Development Board */
+ #define I2C_HW_B_OMAHA 0x010014 /* Omaha I2C interface (ARM) */
+ #define I2C_HW_B_GUIDE 0x010015 /* Guide bit-basher */
+ #define I2C_HW_B_IXP2000 0x010016 /* GPIO on IXP2000 systems */
diff --git a/i2c/i2c-isp1301_omap-driver-cleanups.patch b/i2c/i2c-isp1301_omap-driver-cleanups.patch
new file mode 100644
index 0000000000000..da070e9cf0d85
--- /dev/null
+++ b/i2c/i2c-isp1301_omap-driver-cleanups.patch
@@ -0,0 +1,27 @@
+From khali@linux-fr.org Sun Feb 5 14:30:40 2006
+Date: Sun, 5 Feb 2006 23:31:25 +0100
+From: Jean Delvare <khali@linux-fr.org>
+To: Greg KH <greg@kroah.com>
+Subject: [PATCH 11/11] i2c: Cleanup isp1301_omap
+Message-Id: <20060205233125.5e98e21f.khali@linux-fr.org>
+Content-Disposition: inline; filename=i2c-isp1301_omap-driver-cleanups.patch
+
+Drop unused rogue i2c driver ID and nonsensical i2c class.
+
+Signed-off-by: Jean Delvare <khali@linux-fr.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/i2c/chips/isp1301_omap.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+--- gregkh-2.6.orig/drivers/i2c/chips/isp1301_omap.c
++++ gregkh-2.6/drivers/i2c/chips/isp1301_omap.c
+@@ -1635,8 +1635,6 @@ static struct i2c_driver isp1301_driver
+ .driver = {
+ .name = "isp1301_omap",
+ },
+- .id = 1301, /* FIXME "official", i2c-ids.h */
+- .class = I2C_CLASS_HWMON,
+ .attach_adapter = isp1301_scan_bus,
+ .detach_client = isp1301_detach_client,
+ };
diff --git a/i2c/i2c-ite-name-init.patch b/i2c/i2c-ite-name-init.patch
new file mode 100644
index 0000000000000..d419a13967927
--- /dev/null
+++ b/i2c/i2c-ite-name-init.patch
@@ -0,0 +1,30 @@
+From khali@linux-fr.org Sun Feb 5 14:29:43 2006
+Date: Sun, 5 Feb 2006 23:30:26 +0100
+From: Jean Delvare <khali@linux-fr.org>
+To: Greg KH <greg@kroah.com>
+Subject: [PATCH 10/11] i2c: Fix i2c-ite name initialization
+Message-Id: <20060205233026.58d9fea4.khali@linux-fr.org>
+Content-Disposition: inline; filename=i2c-ite-name-init.patch
+
+Properly set the name member of the i2c_adapter structure of the ite
+i2c adapter driver.
+
+Signed-off-by: Jean Delvare <khali@linux-fr.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/i2c/busses/i2c-ite.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+--- gregkh-2.6.orig/drivers/i2c/busses/i2c-ite.c
++++ gregkh-2.6/drivers/i2c/busses/i2c-ite.c
+@@ -200,9 +200,7 @@ static struct i2c_adapter iic_ite_ops =
+ .owner = THIS_MODULE,
+ .id = I2C_HW_I_IIC,
+ .algo_data = &iic_ite_data,
+- .dev = {
+- .name = "ITE IIC adapter",
+- },
++ .name = "ITE IIC adapter",
+ };
+
+ /* Called when the module is loaded. This function starts the