Skip to content

Commit

Permalink
Merge branch 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelva…
Browse files Browse the repository at this point in the history
…re-2.6

* 'hwmon-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
  hwmon: (fschmd) Add support for the FSC Hades IC
  hwmon: (fschmd) Add support for the FSC Syleus IC
  i2c-i801: Instantiate FSC hardware montioring chips
  dmi: Let dmi_walk() users pass private data
  hwmon: Define a standard interface for chassis intrusion detection
  Move the pcf8591 driver to hwmon
  hwmon: (w83627ehf) Only expose in6 or temp3 on the W83667HG
  hwmon: (w83627ehf) Add support for W83667HG
  hwmon: (w83627ehf) Invert fan pin variables logic
  hwmon: (hdaps) Fix Thinkpad X41 axis inversion
  hwmon: (hdaps) Allow inversion of separate axis
  hwmon: (ds1621) Clean up documentation
  hwmon: (ds1621) Avoid unneeded register access
  hwmon: (ds1621) Clean up register access
  hwmon: (ds1621) Reorder code statements
  • Loading branch information
Linus Torvalds committed Mar 31, 2009
2 parents c4e1aa6 + de15f09 commit 3c6fae6
Show file tree
Hide file tree
Showing 18 changed files with 588 additions and 327 deletions.
51 changes: 3 additions & 48 deletions Documentation/hwmon/ds1621
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,9 @@ of up to +/- 0.5 degrees even when compared against precise temperature
readings. Be sure to have a high vs. low temperature limit gap of al least
1.0 degree Celsius to avoid Tout "bouncing", though!

As for alarms, you can read the alarm status of the DS1621 via the 'alarms'
/sys file interface. The result consists mainly of bit 6 and 5 of the
configuration register of the chip; bit 6 (0x40 or 64) is the high alarm
bit and bit 5 (0x20 or 32) the low one. These bits are set when the high or
low limits are met or exceeded and are reset by the module as soon as the
respective temperature ranges are left.
The alarm bits are set when the high or low limits are met or exceeded and
are reset by the module as soon as the respective temperature ranges are
left.

The alarm registers are in no way suitable to find out about the actual
status of Tout. They will only tell you about its history, whether or not
Expand All @@ -64,45 +61,3 @@ with neither of the alarms set.

Temperature conversion of the DS1621 takes up to 1000ms; internal access to
non-volatile registers may last for 10ms or below.

High Accuracy Temperature Reading
---------------------------------

As said before, the temperature issued via the 9-bit i2c-bus data is
somewhat arbitrary. Internally, the temperature conversion is of a
different kind that is explained (not so...) well in the DS1621 data sheet.
To cut the long story short: Inside the DS1621 there are two oscillators,
both of them biassed by a temperature coefficient.

Higher resolution of the temperature reading can be achieved using the
internal projection, which means taking account of REG_COUNT and REG_SLOPE
(the driver manages them):

Taken from Dallas Semiconductors App Note 068: 'Increasing Temperature
Resolution on the DS1620' and App Note 105: 'High Resolution Temperature
Measurement with Dallas Direct-to-Digital Temperature Sensors'

- Read the 9-bit temperature and strip the LSB (Truncate the .5 degs)
- The resulting value is TEMP_READ.
- Then, read REG_COUNT.
- And then, REG_SLOPE.

TEMP = TEMP_READ - 0.25 + ((REG_SLOPE - REG_COUNT) / REG_SLOPE)

Note that this is what the DONE bit in the DS1621 configuration register is
good for: Internally, one temperature conversion takes up to 1000ms. Before
that conversion is complete you will not be able to read valid things out
of REG_COUNT and REG_SLOPE. The DONE bit, as you may have guessed by now,
tells you whether the conversion is complete ("done", in plain English) and
thus, whether the values you read are good or not.

The DS1621 has two modes of operation: "Continuous" conversion, which can
be understood as the default stand-alone mode where the chip gets the
temperature and controls external devices via its Tout pin or tells other
i2c's about it if they care. The other mode is called "1SHOT", that means
that it only figures out about the temperature when it is explicitly told
to do so; this can be seen as power saving mode.

Now if you want to read REG_COUNT and REG_SLOPE, you have to either stop
the continuous conversions until the contents of these registers are valid,
or, in 1SHOT mode, you have to have one conversion made.
File renamed without changes.
22 changes: 22 additions & 0 deletions Documentation/hwmon/sysfs-interface
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ energy[1-*]_input Cumulative energy use
Unit: microJoule
RO


**********
* Alarms *
**********
Expand Down Expand Up @@ -453,6 +454,27 @@ beep_mask Bitmask for beep.
RW


***********************
* Intrusion detection *
***********************

intrusion[0-*]_alarm
Chassis intrusion detection
0: OK
1: intrusion detected
RW
Contrary to regular alarm flags which clear themselves
automatically when read, this one sticks until cleared by
the user. This is done by writing 0 to the file. Writing
other values is unsupported.

intrusion[0-*]_beep
Chassis intrusion beep
0: disable
1: enable
RW


sysfs attribute writes interpretation
-------------------------------------

Expand Down
29 changes: 20 additions & 9 deletions Documentation/hwmon/w83627ehf
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,40 @@ Kernel driver w83627ehf
=======================

Supported chips:
* Winbond W83627EHF/EHG/DHG (ISA access ONLY)
* Winbond W83627EHF/EHG (ISA access ONLY)
Prefix: 'w83627ehf'
Addresses scanned: ISA address retrieved from Super I/O registers
Datasheet:
http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/W83627EHF_%20W83627EHGb.pdf
DHG datasheet confidential.
http://www.nuvoton.com.tw/NR/rdonlyres/A6A258F0-F0C9-4F97-81C0-C4D29E7E943E/0/W83627EHF.pdf
* Winbond W83627DHG
Prefix: 'w83627dhg'
Addresses scanned: ISA address retrieved from Super I/O registers
Datasheet:
http://www.nuvoton.com.tw/NR/rdonlyres/7885623D-A487-4CF9-A47F-30C5F73D6FE6/0/W83627DHG.pdf
* Winbond W83667HG
Prefix: 'w83667hg'
Addresses scanned: ISA address retrieved from Super I/O registers
Datasheet: not available

Authors:
Jean Delvare <khali@linux-fr.org>
Yuan Mu (Winbond)
Rudolf Marek <r.marek@assembler.cz>
David Hubbard <david.c.hubbard@gmail.com>
Gong Jun <JGong@nuvoton.com>

Description
-----------

This driver implements support for the Winbond W83627EHF, W83627EHG, and
W83627DHG super I/O chips. We will refer to them collectively as Winbond chips.
This driver implements support for the Winbond W83627EHF, W83627EHG,
W83627DHG and W83667HG super I/O chips. We will refer to them collectively
as Winbond chips.

The chips implement three temperature sensors, five fan rotation
speed sensors, ten analog voltage sensors (only nine for the 627DHG), one
VID (6 pins for the 627EHF/EHG, 8 pins for the 627DHG), alarms with beep
warnings (control unimplemented), and some automatic fan regulation
strategies (plus manual fan control mode).
VID (6 pins for the 627EHF/EHG, 8 pins for the 627DHG and 667HG), alarms
with beep warnings (control unimplemented), and some automatic fan
regulation strategies (plus manual fan control mode).

Temperatures are measured in degrees Celsius and measurement resolution is 1
degC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when
Expand Down Expand Up @@ -54,7 +64,8 @@ follows:
temp1 -> pwm1
temp2 -> pwm2
temp3 -> pwm3
prog -> pwm4 (the programmable setting is not supported by the driver)
prog -> pwm4 (not on 667HG; the programmable setting is not supported by
the driver)

/sys files
----------
Expand Down
18 changes: 11 additions & 7 deletions drivers/firmware/dmi_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ static char * __init dmi_string(const struct dmi_header *dm, u8 s)
* pointing to completely the wrong place for example
*/
static void dmi_table(u8 *buf, int len, int num,
void (*decode)(const struct dmi_header *))
void (*decode)(const struct dmi_header *, void *),
void *private_data)
{
u8 *data = buf;
int i = 0;
Expand All @@ -89,7 +90,7 @@ static void dmi_table(u8 *buf, int len, int num,
while ((data - buf < len - 1) && (data[0] || data[1]))
data++;
if (data - buf < len - 1)
decode(dm);
decode(dm, private_data);
data += 2;
i++;
}
Expand All @@ -99,15 +100,16 @@ static u32 dmi_base;
static u16 dmi_len;
static u16 dmi_num;

static int __init dmi_walk_early(void (*decode)(const struct dmi_header *))
static int __init dmi_walk_early(void (*decode)(const struct dmi_header *,
void *))
{
u8 *buf;

buf = dmi_ioremap(dmi_base, dmi_len);
if (buf == NULL)
return -1;

dmi_table(buf, dmi_len, dmi_num, decode);
dmi_table(buf, dmi_len, dmi_num, decode, NULL);

dmi_iounmap(buf, dmi_len);
return 0;
Expand Down Expand Up @@ -295,7 +297,7 @@ static void __init dmi_save_extended_devices(const struct dmi_header *dm)
* and machine entries. For 2.5 we should pull the smbus controller info
* out of here.
*/
static void __init dmi_decode(const struct dmi_header *dm)
static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
{
switch(dm->type) {
case 0: /* BIOS Information */
Expand Down Expand Up @@ -598,10 +600,12 @@ int dmi_get_year(int field)
/**
* dmi_walk - Walk the DMI table and get called back for every record
* @decode: Callback function
* @private_data: Private data to be passed to the callback function
*
* Returns -1 when the DMI table can't be reached, 0 on success.
*/
int dmi_walk(void (*decode)(const struct dmi_header *))
int dmi_walk(void (*decode)(const struct dmi_header *, void *),
void *private_data)
{
u8 *buf;

Expand All @@ -612,7 +616,7 @@ int dmi_walk(void (*decode)(const struct dmi_header *))
if (buf == NULL)
return -1;

dmi_table(buf, dmi_len, dmi_num, decode);
dmi_table(buf, dmi_len, dmi_num, decode, private_data);

iounmap(buf);
return 0;
Expand Down
27 changes: 22 additions & 5 deletions drivers/hwmon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,13 @@ config SENSORS_FSCPOS
will be called fscpos.

config SENSORS_FSCHMD
tristate "FSC Poseidon, Scylla, Hermes, Heimdall and Heracles"
tristate "Fujitsu Siemens Computers sensor chips"
depends on X86 && I2C
help
If you say yes here you get support for various Fujitsu Siemens
Computers sensor chips, including support for the integrated
watchdog.
If you say yes here you get support for the following Fujitsu
Siemens Computers (FSC) sensor chips: Poseidon, Scylla, Hermes,
Heimdall, Heracles, Hades and Syleus including support for the
integrated watchdog.

This is a merged driver for FSC sensor chips replacing the fscpos,
fscscy and fscher drivers and adding support for several other FSC
Expand Down Expand Up @@ -635,6 +636,20 @@ config SENSORS_PC87427
This driver can also be built as a module. If so, the module
will be called pc87427.

config SENSORS_PCF8591
tristate "Philips PCF8591 ADC/DAC"
depends on I2C
default n
help
If you say yes here you get support for Philips PCF8591 4-channel
ADC, 1-channel DAC chips.

This driver can also be built as a module. If so, the module
will be called pcf8591.

These devices are hard to detect and rarely found on mainstream
hardware. If unsure, say N.

config SENSORS_SIS5595
tristate "Silicon Integrated Systems Corp. SiS5595"
depends on PCI
Expand Down Expand Up @@ -827,7 +842,7 @@ config SENSORS_W83627HF
will be called w83627hf.

config SENSORS_W83627EHF
tristate "Winbond W83627EHF/DHG"
tristate "Winbond W83627EHF/EHG/DHG, W83667HG"
select HWMON_VID
help
If you say yes here you get support for the hardware
Expand All @@ -838,6 +853,8 @@ config SENSORS_W83627EHF
chip suited for specific Intel processors that use PECI such as
the Core 2 Duo.

This driver also supports the W83667HG chip.

This driver can also be built as a module. If so, the module
will be called w83627ehf.

Expand Down
1 change: 1 addition & 0 deletions drivers/hwmon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ obj-$(CONFIG_SENSORS_MAX1619) += max1619.o
obj-$(CONFIG_SENSORS_MAX6650) += max6650.o
obj-$(CONFIG_SENSORS_PC87360) += pc87360.o
obj-$(CONFIG_SENSORS_PC87427) += pc87427.o
obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o
obj-$(CONFIG_SENSORS_SIS5595) += sis5595.o
obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o
obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o
Expand Down
Loading

0 comments on commit 3c6fae6

Please sign in to comment.