diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2005-12-21 15:30:46 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-12-21 15:30:46 -0800 |
commit | 7c772cc08c3d4b7d2437c1d69b88bb9cfac954cf (patch) | |
tree | 6f1e35e339c079fa168f21361efa345fe0a0ed2d /i2c | |
parent | 84740ccd39234c69c8b9fca6a90dbbcd2fa7fdb4 (diff) | |
download | patches-7c772cc08c3d4b7d2437c1d69b88bb9cfac954cf.tar.gz |
i2c patches
Diffstat (limited to 'i2c')
-rw-r--r-- | i2c/hwmon-it87-vrm-fits-in-u8.patch | 36 | ||||
-rw-r--r-- | i2c/hwmon-vrm-via.patch | 194 | ||||
-rw-r--r-- | i2c/hwmon-w83792d-misc-cleanups.patch | 93 | ||||
-rw-r--r-- | i2c/hwmon-w83792d-simplify-in-low-bits.patch | 98 | ||||
-rw-r--r-- | i2c/i2c-drop-driver-flags-04-drop-outdated-comments.patch | 41 | ||||
-rw-r--r-- | i2c/i2c-drop-useless-command-callbacks.patch | 116 | ||||
-rw-r--r-- | i2c/i2c-ibm_iic-hwmon-class.patch | 31 | ||||
-rw-r--r-- | i2c/i2c-id-cleanups.patch | 87 | ||||
-rw-r--r-- | i2c/i2c-mv64xxx-abort-fix.patch | 133 | ||||
-rw-r--r-- | i2c/i2c-nforce2-support-nforce4-mcp04.patch | 59 | ||||
-rw-r--r-- | i2c/i2c-update-command-documentation.patch | 40 |
11 files changed, 928 insertions, 0 deletions
diff --git a/i2c/hwmon-it87-vrm-fits-in-u8.patch b/i2c/hwmon-it87-vrm-fits-in-u8.patch new file mode 100644 index 0000000000000..9bc558a9b7c4c --- /dev/null +++ b/i2c/hwmon-it87-vrm-fits-in-u8.patch @@ -0,0 +1,36 @@ +From khali@linux-fr.org Sun Dec 18 07:42:39 2005 +Date: Sun, 18 Dec 2005 16:40:14 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Subject: [PATCH 04/11] hwmon: it87 use u8 for vrm +Message-Id: <20051218164014.3ecbb76b.khali@linux-fr.org> +Content-Disposition: inline; filename=hwmon-it87-vrm-fits-in-u8.patch + +VRM values fit in u8 by design now. + +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + drivers/hwmon/it87.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- gregkh-2.6.orig/drivers/hwmon/it87.c ++++ gregkh-2.6/drivers/hwmon/it87.c +@@ -213,7 +213,7 @@ struct it87_data { + u8 sensor; /* Register value */ + u8 fan_div[3]; /* Register encoding, shifted right */ + u8 vid; /* Register encoding, combined */ +- int vrm; ++ u8 vrm; + u32 alarms; /* Register encoding, combined */ + u8 fan_main_ctrl; /* Register value */ + u8 manual_pwm_ctl[3]; /* manual PWM value set by user */ +@@ -669,7 +669,7 @@ static ssize_t + show_vrm_reg(struct device *dev, struct device_attribute *attr, char *buf) + { + struct it87_data *data = it87_update_device(dev); +- return sprintf(buf, "%ld\n", (long) data->vrm); ++ return sprintf(buf, "%u\n", data->vrm); + } + static ssize_t + store_vrm_reg(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) diff --git a/i2c/hwmon-vrm-via.patch b/i2c/hwmon-vrm-via.patch new file mode 100644 index 0000000000000..1bac3e7a4e0f1 --- /dev/null +++ b/i2c/hwmon-vrm-via.patch @@ -0,0 +1,194 @@ +From khali@linux-fr.org Sun Dec 18 07:37:19 2005 +Date: Sun, 18 Dec 2005 16:36:52 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Cc: Rudolf Marek <r.marek@sh.cvut.cz> +Subject: [PATCH 03/11] hwmon: add VRM/VID support for some VIA CPUs +Message-Id: <20051218163652.1a731d75.khali@linux-fr.org> +Content-Disposition: inline; filename=hwmon-vrm-via.patch + +From: Rudolf Marek <r.marek@sh.cvut.cz> + +This patch adds the VIA CENTAUR CPUs to detection table. +Table was updated to treat future Intel x86 CPUs as VRD10. +Stepping field was added, because some VIA CPUs have +different VRM specs across stepping. I changed the vrm type +to u8 because all drivers use u8 anyway. + +Signed-off-by: Rudolf Marek <r.marek@sh.cvut.cz> +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + drivers/hwmon/hwmon-vid.c | 69 ++++++++++++++++++++++++++++------------------ + include/linux/hwmon-vid.h | 6 ++-- + 2 files changed, 45 insertions(+), 30 deletions(-) + +--- gregkh-2.6.orig/drivers/hwmon/hwmon-vid.c ++++ gregkh-2.6/drivers/hwmon/hwmon-vid.c +@@ -49,20 +49,22 @@ + . . . . + 11110 = 0.800 V + 11111 = 0.000 V (off) ++ ++ The 17 specification is in fact Intel Mobile Voltage Positioning - ++ (IMVP-II). You can find more information in the datasheet of Max1718 ++ http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2452 ++ + */ + + /* vrm is the VRM/VRD document version multiplied by 10. + val is the 4-, 5- or 6-bit VID code. + Returned value is in mV to avoid floating point in the kernel. */ +-int vid_from_reg(int val, int vrm) ++int vid_from_reg(int val, u8 vrm) + { + int vid; + + switch(vrm) { + +- case 0: +- return 0; +- + case 100: /* VRD 10.0 */ + if((val & 0x1f) == 0x1f) + return 0; +@@ -91,10 +93,16 @@ int vid_from_reg(int val, int vrm) + case 84: /* VRM 8.4 */ + val &= 0x0f; + /* fall through */ +- default: /* VRM 8.2 */ ++ case 82: /* VRM 8.2 */ + return(val == 0x1f ? 0 : + val & 0x10 ? 5100 - (val) * 100 : + 2050 - (val) * 50); ++ case 17: /* Intel IMVP-II */ ++ return(val & 0x10 ? 975 - (val & 0xF) * 25 : ++ 1750 - val * 50); ++ default: /* report 0 for unknown */ ++ printk(KERN_INFO "hwmon-vid: requested unknown VRM version\n"); ++ return 0; + } + } + +@@ -108,30 +116,36 @@ struct vrm_model { + u8 vendor; + u8 eff_family; + u8 eff_model; +- int vrm_type; ++ u8 eff_stepping; ++ u8 vrm_type; + }; + + #define ANY 0xFF + + #ifdef CONFIG_X86 + ++/* the stepping parameter is highest acceptable stepping for current line */ ++ + static struct vrm_model vrm_models[] = { +- {X86_VENDOR_AMD, 0x6, ANY, 90}, /* Athlon Duron etc */ +- {X86_VENDOR_AMD, 0xF, ANY, 24}, /* Athlon 64, Opteron */ +- {X86_VENDOR_INTEL, 0x6, 0x9, 85}, /* 0.13um too */ +- {X86_VENDOR_INTEL, 0x6, 0xB, 85}, /* Tualatin */ +- {X86_VENDOR_INTEL, 0x6, ANY, 82}, /* any P6 */ +- {X86_VENDOR_INTEL, 0x7, ANY, 0}, /* Itanium */ +- {X86_VENDOR_INTEL, 0xF, 0x0, 90}, /* P4 */ +- {X86_VENDOR_INTEL, 0xF, 0x1, 90}, /* P4 Willamette */ +- {X86_VENDOR_INTEL, 0xF, 0x2, 90}, /* P4 Northwood */ +- {X86_VENDOR_INTEL, 0xF, 0x3, 100}, /* P4 Prescott */ +- {X86_VENDOR_INTEL, 0xF, 0x4, 100}, /* P4 Prescott */ +- {X86_VENDOR_INTEL, 0x10,ANY, 0}, /* Itanium 2 */ +- {X86_VENDOR_UNKNOWN, ANY, ANY, 0} /* stop here */ ++ {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, 0xB, ANY, 85}, /* Tualatin */ ++ {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 */ ++ {X86_VENDOR_INTEL, 0xF, 0x1, ANY, 90}, /* P4 Willamette */ ++ {X86_VENDOR_INTEL, 0xF, 0x2, ANY, 90}, /* P4 Northwood */ ++ {X86_VENDOR_INTEL, 0xF, ANY, ANY, 100}, /* Prescott and above assume VRD 10 */ ++ {X86_VENDOR_INTEL, 0x10, ANY, ANY, 0}, /* Itanium 2 */ ++ {X86_VENDOR_CENTAUR, 0x6, 0x7, ANY, 85}, /* Eden ESP/Ezra */ ++ {X86_VENDOR_CENTAUR, 0x6, 0x8, 0x7, 85}, /* Ezra T */ ++ {X86_VENDOR_CENTAUR, 0x6, 0x9, 0x7, 85}, /* Nemiah */ ++ {X86_VENDOR_CENTAUR, 0x6, 0x9, ANY, 17}, /* C3-M */ ++ {X86_VENDOR_UNKNOWN, ANY, ANY, ANY, 0} /* stop here */ + }; + +-static int find_vrm(u8 eff_family, u8 eff_model, u8 vendor) ++static u8 find_vrm(u8 eff_family, u8 eff_model, u8 eff_stepping, u8 vendor) + { + int i = 0; + +@@ -139,7 +153,8 @@ static int find_vrm(u8 eff_family, u8 ef + if (vrm_models[i].vendor==vendor) + if ((vrm_models[i].eff_family==eff_family) + && ((vrm_models[i].eff_model==eff_model) || +- (vrm_models[i].eff_model==ANY))) ++ (vrm_models[i].eff_model==ANY)) && ++ (eff_stepping <= vrm_models[i].eff_stepping)) + return vrm_models[i].vrm_type; + i++; + } +@@ -147,12 +162,11 @@ static int find_vrm(u8 eff_family, u8 ef + return 0; + } + +-int vid_which_vrm(void) ++u8 vid_which_vrm(void) + { + struct cpuinfo_x86 *c = cpu_data; + u32 eax; +- u8 eff_family, eff_model; +- int vrm_ret; ++ u8 eff_family, eff_model, eff_stepping, vrm_ret; + + if (c->x86 < 6) /* Any CPU with family lower than 6 */ + return 0; /* doesn't have VID and/or CPUID */ +@@ -160,20 +174,21 @@ int vid_which_vrm(void) + eax = cpuid_eax(1); + eff_family = ((eax & 0x00000F00)>>8); + eff_model = ((eax & 0x000000F0)>>4); ++ eff_stepping = eax & 0xF; + if (eff_family == 0xF) { /* use extended model & family */ + eff_family += ((eax & 0x00F00000)>>20); + eff_model += ((eax & 0x000F0000)>>16)<<4; + } +- vrm_ret = find_vrm(eff_family,eff_model,c->x86_vendor); ++ vrm_ret = find_vrm(eff_family, eff_model, eff_stepping, c->x86_vendor); + if (vrm_ret == 0) + printk(KERN_INFO "hwmon-vid: Unknown VRM version of your " + "x86 CPU\n"); + return vrm_ret; + } + +-/* and now something completely different for the non-x86 world */ ++/* and now for something completely different for the non-x86 world */ + #else +-int vid_which_vrm(void) ++u8 vid_which_vrm(void) + { + printk(KERN_INFO "hwmon-vid: Unknown VRM version of your CPU\n"); + return 0; +--- gregkh-2.6.orig/include/linux/hwmon-vid.h ++++ gregkh-2.6/include/linux/hwmon-vid.h +@@ -23,14 +23,14 @@ + #ifndef _LINUX_HWMON_VID_H + #define _LINUX_HWMON_VID_H + +-int vid_from_reg(int val, int vrm); +-int vid_which_vrm(void); ++int vid_from_reg(int val, u8 vrm); ++u8 vid_which_vrm(void); + + /* vrm is the VRM/VRD document version multiplied by 10. + val is in mV to avoid floating point in the kernel. + Returned value is the 4-, 5- or 6-bit VID code. + Note that only VRM 9.x is supported for now. */ +-static inline int vid_to_reg(int val, int vrm) ++static inline int vid_to_reg(int val, u8 vrm) + { + switch (vrm) { + case 91: /* VRM 9.1 */ diff --git a/i2c/hwmon-w83792d-misc-cleanups.patch b/i2c/hwmon-w83792d-misc-cleanups.patch new file mode 100644 index 0000000000000..56941c226c5c0 --- /dev/null +++ b/i2c/hwmon-w83792d-misc-cleanups.patch @@ -0,0 +1,93 @@ +From khali@linux-fr.org Sun Dec 18 07:31:43 2005 +Date: Sun, 18 Dec 2005 16:29:40 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Cc: Yuan Mu <Ymu@winbond.com.tw> +Subject: [PATCH 01/11] hwmon: w83792d misc cleanups +Message-Id: <20051218162940.702a24ac.khali@linux-fr.org> +Content-Disposition: inline; filename=hwmon-w83792d-misc-cleanups.patch + +Cleanup the w83792d driver a bit: +* Discard unused lock and irrelevant comments inherited from the + w83781d driver. +* Simplify w83792d_{read,write}_value functions. +* Drop useless address test during detection. +* Drop useless bitmasking. + +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Acked-by: Yuan Mu <Ymu@winbond.com.tw> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + drivers/hwmon/w83792d.c | 29 +++++++++-------------------- + 1 file changed, 9 insertions(+), 20 deletions(-) + +--- gregkh-2.6.orig/drivers/hwmon/w83792d.c ++++ gregkh-2.6/drivers/hwmon/w83792d.c +@@ -269,7 +269,6 @@ DIV_TO_REG(long val) + struct w83792d_data { + struct i2c_client client; + struct class_device *class_dev; +- struct semaphore lock; + enum chips type; + + struct semaphore update_lock; +@@ -1192,7 +1191,6 @@ w83792d_detect(struct i2c_adapter *adapt + new_client = &data->client; + i2c_set_clientdata(new_client, data); + new_client->addr = address; +- init_MUTEX(&data->lock); + new_client->adapter = adapter; + new_client->driver = &w83792d_driver; + new_client->flags = 0; +@@ -1243,7 +1241,7 @@ w83792d_detect(struct i2c_adapter *adapt + goto ERROR1; + } + val1 = w83792d_read_value(new_client, W83792D_REG_WCHIPID); +- if (val1 == 0x7a && address >= 0x2c) { ++ if (val1 == 0x7a) { + kind = w83792d; + } else { + if (kind == 0) +@@ -1416,26 +1414,17 @@ w83792d_detach_client(struct i2c_client + return 0; + } + +-/* The SMBus locks itself, usually, but nothing may access the Winbond between +- bank switches. ISA access must always be locked explicitly! +- We ignore the W83792D BUSY flag at this moment - it could lead to deadlocks, +- would slow down the W83792D access and should not be necessary. +- There are some ugly typecasts here, but the good news is - they should +- nowhere else be necessary! */ +-static int +-w83792d_read_value(struct i2c_client *client, u8 reg) ++/* The SMBus locks itself. The Winbond W83792D chip has a bank register, ++ but the driver only accesses registers in bank 0, so we don't have ++ to switch banks and lock access between switches. */ ++static int w83792d_read_value(struct i2c_client *client, u8 reg) + { +- int res=0; +- res = i2c_smbus_read_byte_data(client, reg); +- +- return res; ++ return i2c_smbus_read_byte_data(client, reg); + } + +-static int +-w83792d_write_value(struct i2c_client *client, u8 reg, u8 value) ++static int w83792d_write_value(struct i2c_client *client, u8 reg, u8 value) + { +- i2c_smbus_write_byte_data(client, reg, value); +- return 0; ++ return i2c_smbus_write_byte_data(client, reg, value); + } + + static void +@@ -1506,7 +1495,7 @@ static struct w83792d_data *w83792d_upda + pwm_array_tmp[i] = w83792d_read_value(client, + W83792D_REG_PWM[i]); + data->pwm[i] = pwm_array_tmp[i] & 0x0f; +- data->pwm_mode[i] = (pwm_array_tmp[i] >> 7) & 0x01; ++ data->pwm_mode[i] = pwm_array_tmp[i] >> 7; + } + + reg_tmp = w83792d_read_value(client, W83792D_REG_FAN_CFG); diff --git a/i2c/hwmon-w83792d-simplify-in-low-bits.patch b/i2c/hwmon-w83792d-simplify-in-low-bits.patch new file mode 100644 index 0000000000000..ef6c6ecbb5f3e --- /dev/null +++ b/i2c/hwmon-w83792d-simplify-in-low-bits.patch @@ -0,0 +1,98 @@ +From khali@linux-fr.org Sun Dec 18 07:37:13 2005 +Date: Sun, 18 Dec 2005 16:34:28 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Cc: Yuan Mu <Ymu@winbond.com.tw> +Subject: [PATCH 02/11] hwmon: w83792d simplify in low bits handling +Message-Id: <20051218163428.6142ebe2.khali@linux-fr.org> +Content-Disposition: inline; filename=hwmon-w83792d-simplify-in-low-bits.patch + +Simplify the way the w83792d driver handles the extra resolution +bits of voltage input channels. + +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Acked-by: Yuan Mu <Ymu@winbond.com.tw> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + drivers/hwmon/w83792d.c | 48 ++++++++++-------------------------------------- + 1 file changed, 10 insertions(+), 38 deletions(-) + +--- gregkh-2.6.orig/drivers/hwmon/w83792d.c ++++ gregkh-2.6/drivers/hwmon/w83792d.c +@@ -281,7 +281,7 @@ struct w83792d_data { + u8 in[9]; /* Register value */ + u8 in_max[9]; /* Register value */ + u8 in_min[9]; /* Register value */ +- u8 low_bits[2]; /* Additional resolution to voltage in0-6 */ ++ u16 low_bits; /* Additional resolution to voltage in6-0 */ + u8 fan[7]; /* Register value */ + u8 fan_min[7]; /* Register value */ + u8 temp1[3]; /* current, over, thyst */ +@@ -323,38 +323,10 @@ static struct i2c_driver w83792d_driver + .detach_client = w83792d_detach_client, + }; + +-static long in_count_from_reg(int nr, struct w83792d_data *data) ++static inline long in_count_from_reg(int nr, struct w83792d_data *data) + { +- u16 vol_count = data->in[nr]; +- u16 low_bits = 0; +- vol_count = (vol_count << 2); +- switch (nr) +- { +- case 0: /* vin0 */ +- low_bits = (data->low_bits[0]) & 0x03; +- break; +- case 1: /* vin1 */ +- low_bits = ((data->low_bits[0]) & 0x0c) >> 2; +- break; +- case 2: /* vin2 */ +- low_bits = ((data->low_bits[0]) & 0x30) >> 4; +- break; +- case 3: /* vin3 */ +- low_bits = ((data->low_bits[0]) & 0xc0) >> 6; +- break; +- case 4: /* vin4 */ +- low_bits = (data->low_bits[1]) & 0x03; +- break; +- case 5: /* vin5 */ +- low_bits = ((data->low_bits[1]) & 0x0c) >> 2; +- break; +- case 6: /* vin6 */ +- low_bits = ((data->low_bits[1]) & 0x30) >> 4; +- default: +- break; +- } +- vol_count = vol_count | low_bits; +- return vol_count; ++ /* in7 and in8 do not have low bits, but the formula still works */ ++ return ((data->in[nr] << 2) | ((data->low_bits >> (2 * nr)) & 0x03)); + } + + /* following are the sysfs callback functions */ +@@ -1481,10 +1453,10 @@ static struct w83792d_data *w83792d_upda + data->in_min[i] = w83792d_read_value(client, + W83792D_REG_IN_MIN[i]); + } +- data->low_bits[0] = w83792d_read_value(client, +- W83792D_REG_LOW_BITS1); +- data->low_bits[1] = w83792d_read_value(client, +- W83792D_REG_LOW_BITS2); ++ data->low_bits = w83792d_read_value(client, ++ W83792D_REG_LOW_BITS1) + ++ (w83792d_read_value(client, ++ W83792D_REG_LOW_BITS2) << 8); + for (i = 0; i < 7; i++) { + /* Update the Fan measured value and limits */ + data->fan[i] = w83792d_read_value(client, +@@ -1596,8 +1568,8 @@ static void w83792d_print_debug(struct w + dev_dbg(dev, "vin[%d] max is: 0x%x\n", i, data->in_max[i]); + dev_dbg(dev, "vin[%d] min is: 0x%x\n", i, data->in_min[i]); + } +- dev_dbg(dev, "Low Bit1 is: 0x%x\n", data->low_bits[0]); +- dev_dbg(dev, "Low Bit2 is: 0x%x\n", data->low_bits[1]); ++ dev_dbg(dev, "Low Bit1 is: 0x%x\n", data->low_bits & 0xff); ++ dev_dbg(dev, "Low Bit2 is: 0x%x\n", data->low_bits >> 8); + dev_dbg(dev, "7 set of Fan Counts and Duty Cycles: =====>\n"); + for (i=0; i<7; i++) { + dev_dbg(dev, "fan[%d] is: 0x%x\n", i, data->fan[i]); diff --git a/i2c/i2c-drop-driver-flags-04-drop-outdated-comments.patch b/i2c/i2c-drop-driver-flags-04-drop-outdated-comments.patch new file mode 100644 index 0000000000000..1efcac926db18 --- /dev/null +++ b/i2c/i2c-drop-driver-flags-04-drop-outdated-comments.patch @@ -0,0 +1,41 @@ +From khali@linux-fr.org Sun Dec 18 08:15:40 2005 +Date: Sun, 18 Dec 2005 17:11:51 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Subject: [PATCH 08/11] i2c: I2C_DF_NOTIFY removal comment cleanups +Message-Id: <20051218171151.6c56a057.khali@linux-fr.org> +Content-Disposition: inline; filename=i2c-drop-driver-flags-04-drop-outdated-comments.patch + +The removal of I2C_DF_NOTIFY left some out of date comments in the +code. Drop them. + +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + drivers/i2c/i2c-core.c | 8 -------- + 1 file changed, 8 deletions(-) + +--- gregkh-2.6.orig/drivers/i2c/i2c-core.c ++++ gregkh-2.6/drivers/i2c/i2c-core.c +@@ -246,10 +246,6 @@ int i2c_del_adapter(struct i2c_adapter * + list_for_each_safe(item, _n, &adap->clients) { + client = list_entry(item, struct i2c_client, list); + +- /* detaching devices is unconditional of the set notify +- * flag, as _all_ clients that reside on the adapter +- * must be deleted, as this would cause invalid states. +- */ + if ((res=client->driver->detach_client(client))) { + dev_err(&adap->dev, "detach_client failed for client " + "[%s] at address 0x%02x\n", client->name, +@@ -335,10 +331,6 @@ int i2c_del_driver(struct i2c_driver *dr + /* Have a look at each adapter, if clients of this driver are still + * attached. If so, detach them to be able to kill the driver + * afterwards. +- * +- * Removing clients does not depend on the notify flag, else +- * invalid operation might (will!) result, when using stale client +- * pointers. + */ + list_for_each(item1,&adapters) { + adap = list_entry(item1, struct i2c_adapter, list); diff --git a/i2c/i2c-drop-useless-command-callbacks.patch b/i2c/i2c-drop-useless-command-callbacks.patch new file mode 100644 index 0000000000000..8e2ee7c638aa9 --- /dev/null +++ b/i2c/i2c-drop-useless-command-callbacks.patch @@ -0,0 +1,116 @@ +From khali@linux-fr.org Sun Dec 18 07:48:09 2005 +Date: Sun, 18 Dec 2005 16:49:30 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Cc: Laurent Riffard <laurent.riffard@free.fr>, Michael Geng <linux@MichaelGeng.de>, Petr Vandrovec <vandrove@vc.cvut.cz> +Subject: [PATCH 06/11] i2c: drop empty i2c_driver.command implementations +Message-Id: <20051218164930.658747df.khali@linux-fr.org> +Content-Disposition: inline; filename=i2c-drop-useless-command-callbacks.patch + +From: Laurent Riffard <laurent.riffard@free.fr> + +Given that implementing i2c_driver.command is optional, there is no +point in an empty implementation thereof. + +Signed-off-by: Laurent Riffard <laurent.riffard@free.fr> +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Cc: Michael Geng <linux@MichaelGeng.de> +Cc: Petr Vandrovec <vandrove@vc.cvut.cz> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + drivers/i2c/i2c-dev.c | 7 ------- + drivers/media/video/saa5246a.c | 7 ------- + drivers/media/video/saa5249.c | 7 ------- + drivers/video/matrox/matroxfb_maven.c | 5 ----- + 4 files changed, 26 deletions(-) + +--- gregkh-2.6.orig/drivers/i2c/i2c-dev.c ++++ gregkh-2.6/drivers/i2c/i2c-dev.c +@@ -464,12 +464,6 @@ static int i2cdev_detach_client(struct i + return 0; + } + +-static int i2cdev_command(struct i2c_client *client, unsigned int cmd, +- void *arg) +-{ +- return -1; +-} +- + static struct i2c_driver i2cdev_driver = { + .driver = { + .name = "dev_driver", +@@ -478,7 +472,6 @@ static struct i2c_driver i2cdev_driver = + .attach_adapter = i2cdev_attach_adapter, + .detach_adapter = i2cdev_detach_adapter, + .detach_client = i2cdev_detach_client, +- .command = i2cdev_command, + }; + + static struct i2c_client i2cdev_client_template = { +--- gregkh-2.6.orig/drivers/media/video/saa5246a.c ++++ gregkh-2.6/drivers/media/video/saa5246a.c +@@ -151,12 +151,6 @@ static int saa5246a_detach(struct i2c_cl + return 0; + } + +-static int saa5246a_command(struct i2c_client *device, unsigned int cmd, +- void *arg) +-{ +- return -EINVAL; +-} +- + /* + * I2C interfaces + */ +@@ -169,7 +163,6 @@ static struct i2c_driver i2c_driver_vide + .id = I2C_DRIVERID_SAA5249, /* in i2c.h */ + .attach_adapter = saa5246a_probe, + .detach_client = saa5246a_detach, +- .command = saa5246a_command + }; + + static struct i2c_client client_template = { +--- gregkh-2.6.orig/drivers/media/video/saa5249.c ++++ gregkh-2.6/drivers/media/video/saa5249.c +@@ -226,12 +226,6 @@ static int saa5249_detach(struct i2c_cli + return 0; + } + +-static int saa5249_command(struct i2c_client *device, +- unsigned int cmd, void *arg) +-{ +- return -EINVAL; +-} +- + /* new I2C driver support */ + + static struct i2c_driver i2c_driver_videotext = +@@ -242,7 +236,6 @@ static struct i2c_driver i2c_driver_vide + .id = I2C_DRIVERID_SAA5249, /* in i2c.h */ + .attach_adapter = saa5249_probe, + .detach_client = saa5249_detach, +- .command = saa5249_command + }; + + static struct i2c_client client_template = { +--- gregkh-2.6.orig/drivers/video/matrox/matroxfb_maven.c ++++ gregkh-2.6/drivers/video/matrox/matroxfb_maven.c +@@ -1288,10 +1288,6 @@ static int maven_detach_client(struct i2 + return 0; + } + +-static int maven_command(struct i2c_client* client, unsigned int cmd, void* arg) { +- return -ENOIOCTLCMD; /* or -EINVAL, depends on who will call this */ +-} +- + static struct i2c_driver maven_driver={ + .driver = { + .name = "maven", +@@ -1299,7 +1295,6 @@ static struct i2c_driver maven_driver={ + .id = I2C_DRIVERID_MGATVO, + .attach_adapter = maven_attach_adapter, + .detach_client = maven_detach_client, +- .command = maven_command, + }; + + /* ************************** */ diff --git a/i2c/i2c-ibm_iic-hwmon-class.patch b/i2c/i2c-ibm_iic-hwmon-class.patch new file mode 100644 index 0000000000000..c9ef04a772a51 --- /dev/null +++ b/i2c/i2c-ibm_iic-hwmon-class.patch @@ -0,0 +1,31 @@ +From khali@linux-fr.org Sun Dec 18 08:15:45 2005 +Date: Sun, 18 Dec 2005 17:18:01 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Cc: Martin Hicks <mort@bork.org> +Subject: [PATCH 09/11] i2c: i2c-ibm_iic add I2C_CLASS_HWMON +Message-Id: <20051218171801.1b0c3fd7.khali@linux-fr.org> +Content-Disposition: inline; filename=i2c-ibm_iic-hwmon-class.patch + +From: Martin Hicks <mort@bork.org> + +Add the ibm_iic driver to the HWMON class so it will scan the +bus for connected hardware monitor sensors. + +Signed-off-by: Martin Hicks <mort@bork.org> +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + drivers/i2c/busses/i2c-ibm_iic.c | 1 + + 1 file changed, 1 insertion(+) + +--- gregkh-2.6.orig/drivers/i2c/busses/i2c-ibm_iic.c ++++ gregkh-2.6/drivers/i2c/busses/i2c-ibm_iic.c +@@ -725,6 +725,7 @@ static int __devinit iic_probe(struct oc + strcpy(adap->name, "IBM IIC"); + i2c_set_adapdata(adap, dev); + adap->id = I2C_HW_OCP; ++ adap->class = I2C_CLASS_HWMON; + adap->algo = &iic_algo; + adap->client_register = NULL; + adap->client_unregister = NULL; diff --git a/i2c/i2c-id-cleanups.patch b/i2c/i2c-id-cleanups.patch new file mode 100644 index 0000000000000..f8ba556483744 --- /dev/null +++ b/i2c/i2c-id-cleanups.patch @@ -0,0 +1,87 @@ +From khali@linux-fr.org Sun Dec 18 07:42:47 2005 +Date: Sun, 18 Dec 2005 16:42:35 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Subject: [PATCH 05/11] i2c: driver ID list cleanups +Message-Id: <20051218164235.1ac0707c.khali@linux-fr.org> +Content-Disposition: inline; filename=i2c-id-cleanups.patch + +Cleanups to i2c driver ID list: +* Remove mostly bogus comments about driver ID ranges. +* Drop experimental driver IDs, as the concept is pretty broken. +* Drop now unused IDs of non-I2C (ISA) drivers. +* Drop a few more IDs which are no more used. + +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + include/linux/i2c-id.h | 20 -------------------- + 1 file changed, 20 deletions(-) + +--- gregkh-2.6.orig/include/linux/i2c-id.h ++++ gregkh-2.6/include/linux/i2c-id.h +@@ -25,12 +25,6 @@ + + /* + * ---- Driver types ----------------------------------------------------- +- * device id name + number function description, i2c address(es) +- * +- * Range 1000-1999 range is defined in sensors/sensors.h +- * Range 0x100 - 0x1ff is for V4L2 Common Components +- * Range 0xf000 - 0xffff is reserved for local experimentation, and should +- * never be used in official drivers + */ + + #define I2C_DRIVERID_MSP3400 1 +@@ -110,13 +104,7 @@ + #define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */ + #define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */ + +-#define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */ +-#define I2C_DRIVERID_EXP1 0xF1 +-#define I2C_DRIVERID_EXP2 0xF2 +-#define I2C_DRIVERID_EXP3 0xF3 +- + #define I2C_DRIVERID_I2CDEV 900 +-#define I2C_DRIVERID_I2CPROC 901 + #define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ + #define I2C_DRIVERID_ALERT 903 /* SMBus Alert Responder Client */ + +@@ -131,15 +119,12 @@ + #define I2C_DRIVERID_ADM1021 1008 + #define I2C_DRIVERID_ADM9240 1009 + #define I2C_DRIVERID_LTC1710 1010 +-#define I2C_DRIVERID_SIS5595 1011 + #define I2C_DRIVERID_ICSPLL 1012 + #define I2C_DRIVERID_BT869 1013 + #define I2C_DRIVERID_MAXILIFE 1014 + #define I2C_DRIVERID_MATORB 1015 + #define I2C_DRIVERID_GL520 1016 + #define I2C_DRIVERID_THMC50 1017 +-#define I2C_DRIVERID_DDCMON 1018 +-#define I2C_DRIVERID_VIA686A 1019 + #define I2C_DRIVERID_ADM1025 1020 + #define I2C_DRIVERID_LM87 1021 + #define I2C_DRIVERID_PCF8574 1022 +@@ -151,21 +136,16 @@ + #define I2C_DRIVERID_FSCPOS 1028 + #define I2C_DRIVERID_FSCSCY 1029 + #define I2C_DRIVERID_PCF8591 1030 +-#define I2C_DRIVERID_SMSC47M1 1031 +-#define I2C_DRIVERID_VT1211 1032 + #define I2C_DRIVERID_LM92 1033 +-#define I2C_DRIVERID_VT8231 1034 + #define I2C_DRIVERID_SMARTBATT 1035 + #define I2C_DRIVERID_BMCSENSORS 1036 + #define I2C_DRIVERID_FS451 1037 +-#define I2C_DRIVERID_W83627HF 1038 + #define I2C_DRIVERID_LM85 1039 + #define I2C_DRIVERID_LM83 1040 + #define I2C_DRIVERID_LM90 1042 + #define I2C_DRIVERID_ASB100 1043 + #define I2C_DRIVERID_FSCHER 1046 + #define I2C_DRIVERID_W83L785TS 1047 +-#define I2C_DRIVERID_SMSC47B397 1050 + + /* + * ---- Adapter types ---------------------------------------------------- diff --git a/i2c/i2c-mv64xxx-abort-fix.patch b/i2c/i2c-mv64xxx-abort-fix.patch new file mode 100644 index 0000000000000..9e3b5b95124c9 --- /dev/null +++ b/i2c/i2c-mv64xxx-abort-fix.patch @@ -0,0 +1,133 @@ +From khali@linux-fr.org Sun Dec 18 08:21:02 2005 +Date: Sun, 18 Dec 2005 17:22:01 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Cc: "Mark A. Greer" <mgreer@mvista.com> +Subject: [PATCH 10/11] i2c: i2c-mv64xxx fix transaction abortion +Message-Id: <20051218172201.1e92608e.khali@linux-fr.org> +Content-Disposition: inline; filename=i2c-mv64xxx-abort-fix.patch + +From: "Mark A. Greer" <mgreer@mvista.com> + +When the i2c-mv64xxx i2c driver is signalled to abort a transaction, +it aborts it immediately by issuing a stop condition on the bus. +This violates the i2c protocol and can cause what appears to be an i2c +bus hang. This patch delays issuing the stop condition until the i2c +device can reasonably expect a stop condition. + +Also includes a minor fixup. + +Signed-off-by: Mark A. Greer <mgreer@mvista.com> +Signed-off-by: Jean Delvare <khali@linux-fr.org> +--- + drivers/i2c/busses/i2c-mv64xxx.c | 33 +++++++++++++++------------------ + 1 file changed, 15 insertions(+), 18 deletions(-) + +--- gregkh-2.6.orig/drivers/i2c/busses/i2c-mv64xxx.c ++++ gregkh-2.6/drivers/i2c/busses/i2c-mv64xxx.c +@@ -1,6 +1,4 @@ + /* +- * drivers/i2c/busses/i2c-mv64xxx.c +- * + * Driver for the i2c controller on the Marvell line of host bridges for MIPS + * and PPC (e.g, gt642[46]0, mv643[46]0, mv644[46]0). + * +@@ -65,7 +63,6 @@ enum { + MV64XXX_I2C_STATE_WAITING_FOR_ADDR_2_ACK, + MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_ACK, + MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_DATA, +- MV64XXX_I2C_STATE_ABORTING, + }; + + /* Driver actions */ +@@ -85,6 +82,7 @@ struct mv64xxx_i2c_data { + int irq; + u32 state; + u32 action; ++ u32 aborting; + u32 cntl_bits; + void __iomem *reg_base; + u32 reg_base_p; +@@ -122,12 +120,6 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data + return; + } + +- if (drv_data->state == MV64XXX_I2C_STATE_ABORTING) { +- drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP; +- drv_data->state = MV64XXX_I2C_STATE_IDLE; +- return; +- } +- + /* The status from the ctlr [mostly] tells us what to do next */ + switch (status) { + /* Start condition interrupt */ +@@ -148,14 +140,16 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data + /* FALLTHRU */ + case MV64XXX_I2C_STATUS_MAST_WR_ADDR_2_ACK: /* 0xd0 */ + case MV64XXX_I2C_STATUS_MAST_WR_ACK: /* 0x28 */ +- if (drv_data->bytes_left > 0) { ++ if ((drv_data->bytes_left == 0) ++ || (drv_data->aborting ++ && (drv_data->byte_posn != 0))) { ++ drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP; ++ drv_data->state = MV64XXX_I2C_STATE_IDLE; ++ } else { + drv_data->action = MV64XXX_I2C_ACTION_SEND_DATA; + drv_data->state = + MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_ACK; + drv_data->bytes_left--; +- } else { +- drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP; +- drv_data->state = MV64XXX_I2C_STATE_IDLE; + } + break; + +@@ -184,7 +178,7 @@ mv64xxx_i2c_fsm(struct mv64xxx_i2c_data + } + drv_data->state = MV64XXX_I2C_STATE_WAITING_FOR_SLAVE_DATA; + +- if (drv_data->bytes_left == 1) ++ if ((drv_data->bytes_left == 1) || drv_data->aborting) + drv_data->cntl_bits &= ~MV64XXX_I2C_REG_CONTROL_ACK; + break; + +@@ -320,6 +314,7 @@ mv64xxx_i2c_prepare_for_io(struct mv64xx + drv_data->msg = msg; + drv_data->byte_posn = 0; + drv_data->bytes_left = msg->len; ++ drv_data->aborting = 0; + drv_data->rc = 0; + drv_data->cntl_bits = MV64XXX_I2C_REG_CONTROL_ACK | + MV64XXX_I2C_REG_CONTROL_INTEN | MV64XXX_I2C_REG_CONTROL_TWSIEN; +@@ -359,17 +354,19 @@ mv64xxx_i2c_wait_for_completion(struct m + } + + if (abort && drv_data->block) { +- drv_data->state = MV64XXX_I2C_STATE_ABORTING; ++ drv_data->aborting = 1; + spin_unlock_irqrestore(&drv_data->lock, flags); + + time_left = wait_event_timeout(drv_data->waitq, + !drv_data->block, + msecs_to_jiffies(drv_data->adapter.timeout)); + +- if (time_left <= 0) { ++ if ((time_left <= 0) && drv_data->block) { + drv_data->state = MV64XXX_I2C_STATE_IDLE; + dev_err(&drv_data->adapter.dev, +- "mv64xxx: I2C bus locked\n"); ++ "mv64xxx: I2C bus locked, block: %d, " ++ "time_left: %d\n", drv_data->block, ++ (int)time_left); + } + } else + spin_unlock_irqrestore(&drv_data->lock, flags); +@@ -510,7 +507,7 @@ mv64xxx_i2c_probe(struct platform_device + goto exit_kfree; + } + +- strncpy(drv_data->adapter.name, MV64XXX_I2C_CTLR_NAME " adapter", ++ strlcpy(drv_data->adapter.name, MV64XXX_I2C_CTLR_NAME " adapter", + I2C_NAME_SIZE); + + init_waitqueue_head(&drv_data->waitq); diff --git a/i2c/i2c-nforce2-support-nforce4-mcp04.patch b/i2c/i2c-nforce2-support-nforce4-mcp04.patch new file mode 100644 index 0000000000000..e65123ef4c7a9 --- /dev/null +++ b/i2c/i2c-nforce2-support-nforce4-mcp04.patch @@ -0,0 +1,59 @@ +From khali@linux-fr.org Sun Dec 18 08:26:15 2005 +Date: Sun, 18 Dec 2005 17:25:18 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Cc: Frederic Petit <fredantispam@free.fr> +Subject: [PATCH 11/11] i2c: i2c-nforce2 add nforce4 MCP-04 device ID +Message-Id: <20051218172518.73a00f8d.khali@linux-fr.org> +Content-Disposition: inline; filename=i2c-nforce2-support-nforce4-mcp04.patch + +One more supported PCI ID for the i2c-nforce2 driver. + +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + Documentation/i2c/busses/i2c-nforce2 | 3 ++- + drivers/i2c/busses/i2c-nforce2.c | 2 ++ + include/linux/pci_ids.h | 1 + + 3 files changed, 5 insertions(+), 1 deletion(-) + +--- gregkh-2.6.orig/drivers/i2c/busses/i2c-nforce2.c ++++ gregkh-2.6/drivers/i2c/busses/i2c-nforce2.c +@@ -30,6 +30,7 @@ + nForce3 Pro150 MCP 00D4 + nForce3 250Gb MCP 00E4 + nForce4 MCP 0052 ++ nForce4 MCP-04 0034 + + This driver supports the 2 SMBuses that are included in the MCP of the + nForce2/3/4 chipsets. +@@ -257,6 +258,7 @@ static struct pci_device_id nforce2_ids[ + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3S_SMBUS) }, + { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE4_SMBUS) }, ++ { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SMBUS) }, + { 0 } + }; + +--- gregkh-2.6.orig/Documentation/i2c/busses/i2c-nforce2 ++++ gregkh-2.6/Documentation/i2c/busses/i2c-nforce2 +@@ -5,7 +5,8 @@ Supported adapters: + * nForce2 Ultra 400 MCP 10de:0084 + * nForce3 Pro150 MCP 10de:00D4 + * nForce3 250Gb MCP 10de:00E4 +- * nForce4 MCP 10de:0052 ++ * nForce4 MCP 10de:0052 ++ * nForce4 MCP-04 10de:0034 + + Datasheet: not publically available, but seems to be similar to the + AMD-8111 SMBus 2.0 adapter. +--- gregkh-2.6.orig/include/linux/pci_ids.h ++++ gregkh-2.6/include/linux/pci_ids.h +@@ -971,6 +971,7 @@ + #define PCI_DEVICE_ID_NVIDIA_TNT_UNKNOWN 0x002a + #define PCI_DEVICE_ID_NVIDIA_VTNT2 0x002C + #define PCI_DEVICE_ID_NVIDIA_UVTNT2 0x002D ++#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SMBUS 0x0034 + #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE 0x0035 + #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA 0x0036 + #define PCI_DEVICE_ID_NVIDIA_NVENET_10 0x0037 diff --git a/i2c/i2c-update-command-documentation.patch b/i2c/i2c-update-command-documentation.patch new file mode 100644 index 0000000000000..bd66ba7535d75 --- /dev/null +++ b/i2c/i2c-update-command-documentation.patch @@ -0,0 +1,40 @@ +From khali@linux-fr.org Sun Dec 18 07:53:21 2005 +Date: Sun, 18 Dec 2005 16:51:55 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Subject: [PATCH 07/11] i2c: update i2c_driver.command documentation +Message-Id: <20051218165155.7d51c135.khali@linux-fr.org> +Content-Disposition: inline; filename=i2c-update-command-documentation.patch + +Document i2c_driver.command as being deprecated, and don't suggest an +empty implementation of this callback as it doesn't make any sense. + +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + Documentation/i2c/writing-clients | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +--- gregkh-2.6.orig/Documentation/i2c/writing-clients ++++ gregkh-2.6/Documentation/i2c/writing-clients +@@ -492,17 +492,13 @@ Note that some functions are marked by ` + by `__init_data'. Hose functions and structures can be removed after + kernel booting (or module loading) is completed. + ++ + Command function + ================ + + A generic ioctl-like function call back is supported. You will seldom +-need this. You may even set it to NULL. +- +- /* No commands defined */ +- int foo_command(struct i2c_client *client, unsigned int cmd, void *arg) +- { +- return 0; +- } ++need this, and its use is deprecated anyway, so newer design should not ++use it. Set it to NULL. + + + Sending and receiving |