Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 309015 Details for
Bug 450972
ITE IT8718F chip sensors can not collect the information.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch
linux-2.6.18-hwmon-it8716f-it8718f-v4.patch (text/plain), 23.09 KB, created by
Haruo Tomita
on 2008-06-12 00:28:17 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Haruo Tomita
Created:
2008-06-12 00:28:17 UTC
Size:
23.09 KB
patch
obsolete
>diff -urpN linux-2.6.18-92.el5.orig/Documentation/hwmon/it87 linux-2.6.18-92.el5/Documentation/hwmon/it87 >--- linux-2.6.18-92.el5.orig/Documentation/hwmon/it87 2006-09-20 12:42:06.000000000 +0900 >+++ linux-2.6.18-92.el5/Documentation/hwmon/it87 2008-06-10 16:55:08.000000000 +0900 >@@ -13,12 +13,25 @@ Supported chips: > from Super I/O config space (8 I/O ports) > Datasheet: Publicly available at the ITE website > http://www.ite.com.tw/ >+ * IT8716F >+ Prefix: 'it8716' >+ Addresses scanned: from Super I/O config space (8 I/O ports) >+ Datasheet: Publicly available at the ITE website >+ http://www.ite.com.tw/product_info/file/pc/IT8716F_V0.3.ZIP >+ * IT8718F >+ Prefix: 'it8718' >+ Addresses scanned: from Super I/O config space (8 I/O ports) >+ Datasheet: Publicly available at the ITE website >+ http://www.ite.com.tw/product_info/file/pc/IT8718F_V0.2.zip >+ http://www.ite.com.tw/product_info/file/pc/IT8718F_V0%203_(for%20C%20version).zip > * SiS950 [clone of IT8705F] > Prefix: 'it87' > Addresses scanned: from Super I/O config space (8 I/O ports) > Datasheet: No longer be available > >-Author: Christophe Gauthron <chrisg@0-in.com> >+Authors: >+ Christophe Gauthron <chrisg@0-in.com> >+ Jean Delvare <khali@linux-fr.org> > > > Module Parameters >@@ -43,26 +56,46 @@ Module Parameters > Description > ----------- > >-This driver implements support for the IT8705F, IT8712F and SiS950 chips. >- >-This driver also supports IT8712F, which adds SMBus access, and a VID >-input, used to report the Vcore voltage of the Pentium processor. >-The IT8712F additionally features VID inputs. >+This driver implements support for the IT8705F, IT8712F, IT8716F, >+IT8718F and SiS950 chips. > > These chips are 'Super I/O chips', supporting floppy disks, infrared ports, > joysticks and other miscellaneous stuff. For hardware monitoring, they > include an 'environment controller' with 3 temperature sensors, 3 fan > rotation speed sensors, 8 voltage sensors, and associated alarms. > >+The IT8712F and IT8716F additionally feature VID inputs, used to report >+the Vcore voltage of the processor. The early IT8712F have 5 VID pins, >+the IT8716F and late IT8712F have 6. They are shared with other functions >+though, so the functionality may not be available on a given system. >+The driver dumbly assume it is there. >+ >+The IT8718F also features VID inputs (up to 8 pins) but the value is >+stored in the Super-I/O configuration space. Due to technical limitations, >+this value can currently only be read once at initialization time, so >+the driver won't notice and report changes in the VID value. The two >+upper VID bits share their pins with voltage inputs (in5 and in6) so you >+can't have both on a given board. >+ >+The IT8716F, IT8718F and later IT8712F revisions have support for >+2 additional fans. They are not yet supported by the driver. >+ >+The IT8716F and IT8718F, and late IT8712F and IT8705F also have optional >+16-bit tachometer counters for fans 1 to 3. This is better (no more fan >+clock divider mess) but not compatible with the older chips and >+revisions. For now, the driver only uses the 16-bit mode on the >+IT8716F and IT8718F. >+ > Temperatures are measured in degrees Celsius. An alarm is triggered once > when the Overtemperature Shutdown limit is crossed. > > Fan rotation speeds are reported in RPM (rotations per minute). An alarm is >-triggered if the rotation speed has dropped below a programmable limit. Fan >-readings can be divided by a programmable divider (1, 2, 4 or 8) to give the >-readings more range or accuracy. Not all RPM values can accurately be >-represented, so some rounding is done. With a divider of 2, the lowest >-representable value is around 2600 RPM. >+triggered if the rotation speed has dropped below a programmable limit. When >+16-bit tachometer counters aren't use, fan readings can be divided by >+a programmable divider (1, 2, 4 or 8) to give the readings more range or >+accuracy. With a divider of 2, the lowest representable value is around >+2600 RPM. Not all RPM values can accurately be represented, so some rounding >+is done. > > Voltage sensors (also known as IN sensors) report their values in volts. An > alarm is triggered if the voltage has crossed a programmable minimum or >@@ -71,9 +104,9 @@ zero'; this is important for negative vo > inputs can measure voltages between 0 and 4.08 volts, with a resolution of > 0.016 volt. The battery voltage in8 does not have limit registers. > >-The VID lines (IT8712F only) encode the core voltage value: the voltage >-level your processor should work with. This is hardcoded by the mainboard >-and/or processor itself. It is a value in volts. >+The VID lines (IT8712F/IT8716F/IT8718F) encode the core voltage value: >+the voltage level your processor should work with. This is hardcoded by >+the mainboard and/or processor itself. It is a value in volts. > > If an alarm triggers, it will remain triggered until the hardware register > is read at least once. This means that the cause for the alarm may already >diff -urpN linux-2.6.18-92.el5.orig/drivers/hwmon/Kconfig linux-2.6.18-92.el5/drivers/hwmon/Kconfig >--- linux-2.6.18-92.el5.orig/drivers/hwmon/Kconfig 2008-06-10 16:46:00.000000000 +0900 >+++ linux-2.6.18-92.el5/drivers/hwmon/Kconfig 2008-06-10 16:55:08.000000000 +0900 >@@ -196,8 +196,8 @@ config SENSORS_IT87 > select I2C_ISA > select HWMON_VID > help >- If you say yes here you get support for ITE IT87xx sensor chips >- and clones: SiS960. >+ If you say yes here you get support for ITE IT8705F, IT8712F, >+ IT8716F and IT8718F sensor chips, and the SiS960 clone. > > This driver can also be built as a module. If so, the module > will be called it87. >diff -urpN linux-2.6.18-92.el5.orig/drivers/hwmon/it87.c linux-2.6.18-92.el5/drivers/hwmon/it87.c >--- linux-2.6.18-92.el5.orig/drivers/hwmon/it87.c 2006-09-20 12:42:06.000000000 +0900 >+++ linux-2.6.18-92.el5/drivers/hwmon/it87.c 2008-06-10 16:55:08.000000000 +0900 >@@ -4,10 +4,12 @@ > > Supports: IT8705F Super I/O chip w/LPC interface > IT8712F Super I/O chip w/LPC interface & SMBus >+ IT8716F Super I/O chip w/LPC interface >+ IT8718F Super I/O chip w/LPC interface > Sis950 A clone of the IT8705F > > Copyright (C) 2001 Chris Gauthron <chrisg@0-in.com> >- Largely inspired by lm78.c of the same package >+ Copyright (C) 2005-2006 Jean Delvare <khali@linux-fr.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 >@@ -24,13 +26,6 @@ > Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. > */ > >-/* >- djg@pdp8.net David Gesswein 7/18/01 >- Modified to fix bug with not all alarms enabled. >- Added ability to read battery voltage and select temperature sensor >- type at module load time. >-*/ >- > #include <linux/module.h> > #include <linux/init.h> > #include <linux/slab.h> >@@ -50,12 +45,13 @@ static unsigned short normal_i2c[] = { 0 > static unsigned short isa_address; > > /* Insmod parameters */ >-I2C_CLIENT_INSMOD_2(it87, it8712); >+I2C_CLIENT_INSMOD_4(it87, it8712, it8716, it8718); > > #define REG 0x2e /* The register to read/write */ > #define DEV 0x07 /* Register: Logical device select */ > #define VAL 0x2f /* The value to read/write */ > #define PME 0x04 /* The device with the fan registers in it */ >+#define GPIO 0x07 /* The device with the IT8718F VID value in it */ > #define DEVID 0x20 /* Register: Device ID */ > #define DEVREV 0x22 /* Register: Device Revision */ > >@@ -77,10 +73,10 @@ static int superio_inw(int reg) > } > > static inline void >-superio_select(void) >+superio_select(int ldn) > { > outb(DEV, REG); >- outb(PME, VAL); >+ outb(ldn, VAL); > } > > static inline void >@@ -99,20 +95,27 @@ superio_exit(void) > outb(0x02, VAL); > } > >+/* Logical device 4 registers */ > #define IT8712F_DEVID 0x8712 > #define IT8705F_DEVID 0x8705 >+#define IT8716F_DEVID 0x8716 >+#define IT8718F_DEVID 0x8718 > #define IT87_ACT_REG 0x30 > #define IT87_BASE_REG 0x60 > >+/* Logical device 7 registers (IT8712F and later) */ >+#define IT87_SIO_PINX2_REG 0x2c /* Pin selection */ >+#define IT87_SIO_VID_REG 0xfc /* VID value */ >+ > /* Update battery voltage after every reading if true */ > static int update_vbat; > > /* Not all BIOSes properly configure the PWM registers */ > static int fix_pwm_polarity; > >-/* Chip Type */ >- >+/* Values read from Super-I/O config space */ > static u16 chip_type; >+static u8 vid_value; > > /* Many IT87 constants specified below */ > >@@ -131,13 +134,21 @@ static u16 chip_type; > #define IT87_REG_ALARM2 0x02 > #define IT87_REG_ALARM3 0x03 > >+/* The IT8718F has the VID value in a different register, in Super-I/O >+ configuration space. */ > #define IT87_REG_VID 0x0a >+/* Warning: register 0x0b is used for something completely different in >+ new chips/revisions. I suspect only 16-bit tachometer mode will work >+ for these. */ > #define IT87_REG_FAN_DIV 0x0b >+#define IT87_REG_FAN_16BIT 0x0c > > /* Monitors: 9 voltage (0 to 7, battery), 3 temp (1 to 3), 3 fan (1 to 3) */ > > #define IT87_REG_FAN(nr) (0x0d + (nr)) > #define IT87_REG_FAN_MIN(nr) (0x10 + (nr)) >+#define IT87_REG_FANX(nr) (0x18 + (nr)) >+#define IT87_REG_FANX_MIN(nr) (0x1b + (nr)) > #define IT87_REG_FAN_MAIN_CTRL 0x13 > #define IT87_REG_FAN_CTL 0x14 > #define IT87_REG_PWM(nr) (0x15 + (nr)) >@@ -169,7 +180,16 @@ static inline u8 FAN_TO_REG(long rpm, in > 254); > } > >+static inline u16 FAN16_TO_REG(long rpm) >+{ >+ if (rpm == 0) >+ return 0xffff; >+ return SENSORS_LIMIT((1350000 + rpm) / (rpm * 2), 1, 0xfffe); >+} >+ > #define FAN_FROM_REG(val,div) ((val)==0?-1:(val)==255?0:1350000/((val)*(div))) >+/* The divider is fixed to 2 in 16-bit mode */ >+#define FAN16_FROM_REG(val) ((val)==0?-1:(val)==0xffff?0:1350000/((val)*2)) > > #define TEMP_TO_REG(val) (SENSORS_LIMIT(((val)<0?(((val)-500)/1000):\ > ((val)+500)/1000),-128,127)) >@@ -181,7 +201,7 @@ static inline u8 FAN_TO_REG(long rpm, in > static int DIV_TO_REG(int val) > { > int answer = 0; >- while ((val >>= 1) != 0) >+ while (answer < 7 && (val >>= 1)) > answer++; > return answer; > } >@@ -203,10 +223,11 @@ struct it87_data { > unsigned long last_updated; /* In jiffies */ > > u8 in[9]; /* Register value */ >- u8 in_max[9]; /* Register value */ >- u8 in_min[9]; /* Register value */ >- u8 fan[3]; /* Register value */ >- u8 fan_min[3]; /* Register value */ >+ u8 in_max[8]; /* Register value */ >+ u8 in_min[8]; /* Register value */ >+ u8 has_fan; /* Bitfield, fans enabled */ >+ u16 fan[3]; /* Register values, possibly combined */ >+ u16 fan_min[3]; /* Register values, possibly combined */ > u8 temp[3]; /* Register value */ > u8 temp_high[3]; /* Register value */ > u8 temp_low[3]; /* Register value */ >@@ -544,15 +565,15 @@ static ssize_t set_fan_div(struct device > > struct i2c_client *client = to_i2c_client(dev); > struct it87_data *data = i2c_get_clientdata(client); >- int val = simple_strtol(buf, NULL, 10); >- int i, min[3]; >+ unsigned long val = simple_strtoul(buf, NULL, 10); >+ int min; > u8 old; > > mutex_lock(&data->update_lock); > old = it87_read_value(client, IT87_REG_FAN_DIV); > >- for (i = 0; i < 3; i++) >- min[i] = FAN_FROM_REG(data->fan_min[i], DIV_FROM_REG(data->fan_div[i])); >+ /* Save fan min limit */ >+ min = FAN_FROM_REG(data->fan_min[nr], DIV_FROM_REG(data->fan_div[nr])); > > switch (nr) { > case 0: >@@ -572,10 +593,10 @@ static ssize_t set_fan_div(struct device > val |= 0x1 << 6; > it87_write_value(client, IT87_REG_FAN_DIV, val); > >- for (i = 0; i < 3; i++) { >- data->fan_min[i]=FAN_TO_REG(min[i], DIV_FROM_REG(data->fan_div[i])); >- it87_write_value(client, IT87_REG_FAN_MIN(i), data->fan_min[i]); >- } >+ /* Restore fan min limit */ >+ data->fan_min[nr] = FAN_TO_REG(min, DIV_FROM_REG(data->fan_div[nr])); >+ it87_write_value(client, IT87_REG_FAN_MIN(nr), data->fan_min[nr]); >+ > mutex_unlock(&data->update_lock); > return count; > } >@@ -656,6 +677,59 @@ show_pwm_offset(1); > show_pwm_offset(2); > show_pwm_offset(3); > >+/* A different set of callbacks for 16-bit fans */ >+static ssize_t show_fan16(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 it87_data *data = it87_update_device(dev); >+ return sprintf(buf, "%d\n", FAN16_FROM_REG(data->fan[nr])); >+} >+ >+static ssize_t show_fan16_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 it87_data *data = it87_update_device(dev); >+ return sprintf(buf, "%d\n", FAN16_FROM_REG(data->fan_min[nr])); >+} >+ >+static ssize_t set_fan16_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 it87_data *data = i2c_get_clientdata(client); >+ int val = simple_strtol(buf, NULL, 10); >+ >+ mutex_lock(&data->update_lock); >+ data->fan_min[nr] = FAN16_TO_REG(val); >+ it87_write_value(client, IT87_REG_FAN_MIN(nr), >+ data->fan_min[nr] & 0xff); >+ it87_write_value(client, IT87_REG_FANX_MIN(nr), >+ data->fan_min[nr] >> 8); >+ mutex_unlock(&data->update_lock); >+ return count; >+} >+ >+/* We want to use the same sysfs file names as 8-bit fans, but we need >+ different variable names, so we have to use SENSOR_ATTR instead of >+ SENSOR_DEVICE_ATTR. */ >+#define show_fan16_offset(offset) \ >+static struct sensor_device_attribute sensor_dev_attr_fan##offset##_input16 \ >+ = SENSOR_ATTR(fan##offset##_input, S_IRUGO, \ >+ show_fan16, NULL, offset - 1); \ >+static struct sensor_device_attribute sensor_dev_attr_fan##offset##_min16 \ >+ = SENSOR_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \ >+ show_fan16_min, set_fan16_min, offset - 1) >+ >+show_fan16_offset(1); >+show_fan16_offset(2); >+show_fan16_offset(3); >+ > /* Alarms */ > static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) > { >@@ -720,10 +794,12 @@ static int __init it87_find(unsigned sho > superio_enter(); > chip_type = superio_inw(DEVID); > if (chip_type != IT8712F_DEVID >+ && chip_type != IT8716F_DEVID >+ && chip_type != IT8718F_DEVID > && chip_type != IT8705F_DEVID) > goto exit; > >- superio_select(); >+ superio_select(PME); > if (!(superio_inb(IT87_ACT_REG) & 0x01)) { > pr_info("it87: Device not activated, skipping\n"); > goto exit; >@@ -739,6 +815,21 @@ static int __init it87_find(unsigned sho > pr_info("it87: Found IT%04xF chip at 0x%x, revision %d\n", > chip_type, *address, superio_inb(DEVREV) & 0x0f); > >+ /* Read GPIO config and VID value from LDN 7 (GPIO) */ >+ if (chip_type != IT8705F_DEVID) { >+ int reg; >+ >+ superio_select(GPIO); >+ if (chip_type == it8718) >+ vid_value = superio_inb(IT87_SIO_VID_REG); >+ >+ reg = superio_inb(IT87_SIO_PINX2_REG); >+ if (reg & (1 << 0)) >+ pr_info("it87: in3 is VCC (+5V)\n"); >+ if (reg & (1 << 1)) >+ pr_info("it87: in7 is VCCH (+5V Stand-By)\n"); >+ } >+ > exit: > superio_exit(); > return err; >@@ -799,8 +890,19 @@ static int it87_detect(struct i2c_adapte > i = it87_read_value(new_client, IT87_REG_CHIPID); > if (i == 0x90) { > kind = it87; >- if ((is_isa) && (chip_type == IT8712F_DEVID)) >- kind = it8712; >+ if (is_isa) { >+ switch (chip_type) { >+ case IT8712F_DEVID: >+ kind = it8712; >+ break; >+ case IT8716F_DEVID: >+ kind = it8716; >+ break; >+ case IT8718F_DEVID: >+ kind = it8718; >+ break; >+ } >+ } > } > else { > if (kind == 0) >@@ -817,6 +919,10 @@ static int it87_detect(struct i2c_adapte > name = "it87"; > } else if (kind == it8712) { > name = "it8712"; >+ } else if (kind == it8716) { >+ name = "it8716"; >+ } else if (kind == it8718) { >+ name = "it8718"; > } > > /* Fill in the remaining client fields and put it into the global list */ >@@ -884,15 +990,56 @@ static int it87_detect(struct i2c_adapte > device_create_file(&new_client->dev, &sensor_dev_attr_temp1_type.dev_attr); > device_create_file(&new_client->dev, &sensor_dev_attr_temp2_type.dev_attr); > device_create_file(&new_client->dev, &sensor_dev_attr_temp3_type.dev_attr); >- device_create_file(&new_client->dev, &sensor_dev_attr_fan1_input.dev_attr); >- device_create_file(&new_client->dev, &sensor_dev_attr_fan2_input.dev_attr); >- device_create_file(&new_client->dev, &sensor_dev_attr_fan3_input.dev_attr); >- device_create_file(&new_client->dev, &sensor_dev_attr_fan1_min.dev_attr); >- device_create_file(&new_client->dev, &sensor_dev_attr_fan2_min.dev_attr); >- device_create_file(&new_client->dev, &sensor_dev_attr_fan3_min.dev_attr); >- device_create_file(&new_client->dev, &sensor_dev_attr_fan1_div.dev_attr); >- device_create_file(&new_client->dev, &sensor_dev_attr_fan2_div.dev_attr); >- device_create_file(&new_client->dev, &sensor_dev_attr_fan3_div.dev_attr); >+ >+ /* Do not create fan files for disabled fans */ >+ if (data->type == it8716 || data->type == it8718) { >+ /* 16-bit tachometers */ >+ if (data->has_fan & (1 << 0)) { >+ device_create_file(&new_client->dev, >+ &sensor_dev_attr_fan1_input16.dev_attr); >+ device_create_file(&new_client->dev, >+ &sensor_dev_attr_fan1_min16.dev_attr); >+ } >+ if (data->has_fan & (1 << 1)) { >+ device_create_file(&new_client->dev, >+ &sensor_dev_attr_fan2_input16.dev_attr); >+ device_create_file(&new_client->dev, >+ &sensor_dev_attr_fan2_min16.dev_attr); >+ } >+ if (data->has_fan & (1 << 2)) { >+ device_create_file(&new_client->dev, >+ &sensor_dev_attr_fan3_input16.dev_attr); >+ device_create_file(&new_client->dev, >+ &sensor_dev_attr_fan3_min16.dev_attr); >+ } >+ } else { >+ /* 8-bit tachometers with clock divider */ >+ if (data->has_fan & (1 << 0)) { >+ device_create_file(&new_client->dev, >+ &sensor_dev_attr_fan1_input.dev_attr); >+ device_create_file(&new_client->dev, >+ &sensor_dev_attr_fan1_min.dev_attr); >+ device_create_file(&new_client->dev, >+ &sensor_dev_attr_fan1_div.dev_attr); >+ } >+ if (data->has_fan & (1 << 1)) { >+ device_create_file(&new_client->dev, >+ &sensor_dev_attr_fan2_input.dev_attr); >+ device_create_file(&new_client->dev, >+ &sensor_dev_attr_fan2_min.dev_attr); >+ device_create_file(&new_client->dev, >+ &sensor_dev_attr_fan2_div.dev_attr); >+ } >+ if (data->has_fan & (1 << 2)) { >+ device_create_file(&new_client->dev, >+ &sensor_dev_attr_fan3_input.dev_attr); >+ device_create_file(&new_client->dev, >+ &sensor_dev_attr_fan3_min.dev_attr); >+ device_create_file(&new_client->dev, >+ &sensor_dev_attr_fan3_div.dev_attr); >+ } >+ } >+ > device_create_file(&new_client->dev, &dev_attr_alarms); > if (enable_pwm_interface) { > device_create_file(&new_client->dev, &sensor_dev_attr_pwm1_enable.dev_attr); >@@ -903,8 +1050,11 @@ static int it87_detect(struct i2c_adapte > device_create_file(&new_client->dev, &sensor_dev_attr_pwm3.dev_attr); > } > >- if (data->type == it8712) { >+ if (data->type == it8712 || data->type == it8716 >+ || data->type == it8718) { > data->vrm = vid_which_vrm(); >+ /* VID reading from Super-I/O config space if available */ >+ data->vid = vid_value; > device_create_file_vrm(new_client); > device_create_file_vid(new_client); > } >@@ -1044,6 +1194,22 @@ static void it87_init_client(struct i2c_ > data->manual_pwm_ctl[i] = 0xff; > } > >+ /* Recent revisions seem to have default value 0xff for all limit >+ * registers. For low voltage limits it makes no sense and triggers >+ * alarms, so change to 0 instead. For high temperature limits, it >+ * means -1 degree C, which surprisingly doesn't trigger an alarm, >+ * but is still confusing, so change to 127 degrees C. */ >+ for (i = 0; i < 8; i++) { >+ tmp = it87_read_value(client, IT87_REG_VIN_MIN(i)); >+ if (tmp == 0xff) >+ it87_write_value(client, IT87_REG_VIN_MIN(i), 0); >+ } >+ for (i = 0; i < 3; i++) { >+ tmp = it87_read_value(client, IT87_REG_TEMP_HIGH(i)); >+ if (tmp == 0xff) >+ it87_write_value(client, IT87_REG_TEMP_HIGH(i), 127); >+ } >+ > /* Check if temperature channnels are reset manually or by some reason */ > tmp = it87_read_value(client, IT87_REG_TEMP_ENABLE); > if ((tmp & 0x3f) == 0) { >@@ -1067,6 +1233,18 @@ static void it87_init_client(struct i2c_ > data->fan_main_ctrl |= 0x70; > it87_write_value(client, IT87_REG_FAN_MAIN_CTRL, data->fan_main_ctrl); > } >+ data->has_fan = (data->fan_main_ctrl >> 4) & 0x07; >+ >+ /* Set tachometers to 16-bit mode if needed */ >+ if (data->type == it8716 || data->type == it8718) { >+ tmp = it87_read_value(client, IT87_REG_FAN_16BIT); >+ if (~tmp & 0x07 & data->has_fan) { >+ dev_dbg(&client->dev, >+ "Setting fan1-3 to 16-bit mode\n"); >+ it87_write_value(client, IT87_REG_FAN_16BIT, >+ tmp | 0x07); >+ } >+ } > > /* Set current fan mode registers and the default settings for the > * other mode registers */ >@@ -1117,18 +1295,26 @@ static struct it87_data *it87_update_dev > data->in_max[i] = > it87_read_value(client, IT87_REG_VIN_MAX(i)); > } >+ /* in8 (battery) has no limit registers */ > data->in[8] = > it87_read_value(client, IT87_REG_VIN(8)); >- /* Temperature sensor doesn't have limit registers, set >- to min and max value */ >- data->in_min[8] = 0; >- data->in_max[8] = 255; > > for (i = 0; i < 3; i++) { >- data->fan[i] = >- it87_read_value(client, IT87_REG_FAN(i)); >+ /* Skip disabled fans */ >+ if (!(data->has_fan & (1 << i))) >+ continue; >+ > data->fan_min[i] = > it87_read_value(client, IT87_REG_FAN_MIN(i)); >+ data->fan[i] = it87_read_value(client, >+ IT87_REG_FAN(i)); >+ /* Add high byte if in 16-bit mode */ >+ if (data->type == it8716 || data->type == it8718) { >+ data->fan[i] |= it87_read_value(client, >+ IT87_REG_FANX(i)) << 8; >+ data->fan_min[i] |= it87_read_value(client, >+ IT87_REG_FANX_MIN(i)) << 8; >+ } > } > for (i = 0; i < 3; i++) { > data->temp[i] = >@@ -1139,10 +1325,13 @@ static struct it87_data *it87_update_dev > it87_read_value(client, IT87_REG_TEMP_LOW(i)); > } > >- i = it87_read_value(client, IT87_REG_FAN_DIV); >- data->fan_div[0] = i & 0x07; >- data->fan_div[1] = (i >> 3) & 0x07; >- data->fan_div[2] = (i & 0x40) ? 3 : 1; >+ /* Newer chips don't have clock dividers */ >+ if ((data->has_fan & 0x07) && data->type != it8716) { >+ i = it87_read_value(client, IT87_REG_FAN_DIV); >+ data->fan_div[0] = i & 0x07; >+ data->fan_div[1] = (i >> 3) & 0x07; >+ data->fan_div[2] = (i & 0x40) ? 3 : 1; >+ } > > data->alarms = > it87_read_value(client, IT87_REG_ALARM1) | >@@ -1152,9 +1341,11 @@ static struct it87_data *it87_update_dev > > data->sensor = it87_read_value(client, IT87_REG_TEMP_ENABLE); > /* The 8705 does not have VID capability */ >- if (data->type == it8712) { >+ if (data->type == it8712 || data->type == it8716) { > data->vid = it87_read_value(client, IT87_REG_VID); >- data->vid &= 0x1f; >+ /* The older IT8712F revisions had only 5 VID pins, >+ but we assume it is always safe to read 6 bits. */ >+ data->vid &= 0x3f; > } > data->last_updated = jiffies; > data->valid = 1; >@@ -1192,8 +1383,9 @@ static void __exit sm_it87_exit(void) > } > > >-MODULE_AUTHOR("Chris Gauthron <chrisg@0-in.com>"); >-MODULE_DESCRIPTION("IT8705F, IT8712F, Sis950 driver"); >+MODULE_AUTHOR("Chris Gauthron <chrisg@0-in.com>, " >+ "Jean Delvare <khali@linux-fr.org>"); >+MODULE_DESCRIPTION("IT8705F/8712F/8716F/8718F, SiS950 driver"); > module_param(update_vbat, bool, 0); > MODULE_PARM_DESC(update_vbat, "Update vbat if set else return powerup value"); > module_param(fix_pwm_polarity, bool, 0);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 450972
: 309015 |
309016
|
309017