Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26f31fb9 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull hwmon updates from Guenter Roeck:
 - New drivers for ADC128D818, LTC2945, LTC4260, and LTC4222
 - Added support for LTM4676 to ltc2978 driver
 - Converted several drivers to use devm_hwmon_device_register_with_groups
 - Various cleanup in several drivers

* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (36 commits)
  hwmon: (pmbus/ltc2978) Add support for LTM4676
  hwmon: (pmbus/ltc2978) Add new chip ID for LTC2974
  hwmon: Do not accept invalid name attributes
  hwmon: (max6639) Use SIMPLE_DEV_PM_OPS macro
  hwmon: (lm95245) Make temp2_crit_hyst read-only
  hwmon: (lm95245) Convert to use devm_hwmon_device_register_with_groups
  hwmon: (lm95245) Drop useless debug message
  hwmon: (lm95245) Fix hysteresis temperatures
  hwmon: (max6639) Convert to use devm_hwmon_device_register_with_groups
  hwmon: (max6639) Introduce local dev variable, and reduce noisiness
  hwmon: (max6650) Introduce local 'dev' variable
  hwmon: (max6650) Drop error message after memory allocation failures
  hwmon: (max6650) Convert to use devm_hwmon_device_register_with_groups
  hwmon: (max6650) Rearrange code to no longer require forward declarations
  hwmon: (ltc4215) Convert to devm_hwmon_device_register_with_groups
  hwmon: (coretemp) Convert to use devm_hwmon_device_register_with_groups
  hwmon: (coretemp) Allocate platform data with devm_kzalloc
  hwmon: (coretemp) Use sysfs_create_group to create sysfs attributes
  hwmon: (ltc4245) Remove devicetree conditionals
  hwmon: (ltc4245) Drop debug messages
  ...
parents 0c8cfbad f76992b0
Loading
Loading
Loading
Loading
+47 −0
Original line number Diff line number Diff line
Kernel driver adc128d818
========================

Supported chips:
  * Texas Instruments ADC818D818
    Prefix: 'adc818d818'
    Addresses scanned: I2C 0x1d, 0x1e, 0x1f, 0x2d, 0x2e, 0x2f
    Datasheet: Publicly available at the TI website
               http://www.ti.com/

Author: Guenter Roeck

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

This driver implements support for the Texas Instruments ADC128D818.
It is described as 'ADC System Monitor with Temperature Sensor'.

The ADC128D818 implements one temperature sensor and seven voltage sensors.

Temperatures are measured in degrees Celsius. There is one set of limits.
When the HOT Temperature Limit is crossed, this will cause an alarm that will
be reasserted until the temperature drops below the HOT Hysteresis.
Measurements are guaranteed between -55 and +125 degrees. The temperature
measurement has a resolution of 0.5 degrees; the limits have a resolution
of 1 degree.

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 maximum limit. Note that minimum in this case always means 'closest to
zero'; this is important for negative voltage measurements. All voltage
inputs can measure voltages between 0 and 2.55 volts, with a resolution
of 0.625 mV.

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 have disappeared by the time the alarm is read. The driver
caches the alarm status for each sensor until it is at least reported
once, to ensure that alarms are reported to user space.

The ADC128D818 only updates its values approximately once per second;
reading it more often will do no harm, but will return 'old' values.

In addition to the scanned address list, the chip can also be configured for
addresses 0x35 to 0x37. Those addresses are not scanned. You have to instantiate
the driver explicitly if the chip is configured for any of those addresses in
your system.
+6 −2
Original line number Diff line number Diff line
@@ -24,8 +24,12 @@ is given within a range of -127 to +127.875 degrees. Remote temperatures are
given within a range of -127 to +255 degrees. Resolution depends on
temperature input and range.

Each sensor has its own critical limit, but the hysteresis is common to all
two channels.
Each sensor has its own critical limit. Additionally, there is a relative
hysteresis value common to both critical limits. To make life easier to
user-space applications, two absolute values are exported, one for each
channel, but these values are of course linked. Only the local hysteresis
can be set from user-space, and the same delta applies to the remote
hysteresis.

The lm95245 driver can change its update interval to a fixed set of values.
It will round up to the next selectable interval. See the datasheet for exact
+84 −0
Original line number Diff line number Diff line
Kernel driver ltc2945
=====================

Supported chips:
  * Linear Technology LTC2945
    Prefix: 'ltc2945'
    Addresses scanned: -
    Datasheet:
        http://cds.linear.com/docs/en/datasheet/2945fa.pdf

Author: Guenter Roeck <linux@roeck-us.net>


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

The LTC2945  is a rail-to-rail system monitor that measures current, voltage,
and power consumption.


Usage Notes
-----------

This driver does not probe for LTC2945 devices, since there is no register
which can be safely used to identify the chip. You will have to instantiate
the devices explicitly.

Example: the following will load the driver for an LTC2945 at address 0x10
on I2C bus #1:
$ modprobe ltc2945
$ echo ltc2945 0x10 > /sys/bus/i2c/devices/i2c-1/new_device


Sysfs entries
-------------

Voltage readings provided by this driver are reported as obtained from the ADC
registers. If a set of voltage divider resistors is installed, calculate the
real voltage by multiplying the reported value with (R1+R2)/R2, where R1 is the
value of the divider resistor against the measured voltage and R2 is the value
of the divider resistor against Ground.

Current reading provided by this driver is reported as obtained from the ADC
Current Sense register. The reported value assumes that a 1 mOhm sense resistor
is installed. If a different sense resistor is installed, calculate the real
current by dividing the reported value by the sense resistor value in mOhm.

in1_input		VIN voltage (mV). Voltage is measured either at
			SENSE+ or VDD pin depending on chip configuration.
in1_min			Undervoltage threshold
in1_max			Overvoltage threshold
in1_lowest		Lowest measured voltage
in1_highest		Highest measured voltage
in1_reset_history	Write 1 to reset in1 history
in1_min_alarm		Undervoltage alarm
in1_max_alarm		Overvoltage alarm

in2_input		ADIN voltage (mV)
in2_min			Undervoltage threshold
in2_max			Overvoltage threshold
in2_lowest		Lowest measured voltage
in2_highest		Highest measured voltage
in2_reset_history	Write 1 to reset in2 history
in2_min_alarm		Undervoltage alarm
in2_max_alarm		Overvoltage alarm

curr1_input		SENSE current (mA)
curr1_min		Undercurrent threshold
curr1_max		Overcurrent threshold
curr1_lowest		Lowest measured current
curr1_highest		Highest measured current
curr1_reset_history	Write 1 to reset curr1 history
curr1_min_alarm		Undercurrent alarm
curr1_max_alarm		Overcurrent alarm

power1_input		Power (in uW). Power is calculated based on SENSE+/VDD
			voltage or ADIN voltage depending on chip configuration.
power1_min		Low lower threshold
power1_max		High power threshold
power1_input_lowest	Historical minimum power use
power1_input_highest	Historical maximum power use
power1_reset_history	Write 1 to reset power1 history
power1_min_alarm	Low power alarm
power1_max_alarm	High power alarm
+11 −6
Original line number Diff line number Diff line
@@ -23,6 +23,10 @@ Supported chips:
    Prefix: 'ltc3883'
    Addresses scanned: -
    Datasheet: http://www.linear.com/product/ltc3883
  * Linear Technology LTM4676
    Prefix: 'ltm4676'
    Addresses scanned: -
    Datasheet: http://www.linear.com/product/ltm4676

Author: Guenter Roeck <linux@roeck-us.net>

@@ -33,7 +37,8 @@ Description
LTC2974 is a quad digital power supply manager. LTC2978 is an octal power supply
monitor. LTC2977 is a pin compatible replacement for LTC2978. LTC3880 is a dual
output poly-phase step-down DC/DC controller. LTC3883 is a single phase
step-down DC/DC controller.
step-down DC/DC controller. LTM4676 is a dual 13A or single 26A uModule
regulator.


Usage Notes
@@ -75,7 +80,7 @@ in[N]_label "vout[1-8]".
			LTC2974: N=2-5
			LTC2977: N=2-9
			LTC2978: N=2-9
			LTC3880: N=2-3
			LTC3880, LTM4676: N=2-3
			LTC3883: N=2
in[N]_input		Measured output voltage.
in[N]_min		Minimum output voltage.
@@ -95,7 +100,7 @@ temp[N]_input Measured temperature.
			and temp5 reports the chip temperature.
			On LTC2977 and LTC2978, only one temperature measurement
			is supported and reports the chip temperature.
			On LTC3880, temp1 and temp2 report external
			On LTC3880 and LTM4676, temp1 and temp2 report external
			temperatures, and temp3 reports the chip temperature.
			On LTC3883, temp1 reports an external temperature,
			and temp2 reports the chip temperature.
@@ -123,11 +128,11 @@ power[N]_label "pout[1-4]".
			LTC2974: N=1-4
			LTC2977: Not supported
			LTC2978: Not supported
			LTC3880: N=1-2
			LTC3880, LTM4676: N=1-2
			LTC3883: N=2
power[N]_input		Measured output power.

curr1_label		"iin". LTC3880 and LTC3883 only.
curr1_label		"iin". LTC3880, LTC3883, and LTM4676 only.
curr1_input		Measured input current.
curr1_max		Maximum input current.
curr1_max_alarm		Input current high alarm.
@@ -138,7 +143,7 @@ curr[N]_label "iout[1-4]".
			LTC2974: N=1-4
			LTC2977: not supported
			LTC2978: not supported
			LTC3880: N=2-3
			LTC3880, LTM4676: N=2-3
			LTC3883: N=2
curr[N]_input		Measured output current.
curr[N]_max		Maximum output current.
+56 −0
Original line number Diff line number Diff line
Kernel driver ltc4260
=====================

Supported chips:
  * Linear Technology LTC4260
    Prefix: 'ltc4260'
    Addresses scanned: -
    Datasheet:
        http://cds.linear.com/docs/en/datasheet/4260fc.pdf

Author: Guenter Roeck <linux@roeck-us.net>


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

The LTC4260 Hot Swap controller allows a board to be safely inserted
and removed from a live backplane.


Usage Notes
-----------

This driver does not probe for LTC4260 devices, since there is no register
which can be safely used to identify the chip. You will have to instantiate
the devices explicitly.

Example: the following will load the driver for an LTC4260 at address 0x10
on I2C bus #1:
$ modprobe ltc4260
$ echo ltc4260 0x10 > /sys/bus/i2c/devices/i2c-1/new_device


Sysfs entries
-------------

Voltage readings provided by this driver are reported as obtained from the ADC
registers. If a set of voltage divider resistors is installed, calculate the
real voltage by multiplying the reported value with (R1+R2)/R2, where R1 is the
value of the divider resistor against the measured voltage and R2 is the value
of the divider resistor against Ground.

Current reading provided by this driver is reported as obtained from the ADC
Current Sense register. The reported value assumes that a 1 mOhm sense resistor
is installed. If a different sense resistor is installed, calculate the real
current by dividing the reported value by the sense resistor value in mOhm.

in1_input		SOURCE voltage (mV)
in1_min_alarm		Undervoltage alarm
in1_max_alarm		Overvoltage alarm

in2_input		ADIN voltage (mV)
in2_alarm		Power bad alarm

curr1_input		SENSE current (mA)
curr1_alarm		SENSE overcurrent alarm
Loading