Skip to content

Commit

Permalink
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/groeck/staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging: (44 commits)
  hwmon: Support for Dallas Semiconductor DS620
  hwmon: driver for Sensirion SHT21 humidity and temperature sensor
  hwmon: Add humidity attribute to sysfs ABI
  hwmon: sysfs ABI updates
  hwmon: (via-cputemp) sync hotplug handling with coretemp/pkgtemp
  hwmon: (lm95241) Rewrite to avoid using macros
  hwmon: (applesmc) Fix checkpatch errors and fix value range checks
  hwmon: (applesmc) Update copyright information
  hwmon: (applesmc) Silence driver
  hwmon: (applesmc) Simplify feature sysfs handling
  hwmon: (applesmc) Dynamic creation of fan files
  hwmon: (applesmc) Extract all features generically
  hwmon: (applesmc) Handle new temperature format
  hwmon: (applesmc) Dynamic creation of temperature files
  hwmon: (applesmc) Introduce a register lookup table
  hwmon: (applesmc) Use pr_fmt and pr_<level>
  hwmon: (applesmc) Relax the severity of device init failure
  hwmon: (applesmc) Add MacBookAir3,1(3,2) support
  hwmon: (w83627hf) Use pr_fmt and pr_<level>
  hwmon: (w83627ehf) Use pr_fmt and pr_<level>
  ...
  • Loading branch information
torvalds committed Jan 10, 2011
2 parents 0bd2cbc + 6099469 commit a089488
Show file tree
Hide file tree
Showing 36 changed files with 1,827 additions and 1,546 deletions.
34 changes: 34 additions & 0 deletions Documentation/hwmon/ds620
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Kernel driver ds620
===================

Supported chips:
* Dallas Semiconductor DS620
Prefix: 'ds620'
Datasheet: Publicly available at the Dallas Semiconductor website
http://www.dalsemi.com/

Authors:
Roland Stigge <[email protected]>
based on ds1621.c by
Christian W. Zuckschwerdt <[email protected]>

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

The DS620 is a (one instance) digital thermometer and thermostat. It has both
high and low temperature limits which can be user defined (i.e. programmed
into non-volatile on-chip registers). Temperature range is -55 degree Celsius
to +125. Between 0 and 70 degree Celsius, accuracy is 0.5 Kelvin. The value
returned via sysfs displays post decimal positions.

The thermostat function works as follows: When configured via platform_data
(struct ds620_platform_data) .pomode == 0 (default), the thermostat output pin
PO is always low. If .pomode == 1, the thermostat is in PO_LOW mode. I.e., the
output pin PO becomes active when the temperature falls below temp1_min and
stays active until the temperature goes above temp1_max.

Likewise, with .pomode == 2, the thermostat is in PO_HIGH mode. I.e., the PO
output pin becomes active when the temperature goes above temp1_max and stays
active until the temperature falls below temp1_min.

The PO output pin of the DS620 operates active-low.
49 changes: 49 additions & 0 deletions Documentation/hwmon/sht21
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Kernel driver sht21
===================

Supported chips:
* Sensirion SHT21
Prefix: 'sht21'
Addresses scanned: none
Datasheet: Publicly available at the Sensirion website
http://www.sensirion.com/en/pdf/product_information/Datasheet-humidity-sensor-SHT21.pdf

* Sensirion SHT25
Prefix: 'sht21'
Addresses scanned: none
Datasheet: Publicly available at the Sensirion website
http://www.sensirion.com/en/pdf/product_information/Datasheet-humidity-sensor-SHT25.pdf

Author:
Urs Fleisch <[email protected]>

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

The SHT21 and SHT25 are humidity and temperature sensors in a DFN package of
only 3 x 3 mm footprint and 1.1 mm height. The difference between the two
devices is the higher level of precision of the SHT25 (1.8% relative humidity,
0.2 degree Celsius) compared with the SHT21 (2.0% relative humidity,
0.3 degree Celsius).

The devices communicate with the I2C protocol. All sensors are set to the same
I2C address 0x40, so an entry with I2C_BOARD_INFO("sht21", 0x40) can be used
in the board setup code.

sysfs-Interface
---------------

temp1_input - temperature input
humidity1_input - humidity input

Notes
-----

The driver uses the default resolution settings of 12 bit for humidity and 14
bit for temperature, which results in typical measurement times of 22 ms for
humidity and 66 ms for temperature. To keep self heating below 0.1 degree
Celsius, the device should not be active for more than 10% of the time,
e.g. maximum two measurements per second at the given resolution.

Different resolutions, the on-chip heater, using the CRC checksum and reading
the serial number are not supported yet.
49 changes: 42 additions & 7 deletions Documentation/hwmon/sysfs-interface
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,20 @@ curr[1-*]_min Current min value.
Unit: milliampere
RW

curr[1-*]_lcrit Current critical low value
Unit: milliampere
RW

curr[1-*]_crit Current critical high value.
Unit: milliampere
RW

curr[1-*]_input Current input value
Unit: milliampere
RO

Also see the Alarms section for status flags associated with currents.

*********
* Power *
*********
Expand Down Expand Up @@ -450,13 +460,6 @@ power[1-*]_accuracy Accuracy of the power meter.
Unit: Percent
RO

power[1-*]_alarm 1 if the system is drawing more power than the
cap allows; 0 otherwise. A poll notification is
sent to this file when the power use exceeds the
cap. This file only appears if the cap is known
to be enforced by hardware.
RO

power[1-*]_cap If power use rises above this limit, the
system should take action to reduce power use.
A poll notification is sent to this file if the
Expand All @@ -479,6 +482,20 @@ power[1-*]_cap_min Minimum cap that can be set.
Unit: microWatt
RO

power[1-*]_max Maximum power.
Unit: microWatt
RW

power[1-*]_crit Critical maximum power.
If power rises to or above this limit, the
system is expected take drastic action to reduce
power consumption, such as a system shutdown or
a forced powerdown of some devices.
Unit: microWatt
RW

Also see the Alarms section for status flags associated with power readings.

**********
* Energy *
**********
Expand All @@ -488,6 +505,15 @@ energy[1-*]_input Cumulative energy use
RO


************
* Humidity *
************

humidity[1-*]_input Humidity
Unit: milli-percent (per cent mille, pcm)
RO


**********
* Alarms *
**********
Expand All @@ -501,6 +527,7 @@ implementation.

in[0-*]_alarm
curr[1-*]_alarm
power[1-*]_alarm
fan[1-*]_alarm
temp[1-*]_alarm
Channel alarm
Expand All @@ -512,12 +539,20 @@ OR

in[0-*]_min_alarm
in[0-*]_max_alarm
in[0-*]_lcrit_alarm
in[0-*]_crit_alarm
curr[1-*]_min_alarm
curr[1-*]_max_alarm
curr[1-*]_lcrit_alarm
curr[1-*]_crit_alarm
power[1-*]_cap_alarm
power[1-*]_max_alarm
power[1-*]_crit_alarm
fan[1-*]_min_alarm
fan[1-*]_max_alarm
temp[1-*]_min_alarm
temp[1-*]_max_alarm
temp[1-*]_lcrit_alarm
temp[1-*]_crit_alarm
temp[1-*]_emergency_alarm
Limit alarm
Expand Down
20 changes: 20 additions & 0 deletions drivers/hwmon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,16 @@ config SENSORS_ATXP1
This driver can also be built as a module. If so, the module
will be called atxp1.

config SENSORS_DS620
tristate "Dallas Semiconductor DS620"
depends on I2C
help
If you say yes here you get support for Dallas Semiconductor
DS620 sensor chip.

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

config SENSORS_DS1621
tristate "Dallas Semiconductor DS1621 and DS1625"
depends on I2C
Expand Down Expand Up @@ -734,6 +744,16 @@ config SENSORS_SHT15
This driver can also be built as a module. If so, the module
will be called sht15.

config SENSORS_SHT21
tristate "Sensiron humidity and temperature sensors. SHT21 and compat."
depends on I2C
help
If you say yes here you get support for the Sensiron SHT21, SHT25
humidity and temperature sensors.

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

config SENSORS_S3C
tristate "Samsung built-in ADC"
depends on S3C_ADC
Expand Down
2 changes: 2 additions & 0 deletions drivers/hwmon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ obj-$(CONFIG_SENSORS_ATXP1) += atxp1.o
obj-$(CONFIG_SENSORS_CORETEMP) += coretemp.o
obj-$(CONFIG_SENSORS_PKGTEMP) += pkgtemp.o
obj-$(CONFIG_SENSORS_DME1737) += dme1737.o
obj-$(CONFIG_SENSORS_DS620) += ds620.o
obj-$(CONFIG_SENSORS_DS1621) += ds1621.o
obj-$(CONFIG_SENSORS_EMC1403) += emc1403.o
obj-$(CONFIG_SENSORS_EMC2103) += emc2103.o
Expand Down Expand Up @@ -90,6 +91,7 @@ obj-$(CONFIG_SENSORS_PC87427) += pc87427.o
obj-$(CONFIG_SENSORS_PCF8591) += pcf8591.o
obj-$(CONFIG_SENSORS_S3C) += s3c-hwmon.o
obj-$(CONFIG_SENSORS_SHT15) += sht15.o
obj-$(CONFIG_SENSORS_SHT21) += sht21.o
obj-$(CONFIG_SENSORS_SIS5595) += sis5595.o
obj-$(CONFIG_SENSORS_SMM665) += smm665.o
obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o
Expand Down
36 changes: 17 additions & 19 deletions drivers/hwmon/abituguru.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
the custom Abit uGuru chip found on Abit uGuru motherboards. Note: because
of lack of specs the CPU/RAM voltage & frequency control is not supported!
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/sched.h>
#include <linux/init.h>
Expand Down Expand Up @@ -220,6 +223,10 @@ struct abituguru_data {
u8 pwm_settings[ABIT_UGURU_MAX_PWMS][5];
};

static const char *never_happen = "This should never happen.";
static const char *report_this =
"Please report this to the abituguru maintainer (see MAINTAINERS)";

/* wait till the uguru is in the specified state */
static int abituguru_wait(struct abituguru_data *data, u8 state)
{
Expand Down Expand Up @@ -438,8 +445,7 @@ abituguru_detect_bank1_sensor_type(struct abituguru_data *data,

/* Test val is sane / usable for sensor type detection. */
if ((val < 10u) || (val > 250u)) {
printk(KERN_WARNING ABIT_UGURU_NAME
": bank1-sensor: %d reading (%d) too close to limits, "
pr_warn("bank1-sensor: %d reading (%d) too close to limits, "
"unable to determine sensor type, skipping sensor\n",
(int)sensor_addr, (int)val);
/* assume no sensor is there for sensors for which we can't
Expand Down Expand Up @@ -535,10 +541,8 @@ abituguru_detect_bank1_sensor_type(struct abituguru_data *data,
3) == 3)
break;
if (i == 3) {
printk(KERN_ERR ABIT_UGURU_NAME
": Fatal error could not restore original settings. "
"This should never happen please report this to the "
"abituguru maintainer (see MAINTAINERS)\n");
pr_err("Fatal error could not restore original settings. %s %s\n",
never_happen, report_this);
return -ENODEV;
}
return ret;
Expand Down Expand Up @@ -1268,14 +1272,12 @@ static int __devinit abituguru_probe(struct platform_device *pdev)
}
/* Fail safe check, this should never happen! */
if (sysfs_names_free < 0) {
printk(KERN_ERR ABIT_UGURU_NAME ": Fatal error ran out of "
"space for sysfs attr names. This should never "
"happen please report to the abituguru maintainer "
"(see MAINTAINERS)\n");
pr_err("Fatal error ran out of space for sysfs attr names. %s %s",
never_happen, report_this);
res = -ENAMETOOLONG;
goto abituguru_probe_error;
}
printk(KERN_INFO ABIT_UGURU_NAME ": found Abit uGuru\n");
pr_info("found Abit uGuru\n");

/* Register sysfs hooks */
for (i = 0; i < sysfs_attr_i; i++)
Expand Down Expand Up @@ -1432,8 +1434,7 @@ static int __init abituguru_detect(void)
"0x%02X\n", (unsigned int)data_val, (unsigned int)cmd_val);

if (force) {
printk(KERN_INFO ABIT_UGURU_NAME ": Assuming Abit uGuru is "
"present because of \"force\" parameter\n");
pr_info("Assuming Abit uGuru is present because of \"force\" parameter\n");
return ABIT_UGURU_BASE;
}

Expand Down Expand Up @@ -1467,8 +1468,7 @@ static int __init abituguru_init(void)

abituguru_pdev = platform_device_alloc(ABIT_UGURU_NAME, address);
if (!abituguru_pdev) {
printk(KERN_ERR ABIT_UGURU_NAME
": Device allocation failed\n");
pr_err("Device allocation failed\n");
err = -ENOMEM;
goto exit_driver_unregister;
}
Expand All @@ -1479,15 +1479,13 @@ static int __init abituguru_init(void)

err = platform_device_add_resources(abituguru_pdev, &res, 1);
if (err) {
printk(KERN_ERR ABIT_UGURU_NAME
": Device resource addition failed (%d)\n", err);
pr_err("Device resource addition failed (%d)\n", err);
goto exit_device_put;
}

err = platform_device_add(abituguru_pdev);
if (err) {
printk(KERN_ERR ABIT_UGURU_NAME
": Device addition failed (%d)\n", err);
pr_err("Device addition failed (%d)\n", err);
goto exit_device_put;
}

Expand Down
Loading

0 comments on commit a089488

Please sign in to comment.