diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2005-11-28 14:51:52 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-11-28 14:51:52 -0800 |
commit | ea3ff351d2b6afdfff71b7fe59efce2f9d9fa30f (patch) | |
tree | 22c394201cdc8ee6ac7cdcbffcf6d8d277364d2d /i2c | |
parent | 6679fbe6bdbce2f3cf532e354bbc8398d9b6672a (diff) | |
download | patches-ea3ff351d2b6afdfff71b7fe59efce2f9d9fa30f.tar.gz |
i2c patches
Diffstat (limited to 'i2c')
-rw-r--r-- | i2c/hwmon-lm85-adt7463-vrm-10.patch | 124 | ||||
-rw-r--r-- | i2c/hwmon-vt8231-new-driver.patch | 934 | ||||
-rw-r--r-- | i2c/hwmon-w83627thf-fix-vrm-and-vid.patch | 70 | ||||
-rw-r--r-- | i2c/hwmon-w83627thf-vid-documentation-update.patch | 47 | ||||
-rw-r--r-- | i2c/i2c-drop-driver-flags-01-df-dummy.patch | 48 | ||||
-rw-r--r-- | i2c/i2c-drop-driver-flags-02-df-notify.patch | 1044 | ||||
-rw-r--r-- | i2c/i2c-drop-driver-flags-03-flags.patch | 36 | ||||
-rw-r--r-- | i2c/i2c-parport-barco-ltp-dvi.patch | 57 | ||||
-rw-r--r-- | i2c/i2c-rtc8564-remove-duplicate-bcd-macros.patch | 92 |
9 files changed, 2452 insertions, 0 deletions
diff --git a/i2c/hwmon-lm85-adt7463-vrm-10.patch b/i2c/hwmon-lm85-adt7463-vrm-10.patch new file mode 100644 index 0000000000000..92e87c9ef322b --- /dev/null +++ b/i2c/hwmon-lm85-adt7463-vrm-10.patch @@ -0,0 +1,124 @@ +From khali@linux-fr.org Sat Nov 26 19:23:43 2005 +Date: Sat, 26 Nov 2005 20:07:54 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Cc: Paul Aviles <paul.aviles@palei.com> +Subject: [PATCH 01/25] hwmon: Support the VRM 10 mode of the ADT7463 +Message-Id: <20051126200754.51c8df83.khali@linux-fr.org> +Content-Disposition: inline; filename=hwmon-lm85-adt7463-vrm-10.patch + +Support the VRM 10 mode of the ADT7463. + +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/hwmon/lm85.c | 44 ++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 36 insertions(+), 8 deletions(-) + +--- gregkh-2.6.orig/drivers/hwmon/lm85.c ++++ gregkh-2.6/drivers/hwmon/lm85.c +@@ -443,7 +443,17 @@ show_fan_offset(4); + static ssize_t show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf) + { + struct lm85_data *data = lm85_update_device(dev); +- return sprintf(buf, "%ld\n", (long) vid_from_reg(data->vid, data->vrm)); ++ int vid; ++ ++ if (data->type == adt7463 && (data->vid & 0x80)) { ++ /* 6-pin VID (VRM 10) */ ++ vid = vid_from_reg(data->vid & 0x3f, data->vrm); ++ } else { ++ /* 5-pin VID (VRM 9) */ ++ vid = vid_from_reg(data->vid & 0x1f, data->vrm); ++ } ++ ++ return sprintf(buf, "%d\n", vid); + } + + static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL); +@@ -1176,17 +1186,14 @@ static int lm85_detect(struct i2c_adapte + device_create_file(&new_client->dev, &dev_attr_in1_input); + device_create_file(&new_client->dev, &dev_attr_in2_input); + device_create_file(&new_client->dev, &dev_attr_in3_input); +- device_create_file(&new_client->dev, &dev_attr_in4_input); + device_create_file(&new_client->dev, &dev_attr_in0_min); + device_create_file(&new_client->dev, &dev_attr_in1_min); + device_create_file(&new_client->dev, &dev_attr_in2_min); + device_create_file(&new_client->dev, &dev_attr_in3_min); +- device_create_file(&new_client->dev, &dev_attr_in4_min); + device_create_file(&new_client->dev, &dev_attr_in0_max); + device_create_file(&new_client->dev, &dev_attr_in1_max); + device_create_file(&new_client->dev, &dev_attr_in2_max); + device_create_file(&new_client->dev, &dev_attr_in3_max); +- device_create_file(&new_client->dev, &dev_attr_in4_max); + 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); +@@ -1224,6 +1231,15 @@ static int lm85_detect(struct i2c_adapte + device_create_file(&new_client->dev, &dev_attr_temp2_auto_temp_crit); + device_create_file(&new_client->dev, &dev_attr_temp3_auto_temp_crit); + ++ /* The ADT7463 has an optional VRM 10 mode where pin 21 is used ++ as a sixth digital VID input rather than an analog input. */ ++ data->vid = lm85_read_value(new_client, LM85_REG_VID); ++ if (!(kind == adt7463 && (data->vid & 0x80))) { ++ device_create_file(&new_client->dev, &dev_attr_in4_input); ++ device_create_file(&new_client->dev, &dev_attr_in4_min); ++ device_create_file(&new_client->dev, &dev_attr_in4_max); ++ } ++ + return 0; + + /* Error out and cleanup code */ +@@ -1382,11 +1398,18 @@ static struct lm85_data *lm85_update_dev + irrelevant. So it is left in 4*/ + data->adc_scale = (data->type == emc6d102 ) ? 16 : 4; + +- for (i = 0; i <= 4; ++i) { ++ data->vid = lm85_read_value(client, LM85_REG_VID); ++ ++ for (i = 0; i <= 3; ++i) { + data->in[i] = + lm85_read_value(client, LM85_REG_IN(i)); + } + ++ if (!(data->type == adt7463 && (data->vid & 0x80))) { ++ data->in[4] = lm85_read_value(client, ++ LM85_REG_IN(4)); ++ } ++ + for (i = 0; i <= 3; ++i) { + data->fan[i] = + lm85_read_value(client, LM85_REG_FAN(i)); +@@ -1450,13 +1473,20 @@ static struct lm85_data *lm85_update_dev + /* Things that don't change often */ + dev_dbg(&client->dev, "Reading config values\n"); + +- for (i = 0; i <= 4; ++i) { ++ for (i = 0; i <= 3; ++i) { + data->in_min[i] = + lm85_read_value(client, LM85_REG_IN_MIN(i)); + data->in_max[i] = + lm85_read_value(client, LM85_REG_IN_MAX(i)); + } + ++ if (!(data->type == adt7463 && (data->vid & 0x80))) { ++ data->in_min[4] = lm85_read_value(client, ++ LM85_REG_IN_MIN(4)); ++ data->in_max[4] = lm85_read_value(client, ++ LM85_REG_IN_MAX(4)); ++ } ++ + if ( data->type == emc6d100 ) { + for (i = 5; i <= 7; ++i) { + data->in_min[i] = +@@ -1478,8 +1508,6 @@ static struct lm85_data *lm85_update_dev + lm85_read_value(client, LM85_REG_TEMP_MAX(i)); + } + +- data->vid = lm85_read_value(client, LM85_REG_VID); +- + for (i = 0; i <= 2; ++i) { + int val ; + data->autofan[i].config = diff --git a/i2c/hwmon-vt8231-new-driver.patch b/i2c/hwmon-vt8231-new-driver.patch new file mode 100644 index 0000000000000..4b357ca73e5b3 --- /dev/null +++ b/i2c/hwmon-vt8231-new-driver.patch @@ -0,0 +1,934 @@ +From khali@linux-fr.org Sat Nov 26 19:23:59 2005 +Date: Sat, 26 Nov 2005 20:20:05 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Cc: Roger Lucas <roger@planbit.co.uk> +Subject: [PATCH 06/25] hwmon: New vt8231 driver +Message-Id: <20051126202005.047e16c8.khali@linux-fr.org> +Content-Disposition: inline; filename=hwmon-vt8231-new-driver.patch + +From: Roger Lucas <roger@planbit.co.uk> + +Port the vt8231 hardware monitoring driver from lm_sensors CVS to +Linux 2.6. + +Signed-off-by: Roger Lucas <roger@planbit.co.uk> +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + MAINTAINERS | 6 + drivers/hwmon/Kconfig | 12 + drivers/hwmon/Makefile | 1 + drivers/hwmon/vt8231.c | 861 +++++++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 880 insertions(+) + +--- gregkh-2.6.orig/drivers/hwmon/Kconfig ++++ gregkh-2.6/drivers/hwmon/Kconfig +@@ -350,6 +350,18 @@ config SENSORS_VIA686A + This driver can also be built as a module. If so, the module + will be called via686a. + ++config SENSORS_VT8231 ++ tristate "VT8231" ++ depends on HWMON && I2C && PCI && EXPERIMENTAL ++ select HWMON_VID ++ select I2C_ISA ++ help ++ If you say yes here then you get support for the integrated sensors ++ in the VIA VT8231 device. ++ ++ This driver can also be built as a module. If so, the module ++ will be called vt8231. ++ + config SENSORS_W83781D + tristate "Winbond W83781D, W83782D, W83783S, W83627HF, Asus AS99127F" + depends on HWMON && I2C +--- gregkh-2.6.orig/drivers/hwmon/Makefile ++++ gregkh-2.6/drivers/hwmon/Makefile +@@ -40,6 +40,7 @@ obj-$(CONFIG_SENSORS_SIS5595) += sis5595 + obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o + obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o + obj-$(CONFIG_SENSORS_VIA686A) += via686a.o ++obj-$(CONFIG_SENSORS_VT8231) += vt8231.o + obj-$(CONFIG_SENSORS_W83627EHF) += w83627ehf.o + obj-$(CONFIG_SENSORS_W83L785TS) += w83l785ts.o + +--- /dev/null ++++ gregkh-2.6/drivers/hwmon/vt8231.c +@@ -0,0 +1,861 @@ ++/* ++ vt8231.c - Part of lm_sensors, Linux kernel modules ++ for hardware monitoring ++ ++ Copyright (c) 2005 Roger Lucas <roger@planbit.co.uk> ++ Copyright (c) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com> ++ Aaron M. Marsh <amarsh@sdf.lonestar.org> ++ ++ 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 ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++*/ ++ ++/* Supports VIA VT8231 South Bridge embedded sensors ++*/ ++ ++#include <linux/module.h> ++#include <linux/init.h> ++#include <linux/slab.h> ++#include <linux/pci.h> ++#include <linux/jiffies.h> ++#include <linux/i2c.h> ++#include <linux/i2c-isa.h> ++#include <linux/hwmon.h> ++#include <linux/hwmon-sysfs.h> ++#include <linux/hwmon-vid.h> ++#include <linux/err.h> ++#include <asm/io.h> ++ ++static int force_addr; ++module_param(force_addr, int, 0); ++MODULE_PARM_DESC(force_addr, "Initialize the base address of the sensors"); ++ ++/* Device address ++ Note that we can't determine the ISA address until we have initialized ++ our module */ ++static unsigned short isa_address; ++ ++#define VT8231_EXTENT 0x80 ++#define VT8231_BASE_REG 0x70 ++#define VT8231_ENABLE_REG 0x74 ++ ++/* The VT8231 registers ++ ++ The reset value for the input channel configuration is used (Reg 0x4A=0x07) ++ which sets the selected inputs marked with '*' below if multiple options are ++ possible: ++ ++ Voltage Mode Temperature Mode ++ Sensor Linux Id Linux Id VIA Id ++ -------- -------- -------- ------ ++ CPU Diode N/A temp1 0 ++ UIC1 in0 temp2 * 1 ++ UIC2 in1 * temp3 2 ++ UIC3 in2 * temp4 3 ++ UIC4 in3 * temp5 4 ++ UIC5 in4 * temp6 5 ++ 3.3V in5 N/A ++ ++ Note that the BIOS may set the configuration register to a different value ++ to match the motherboard configuration. ++*/ ++ ++/* fans numbered 0-1 */ ++#define VT8231_REG_FAN_MIN(nr) (0x3b + (nr)) ++#define VT8231_REG_FAN(nr) (0x29 + (nr)) ++ ++/* Voltage inputs numbered 0-5 */ ++ ++static const u8 regvolt[] = { 0x21, 0x22, 0x23, 0x24, 0x25, 0x26 }; ++static const u8 regvoltmax[] = { 0x3d, 0x2b, 0x2d, 0x2f, 0x31, 0x33 }; ++static const u8 regvoltmin[] = { 0x3e, 0x2c, 0x2e, 0x30, 0x32, 0x34 }; ++ ++/* Temperatures are numbered 1-6 according to the Linux kernel specification. ++** ++** In the VIA datasheet, however, the temperatures are numbered from zero. ++** Since it is important that this driver can easily be compared to the VIA ++** datasheet, we will use the VIA numbering within this driver and map the ++** kernel sysfs device name to the VIA number in the sysfs callback. ++*/ ++ ++#define VT8231_REG_TEMP_LOW01 0x49 ++#define VT8231_REG_TEMP_LOW25 0x4d ++ ++static const u8 regtemp[] = { 0x1f, 0x21, 0x22, 0x23, 0x24, 0x25 }; ++static const u8 regtempmax[] = { 0x39, 0x3d, 0x2b, 0x2d, 0x2f, 0x31 }; ++static const u8 regtempmin[] = { 0x3a, 0x3e, 0x2c, 0x2e, 0x30, 0x32 }; ++ ++#define TEMP_FROM_REG(reg) (((253 * 4 - (reg)) * 550 + 105) / 210) ++#define TEMP_MAXMIN_FROM_REG(reg) (((253 - (reg)) * 2200 + 105) / 210) ++#define TEMP_MAXMIN_TO_REG(val) (253 - ((val) * 210 + 1100) / 2200) ++ ++#define VT8231_REG_CONFIG 0x40 ++#define VT8231_REG_ALARM1 0x41 ++#define VT8231_REG_ALARM2 0x42 ++#define VT8231_REG_FANDIV 0x47 ++#define VT8231_REG_UCH_CONFIG 0x4a ++#define VT8231_REG_TEMP1_CONFIG 0x4b ++#define VT8231_REG_TEMP2_CONFIG 0x4c ++ ++/* temps 0-5 as numbered in VIA datasheet - see later for mapping to Linux ++** numbering ++*/ ++#define ISTEMP(i, ch_config) ((i) == 0 ? 1 : \ ++ ((ch_config) >> ((i)+1)) & 0x01) ++/* voltages 0-5 */ ++#define ISVOLT(i, ch_config) ((i) == 5 ? 1 : \ ++ !(((ch_config) >> ((i)+2)) & 0x01)) ++ ++#define DIV_FROM_REG(val) (1 << (val)) ++ ++/* NB The values returned here are NOT temperatures. The calibration curves ++** for the thermistor curves are board-specific and must go in the ++** sensors.conf file. Temperature sensors are actually ten bits, but the ++** VIA datasheet only considers the 8 MSBs obtained from the regtemp[] ++** register. The temperature value returned should have a magnitude of 3, ++** so we use the VIA scaling as the "true" scaling and use the remaining 2 ++** LSBs as fractional precision. ++** ++** All the on-chip hardware temperature comparisons for the alarms are only ++** 8-bits wide, and compare against the 8 MSBs of the temperature. The bits ++** in the registers VT8231_REG_TEMP_LOW01 and VT8231_REG_TEMP_LOW25 are ++** ignored. ++*/ ++ ++/******** FAN RPM CONVERSIONS ******** ++** This chip saturates back at 0, not at 255 like many the other chips. ++** So, 0 means 0 RPM ++*/ ++static inline u8 FAN_TO_REG(long rpm, int div) ++{ ++ if (rpm == 0) ++ return 0; ++ return SENSORS_LIMIT(1310720 / (rpm * div), 1, 255); ++} ++ ++#define FAN_FROM_REG(val, div) ((val) == 0 ? 0 : 1310720 / ((val) * (div))) ++ ++struct vt8231_data { ++ struct i2c_client client; ++ struct semaphore update_lock; ++ struct class_device *class_dev; ++ char valid; /* !=0 if following fields are valid */ ++ unsigned long last_updated; /* In jiffies */ ++ ++ u8 in[6]; /* Register value */ ++ u8 in_max[6]; /* Register value */ ++ u8 in_min[6]; /* Register value */ ++ u16 temp[6]; /* Register value 10 bit, right aligned */ ++ u8 temp_max[6]; /* Register value */ ++ u8 temp_min[6]; /* Register value */ ++ u8 fan[2]; /* Register value */ ++ u8 fan_min[2]; /* Register value */ ++ u8 fan_div[2]; /* Register encoding, shifted right */ ++ u16 alarms; /* Register encoding */ ++ u8 uch_config; ++}; ++ ++static struct pci_dev *s_bridge; ++static int vt8231_detect(struct i2c_adapter *adapter); ++static int vt8231_detach_client(struct i2c_client *client); ++static struct vt8231_data *vt8231_update_device(struct device *dev); ++static void vt8231_init_client(struct i2c_client *client); ++ ++static inline int vt8231_read_value(struct i2c_client *client, u8 reg) ++{ ++ return inb_p(client->addr + reg); ++} ++ ++static inline void vt8231_write_value(struct i2c_client *client, u8 reg, ++ u8 value) ++{ ++ outb_p(value, client->addr + reg); ++} ++ ++/* following are the sysfs callback functions */ ++static ssize_t show_in(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; ++ struct vt8231_data *data = vt8231_update_device(dev); ++ ++ return sprintf(buf, "%d\n", ((data->in[nr] - 3) * 10000) / 958); ++} ++ ++static ssize_t show_in_min(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; ++ struct vt8231_data *data = vt8231_update_device(dev); ++ ++ return sprintf(buf, "%d\n", ((data->in_min[nr] - 3) * 10000) / 958); ++} ++ ++static ssize_t show_in_max(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; ++ struct vt8231_data *data = vt8231_update_device(dev); ++ ++ return sprintf(buf, "%d\n", (((data->in_max[nr] - 3) * 10000) / 958)); ++} ++ ++static ssize_t set_in_min(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; ++ struct i2c_client *client = to_i2c_client(dev); ++ struct vt8231_data *data = i2c_get_clientdata(client); ++ unsigned long val = simple_strtoul(buf, NULL, 10); ++ ++ down(&data->update_lock); ++ data->in_min[nr] = SENSORS_LIMIT(((val * 958) / 10000) + 3, 0, 255); ++ vt8231_write_value(client, regvoltmin[nr], data->in_min[nr]); ++ up(&data->update_lock); ++ return count; ++} ++ ++static ssize_t set_in_max(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; ++ struct i2c_client *client = to_i2c_client(dev); ++ struct vt8231_data *data = i2c_get_clientdata(client); ++ unsigned long val = simple_strtoul(buf, NULL, 10); ++ ++ down(&data->update_lock); ++ data->in_max[nr] = SENSORS_LIMIT(((val * 958) / 10000) + 3, 0, 255); ++ vt8231_write_value(client, regvoltmax[nr], data->in_max[nr]); ++ up(&data->update_lock); ++ return count; ++} ++ ++/* Special case for input 5 as this has 3.3V scaling built into the chip */ ++static ssize_t show_in5(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct vt8231_data *data = vt8231_update_device(dev); ++ ++ return sprintf(buf, "%d\n", ++ (((data->in[5] - 3) * 10000 * 54) / (958 * 34))); ++} ++ ++static ssize_t show_in5_min(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct vt8231_data *data = vt8231_update_device(dev); ++ ++ return sprintf(buf, "%d\n", ++ (((data->in_min[5] - 3) * 10000 * 54) / (958 * 34))); ++} ++ ++static ssize_t show_in5_max(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct vt8231_data *data = vt8231_update_device(dev); ++ ++ return sprintf(buf, "%d\n", ++ (((data->in_max[5] - 3) * 10000 * 54) / (958 * 34))); ++} ++ ++static ssize_t set_in5_min(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct vt8231_data *data = i2c_get_clientdata(client); ++ unsigned long val = simple_strtoul(buf, NULL, 10); ++ ++ down(&data->update_lock); ++ data->in_min[5] = SENSORS_LIMIT(((val * 958 * 34) / (10000 * 54)) + 3, ++ 0, 255); ++ vt8231_write_value(client, regvoltmin[5], data->in_min[5]); ++ up(&data->update_lock); ++ return count; ++} ++ ++static ssize_t set_in5_max(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct vt8231_data *data = i2c_get_clientdata(client); ++ unsigned long val = simple_strtoul(buf, NULL, 10); ++ ++ down(&data->update_lock); ++ data->in_max[5] = SENSORS_LIMIT(((val * 958 * 34) / (10000 * 54)) + 3, ++ 0, 255); ++ vt8231_write_value(client, regvoltmax[5], data->in_max[5]); ++ up(&data->update_lock); ++ return count; ++} ++ ++#define define_voltage_sysfs(offset) \ ++static SENSOR_DEVICE_ATTR(in##offset##_input, S_IRUGO, \ ++ show_in, NULL, offset); \ ++static SENSOR_DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \ ++ show_in_min, set_in_min, offset); \ ++static SENSOR_DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \ ++ show_in_max, set_in_max, offset) ++ ++define_voltage_sysfs(0); ++define_voltage_sysfs(1); ++define_voltage_sysfs(2); ++define_voltage_sysfs(3); ++define_voltage_sysfs(4); ++ ++static DEVICE_ATTR(in5_input, S_IRUGO, show_in5, NULL); ++static DEVICE_ATTR(in5_min, S_IRUGO | S_IWUSR, show_in5_min, set_in5_min); ++static DEVICE_ATTR(in5_max, S_IRUGO | S_IWUSR, show_in5_max, set_in5_max); ++ ++/* Temperatures */ ++static ssize_t show_temp0(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct vt8231_data *data = vt8231_update_device(dev); ++ return sprintf(buf, "%d\n", data->temp[0] * 250); ++} ++ ++static ssize_t show_temp0_max(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct vt8231_data *data = vt8231_update_device(dev); ++ return sprintf(buf, "%d\n", data->temp_max[0] * 1000); ++} ++ ++static ssize_t show_temp0_min(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct vt8231_data *data = vt8231_update_device(dev); ++ return sprintf(buf, "%d\n", data->temp_min[0] * 1000); ++} ++ ++static ssize_t set_temp0_max(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct vt8231_data *data = i2c_get_clientdata(client); ++ int val = simple_strtol(buf, NULL, 10); ++ ++ down(&data->update_lock); ++ data->temp_max[0] = SENSORS_LIMIT((val + 500) / 1000, 0, 255); ++ vt8231_write_value(client, regtempmax[0], data->temp_max[0]); ++ up(&data->update_lock); ++ return count; ++} ++static ssize_t set_temp0_min(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct vt8231_data *data = i2c_get_clientdata(client); ++ int val = simple_strtol(buf, NULL, 10); ++ ++ down(&data->update_lock); ++ data->temp_min[0] = SENSORS_LIMIT((val + 500) / 1000, 0, 255); ++ vt8231_write_value(client, regtempmin[0], data->temp_min[0]); ++ up(&data->update_lock); ++ return count; ++} ++ ++static ssize_t show_temp(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; ++ struct vt8231_data *data = vt8231_update_device(dev); ++ return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[nr])); ++} ++ ++static ssize_t show_temp_max(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; ++ struct vt8231_data *data = vt8231_update_device(dev); ++ return sprintf(buf, "%d\n", TEMP_MAXMIN_FROM_REG(data->temp_max[nr])); ++} ++ ++static ssize_t show_temp_min(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; ++ struct vt8231_data *data = vt8231_update_device(dev); ++ return sprintf(buf, "%d\n", TEMP_MAXMIN_FROM_REG(data->temp_min[nr])); ++} ++ ++static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; ++ struct i2c_client *client = to_i2c_client(dev); ++ struct vt8231_data *data = i2c_get_clientdata(client); ++ int val = simple_strtol(buf, NULL, 10); ++ ++ down(&data->update_lock); ++ data->temp_max[nr] = SENSORS_LIMIT(TEMP_MAXMIN_TO_REG(val), 0, 255); ++ vt8231_write_value(client, regtempmax[nr], data->temp_max[nr]); ++ up(&data->update_lock); ++ return count; ++} ++static ssize_t set_temp_min(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; ++ struct i2c_client *client = to_i2c_client(dev); ++ struct vt8231_data *data = i2c_get_clientdata(client); ++ int val = simple_strtol(buf, NULL, 10); ++ ++ down(&data->update_lock); ++ data->temp_min[nr] = SENSORS_LIMIT(TEMP_MAXMIN_TO_REG(val), 0, 255); ++ vt8231_write_value(client, regtempmin[nr], data->temp_min[nr]); ++ up(&data->update_lock); ++ return count; ++} ++ ++/* Note that these map the Linux temperature sensor numbering (1-6) to the VIA ++** temperature sensor numbering (0-5) ++*/ ++#define define_temperature_sysfs(offset) \ ++static SENSOR_DEVICE_ATTR(temp##offset##_input, S_IRUGO, \ ++ 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, \ ++ 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); ++ ++define_temperature_sysfs(2); ++define_temperature_sysfs(3); ++define_temperature_sysfs(4); ++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.dev_attr } ++#define CFG_INFO_VOLT(id) { &sensor_dev_attr_in##id##_input.dev_attr, \ ++ &sensor_dev_attr_in##id##_min.dev_attr, \ ++ &sensor_dev_attr_in##id##_max.dev_attr } ++ ++struct str_device_attr_table { ++ struct device_attribute *input; ++ struct device_attribute *min; ++ struct device_attribute *max; ++}; ++ ++static struct str_device_attr_table cfg_info_temp[] = { ++ { &dev_attr_temp1_input, &dev_attr_temp1_min, &dev_attr_temp1_max }, ++ CFG_INFO_TEMP(2), ++ CFG_INFO_TEMP(3), ++ CFG_INFO_TEMP(4), ++ CFG_INFO_TEMP(5), ++ CFG_INFO_TEMP(6) ++}; ++ ++static struct str_device_attr_table cfg_info_volt[] = { ++ CFG_INFO_VOLT(0), ++ CFG_INFO_VOLT(1), ++ CFG_INFO_VOLT(2), ++ CFG_INFO_VOLT(3), ++ CFG_INFO_VOLT(4), ++ { &dev_attr_in5_input, &dev_attr_in5_min, &dev_attr_in5_max } ++}; ++ ++/* Fans */ ++static ssize_t show_fan(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; ++ struct vt8231_data *data = vt8231_update_device(dev); ++ return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[nr], ++ DIV_FROM_REG(data->fan_div[nr]))); ++} ++ ++static ssize_t show_fan_min(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; ++ struct vt8231_data *data = vt8231_update_device(dev); ++ return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan_min[nr], ++ DIV_FROM_REG(data->fan_div[nr]))); ++} ++ ++static ssize_t show_fan_div(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; ++ struct vt8231_data *data = vt8231_update_device(dev); ++ return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[nr])); ++} ++ ++static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); ++ int nr = sensor_attr->index; ++ struct i2c_client *client = to_i2c_client(dev); ++ struct vt8231_data *data = i2c_get_clientdata(client); ++ int val = simple_strtoul(buf, NULL, 10); ++ ++ down(&data->update_lock); ++ data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); ++ vt8231_write_value(client, VT8231_REG_FAN_MIN(nr), data->fan_min[nr]); ++ up(&data->update_lock); ++ return count; ++} ++ ++static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct vt8231_data *data = i2c_get_clientdata(client); ++ struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); ++ unsigned long val = simple_strtoul(buf, NULL, 10); ++ int nr = sensor_attr->index; ++ int old = vt8231_read_value(client, VT8231_REG_FANDIV); ++ long min = FAN_FROM_REG(data->fan_min[nr], ++ DIV_FROM_REG(data->fan_div[nr])); ++ ++ down(&data->update_lock); ++ switch (val) { ++ case 1: data->fan_div[nr] = 0; break; ++ case 2: data->fan_div[nr] = 1; break; ++ case 4: data->fan_div[nr] = 2; break; ++ case 8: data->fan_div[nr] = 3; break; ++ default: ++ dev_err(&client->dev, "fan_div value %ld not supported." ++ "Choose one of 1, 2, 4 or 8!\n", val); ++ up(&data->update_lock); ++ return -EINVAL; ++ } ++ ++ /* Correct the fan minimum speed */ ++ data->fan_min[nr] = FAN_TO_REG(min, DIV_FROM_REG(data->fan_div[nr])); ++ vt8231_write_value(client, VT8231_REG_FAN_MIN(nr), data->fan_min[nr]); ++ ++ old = (old & 0x0f) | (data->fan_div[1] << 6) | (data->fan_div[0] << 4); ++ vt8231_write_value(client, VT8231_REG_FANDIV, old); ++ up(&data->update_lock); ++ return count; ++} ++ ++ ++#define define_fan_sysfs(offset) \ ++static SENSOR_DEVICE_ATTR(fan##offset##_input, S_IRUGO, \ ++ show_fan, NULL, offset - 1); \ ++static SENSOR_DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \ ++ show_fan_div, set_fan_div, offset - 1); \ ++static SENSOR_DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ ++ show_fan_min, set_fan_min, offset - 1) ++ ++define_fan_sysfs(1); ++define_fan_sysfs(2); ++ ++/* Alarms */ ++static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ struct vt8231_data *data = vt8231_update_device(dev); ++ return sprintf(buf, "%d\n", data->alarms); ++} ++ ++static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); ++ ++static struct i2c_driver vt8231_driver = { ++ .owner = THIS_MODULE, ++ .name = "vt8231", ++ .attach_adapter = vt8231_detect, ++ .detach_client = vt8231_detach_client, ++}; ++ ++static struct pci_device_id vt8231_pci_ids[] = { ++ { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231_4) }, ++ { 0, } ++}; ++ ++MODULE_DEVICE_TABLE(pci, vt8231_pci_ids); ++ ++static int __devinit vt8231_pci_probe(struct pci_dev *dev, ++ const struct pci_device_id *id); ++ ++static struct pci_driver vt8231_pci_driver = { ++ .name = "vt8231", ++ .id_table = vt8231_pci_ids, ++ .probe = vt8231_pci_probe, ++}; ++ ++int vt8231_detect(struct i2c_adapter *adapter) ++{ ++ struct i2c_client *client; ++ struct vt8231_data *data; ++ int err = 0, i; ++ u16 val; ++ ++ /* 8231 requires multiple of 256 */ ++ if (force_addr) { ++ isa_address = force_addr & 0xFF00; ++ dev_warn(&adapter->dev, "forcing ISA address 0x%04X\n", ++ isa_address); ++ if (PCIBIOS_SUCCESSFUL != pci_write_config_word(s_bridge, ++ VT8231_BASE_REG, isa_address)) ++ return -ENODEV; ++ } ++ ++ if (PCIBIOS_SUCCESSFUL != ++ pci_read_config_word(s_bridge, VT8231_ENABLE_REG, &val)) ++ return -ENODEV; ++ ++ if (!(val & 0x0001)) { ++ dev_warn(&adapter->dev, "enabling sensors\n"); ++ if (PCIBIOS_SUCCESSFUL != ++ pci_write_config_word(s_bridge, VT8231_ENABLE_REG, ++ val | 0x0001)) ++ return -ENODEV; ++ } ++ ++ /* Reserve the ISA region */ ++ if (!request_region(isa_address, VT8231_EXTENT, ++ vt8231_pci_driver.name)) { ++ dev_err(&adapter->dev, "region 0x%x already in use!\n", ++ isa_address); ++ return -ENODEV; ++ } ++ ++ if (!(data = kzalloc(sizeof(struct vt8231_data), GFP_KERNEL))) { ++ err = -ENOMEM; ++ goto exit_release; ++ } ++ ++ client = &data->client; ++ i2c_set_clientdata(client, data); ++ client->addr = isa_address; ++ client->adapter = adapter; ++ client->driver = &vt8231_driver; ++ client->dev.parent = &adapter->dev; ++ ++ /* Fill in the remaining client fields and put into the global list */ ++ strlcpy(client->name, "vt8231", I2C_NAME_SIZE); ++ ++ init_MUTEX(&data->update_lock); ++ ++ /* Tell the I2C layer a new client has arrived */ ++ if ((err = i2c_attach_client(client))) ++ goto exit_free; ++ ++ vt8231_init_client(client); ++ ++ /* Register sysfs hooks */ ++ data->class_dev = hwmon_device_register(&client->dev); ++ if (IS_ERR(data->class_dev)) { ++ err = PTR_ERR(data->class_dev); ++ goto exit_detach; ++ } ++ ++ /* Must update device information to find out the config field */ ++ data->uch_config = vt8231_read_value(client, VT8231_REG_UCH_CONFIG); ++ ++ for (i = 0; i < ARRAY_SIZE(cfg_info_temp); i++) { ++ if (ISTEMP(i, data->uch_config)) { ++ device_create_file(&client->dev, ++ cfg_info_temp[i].input); ++ device_create_file(&client->dev, cfg_info_temp[i].max); ++ device_create_file(&client->dev, cfg_info_temp[i].min); ++ } ++ } ++ ++ for (i = 0; i < ARRAY_SIZE(cfg_info_volt); i++) { ++ if (ISVOLT(i, data->uch_config)) { ++ device_create_file(&client->dev, ++ cfg_info_volt[i].input); ++ device_create_file(&client->dev, cfg_info_volt[i].max); ++ device_create_file(&client->dev, cfg_info_volt[i].min); ++ } ++ } ++ ++ device_create_file(&client->dev, &sensor_dev_attr_fan1_input.dev_attr); ++ device_create_file(&client->dev, &sensor_dev_attr_fan2_input.dev_attr); ++ device_create_file(&client->dev, &sensor_dev_attr_fan1_min.dev_attr); ++ device_create_file(&client->dev, &sensor_dev_attr_fan2_min.dev_attr); ++ device_create_file(&client->dev, &sensor_dev_attr_fan1_div.dev_attr); ++ device_create_file(&client->dev, &sensor_dev_attr_fan2_div.dev_attr); ++ ++ device_create_file(&client->dev, &dev_attr_alarms); ++ return 0; ++ ++exit_detach: ++ i2c_detach_client(client); ++exit_free: ++ kfree(data); ++exit_release: ++ release_region(isa_address, VT8231_EXTENT); ++ return err; ++} ++ ++static int vt8231_detach_client(struct i2c_client *client) ++{ ++ struct vt8231_data *data = i2c_get_clientdata(client); ++ int err; ++ ++ hwmon_device_unregister(data->class_dev); ++ ++ if ((err = i2c_detach_client(client))) { ++ return err; ++ } ++ ++ release_region(client->addr, VT8231_EXTENT); ++ kfree(data); ++ ++ return 0; ++} ++ ++static void vt8231_init_client(struct i2c_client *client) ++{ ++ vt8231_write_value(client, VT8231_REG_TEMP1_CONFIG, 0); ++ vt8231_write_value(client, VT8231_REG_TEMP2_CONFIG, 0); ++} ++ ++static struct vt8231_data *vt8231_update_device(struct device *dev) ++{ ++ struct i2c_client *client = to_i2c_client(dev); ++ struct vt8231_data *data = i2c_get_clientdata(client); ++ int i; ++ u16 low; ++ ++ down(&data->update_lock); ++ ++ if (time_after(jiffies, data->last_updated + HZ + HZ / 2) ++ || !data->valid) { ++ for (i = 0; i < 6; i++) { ++ if (ISVOLT(i, data->uch_config)) { ++ data->in[i] = vt8231_read_value(client, ++ regvolt[i]); ++ data->in_min[i] = vt8231_read_value(client, ++ regvoltmin[i]); ++ data->in_max[i] = vt8231_read_value(client, ++ regvoltmax[i]); ++ } ++ } ++ for (i = 0; i < 2; i++) { ++ data->fan[i] = vt8231_read_value(client, ++ VT8231_REG_FAN(i)); ++ data->fan_min[i] = vt8231_read_value(client, ++ VT8231_REG_FAN_MIN(i)); ++ } ++ ++ low = vt8231_read_value(client, VT8231_REG_TEMP_LOW01); ++ low = (low >> 6) | ((low & 0x30) >> 2) ++ | (vt8231_read_value(client, VT8231_REG_TEMP_LOW25) << 4); ++ for (i = 0; i < 6; i++) { ++ if (ISTEMP(i, data->uch_config)) { ++ data->temp[i] = (vt8231_read_value(client, ++ regtemp[i]) << 2) ++ | ((low >> (2 * i)) & 0x03); ++ data->temp_max[i] = vt8231_read_value(client, ++ regtempmax[i]); ++ data->temp_min[i] = vt8231_read_value(client, ++ regtempmin[i]); ++ } ++ } ++ ++ i = vt8231_read_value(client, VT8231_REG_FANDIV); ++ data->fan_div[0] = (i >> 4) & 0x03; ++ data->fan_div[1] = i >> 6; ++ data->alarms = vt8231_read_value(client, VT8231_REG_ALARM1) | ++ (vt8231_read_value(client, VT8231_REG_ALARM2) << 8); ++ ++ /* Set alarm flags correctly */ ++ if (!data->fan[0] && data->fan_min[0]) { ++ data->alarms |= 0x40; ++ } else if (data->fan[0] && !data->fan_min[0]) { ++ data->alarms &= ~0x40; ++ } ++ ++ if (!data->fan[1] && data->fan_min[1]) { ++ data->alarms |= 0x80; ++ } else if (data->fan[1] && !data->fan_min[1]) { ++ data->alarms &= ~0x80; ++ } ++ ++ data->last_updated = jiffies; ++ data->valid = 1; ++ } ++ ++ up(&data->update_lock); ++ ++ return data; ++} ++ ++static int __devinit vt8231_pci_probe(struct pci_dev *dev, ++ const struct pci_device_id *id) ++{ ++ u16 val; ++ ++ if (PCIBIOS_SUCCESSFUL != pci_read_config_word(dev, VT8231_BASE_REG, ++ &val)) ++ return -ENODEV; ++ ++ isa_address = val & ~(VT8231_EXTENT - 1); ++ if (isa_address == 0 && force_addr == 0) { ++ dev_err(&dev->dev, "base address not set -\ ++ upgrade BIOS or use force_addr=0xaddr\n"); ++ return -ENODEV; ++ } ++ ++ s_bridge = pci_dev_get(dev); ++ ++ if (i2c_isa_add_driver(&vt8231_driver)) { ++ pci_dev_put(s_bridge); ++ s_bridge = NULL; ++ } ++ ++ /* Always return failure here. This is to allow other drivers to bind ++ * to this pci device. We don't really want to have control over the ++ * pci device, we only wanted to read as few register values from it. ++ */ ++ return -ENODEV; ++} ++ ++static int __init sm_vt8231_init(void) ++{ ++ return pci_module_init(&vt8231_pci_driver); ++} ++ ++static void __exit sm_vt8231_exit(void) ++{ ++ pci_unregister_driver(&vt8231_pci_driver); ++ if (s_bridge != NULL) { ++ i2c_isa_del_driver(&vt8231_driver); ++ pci_dev_put(s_bridge); ++ s_bridge = NULL; ++ } ++} ++ ++MODULE_AUTHOR("Roger Lucas <roger@planbit.co.uk>"); ++MODULE_DESCRIPTION("VT8231 sensors"); ++MODULE_LICENSE("GPL"); ++ ++module_init(sm_vt8231_init); ++module_exit(sm_vt8231_exit); +--- gregkh-2.6.orig/MAINTAINERS ++++ gregkh-2.6/MAINTAINERS +@@ -2894,6 +2894,12 @@ L: video4linux-list@redhat.com + W: http://linuxtv.org + S: Maintained + ++VT8231 HARDWARE MONITOR DRIVER ++P: Roger Lucas ++M: roger@planbit.co.uk ++L: lm-sensors@lm-sensors.org ++S: Maintained ++ + W1 DALLAS'S 1-WIRE BUS + P: Evgeniy Polyakov + M: johnpol@2ka.mipt.ru diff --git a/i2c/hwmon-w83627thf-fix-vrm-and-vid.patch b/i2c/hwmon-w83627thf-fix-vrm-and-vid.patch new file mode 100644 index 0000000000000..26c3d71976a59 --- /dev/null +++ b/i2c/hwmon-w83627thf-fix-vrm-and-vid.patch @@ -0,0 +1,70 @@ +From khali@linux-fr.org Sat Nov 26 19:23:50 2005 +Date: Sat, 26 Nov 2005 20:13:18 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Cc: LM Sensors <lm-sensors@lm-sensors.org>, Yuan Mu <ymu@winbond.com.tw> +Subject: [PATCH 03/25] hwmon: W83627THF VID fixes +Message-Id: <20051126201318.0c86d9d3.khali@linux-fr.org> +Content-Disposition: inline; filename=hwmon-w83627thf-fix-vrm-and-vid.patch + +From: Yuan Mu <ymu@winbond.com.tw> + +This patch fixes the VID reading; no cpu0_vid and vrm files created if +the chip is w83627thf and GPIO5 not enabled. + +Signed-off-by: Yuan Mu <ymu@winbond.com.tw> +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + drivers/hwmon/w83627hf.c | 16 +++++++--------- + 1 file changed, 7 insertions(+), 9 deletions(-) + +--- gregkh-2.6.orig/drivers/hwmon/w83627hf.c ++++ gregkh-2.6/drivers/hwmon/w83627hf.c +@@ -1122,11 +1122,10 @@ static int w83627hf_detect(struct i2c_ad + if (kind != w83697hf) + device_create_file_temp(new_client, 3); + +- if (kind != w83697hf) ++ if (kind != w83697hf && data->vid != 0xff) { + device_create_file_vid(new_client); +- +- if (kind != w83697hf) + device_create_file_vrm(new_client); ++ } + + device_create_file_fan_div(new_client, 1); + device_create_file_fan_div(new_client, 2); +@@ -1232,7 +1231,7 @@ static int w83627thf_read_gpio5(struct i + + /* Make sure the pins are configured for input + There must be at least five (VRM 9), and possibly 6 (VRM 10) */ +- sel = superio_inb(W83627THF_GPIO5_IOSR); ++ sel = superio_inb(W83627THF_GPIO5_IOSR) & 0x3f; + if ((sel & 0x1f) != 0x1f) { + dev_dbg(&client->dev, "GPIO5 not configured for VID " + "function\n"); +@@ -1323,19 +1322,18 @@ static void w83627hf_init_client(struct + int hi = w83627hf_read_value(client, W83781D_REG_CHIPID); + data->vid = (lo & 0x0f) | ((hi & 0x01) << 4); + } else if (w83627thf == data->type) { +- data->vid = w83627thf_read_gpio5(client) & 0x3f; ++ data->vid = w83627thf_read_gpio5(client); + } + + /* Read VRM & OVT Config only once */ + if (w83627thf == data->type || w83637hf == data->type) { + data->vrm_ovt = + w83627hf_read_value(client, W83627THF_REG_VRM_OVT_CFG); +- data->vrm = (data->vrm_ovt & 0x01) ? 90 : 82; +- } else { +- /* Convert VID to voltage based on default VRM */ +- data->vrm = vid_which_vrm(); + } + ++ /* Convert VID to voltage based on VRM */ ++ data->vrm = vid_which_vrm(); ++ + tmp = w83627hf_read_value(client, W83781D_REG_SCFG1); + for (i = 1; i <= 3; i++) { + if (!(tmp & BIT_SCFG1[i - 1])) { diff --git a/i2c/hwmon-w83627thf-vid-documentation-update.patch b/i2c/hwmon-w83627thf-vid-documentation-update.patch new file mode 100644 index 0000000000000..b0ea981654758 --- /dev/null +++ b/i2c/hwmon-w83627thf-vid-documentation-update.patch @@ -0,0 +1,47 @@ +From khali@linux-fr.org Sat Nov 26 19:23:48 2005 +Date: Sat, 26 Nov 2005 20:10:56 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> +Subject: [PATCH 02/25] hwmon: Clarify the W83627THF VID documentation +Message-Id: <20051126201056.18f3a2fe.khali@linux-fr.org> +Content-Disposition: inline; filename=hwmon-w83627thf-vid-documentation-update.patch + +From: "Mark M. Hoffman" <mhoffman@lightlink.com> + +This patch clarifies the W83627THF VID documentation. + +Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com> +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + Documentation/hwmon/w83627hf | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +--- gregkh-2.6.orig/Documentation/hwmon/w83627hf ++++ gregkh-2.6/Documentation/hwmon/w83627hf +@@ -54,13 +54,16 @@ If you really want i2c accesses for thes + use the w83781d driver. However this is not the preferred method + now that this ISA driver has been developed. + +-Technically, the w83627thf does not support a VID reading. However, it's +-possible or even likely that your mainboard maker has routed these signals +-to a specific set of general purpose IO pins (the Asus P4C800-E is one such +-board). The w83627thf driver now interprets these as VID. If the VID on +-your board doesn't work, first see doc/vid in the lm_sensors package. If +-that still doesn't help, email us at lm-sensors@lm-sensors.org. ++The w83627_HF_ uses pins 110-106 as VID0-VID4. The w83627_THF_ uses the ++same pins as GPIO[0:4]. Technically, the w83627_THF_ does not support a ++VID reading. However the two chips have the identical 128 pin package. So, ++it is possible or even likely for a w83627thf to have the VID signals routed ++to these pins despite their not being labeled for that purpose. Therefore, ++the w83627thf driver interprets these as VID. If the VID on your board ++doesn't work, first see doc/vid in the lm_sensors package[1]. If that still ++doesn't help, you may just ignore the bogus VID reading with no harm done. + +-For further information on this driver see the w83781d driver +-documentation. ++For further information on this driver see the w83781d driver documentation. ++ ++[1] http://www2.lm-sensors.nu/~lm78/cvs/browse.cgi/lm_sensors2/doc/vid + diff --git a/i2c/i2c-drop-driver-flags-01-df-dummy.patch b/i2c/i2c-drop-driver-flags-01-df-dummy.patch new file mode 100644 index 0000000000000..4f1aa11c469ee --- /dev/null +++ b/i2c/i2c-drop-driver-flags-01-df-dummy.patch @@ -0,0 +1,48 @@ +From khali@linux-fr.org Sat Nov 26 19:24:08 2005 +Date: Sat, 26 Nov 2005 20:24:59 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Cc: Mauro Carvalho Chehab <mchehab@brturbo.com.br> +Subject: [PATCH 07/25] i2c: Drop i2c_driver.flags, 1 of 3 +Message-Id: <20051126202459.080d3091.khali@linux-fr.org> +Content-Disposition: inline; filename=i2c-drop-driver-flags-01-df-dummy.patch + +The I2C_DF_DUMMY flag is gone since 2.5.70, it's about time to +drop all ifdef'd out references thereto. + +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + drivers/media/video/tvmixer.c | 4 ---- + include/linux/i2c.h | 5 ----- + 2 files changed, 9 deletions(-) + +--- gregkh-2.6.orig/drivers/media/video/tvmixer.c ++++ gregkh-2.6/drivers/media/video/tvmixer.c +@@ -232,12 +232,8 @@ static struct i2c_driver driver = { + #endif + .name = "tv card mixer driver", + .id = I2C_DRIVERID_TVMIXER, +-#ifdef I2C_DF_DUMMY +- .flags = I2C_DF_DUMMY, +-#else + .flags = I2C_DF_NOTIFY, + .detach_adapter = tvmixer_adapters, +-#endif + .attach_adapter = tvmixer_adapters, + .detach_client = tvmixer_clients, + }; +--- gregkh-2.6.orig/include/linux/i2c.h ++++ gregkh-2.6/include/linux/i2c.h +@@ -252,11 +252,6 @@ static inline void i2c_set_adapdata (str + + /*flags for the driver struct: */ + #define I2C_DF_NOTIFY 0x01 /* notify on bus (de/a)ttaches */ +-#if 0 +-/* this flag is gone -- there is a (optional) driver->detach_adapter +- * callback now which can be used instead */ +-# define I2C_DF_DUMMY 0x02 +-#endif + + /*flags for the client struct: */ + #define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */ diff --git a/i2c/i2c-drop-driver-flags-02-df-notify.patch b/i2c/i2c-drop-driver-flags-02-df-notify.patch new file mode 100644 index 0000000000000..16b1c9a30ecd0 --- /dev/null +++ b/i2c/i2c-drop-driver-flags-02-df-notify.patch @@ -0,0 +1,1044 @@ +From khali@linux-fr.org Sat Nov 26 19:24:10 2005 +Date: Sat, 26 Nov 2005 20:28:06 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Cc: Mauro Carvalho Chehab <mchehab@brturbo.com.br> +Subject: [PATCH 08/25] i2c: Drop i2c_driver.flags, 2 of 3 +Message-Id: <20051126202806.57c55d7c.khali@linux-fr.org> +Content-Disposition: inline; filename=i2c-drop-driver-flags-02-df-notify.patch + +Just about every i2c chip driver sets the I2C_DF_NOTIFY flag, so we +can simply make it the default and drop the flag. If any driver really +doesn't want to be notified when i2c adapters are added, that driver +can simply omit to set .attach_adapter. This approach is also more +robust as it prevents accidental NULL pointer dereferences. + +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + Documentation/i2c/porting-clients | 3 +++ + Documentation/i2c/writing-clients | 5 ----- + arch/arm/mach-pxa/akita-ioexp.c | 1 - + drivers/acorn/char/pcf8583.c | 1 - + drivers/hwmon/adm1021.c | 1 - + drivers/hwmon/adm1025.c | 1 - + drivers/hwmon/adm1026.c | 1 - + drivers/hwmon/adm1031.c | 1 - + drivers/hwmon/adm9240.c | 1 - + drivers/hwmon/asb100.c | 1 - + drivers/hwmon/atxp1.c | 1 - + drivers/hwmon/ds1621.c | 1 - + drivers/hwmon/fscher.c | 1 - + drivers/hwmon/fscpos.c | 1 - + drivers/hwmon/gl518sm.c | 1 - + drivers/hwmon/gl520sm.c | 1 - + drivers/hwmon/it87.c | 1 - + drivers/hwmon/lm63.c | 1 - + drivers/hwmon/lm75.c | 1 - + drivers/hwmon/lm77.c | 1 - + drivers/hwmon/lm78.c | 1 - + drivers/hwmon/lm80.c | 1 - + drivers/hwmon/lm83.c | 1 - + drivers/hwmon/lm85.c | 1 - + drivers/hwmon/lm87.c | 1 - + drivers/hwmon/lm90.c | 1 - + drivers/hwmon/lm92.c | 1 - + drivers/hwmon/max1619.c | 1 - + drivers/hwmon/w83781d.c | 1 - + drivers/hwmon/w83792d.c | 1 - + drivers/hwmon/w83l785ts.c | 1 - + drivers/i2c/chips/ds1337.c | 1 - + drivers/i2c/chips/ds1374.c | 1 - + drivers/i2c/chips/eeprom.c | 1 - + drivers/i2c/chips/isp1301_omap.c | 1 - + drivers/i2c/chips/m41t00.c | 1 - + drivers/i2c/chips/max6875.c | 1 - + drivers/i2c/chips/pca9539.c | 1 - + drivers/i2c/chips/pcf8574.c | 1 - + drivers/i2c/chips/pcf8591.c | 1 - + drivers/i2c/chips/rtc8564.c | 1 - + drivers/i2c/chips/tps65010.c | 1 - + drivers/i2c/chips/x1205.c | 1 - + drivers/i2c/i2c-core.c | 4 ++-- + drivers/i2c/i2c-dev.c | 1 - + drivers/macintosh/therm_adt746x.c | 1 - + drivers/macintosh/therm_pm72.c | 1 - + drivers/macintosh/therm_windtunnel.c | 1 - + drivers/macintosh/windfarm_lm75_sensor.c | 1 - + drivers/media/video/adv7170.c | 1 - + drivers/media/video/adv7175.c | 1 - + drivers/media/video/bt819.c | 1 - + drivers/media/video/bt832.c | 1 - + drivers/media/video/bt856.c | 1 - + drivers/media/video/cs53l32a.c | 1 - + drivers/media/video/cx25840/cx25840-core.c | 1 - + drivers/media/video/indycam.c | 1 - + drivers/media/video/ir-kbd-i2c.c | 1 - + drivers/media/video/msp3400.c | 1 - + drivers/media/video/ovcamchip/ovcamchip_core.c | 1 - + drivers/media/video/saa5246a.c | 1 - + drivers/media/video/saa5249.c | 1 - + drivers/media/video/saa6588.c | 1 - + drivers/media/video/saa7110.c | 1 - + drivers/media/video/saa7111.c | 1 - + drivers/media/video/saa7114.c | 1 - + drivers/media/video/saa7115.c | 1 - + drivers/media/video/saa711x.c | 1 - + drivers/media/video/saa7127.c | 1 - + drivers/media/video/saa7134/saa6752hs.c | 1 - + drivers/media/video/saa7185.c | 1 - + drivers/media/video/saa7191.c | 1 - + drivers/media/video/tda7432.c | 1 - + drivers/media/video/tda9840.c | 1 - + drivers/media/video/tda9875.c | 1 - + drivers/media/video/tda9887.c | 1 - + drivers/media/video/tea6415c.c | 1 - + drivers/media/video/tea6420.c | 1 - + drivers/media/video/tuner-3036.c | 1 - + drivers/media/video/tuner-core.c | 1 - + drivers/media/video/tvaudio.c | 1 - + drivers/media/video/tveeprom.c | 1 - + drivers/media/video/tvmixer.c | 1 - + drivers/media/video/tvp5150.c | 1 - + drivers/media/video/vpx3220.c | 1 - + drivers/media/video/wm8775.c | 1 - + drivers/video/matrox/matroxfb_maven.c | 1 - + include/linux/i2c.h | 1 - + sound/oss/dmasound/dac3550a.c | 1 - + sound/oss/dmasound/tas_common.c | 1 - + sound/ppc/keywest.c | 1 - + 91 files changed, 5 insertions(+), 95 deletions(-) + +--- gregkh-2.6.orig/Documentation/i2c/porting-clients ++++ gregkh-2.6/Documentation/i2c/porting-clients +@@ -109,6 +109,9 @@ Technical changes: + there is a MODULE_LICENSE() line, at the bottom of the file + (after MODULE_AUTHOR() and MODULE_DESCRIPTION(), in this order). + ++* [Driver] The flags field of the i2c_driver structure is gone. ++ I2C_DF_NOTIFY is now the default behavior. ++ + Coding policy: + + * [Copyright] Use (C), not (c), for copyright. +--- gregkh-2.6.orig/Documentation/i2c/writing-clients ++++ gregkh-2.6/Documentation/i2c/writing-clients +@@ -27,7 +27,6 @@ address. + static struct i2c_driver foo_driver = { + .owner = THIS_MODULE, + .name = "Foo version 2.3 driver", +- .flags = I2C_DF_NOTIFY, + .attach_adapter = &foo_attach_adapter, + .detach_client = &foo_detach_client, + .command = &foo_command /* may be NULL */ +@@ -36,10 +35,6 @@ static struct i2c_driver foo_driver = { + The name field must match the driver name, including the case. It must not + contain spaces, and may be up to 31 characters long. + +-Don't worry about the flags field; just put I2C_DF_NOTIFY into it. This +-means that your driver will be notified when new adapters are found. +-This is almost always what you want. +- + All other fields are for call-back functions which will be explained + below. + +--- gregkh-2.6.orig/arch/arm/mach-pxa/akita-ioexp.c ++++ gregkh-2.6/arch/arm/mach-pxa/akita-ioexp.c +@@ -127,7 +127,6 @@ static struct i2c_driver max7310_i2c_dri + .owner = THIS_MODULE, + .name = "akita-max7310", + .id = I2C_DRIVERID_AKITAIOEXP, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = max7310_attach_adapter, + .detach_client = max7310_detach_client, + }; +--- gregkh-2.6.orig/drivers/acorn/char/pcf8583.c ++++ gregkh-2.6/drivers/acorn/char/pcf8583.c +@@ -259,7 +259,6 @@ pcf8583_command(struct i2c_client *clien + static struct i2c_driver pcf8583_driver = { + .name = "PCF8583", + .id = I2C_DRIVERID_PCF8583, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = pcf8583_probe, + .detach_client = pcf8583_detach, + .command = pcf8583_command +--- gregkh-2.6.orig/drivers/hwmon/adm1021.c ++++ gregkh-2.6/drivers/hwmon/adm1021.c +@@ -129,7 +129,6 @@ static struct i2c_driver adm1021_driver + .owner = THIS_MODULE, + .name = "adm1021", + .id = I2C_DRIVERID_ADM1021, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = adm1021_attach_adapter, + .detach_client = adm1021_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/adm1025.c ++++ gregkh-2.6/drivers/hwmon/adm1025.c +@@ -121,7 +121,6 @@ static struct i2c_driver adm1025_driver + .owner = THIS_MODULE, + .name = "adm1025", + .id = I2C_DRIVERID_ADM1025, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = adm1025_attach_adapter, + .detach_client = adm1025_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/adm1026.c ++++ gregkh-2.6/drivers/hwmon/adm1026.c +@@ -310,7 +310,6 @@ static void adm1026_init_client(struct i + static struct i2c_driver adm1026_driver = { + .owner = THIS_MODULE, + .name = "adm1026", +- .flags = I2C_DF_NOTIFY, + .attach_adapter = adm1026_attach_adapter, + .detach_client = adm1026_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/adm1031.c ++++ gregkh-2.6/drivers/hwmon/adm1031.c +@@ -107,7 +107,6 @@ static struct adm1031_data *adm1031_upda + static struct i2c_driver adm1031_driver = { + .owner = THIS_MODULE, + .name = "adm1031", +- .flags = I2C_DF_NOTIFY, + .attach_adapter = adm1031_attach_adapter, + .detach_client = adm1031_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/adm9240.c ++++ gregkh-2.6/drivers/hwmon/adm9240.c +@@ -140,7 +140,6 @@ static struct i2c_driver adm9240_driver + .owner = THIS_MODULE, + .name = "adm9240", + .id = I2C_DRIVERID_ADM9240, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = adm9240_attach_adapter, + .detach_client = adm9240_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/asb100.c ++++ gregkh-2.6/drivers/hwmon/asb100.c +@@ -220,7 +220,6 @@ static struct i2c_driver asb100_driver = + .owner = THIS_MODULE, + .name = "asb100", + .id = I2C_DRIVERID_ASB100, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = asb100_attach_adapter, + .detach_client = asb100_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/atxp1.c ++++ gregkh-2.6/drivers/hwmon/atxp1.c +@@ -52,7 +52,6 @@ static int atxp1_detect(struct i2c_adapt + static struct i2c_driver atxp1_driver = { + .owner = THIS_MODULE, + .name = "atxp1", +- .flags = I2C_DF_NOTIFY, + .attach_adapter = atxp1_attach_adapter, + .detach_client = atxp1_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/ds1621.c ++++ gregkh-2.6/drivers/hwmon/ds1621.c +@@ -92,7 +92,6 @@ static struct i2c_driver ds1621_driver = + .owner = THIS_MODULE, + .name = "ds1621", + .id = I2C_DRIVERID_DS1621, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = ds1621_attach_adapter, + .detach_client = ds1621_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/fscher.c ++++ gregkh-2.6/drivers/hwmon/fscher.c +@@ -121,7 +121,6 @@ static struct i2c_driver fscher_driver = + .owner = THIS_MODULE, + .name = "fscher", + .id = I2C_DRIVERID_FSCHER, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = fscher_attach_adapter, + .detach_client = fscher_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/fscpos.c ++++ gregkh-2.6/drivers/hwmon/fscpos.c +@@ -103,7 +103,6 @@ static struct i2c_driver fscpos_driver = + .owner = THIS_MODULE, + .name = "fscpos", + .id = I2C_DRIVERID_FSCPOS, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = fscpos_attach_adapter, + .detach_client = fscpos_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/gl518sm.c ++++ gregkh-2.6/drivers/hwmon/gl518sm.c +@@ -154,7 +154,6 @@ static struct i2c_driver gl518_driver = + .owner = THIS_MODULE, + .name = "gl518sm", + .id = I2C_DRIVERID_GL518, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = gl518_attach_adapter, + .detach_client = gl518_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/gl520sm.c ++++ gregkh-2.6/drivers/hwmon/gl520sm.c +@@ -112,7 +112,6 @@ static struct i2c_driver gl520_driver = + .owner = THIS_MODULE, + .name = "gl520sm", + .id = I2C_DRIVERID_GL520, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = gl520_attach_adapter, + .detach_client = gl520_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/it87.c ++++ gregkh-2.6/drivers/hwmon/it87.c +@@ -237,7 +237,6 @@ static struct i2c_driver it87_driver = { + .owner = THIS_MODULE, + .name = "it87", + .id = I2C_DRIVERID_IT87, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = it87_attach_adapter, + .detach_client = it87_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/lm63.c ++++ gregkh-2.6/drivers/hwmon/lm63.c +@@ -141,7 +141,6 @@ static void lm63_init_client(struct i2c_ + static struct i2c_driver lm63_driver = { + .owner = THIS_MODULE, + .name = "lm63", +- .flags = I2C_DF_NOTIFY, + .attach_adapter = lm63_attach_adapter, + .detach_client = lm63_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/lm75.c ++++ gregkh-2.6/drivers/hwmon/lm75.c +@@ -82,7 +82,6 @@ static struct i2c_driver lm75_driver = { + .owner = THIS_MODULE, + .name = "lm75", + .id = I2C_DRIVERID_LM75, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = lm75_attach_adapter, + .detach_client = lm75_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/lm77.c ++++ gregkh-2.6/drivers/hwmon/lm77.c +@@ -76,7 +76,6 @@ static struct lm77_data *lm77_update_dev + static struct i2c_driver lm77_driver = { + .owner = THIS_MODULE, + .name = "lm77", +- .flags = I2C_DF_NOTIFY, + .attach_adapter = lm77_attach_adapter, + .detach_client = lm77_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/lm78.c ++++ gregkh-2.6/drivers/hwmon/lm78.c +@@ -167,7 +167,6 @@ static struct i2c_driver lm78_driver = { + .owner = THIS_MODULE, + .name = "lm78", + .id = I2C_DRIVERID_LM78, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = lm78_attach_adapter, + .detach_client = lm78_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/lm80.c ++++ gregkh-2.6/drivers/hwmon/lm80.c +@@ -146,7 +146,6 @@ static struct i2c_driver lm80_driver = { + .owner = THIS_MODULE, + .name = "lm80", + .id = I2C_DRIVERID_LM80, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = lm80_attach_adapter, + .detach_client = lm80_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/lm83.c ++++ gregkh-2.6/drivers/hwmon/lm83.c +@@ -127,7 +127,6 @@ static struct i2c_driver lm83_driver = { + .owner = THIS_MODULE, + .name = "lm83", + .id = I2C_DRIVERID_LM83, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = lm83_attach_adapter, + .detach_client = lm83_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/lm85.c ++++ gregkh-2.6/drivers/hwmon/lm85.c +@@ -383,7 +383,6 @@ static struct i2c_driver lm85_driver = { + .owner = THIS_MODULE, + .name = "lm85", + .id = I2C_DRIVERID_LM85, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = lm85_attach_adapter, + .detach_client = lm85_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/lm87.c ++++ gregkh-2.6/drivers/hwmon/lm87.c +@@ -164,7 +164,6 @@ static struct i2c_driver lm87_driver = { + .owner = THIS_MODULE, + .name = "lm87", + .id = I2C_DRIVERID_LM87, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = lm87_attach_adapter, + .detach_client = lm87_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/lm90.c ++++ gregkh-2.6/drivers/hwmon/lm90.c +@@ -189,7 +189,6 @@ static struct i2c_driver lm90_driver = { + .owner = THIS_MODULE, + .name = "lm90", + .id = I2C_DRIVERID_LM90, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = lm90_attach_adapter, + .detach_client = lm90_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/lm92.c ++++ gregkh-2.6/drivers/hwmon/lm92.c +@@ -413,7 +413,6 @@ static struct i2c_driver lm92_driver = { + .owner = THIS_MODULE, + .name = "lm92", + .id = I2C_DRIVERID_LM92, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = lm92_attach_adapter, + .detach_client = lm92_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/max1619.c ++++ gregkh-2.6/drivers/hwmon/max1619.c +@@ -92,7 +92,6 @@ static struct max1619_data *max1619_upda + static struct i2c_driver max1619_driver = { + .owner = THIS_MODULE, + .name = "max1619", +- .flags = I2C_DF_NOTIFY, + .attach_adapter = max1619_attach_adapter, + .detach_client = max1619_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/w83781d.c ++++ gregkh-2.6/drivers/hwmon/w83781d.c +@@ -272,7 +272,6 @@ static struct i2c_driver w83781d_driver + .owner = THIS_MODULE, + .name = "w83781d", + .id = I2C_DRIVERID_W83781D, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = w83781d_attach_adapter, + .detach_client = w83781d_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/w83792d.c ++++ gregkh-2.6/drivers/hwmon/w83792d.c +@@ -318,7 +318,6 @@ static void w83792d_init_client(struct i + static struct i2c_driver w83792d_driver = { + .owner = THIS_MODULE, + .name = "w83792d", +- .flags = I2C_DF_NOTIFY, + .attach_adapter = w83792d_attach_adapter, + .detach_client = w83792d_detach_client, + }; +--- gregkh-2.6.orig/drivers/hwmon/w83l785ts.c ++++ gregkh-2.6/drivers/hwmon/w83l785ts.c +@@ -95,7 +95,6 @@ static struct i2c_driver w83l785ts_drive + .owner = THIS_MODULE, + .name = "w83l785ts", + .id = I2C_DRIVERID_W83L785TS, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = w83l785ts_attach_adapter, + .detach_client = w83l785ts_detach_client, + }; +--- gregkh-2.6.orig/drivers/i2c/chips/ds1337.c ++++ gregkh-2.6/drivers/i2c/chips/ds1337.c +@@ -54,7 +54,6 @@ static int ds1337_command(struct i2c_cli + static struct i2c_driver ds1337_driver = { + .owner = THIS_MODULE, + .name = "ds1337", +- .flags = I2C_DF_NOTIFY, + .attach_adapter = ds1337_attach_adapter, + .detach_client = ds1337_detach_client, + .command = ds1337_command, +--- gregkh-2.6.orig/drivers/i2c/chips/ds1374.c ++++ gregkh-2.6/drivers/i2c/chips/ds1374.c +@@ -235,7 +235,6 @@ static struct i2c_driver ds1374_driver = + .owner = THIS_MODULE, + .name = DS1374_DRV_NAME, + .id = I2C_DRIVERID_DS1374, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = ds1374_attach, + .detach_client = ds1374_detach, + }; +--- gregkh-2.6.orig/drivers/i2c/chips/eeprom.c ++++ gregkh-2.6/drivers/i2c/chips/eeprom.c +@@ -71,7 +71,6 @@ static struct i2c_driver eeprom_driver = + .owner = THIS_MODULE, + .name = "eeprom", + .id = I2C_DRIVERID_EEPROM, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = eeprom_attach_adapter, + .detach_client = eeprom_detach_client, + }; +--- gregkh-2.6.orig/drivers/i2c/chips/isp1301_omap.c ++++ gregkh-2.6/drivers/i2c/chips/isp1301_omap.c +@@ -1636,7 +1636,6 @@ static struct i2c_driver isp1301_driver + .name = "isp1301_omap", + .id = 1301, /* FIXME "official", i2c-ids.h */ + .class = I2C_CLASS_HWMON, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = isp1301_scan_bus, + .detach_client = isp1301_detach_client, + }; +--- gregkh-2.6.orig/drivers/i2c/chips/m41t00.c ++++ gregkh-2.6/drivers/i2c/chips/m41t00.c +@@ -214,7 +214,6 @@ static struct i2c_driver m41t00_driver = + .owner = THIS_MODULE, + .name = M41T00_DRV_NAME, + .id = I2C_DRIVERID_STM41T00, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = m41t00_attach, + .detach_client = m41t00_detach, + }; +--- gregkh-2.6.orig/drivers/i2c/chips/max6875.c ++++ gregkh-2.6/drivers/i2c/chips/max6875.c +@@ -69,7 +69,6 @@ static int max6875_detach_client(struct + static struct i2c_driver max6875_driver = { + .owner = THIS_MODULE, + .name = "max6875", +- .flags = I2C_DF_NOTIFY, + .attach_adapter = max6875_attach_adapter, + .detach_client = max6875_detach_client, + }; +--- gregkh-2.6.orig/drivers/i2c/chips/pca9539.c ++++ gregkh-2.6/drivers/i2c/chips/pca9539.c +@@ -40,7 +40,6 @@ static int pca9539_detach_client(struct + static struct i2c_driver pca9539_driver = { + .owner = THIS_MODULE, + .name = "pca9539", +- .flags = I2C_DF_NOTIFY, + .attach_adapter = pca9539_attach_adapter, + .detach_client = pca9539_detach_client, + }; +--- gregkh-2.6.orig/drivers/i2c/chips/pcf8574.c ++++ gregkh-2.6/drivers/i2c/chips/pcf8574.c +@@ -68,7 +68,6 @@ static struct i2c_driver pcf8574_driver + .owner = THIS_MODULE, + .name = "pcf8574", + .id = I2C_DRIVERID_PCF8574, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = pcf8574_attach_adapter, + .detach_client = pcf8574_detach_client, + }; +--- gregkh-2.6.orig/drivers/i2c/chips/pcf8591.c ++++ gregkh-2.6/drivers/i2c/chips/pcf8591.c +@@ -91,7 +91,6 @@ static struct i2c_driver pcf8591_driver + .owner = THIS_MODULE, + .name = "pcf8591", + .id = I2C_DRIVERID_PCF8591, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = pcf8591_attach_adapter, + .detach_client = pcf8591_detach_client, + }; +--- gregkh-2.6.orig/drivers/i2c/chips/rtc8564.c ++++ gregkh-2.6/drivers/i2c/chips/rtc8564.c +@@ -362,7 +362,6 @@ static struct i2c_driver rtc8564_driver + .owner = THIS_MODULE, + .name = "RTC8564", + .id = I2C_DRIVERID_RTC8564, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = rtc8564_probe, + .detach_client = rtc8564_detach, + .command = rtc8564_command +--- gregkh-2.6.orig/drivers/i2c/chips/tps65010.c ++++ gregkh-2.6/drivers/i2c/chips/tps65010.c +@@ -639,7 +639,6 @@ static int __init tps65010_scan_bus(stru + static struct i2c_driver tps65010_driver = { + .owner = THIS_MODULE, + .name = "tps65010", +- .flags = I2C_DF_NOTIFY, + .attach_adapter = tps65010_scan_bus, + .detach_client = __exit_p(tps65010_detach_client), + }; +--- gregkh-2.6.orig/drivers/i2c/chips/x1205.c ++++ gregkh-2.6/drivers/i2c/chips/x1205.c +@@ -107,7 +107,6 @@ static int x1205_command(struct i2c_clie + static struct i2c_driver x1205_driver = { + .owner = THIS_MODULE, + .name = "x1205", +- .flags = I2C_DF_NOTIFY, + .attach_adapter = &x1205_attach, + .detach_client = &x1205_detach, + }; +--- gregkh-2.6.orig/drivers/i2c/i2c-core.c ++++ gregkh-2.6/drivers/i2c/i2c-core.c +@@ -197,7 +197,7 @@ int i2c_add_adapter(struct i2c_adapter * + /* inform drivers of new adapters */ + list_for_each(item,&drivers) { + driver = list_entry(item, struct i2c_driver, list); +- if (driver->flags & I2C_DF_NOTIFY) ++ if (driver->attach_adapter) + /* We ignore the return code; if it fails, too bad */ + driver->attach_adapter(adap); + } +@@ -309,7 +309,7 @@ int i2c_add_driver(struct i2c_driver *dr + pr_debug("i2c-core: driver [%s] registered\n", driver->name); + + /* now look for instances of driver on our adapters */ +- if (driver->flags & I2C_DF_NOTIFY) { ++ if (driver->attach_adapter) { + list_for_each(item,&adapters) { + adapter = list_entry(item, struct i2c_adapter, list); + driver->attach_adapter(adapter); +--- gregkh-2.6.orig/drivers/i2c/i2c-dev.c ++++ gregkh-2.6/drivers/i2c/i2c-dev.c +@@ -484,7 +484,6 @@ static struct i2c_driver i2cdev_driver = + .owner = THIS_MODULE, + .name = "dev_driver", + .id = I2C_DRIVERID_I2CDEV, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = i2cdev_attach_adapter, + .detach_adapter = i2cdev_detach_adapter, + .detach_client = i2cdev_detach_client, +--- gregkh-2.6.orig/drivers/macintosh/therm_adt746x.c ++++ gregkh-2.6/drivers/macintosh/therm_adt746x.c +@@ -173,7 +173,6 @@ detach_thermostat(struct i2c_adapter *ad + static struct i2c_driver thermostat_driver = { + .owner = THIS_MODULE, + .name = "therm_adt746x", +- .flags = I2C_DF_NOTIFY, + .attach_adapter = attach_thermostat, + .detach_adapter = detach_thermostat, + }; +--- gregkh-2.6.orig/drivers/macintosh/therm_pm72.c ++++ gregkh-2.6/drivers/macintosh/therm_pm72.c +@@ -285,7 +285,6 @@ static struct i2c_driver therm_pm72_driv + { + .owner = THIS_MODULE, + .name = "therm_pm72", +- .flags = I2C_DF_NOTIFY, + .attach_adapter = therm_pm72_attach, + .detach_adapter = therm_pm72_detach, + }; +--- gregkh-2.6.orig/drivers/macintosh/therm_windtunnel.c ++++ gregkh-2.6/drivers/macintosh/therm_windtunnel.c +@@ -357,7 +357,6 @@ static struct i2c_driver g4fan_driver = + .owner = THIS_MODULE, + .name = "therm_windtunnel", + .id = I2C_DRIVERID_G4FAN, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = do_attach, + .detach_client = do_detach, + }; +--- gregkh-2.6.orig/drivers/macintosh/windfarm_lm75_sensor.c ++++ gregkh-2.6/drivers/macintosh/windfarm_lm75_sensor.c +@@ -49,7 +49,6 @@ static int wf_lm75_detach(struct i2c_cli + static struct i2c_driver wf_lm75_driver = { + .owner = THIS_MODULE, + .name = "wf_lm75", +- .flags = I2C_DF_NOTIFY, + .attach_adapter = wf_lm75_attach, + .detach_client = wf_lm75_detach, + }; +--- gregkh-2.6.orig/drivers/media/video/adv7170.c ++++ gregkh-2.6/drivers/media/video/adv7170.c +@@ -502,7 +502,6 @@ static struct i2c_driver i2c_driver_adv7 + .name = "adv7170", /* name */ + + .id = I2C_DRIVERID_ADV7170, +- .flags = I2C_DF_NOTIFY, + + .attach_adapter = adv7170_attach_adapter, + .detach_client = adv7170_detach_client, +--- gregkh-2.6.orig/drivers/media/video/adv7175.c ++++ gregkh-2.6/drivers/media/video/adv7175.c +@@ -552,7 +552,6 @@ static struct i2c_driver i2c_driver_adv7 + .name = "adv7175", /* name */ + + .id = I2C_DRIVERID_ADV7175, +- .flags = I2C_DF_NOTIFY, + + .attach_adapter = adv7175_attach_adapter, + .detach_client = adv7175_detach_client, +--- gregkh-2.6.orig/drivers/media/video/bt819.c ++++ gregkh-2.6/drivers/media/video/bt819.c +@@ -627,7 +627,6 @@ static struct i2c_driver i2c_driver_bt81 + .name = "bt819", + + .id = I2C_DRIVERID_BT819, +- .flags = I2C_DF_NOTIFY, + + .attach_adapter = bt819_attach_adapter, + .detach_client = bt819_detach_client, +--- gregkh-2.6.orig/drivers/media/video/bt832.c ++++ gregkh-2.6/drivers/media/video/bt832.c +@@ -233,7 +233,6 @@ static struct i2c_driver driver = { + .owner = THIS_MODULE, + .name = "i2c bt832 driver", + .id = -1, /* FIXME */ +- .flags = I2C_DF_NOTIFY, + .attach_adapter = bt832_probe, + .detach_client = bt832_detach, + .command = bt832_command, +--- gregkh-2.6.orig/drivers/media/video/bt856.c ++++ gregkh-2.6/drivers/media/video/bt856.c +@@ -409,7 +409,6 @@ static struct i2c_driver i2c_driver_bt85 + .name = "bt856", + + .id = I2C_DRIVERID_BT856, +- .flags = I2C_DF_NOTIFY, + + .attach_adapter = bt856_attach_adapter, + .detach_client = bt856_detach_client, +--- gregkh-2.6.orig/drivers/media/video/cs53l32a.c ++++ gregkh-2.6/drivers/media/video/cs53l32a.c +@@ -218,7 +218,6 @@ static int cs53l32a_detach(struct i2c_cl + static struct i2c_driver i2c_driver = { + .name = "cs53l32a", + .id = I2C_DRIVERID_CS53L32A, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = cs53l32a_probe, + .detach_client = cs53l32a_detach, + .command = cs53l32a_command, +--- gregkh-2.6.orig/drivers/media/video/cx25840/cx25840-core.c ++++ gregkh-2.6/drivers/media/video/cx25840/cx25840-core.c +@@ -811,7 +811,6 @@ struct i2c_driver i2c_driver_cx25840 = { + .name = "cx25840", + + .id = I2C_DRIVERID_CX25840, +- .flags = I2C_DF_NOTIFY, + + .attach_adapter = cx25840_attach_adapter, + .detach_client = cx25840_detach_client, +--- gregkh-2.6.orig/drivers/media/video/indycam.c ++++ gregkh-2.6/drivers/media/video/indycam.c +@@ -454,7 +454,6 @@ static struct i2c_driver i2c_driver_indy + .owner = THIS_MODULE, + .name = "indycam", + .id = I2C_DRIVERID_INDYCAM, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = indycam_probe, + .detach_client = indycam_detach, + .command = indycam_command, +--- gregkh-2.6.orig/drivers/media/video/ir-kbd-i2c.c ++++ gregkh-2.6/drivers/media/video/ir-kbd-i2c.c +@@ -279,7 +279,6 @@ static int ir_probe(struct i2c_adapter * + static struct i2c_driver driver = { + .name = "ir remote kbd driver", + .id = I2C_DRIVERID_EXP3, /* FIXME */ +- .flags = I2C_DF_NOTIFY, + .attach_adapter = ir_probe, + .detach_client = ir_detach, + }; +--- gregkh-2.6.orig/drivers/media/video/msp3400.c ++++ gregkh-2.6/drivers/media/video/msp3400.c +@@ -1560,7 +1560,6 @@ static struct i2c_driver driver = { + .owner = THIS_MODULE, + .name = "msp3400", + .id = I2C_DRIVERID_MSP3400, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = msp_probe, + .detach_client = msp_detach, + .command = msp_command, +--- gregkh-2.6.orig/drivers/media/video/ovcamchip/ovcamchip_core.c ++++ gregkh-2.6/drivers/media/video/ovcamchip/ovcamchip_core.c +@@ -414,7 +414,6 @@ static struct i2c_driver driver = { + .name = "ovcamchip", + .id = I2C_DRIVERID_OVCAMCHIP, + .class = I2C_CLASS_CAM_DIGITAL, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = ovcamchip_attach, + .detach_client = ovcamchip_detach, + .command = ovcamchip_command, +--- gregkh-2.6.orig/drivers/media/video/saa5246a.c ++++ gregkh-2.6/drivers/media/video/saa5246a.c +@@ -166,7 +166,6 @@ static struct i2c_driver i2c_driver_vide + .owner = THIS_MODULE, + .name = IF_NAME, /* name */ + .id = I2C_DRIVERID_SAA5249, /* in i2c.h */ +- .flags = I2C_DF_NOTIFY, + .attach_adapter = saa5246a_probe, + .detach_client = saa5246a_detach, + .command = saa5246a_command +--- gregkh-2.6.orig/drivers/media/video/saa5249.c ++++ gregkh-2.6/drivers/media/video/saa5249.c +@@ -239,7 +239,6 @@ static struct i2c_driver i2c_driver_vide + .owner = THIS_MODULE, + .name = IF_NAME, /* name */ + .id = I2C_DRIVERID_SAA5249, /* in i2c.h */ +- .flags = I2C_DF_NOTIFY, + .attach_adapter = saa5249_probe, + .detach_client = saa5249_detach, + .command = saa5249_command +--- gregkh-2.6.orig/drivers/media/video/saa6588.c ++++ gregkh-2.6/drivers/media/video/saa6588.c +@@ -499,7 +499,6 @@ static struct i2c_driver driver = { + .owner = THIS_MODULE, + .name = "i2c saa6588 driver", + .id = -1, /* FIXME */ +- .flags = I2C_DF_NOTIFY, + .attach_adapter = saa6588_probe, + .detach_client = saa6588_detach, + .command = saa6588_command, +--- gregkh-2.6.orig/drivers/media/video/saa7110.c ++++ gregkh-2.6/drivers/media/video/saa7110.c +@@ -591,7 +591,6 @@ static struct i2c_driver i2c_driver_saa7 + .name = "saa7110", + + .id = I2C_DRIVERID_SAA7110, +- .flags = I2C_DF_NOTIFY, + + .attach_adapter = saa7110_attach_adapter, + .detach_client = saa7110_detach_client, +--- gregkh-2.6.orig/drivers/media/video/saa7111.c ++++ gregkh-2.6/drivers/media/video/saa7111.c +@@ -594,7 +594,6 @@ static struct i2c_driver i2c_driver_saa7 + .name = "saa7111", + + .id = I2C_DRIVERID_SAA7111A, +- .flags = I2C_DF_NOTIFY, + + .attach_adapter = saa7111_attach_adapter, + .detach_client = saa7111_detach_client, +--- gregkh-2.6.orig/drivers/media/video/saa7114.c ++++ gregkh-2.6/drivers/media/video/saa7114.c +@@ -1208,7 +1208,6 @@ static struct i2c_driver i2c_driver_saa7 + .name = "saa7114", + + .id = I2C_DRIVERID_SAA7114, +- .flags = I2C_DF_NOTIFY, + + .attach_adapter = saa7114_attach_adapter, + .detach_client = saa7114_detach_client, +--- gregkh-2.6.orig/drivers/media/video/saa7115.c ++++ gregkh-2.6/drivers/media/video/saa7115.c +@@ -1354,7 +1354,6 @@ static int saa7115_detach(struct i2c_cli + static struct i2c_driver i2c_driver_saa7115 = { + .name = "saa7115", + .id = I2C_DRIVERID_SAA711X, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = saa7115_probe, + .detach_client = saa7115_detach, + .command = saa7115_command, +--- gregkh-2.6.orig/drivers/media/video/saa711x.c ++++ gregkh-2.6/drivers/media/video/saa711x.c +@@ -569,7 +569,6 @@ static struct i2c_driver i2c_driver_saa7 + .name = "saa711x", + + .id = I2C_DRIVERID_SAA711X, +- .flags = I2C_DF_NOTIFY, + + .attach_adapter = saa711x_attach_adapter, + .detach_client = saa711x_detach_client, +--- gregkh-2.6.orig/drivers/media/video/saa7127.c ++++ gregkh-2.6/drivers/media/video/saa7127.c +@@ -821,7 +821,6 @@ static int saa7127_detach(struct i2c_cli + struct i2c_driver i2c_driver_saa7127 = { + .name = "saa7127", + .id = I2C_DRIVERID_SAA7127, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = saa7127_probe, + .detach_client = saa7127_detach, + .command = saa7127_command, +--- gregkh-2.6.orig/drivers/media/video/saa7134/saa6752hs.c ++++ gregkh-2.6/drivers/media/video/saa7134/saa6752hs.c +@@ -599,7 +599,6 @@ static struct i2c_driver driver = { + .owner = THIS_MODULE, + .name = "i2c saa6752hs MPEG encoder", + .id = I2C_DRIVERID_SAA6752HS, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = saa6752hs_probe, + .detach_client = saa6752hs_detach, + .command = saa6752hs_command, +--- gregkh-2.6.orig/drivers/media/video/saa7185.c ++++ gregkh-2.6/drivers/media/video/saa7185.c +@@ -491,7 +491,6 @@ static struct i2c_driver i2c_driver_saa7 + .name = "saa7185", /* name */ + + .id = I2C_DRIVERID_SAA7185B, +- .flags = I2C_DF_NOTIFY, + + .attach_adapter = saa7185_attach_adapter, + .detach_client = saa7185_detach_client, +--- gregkh-2.6.orig/drivers/media/video/saa7191.c ++++ gregkh-2.6/drivers/media/video/saa7191.c +@@ -791,7 +791,6 @@ static struct i2c_driver i2c_driver_saa7 + .owner = THIS_MODULE, + .name = "saa7191", + .id = I2C_DRIVERID_SAA7191, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = saa7191_probe, + .detach_client = saa7191_detach, + .command = saa7191_command +--- gregkh-2.6.orig/drivers/media/video/tda7432.c ++++ gregkh-2.6/drivers/media/video/tda7432.c +@@ -504,7 +504,6 @@ static struct i2c_driver driver = { + .owner = THIS_MODULE, + .name = "i2c tda7432 driver", + .id = I2C_DRIVERID_TDA7432, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = tda7432_probe, + .detach_client = tda7432_detach, + .command = tda7432_command, +--- gregkh-2.6.orig/drivers/media/video/tda9840.c ++++ gregkh-2.6/drivers/media/video/tda9840.c +@@ -224,7 +224,6 @@ static struct i2c_driver driver = { + .owner = THIS_MODULE, + .name = "tda9840", + .id = I2C_DRIVERID_TDA9840, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = attach, + .detach_client = detach, + .command = command, +--- gregkh-2.6.orig/drivers/media/video/tda9875.c ++++ gregkh-2.6/drivers/media/video/tda9875.c +@@ -375,7 +375,6 @@ static struct i2c_driver driver = { + .owner = THIS_MODULE, + .name = "i2c tda9875 driver", + .id = I2C_DRIVERID_TDA9875, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = tda9875_probe, + .detach_client = tda9875_detach, + .command = tda9875_command, +--- gregkh-2.6.orig/drivers/media/video/tda9887.c ++++ gregkh-2.6/drivers/media/video/tda9887.c +@@ -821,7 +821,6 @@ static struct i2c_driver driver = { + .owner = THIS_MODULE, + .name = "i2c tda9887 driver", + .id = -1, /* FIXME */ +- .flags = I2C_DF_NOTIFY, + .attach_adapter = tda9887_probe, + .detach_client = tda9887_detach, + .command = tda9887_command, +--- gregkh-2.6.orig/drivers/media/video/tea6415c.c ++++ gregkh-2.6/drivers/media/video/tea6415c.c +@@ -193,7 +193,6 @@ static struct i2c_driver driver = { + .owner = THIS_MODULE, + .name = "tea6415c", + .id = I2C_DRIVERID_TEA6415C, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = attach, + .detach_client = detach, + .command = command, +--- gregkh-2.6.orig/drivers/media/video/tea6420.c ++++ gregkh-2.6/drivers/media/video/tea6420.c +@@ -170,7 +170,6 @@ static struct i2c_driver driver = { + .owner = THIS_MODULE, + .name = "tea6420", + .id = I2C_DRIVERID_TEA6420, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = attach, + .detach_client = detach, + .command = command, +--- gregkh-2.6.orig/drivers/media/video/tuner-3036.c ++++ gregkh-2.6/drivers/media/video/tuner-3036.c +@@ -178,7 +178,6 @@ i2c_driver_tuner = + .owner = THIS_MODULE, + .name = "sab3036", + .id = I2C_DRIVERID_SAB3036, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = tuner_probe, + .detach_client = tuner_detach, + .command = tuner_command +--- gregkh-2.6.orig/drivers/media/video/tuner-core.c ++++ gregkh-2.6/drivers/media/video/tuner-core.c +@@ -745,7 +745,6 @@ static struct i2c_driver driver = { + .owner = THIS_MODULE, + .name = "tuner", + .id = I2C_DRIVERID_TUNER, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = tuner_probe, + .detach_client = tuner_detach, + .command = tuner_command, +--- gregkh-2.6.orig/drivers/media/video/tvaudio.c ++++ gregkh-2.6/drivers/media/video/tvaudio.c +@@ -1705,7 +1705,6 @@ static struct i2c_driver driver = { + .owner = THIS_MODULE, + .name = "generic i2c audio driver", + .id = I2C_DRIVERID_TVAUDIO, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = chip_probe, + .detach_client = chip_detach, + .command = chip_command, +--- gregkh-2.6.orig/drivers/media/video/tveeprom.c ++++ gregkh-2.6/drivers/media/video/tveeprom.c +@@ -739,7 +739,6 @@ static struct i2c_driver i2c_driver_tvee + .owner = THIS_MODULE, + .name = "tveeprom", + .id = I2C_DRIVERID_TVEEPROM, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = tveeprom_attach_adapter, + .detach_client = tveeprom_detach_client, + .command = tveeprom_command, +--- gregkh-2.6.orig/drivers/media/video/tvmixer.c ++++ gregkh-2.6/drivers/media/video/tvmixer.c +@@ -232,7 +232,6 @@ static struct i2c_driver driver = { + #endif + .name = "tv card mixer driver", + .id = I2C_DRIVERID_TVMIXER, +- .flags = I2C_DF_NOTIFY, + .detach_adapter = tvmixer_adapters, + .attach_adapter = tvmixer_adapters, + .detach_client = tvmixer_clients, +--- gregkh-2.6.orig/drivers/media/video/tvp5150.c ++++ gregkh-2.6/drivers/media/video/tvp5150.c +@@ -807,7 +807,6 @@ static struct i2c_driver driver = { + + /* FIXME */ + .id = I2C_DRIVERID_SAA7110, +- .flags = I2C_DF_NOTIFY, + + .attach_adapter = tvp5150_attach_adapter, + .detach_client = tvp5150_detach_client, +--- gregkh-2.6.orig/drivers/media/video/vpx3220.c ++++ gregkh-2.6/drivers/media/video/vpx3220.c +@@ -726,7 +726,6 @@ static struct i2c_driver vpx3220_i2c_dri + .name = "vpx3220", + + .id = I2C_DRIVERID_VPX3220, +- .flags = I2C_DF_NOTIFY, + + .attach_adapter = vpx3220_attach_adapter, + .detach_client = vpx3220_detach_client, +--- gregkh-2.6.orig/drivers/media/video/wm8775.c ++++ gregkh-2.6/drivers/media/video/wm8775.c +@@ -236,7 +236,6 @@ static struct i2c_driver i2c_driver = { + .name = "wm8775", + + .id = I2C_DRIVERID_WM8775, +- .flags = I2C_DF_NOTIFY, + + .attach_adapter = wm8775_probe, + .detach_client = wm8775_detach, +--- gregkh-2.6.orig/drivers/video/matrox/matroxfb_maven.c ++++ gregkh-2.6/drivers/video/matrox/matroxfb_maven.c +@@ -1296,7 +1296,6 @@ static struct i2c_driver maven_driver={ + .owner = THIS_MODULE, + .name = "maven", + .id = I2C_DRIVERID_MGATVO, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = maven_attach_adapter, + .detach_client = maven_detach_client, + .command = maven_command, +--- gregkh-2.6.orig/include/linux/i2c.h ++++ gregkh-2.6/include/linux/i2c.h +@@ -251,7 +251,6 @@ static inline void i2c_set_adapdata (str + } + + /*flags for the driver struct: */ +-#define I2C_DF_NOTIFY 0x01 /* notify on bus (de/a)ttaches */ + + /*flags for the client struct: */ + #define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */ +--- gregkh-2.6.orig/sound/oss/dmasound/dac3550a.c ++++ gregkh-2.6/sound/oss/dmasound/dac3550a.c +@@ -44,7 +44,6 @@ struct i2c_driver daca_driver = { + .owner = THIS_MODULE, + .name = "DAC3550A driver V " DACA_VERSION, + .id = I2C_DRIVERID_DACA, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = daca_attach_adapter, + .detach_client = daca_detach_client, + }; +--- gregkh-2.6.orig/sound/oss/dmasound/tas_common.c ++++ gregkh-2.6/sound/oss/dmasound/tas_common.c +@@ -49,7 +49,6 @@ static int tas_detach_client(struct i2c_ + struct i2c_driver tas_driver = { + .owner = THIS_MODULE, + .name = "tas", +- .flags = I2C_DF_NOTIFY, + .attach_adapter = tas_attach_adapter, + .detach_client = tas_detach_client, + }; +--- gregkh-2.6.orig/sound/ppc/keywest.c ++++ gregkh-2.6/sound/ppc/keywest.c +@@ -43,7 +43,6 @@ static int keywest_detach_client(struct + struct i2c_driver keywest_driver = { + .name = "PMac Keywest Audio", + .id = I2C_DRIVERID_KEYWEST, +- .flags = I2C_DF_NOTIFY, + .attach_adapter = &keywest_attach_adapter, + .detach_client = &keywest_detach_client, + }; diff --git a/i2c/i2c-drop-driver-flags-03-flags.patch b/i2c/i2c-drop-driver-flags-03-flags.patch new file mode 100644 index 0000000000000..61750bfe6390f --- /dev/null +++ b/i2c/i2c-drop-driver-flags-03-flags.patch @@ -0,0 +1,36 @@ +From khali@linux-fr.org Sat Nov 26 23:58:45 2005 +Date: Sun, 27 Nov 2005 08:57:10 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: "Mark M. Hoffman" <mhoffman@lightlink.com>, Greg KH <greg@kroah.com> +Cc: Mauro Carvalho Chehab <mchehab@brturbo.com.br> +Subject: [PATCH 09/25] i2c: Drop i2c_driver.flags, 3 of 3 +Message-Id: <20051127085710.543e31ce.khali@linux-fr.org> +Content-Disposition: inline; filename=i2c-drop-driver-flags-03-flags.patch + +The flags member of the i2c_driver structure is no more used. Drop it. + +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + include/linux/i2c.h | 3 --- + 1 file changed, 3 deletions(-) + +--- gregkh-2.6.orig/include/linux/i2c.h ++++ gregkh-2.6/include/linux/i2c.h +@@ -112,7 +112,6 @@ struct i2c_driver { + char name[32]; + int id; + unsigned int class; +- unsigned int flags; /* div., see below */ + + /* Notifies the driver that a new bus has appeared. This routine + * can be used by the driver to test if the bus meets its conditions +@@ -250,8 +249,6 @@ static inline void i2c_set_adapdata (str + dev_set_drvdata (&dev->dev, data); + } + +-/*flags for the driver struct: */ +- + /*flags for the client struct: */ + #define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */ + #define I2C_CLIENT_ALLOW_MULTIPLE_USE 0x02 /* Allow multiple access-locks */ diff --git a/i2c/i2c-parport-barco-ltp-dvi.patch b/i2c/i2c-parport-barco-ltp-dvi.patch new file mode 100644 index 0000000000000..b6374fd5dbecb --- /dev/null +++ b/i2c/i2c-parport-barco-ltp-dvi.patch @@ -0,0 +1,57 @@ +From khali@linux-fr.org Sat Nov 26 19:23:57 2005 +Date: Sat, 26 Nov 2005 20:18:43 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Cc: Peter Korsgaard <jacmet@sunsite.dk> +Subject: [PATCH 05/25] i2c: Add support for Barco LTP->DVI to i2c-parport +Message-Id: <20051126201843.75fd91a3.khali@linux-fr.org> +Content-Disposition: inline; filename=i2c-parport-barco-ltp-dvi.patch + +From: Peter Korsgaard <jacmet@sunsite.dk> + +The following patch adds support for the Barco LTP->DVI I2C adapter to +the i2c-parport driver. + +Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + Documentation/i2c/busses/i2c-parport | 1 + + drivers/i2c/busses/i2c-parport.h | 12 +++++++++++- + 2 files changed, 12 insertions(+), 1 deletion(-) + +--- gregkh-2.6.orig/Documentation/i2c/busses/i2c-parport ++++ gregkh-2.6/Documentation/i2c/busses/i2c-parport +@@ -17,6 +17,7 @@ It currently supports the following devi + * Velleman K8000 adapter + * ELV adapter + * Analog Devices evaluation boards (ADM1025, ADM1030, ADM1031, ADM1032) ++ * Barco LPT->DVI (K5800236) adapter + + These devices use different pinout configurations, so you have to tell + the driver what you have, using the type module parameter. There is no +--- gregkh-2.6.orig/drivers/i2c/busses/i2c-parport.h ++++ gregkh-2.6/drivers/i2c/busses/i2c-parport.h +@@ -80,6 +80,14 @@ static struct adapter_parm adapter_parm[ + .setscl = { 0x01, DATA, 1 }, + .getsda = { 0x10, STAT, 1 }, + }, ++ /* type 6: Barco LPT->DVI (K5800236) adapter */ ++ { ++ .setsda = { 0x02, DATA, 1 }, ++ .setscl = { 0x01, DATA, 1 }, ++ .getsda = { 0x20, STAT, 0 }, ++ .getscl = { 0x40, STAT, 0 }, ++ .init = { 0xfc, DATA, 0 }, ++ }, + }; + + static int type; +@@ -91,4 +99,6 @@ MODULE_PARM_DESC(type, + " 2 = Velleman K8000 adapter\n" + " 3 = ELV adapter\n" + " 4 = ADM1032 evaluation board\n" +- " 5 = ADM1025, ADM1030 and ADM1031 evaluation boards\n"); ++ " 5 = ADM1025, ADM1030 and ADM1031 evaluation boards\n" ++ " 6 = Barco LPT->DVI (K5800236) adapter\n" ++); diff --git a/i2c/i2c-rtc8564-remove-duplicate-bcd-macros.patch b/i2c/i2c-rtc8564-remove-duplicate-bcd-macros.patch new file mode 100644 index 0000000000000..00e047276047e --- /dev/null +++ b/i2c/i2c-rtc8564-remove-duplicate-bcd-macros.patch @@ -0,0 +1,92 @@ +From khali@linux-fr.org Sat Nov 26 19:23:55 2005 +Date: Sat, 26 Nov 2005 20:15:23 +0100 +From: Jean Delvare <khali@linux-fr.org> +To: Greg KH <greg@kroah.com> +Cc: Nicolas Kaiser <nikai@nikai.net> +Subject: [PATCH 04/25] i2c: Remove duplicate rtc8564 BCD macros +Message-Id: <20051126201523.0f1f682d.khali@linux-fr.org> +Content-Disposition: inline; filename=i2c-rtc8564-remove-duplicate-bcd-macros.patch + +From: Nicolas Kaiser <nikai@nikai.net> + +Remove duplicate of BCD macros. + +Signed-off-by: Nicolas Kaiser <nikai@nikai.net> +Signed-off-by: Jean Delvare <khali@linux-fr.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + drivers/i2c/chips/rtc8564.c | 36 +++++++++++++++++------------------- + 1 file changed, 17 insertions(+), 19 deletions(-) + +--- gregkh-2.6.orig/drivers/i2c/chips/rtc8564.c ++++ gregkh-2.6/drivers/i2c/chips/rtc8564.c +@@ -14,6 +14,7 @@ + */ + #include <linux/module.h> + #include <linux/kernel.h> ++#include <linux/bcd.h> + #include <linux/i2c.h> + #include <linux/slab.h> + #include <linux/string.h> +@@ -52,9 +53,6 @@ static inline u8 _rtc8564_ctrl2(struct i + #define CTRL1(c) _rtc8564_ctrl1(c) + #define CTRL2(c) _rtc8564_ctrl2(c) + +-#define BCD_TO_BIN(val) (((val)&15) + ((val)>>4)*10) +-#define BIN_TO_BCD(val) ((((val)/10)<<4) + (val)%10) +- + static int debug;; + module_param(debug, int, S_IRUGO | S_IWUSR); + +@@ -224,16 +222,16 @@ static int rtc8564_get_datetime(struct i + return ret; + + /* century stored in minute alarm reg */ +- dt->year = BCD_TO_BIN(buf[RTC8564_REG_YEAR]); +- dt->year += 100 * BCD_TO_BIN(buf[RTC8564_REG_AL_MIN] & 0x3f); +- dt->mday = BCD_TO_BIN(buf[RTC8564_REG_DAY] & 0x3f); +- dt->wday = BCD_TO_BIN(buf[RTC8564_REG_WDAY] & 7); +- dt->mon = BCD_TO_BIN(buf[RTC8564_REG_MON_CENT] & 0x1f); ++ dt->year = BCD2BIN(buf[RTC8564_REG_YEAR]); ++ dt->year += 100 * BCD2BIN(buf[RTC8564_REG_AL_MIN] & 0x3f); ++ dt->mday = BCD2BIN(buf[RTC8564_REG_DAY] & 0x3f); ++ dt->wday = BCD2BIN(buf[RTC8564_REG_WDAY] & 7); ++ dt->mon = BCD2BIN(buf[RTC8564_REG_MON_CENT] & 0x1f); + +- dt->secs = BCD_TO_BIN(buf[RTC8564_REG_SEC] & 0x7f); ++ dt->secs = BCD2BIN(buf[RTC8564_REG_SEC] & 0x7f); + dt->vl = (buf[RTC8564_REG_SEC] & 0x80) == 0x80; +- dt->mins = BCD_TO_BIN(buf[RTC8564_REG_MIN] & 0x7f); +- dt->hours = BCD_TO_BIN(buf[RTC8564_REG_HR] & 0x3f); ++ dt->mins = BCD2BIN(buf[RTC8564_REG_MIN] & 0x7f); ++ dt->hours = BCD2BIN(buf[RTC8564_REG_HR] & 0x3f); + + _DBGRTCTM(2, *dt); + +@@ -255,18 +253,18 @@ rtc8564_set_datetime(struct i2c_client * + + buf[RTC8564_REG_CTRL1] = CTRL1(client) | RTC8564_CTRL1_STOP; + buf[RTC8564_REG_CTRL2] = CTRL2(client); +- buf[RTC8564_REG_SEC] = BIN_TO_BCD(dt->secs); +- buf[RTC8564_REG_MIN] = BIN_TO_BCD(dt->mins); +- buf[RTC8564_REG_HR] = BIN_TO_BCD(dt->hours); ++ buf[RTC8564_REG_SEC] = BIN2BCD(dt->secs); ++ buf[RTC8564_REG_MIN] = BIN2BCD(dt->mins); ++ buf[RTC8564_REG_HR] = BIN2BCD(dt->hours); + + if (datetoo) { + len += 5; +- buf[RTC8564_REG_DAY] = BIN_TO_BCD(dt->mday); +- buf[RTC8564_REG_WDAY] = BIN_TO_BCD(dt->wday); +- buf[RTC8564_REG_MON_CENT] = BIN_TO_BCD(dt->mon) & 0x1f; ++ buf[RTC8564_REG_DAY] = BIN2BCD(dt->mday); ++ buf[RTC8564_REG_WDAY] = BIN2BCD(dt->wday); ++ buf[RTC8564_REG_MON_CENT] = BIN2BCD(dt->mon) & 0x1f; + /* century stored in minute alarm reg */ +- buf[RTC8564_REG_YEAR] = BIN_TO_BCD(dt->year % 100); +- buf[RTC8564_REG_AL_MIN] = BIN_TO_BCD(dt->year / 100); ++ buf[RTC8564_REG_YEAR] = BIN2BCD(dt->year % 100); ++ buf[RTC8564_REG_AL_MIN] = BIN2BCD(dt->year / 100); + } + + ret = rtc8564_write(client, 0, buf, len); |