Skip to content

Commit

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

Pull hwmon updates from Guenter Roeck:
 - New drivers for NSA320 and LTC2990
 - Added support for ADM1278 to adm1275 driver
 - Added support for ncpXXxh103 to ntc_thermistor driver
 - Renamed vexpress hwmon implementation
 - Minor cleanups and improvements

* tag 'hwmon-for-linus-v4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: Create an NSA320 hardware monitoring driver
  hwmon: Define binding for the nsa320-hwmon driver
  hwmon: (adm1275) Add support for ADM1278
  hwmon: (ntc_thermistor) Add support for ncpXXxh103
  Doc: hwmon: Fix typo "montoring" in hwmon
  ARM: dts: vfxxx: Add iio_hwmon node for ADC temperature channel
  ARM: dts: Change iio_hwmon nodes to use hypen in node names
  hwmon: (iio_hwmon) Allow the driver to accept hypen in device tree node names
  hwmon: Add LTC2990 sensor driver
  hwmon: (vexpress) rename vexpress hwmon implementation
  • Loading branch information
torvalds committed Mar 16, 2016
2 parents 555f816 + 630300d commit f0718ce
Show file tree
Hide file tree
Showing 26 changed files with 677 additions and 23 deletions.
20 changes: 20 additions & 0 deletions Documentation/devicetree/bindings/hwmon/nsa320-mcu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Bindings for the fan / temperature monitor microcontroller used on
the Zyxel NSA 320 and several subsequent models.

Required properties:
- compatible : "zyxel,nsa320-mcu"
- data-gpios : The GPIO pin connected to the data line on the MCU
- clk-gpios : The GPIO pin connected to the clock line on the MCU
- act-gpios : The GPIO pin connected to the active line on the MCU

Example:

hwmon {
compatible = "zyxel,nsa320-mcu";
pinctrl-0 = <&pmx_mcu_data &pmx_mcu_clk &pmx_mcu_act>;
pinctrl-names = "default";

data-gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
clk-gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
act-gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
};
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/hwmon/ntc_thermistor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Requires node properties:
"murata,ncp03wb473"
"murata,ncp15wl333"
"murata,ncp03wf104"
"murata,ncp15xh103"

/* Usage of vendor name "ntc" is deprecated */
<DEPRECATED> "ntc,ncp15wb473"
Expand Down
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/iio/iio-bindings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ vdd channel is connected to output 0 of the &ref device.

...

iio_hwmon {
iio-hwmon {
compatible = "iio-hwmon";
io-channels = <&adc 0>, <&adc 1>, <&adc 2>,
<&adc 3>, <&adc 4>, <&adc 5>,
Expand Down
29 changes: 23 additions & 6 deletions Documentation/hwmon/adm1275
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Supported chips:
Prefix: 'adm1276'
Addresses scanned: -
Datasheet: www.analog.com/static/imported-files/data_sheets/ADM1276.pdf
* Analog Devices ADM1278
Prefix: 'adm1278'
Addresses scanned: -
Datasheet: www.analog.com/static/imported-files/data_sheets/ADM1278.pdf
* Analog Devices ADM1293/ADM1294
Prefix: 'adm1293', 'adm1294'
Addresses scanned: -
Expand All @@ -25,13 +29,15 @@ Author: Guenter Roeck <[email protected]>
Description
-----------

This driver supports hardware montoring for Analog Devices ADM1075, ADM1275,
ADM1276, ADM1293, and ADM1294 Hot-Swap Controller and Digital Power Monitors.
This driver supports hardware monitoring for Analog Devices ADM1075, ADM1275,
ADM1276, ADM1278, ADM1293, and ADM1294 Hot-Swap Controller and Digital
Power Monitors.

ADM1075, ADM1275, ADM1276, ADM1293, and ADM1294 are hot-swap controllers that
allow a circuit board to be removed from or inserted into a live backplane.
They also feature current and voltage readback via an integrated 12
bit analog-to-digital converter (ADC), accessed using a PMBus interface.
ADM1075, ADM1275, ADM1276, ADM1278, ADM1293, and ADM1294 are hot-swap
controllers that allow a circuit board to be removed from or inserted into
a live backplane. They also feature current and voltage readback via an
integrated 12 bit analog-to-digital converter (ADC), accessed using a
PMBus interface.

The driver is a client driver to the core PMBus driver. Please see
Documentation/hwmon/pmbus for details on PMBus client drivers.
Expand Down Expand Up @@ -96,3 +102,14 @@ power1_reset_history Write any value to reset history.

Power attributes are supported on ADM1075, ADM1276,
ADM1293, and ADM1294.

temp1_input Chip temperature.
Temperature attributes are only available on ADM1278.
temp1_max Maximum chip temperature.
temp1_max_alarm Temperature alarm.
temp1_crit Critical chip temperature.
temp1_crit_alarm Critical temperature high alarm.
temp1_highest Highest observed temperature.
temp1_reset_history Write any value to reset history.

Temperature attributes are supported on ADM1278.
2 changes: 1 addition & 1 deletion Documentation/hwmon/lm25066
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Author: Guenter Roeck <[email protected]>
Description
-----------

This driver supports hardware montoring for National Semiconductor / TI LM25056,
This driver supports hardware monitoring for National Semiconductor / TI LM25056,
LM25063, LM25066, LM5064, and LM5066 Power Management, Monitoring, Control, and
Protection ICs.

Expand Down
43 changes: 43 additions & 0 deletions Documentation/hwmon/ltc2990
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Kernel driver ltc2990
=====================

Supported chips:
* Linear Technology LTC2990
Prefix: 'ltc2990'
Addresses scanned: -
Datasheet: http://www.linear.com/product/ltc2990

Author: Mike Looijmans <[email protected]>


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

LTC2990 is a Quad I2C Voltage, Current and Temperature Monitor.
The chip's inputs can measure 4 voltages, or two inputs together (1+2 and 3+4)
can be combined to measure a differential voltage, which is typically used to
measure current through a series resistor, or a temperature.

This driver currently uses the 2x differential mode only. In order to support
other modes, the driver will need to be expanded.


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

This driver does not probe for PMBus devices. You will have to instantiate
devices explicitly.


Sysfs attributes
----------------

The "curr*_input" measurements actually report the voltage drop across the
input pins in microvolts. This is equivalent to the current through a 1mOhm
sense resistor. Divide the reported value by the actual sense resistor value
in mOhm to get the actual value.

in0_input Voltage at Vcc pin in millivolt (range 2.5V to 5V)
temp1_input Internal chip temperature in millidegrees Celcius
curr1_input Current in mA across v1-v2 assuming a 1mOhm sense resistor.
curr2_input Current in mA across v3-v4 assuming a 1mOhm sense resistor.
2 changes: 1 addition & 1 deletion Documentation/hwmon/max16064
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Author: Guenter Roeck <[email protected]>
Description
-----------

This driver supports hardware montoring for Maxim MAX16064 Quad Power-Supply
This driver supports hardware monitoring for Maxim MAX16064 Quad Power-Supply
Controller with Active-Voltage Output Control and PMBus Interface.

The driver is a client driver to the core PMBus driver.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/hwmon/max34440
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Author: Guenter Roeck <[email protected]>
Description
-----------

This driver supports hardware montoring for Maxim MAX34440 PMBus 6-Channel
This driver supports hardware monitoring for Maxim MAX34440 PMBus 6-Channel
Power-Supply Manager, MAX34441 PMBus 5-Channel Power-Supply Manager
and Intelligent Fan Controller, and MAX34446 PMBus Power-Supply Data Logger.
It also supports the MAX34460 and MAX34461 PMBus Voltage Monitor & Sequencers.
Expand Down
2 changes: 1 addition & 1 deletion Documentation/hwmon/max8688
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Author: Guenter Roeck <[email protected]>
Description
-----------

This driver supports hardware montoring for Maxim MAX8688 Digital Power-Supply
This driver supports hardware monitoring for Maxim MAX8688 Digital Power-Supply
Controller/Monitor with PMBus Interface.

The driver is a client driver to the core PMBus driver. Please see
Expand Down
53 changes: 53 additions & 0 deletions Documentation/hwmon/nsa320
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Kernel driver nsa320_hwmon
==========================

Supported chips:
* Holtek HT46R065 microcontroller with onboard firmware that configures
it to act as a hardware monitor.
Prefix: 'nsa320'
Addresses scanned: none
Datasheet: Not available, driver was reverse engineered based upon the
Zyxel kernel source

Author:
Adam Baker <[email protected]>

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

This chip is known to be used in the Zyxel NSA320 and NSA325 NAS Units and
also in some variants of the NSA310 but the driver has only been tested
on the NSA320. In all of these devices it is connected to the same 3 GPIO
lines which are used to provide chip select, clock and data lines. The
interface behaves similarly to SPI but at much lower speeds than are normally
used for SPI.

Following each chip select pulse the chip will generate a single 32 bit word
that contains 0x55 as a marker to indicate that data is being read correctly,
followed by an 8 bit fan speed in 100s of RPM and a 16 bit temperature in
tenths of a degree.


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

temp1_input - temperature input
fan1_input - fan speed

Notes
-----

The access timings used in the driver are the same as used in the Zyxel
provided kernel. Testing has shown that if the delay between chip select and
the first clock pulse is reduced from 100 ms to just under 10ms then the chip
will not produce any output. If the duration of either phase of the clock
is reduced from 100 us to less than 15 us then data pulses are likely to be
read twice corrupting the output. The above analysis is based upon a sample
of one unit but suggests that the Zyxel provided delay values include a
reasonable tolerance.

The driver incorporates a limit that it will not check for updated values
faster than once a second. This is because the hardware takes a relatively long
time to read the data from the device and when it does it reads both temp and
fan speed. As the most likely case for two accesses in quick succession is
to read both of these values avoiding a second read delay is desirable.
4 changes: 2 additions & 2 deletions Documentation/hwmon/ntc_thermistor
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Kernel driver ntc_thermistor

Supported thermistors from Murata:
* Murata NTC Thermistors NCP15WB473, NCP18WB473, NCP21WB473, NCP03WB473,
NCP15WL333, NCP03WF104
NCP15WL333, NCP03WF104, NCP15XH103
Prefixes: 'ncp15wb473', 'ncp18wb473', 'ncp21wb473', 'ncp03wb473',
'ncp15wl333', 'ncp03wf104'
'ncp15wl333', 'ncp03wf104', 'ncp15xh103'
Datasheet: Publicly available at Murata

Supported thermistors from EPCOS:
Expand Down
2 changes: 1 addition & 1 deletion Documentation/hwmon/pmbus
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Author: Guenter Roeck <[email protected]>
Description
-----------

This driver supports hardware montoring for various PMBus compliant devices.
This driver supports hardware monitoring for various PMBus compliant devices.
It supports voltage, current, power, and temperature sensors as supported
by the device.

Expand Down
2 changes: 1 addition & 1 deletion Documentation/hwmon/zl6100
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Author: Guenter Roeck <[email protected]>
Description
-----------

This driver supports hardware montoring for Intersil / Zilker Labs ZL6100 and
This driver supports hardware monitoring for Intersil / Zilker Labs ZL6100 and
compatible digital DC-DC controllers.

The driver is a client driver to the core PMBus driver. Please see
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/imx23.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@
};
};

iio_hwmon {
iio-hwmon {
compatible = "iio-hwmon";
io-channels = <&lradc 8>;
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/imx28.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@
};
};

iio_hwmon {
iio-hwmon {
compatible = "iio-hwmon";
io-channels = <&lradc 8>;
};
Expand Down
5 changes: 5 additions & 0 deletions arch/arm/boot/dts/vfxxx.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -629,5 +629,10 @@
status = "disabled";
};
};

iio-hwmon {
compatible = "iio-hwmon";
io-channels = <&adc0 16>, <&adc1 16>;
};
};
};
31 changes: 30 additions & 1 deletion drivers/hwmon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,20 @@ config SENSORS_LTC2945
This driver can also be built as a module. If so, the module will
be called ltc2945.

config SENSORS_LTC2990
tristate "Linear Technology LTC2990 (current monitoring mode only)"
depends on I2C
help
If you say yes here you get support for Linear Technology LTC2990
I2C System Monitor. The LTC2990 supports a combination of voltage,
current and temperature monitoring, but in addition to the Vcc supply
voltage and chip temperature, this driver currently only supports
reading two currents by measuring two differential voltages across
series resistors.

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

config SENSORS_LTC4151
tristate "Linear Technology LTC4151"
depends on I2C
Expand Down Expand Up @@ -1127,7 +1141,7 @@ config SENSORS_NTC_THERMISTOR

Currently, this driver supports
NCP15WB473, NCP18WB473, NCP21WB473, NCP03WB473, NCP15WL333,
and NCP03WF104 from Murata and B57330V2103 from EPCOS.
NCP03WF104 and NCP15XH103 from Murata and B57330V2103 from EPCOS.

This driver can also be built as a module. If so, the module
will be called ntc-thermistor.
Expand Down Expand Up @@ -1176,6 +1190,21 @@ config SENSORS_NCT7904
This driver can also be built as a module. If so, the module
will be called nct7904.

config SENSORS_NSA320
tristate "ZyXEL NSA320 and compatible fan speed and temperature sensors"
depends on GPIOLIB && OF
depends on MACH_KIRKWOOD || COMPILE_TEST
help
If you say yes here you get support for hardware monitoring
for the ZyXEL NSA320 Media Server and other compatible devices
(probably the NSA325 and some NSA310 variants).

The sensor data is taken from a Holtek HT46R065 microcontroller
connected to GPIO lines.

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

config SENSORS_PCF8591
tristate "Philips PCF8591 ADC/DAC"
depends on I2C
Expand Down
4 changes: 3 additions & 1 deletion drivers/hwmon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ obj-$(CONFIG_SENSORS_LM95234) += lm95234.o
obj-$(CONFIG_SENSORS_LM95241) += lm95241.o
obj-$(CONFIG_SENSORS_LM95245) += lm95245.o
obj-$(CONFIG_SENSORS_LTC2945) += ltc2945.o
obj-$(CONFIG_SENSORS_LTC2990) += ltc2990.o
obj-$(CONFIG_SENSORS_LTC4151) += ltc4151.o
obj-$(CONFIG_SENSORS_LTC4215) += ltc4215.o
obj-$(CONFIG_SENSORS_LTC4222) += ltc4222.o
Expand All @@ -123,6 +124,7 @@ obj-$(CONFIG_SENSORS_NCT6683) += nct6683.o
obj-$(CONFIG_SENSORS_NCT6775) += nct6775.o
obj-$(CONFIG_SENSORS_NCT7802) += nct7802.o
obj-$(CONFIG_SENSORS_NCT7904) += nct7904.o
obj-$(CONFIG_SENSORS_NSA320) += nsa320-hwmon.o
obj-$(CONFIG_SENSORS_NTC_THERMISTOR) += ntc_thermistor.o
obj-$(CONFIG_SENSORS_PC87360) += pc87360.o
obj-$(CONFIG_SENSORS_PC87427) += pc87427.o
Expand All @@ -149,7 +151,7 @@ obj-$(CONFIG_SENSORS_TMP103) += tmp103.o
obj-$(CONFIG_SENSORS_TMP401) += tmp401.o
obj-$(CONFIG_SENSORS_TMP421) += tmp421.o
obj-$(CONFIG_SENSORS_TWL4030_MADC)+= twl4030-madc-hwmon.o
obj-$(CONFIG_SENSORS_VEXPRESS) += vexpress.o
obj-$(CONFIG_SENSORS_VEXPRESS) += vexpress-hwmon.o
obj-$(CONFIG_SENSORS_VIA_CPUTEMP)+= via-cputemp.o
obj-$(CONFIG_SENSORS_VIA686A) += via686a.o
obj-$(CONFIG_SENSORS_VT1211) += vt1211.o
Expand Down
11 changes: 10 additions & 1 deletion drivers/hwmon/iio_hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ static int iio_hwmon_probe(struct platform_device *pdev)
enum iio_chan_type type;
struct iio_channel *channels;
const char *name = "iio_hwmon";
char *sname;

if (dev->of_node && dev->of_node->name)
name = dev->of_node->name;
Expand Down Expand Up @@ -144,7 +145,15 @@ static int iio_hwmon_probe(struct platform_device *pdev)

st->attr_group.attrs = st->attrs;
st->groups[0] = &st->attr_group;
st->hwmon_dev = hwmon_device_register_with_groups(dev, name, st,

sname = devm_kstrdup(dev, name, GFP_KERNEL);
if (!sname) {
ret = -ENOMEM;
goto error_release_channels;
}

strreplace(sname, '-', '_');
st->hwmon_dev = hwmon_device_register_with_groups(dev, sname, st,
st->groups);
if (IS_ERR(st->hwmon_dev)) {
ret = PTR_ERR(st->hwmon_dev);
Expand Down
Loading

0 comments on commit f0718ce

Please sign in to comment.