Skip to content

Commit

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

Pull hwmon updates from Guenter Roeck:

 - new drivers:
   - Lantiq CPU temperature sensor
   - IBM CFF power supply
   - TPS53679 PMBus driver

 - new support:
   - LM5066I (lm25066 PMBus driver)
   - Intel VID protocol VR13 (PMBus drivers)
   - CAT34TS02C, GT30TS00, GT34TS02, and CAT34TS04 (jc42 driver)

 - cleanup and minor improvements in several drivers

* tag 'hwmon-for-linus-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (36 commits)
  hwmon: (ltq-cputemp) add cpu temp sensor driver
  hwmon: (ltq-cputemp) add devicetree bindings documentation
  hwmon: (pmbus) Add support for Texas Instruments tps53679 device
  hwmon: (asc7621) make several arrays static const
  hwmon: (pmbus/lm25066) Add support for TI LM5066I
  hwmon: (pmbus/lm25066) Offset coefficient depends on CL
  hwmon: (pmbus) Add support for Intel VID protocol VR13
  Documentation: hwmon: Document the IBM CFF power supply
  hwmon: (pmbus) Add IBM Common Form Factor (CFF) power supply driver
  dt-bindings: hwmon: Document the IBM CCF power supply version 1
  hwmon: (ftsteutates) constify i2c_device_id
  hwmon: da9052: Add support for TSI channel
  mfd: da9052: Make touchscreen registration optional
  hwmon: da9052: Replace S_IRUGO with 0444
  mfd: da9052: Add register details for TSI
  hwmon: (aspeed-pwm) add THERMAL dependency
  hwmon: (pmbus) Add debugfs for status registers
  hwmon: (aspeed-pwm-tacho) cooling device support.
  Documentation: dt-bindings: aspeed-pwm-tacho cooling device.
  hwmon: (pmbus): Add generic alarm bit for iin and pin
  ...
  • Loading branch information
Linus Torvalds committed Sep 4, 2017
2 parents aa9d464 + 7074d0a commit fe91f28
Show file tree
Hide file tree
Showing 33 changed files with 1,505 additions and 138 deletions.
9 changes: 9 additions & 0 deletions Documentation/devicetree/bindings/hwmon/aspeed-pwm-tacho.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Required properties for pwm-tacho node:

- #size-cells : should be 1.

- #cooling-cells: should be 2.

- reg : address and length of the register set for the device.

- pinctrl-names : a pinctrl state named "default" must be defined.
Expand All @@ -28,12 +30,17 @@ fan subnode format:
Under fan subnode there can upto 8 child nodes, with each child node
representing a fan. If there are 8 fans each fan can have one PWM port and
one/two Fan tach inputs.
For PWM port can be configured cooling-levels to create cooling device.
Cooling device could be bound to a thermal zone for the thermal control.

Required properties for each child node:
- reg : should specify PWM source port.
integer value in the range 0 to 7 with 0 indicating PWM port A and
7 indicating PWM port H.

- cooling-levels: PWM duty cycle values in a range from 0 to 255
which correspond to thermal cooling states.

- aspeed,fan-tach-ch : should specify the Fan tach input channel.
integer value in the range 0 through 15, with 0 indicating
Fan tach channel 0 and 15 indicating Fan tach channel 15.
Expand All @@ -50,6 +57,7 @@ pwm_tacho_fixed_clk: fixedclk {
pwm_tacho: pwmtachocontroller@1e786000 {
#address-cells = <1>;
#size-cells = <1>;
#cooling-cells = <2>;
reg = <0x1E786000 0x1000>;
compatible = "aspeed,ast2500-pwm-tacho";
clocks = <&pwm_tacho_fixed_clk>;
Expand All @@ -58,6 +66,7 @@ pwm_tacho: pwmtachocontroller@1e786000 {

fan@0 {
reg = <0x00>;
cooling-levels = /bits/ 8 <125 151 177 203 229 255>;
aspeed,fan-tach-ch = /bits/ 8 <0x00>;
};

Expand Down
21 changes: 21 additions & 0 deletions Documentation/devicetree/bindings/hwmon/ibm,cffps1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Device-tree bindings for IBM Common Form Factor Power Supply Version 1
----------------------------------------------------------------------

Required properties:
- compatible = "ibm,cffps1";
- reg = < I2C bus address >; : Address of the power supply on the
I2C bus.

Example:

i2c-bus@100 {
#address-cells = <1>;
#size-cells = <0>;
#interrupt-cells = <1>;
< more properties >

power-supply@68 {
compatible = "ibm,cffps1";
reg = <0x68>;
};
};
10 changes: 10 additions & 0 deletions Documentation/devicetree/bindings/hwmon/ltq-cputemp.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Lantiq cpu temperatur sensor

Requires node properties:
- compatible value :
"lantiq,cputemp"

Example:
cputemp@0 {
compatible = "lantiq,cputemp";
};
4 changes: 4 additions & 0 deletions Documentation/hwmon/ftsteutates
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ enhancements. It can monitor up to 4 voltages, 16 temperatures and
8 fans. It also contains an integrated watchdog which is currently
implemented in this driver.

To clear a temperature or fan alarm, execute the following command with the
correct path to the alarm file:
echo 0 >XXXX_alarm

Specification of the chip can be found here:
ftp://ftp.ts.fujitsu.com/pub/Mainboard-OEM-Sales/Services/Software&Tools/Linux_SystemMonitoring&Watchdog&GPIO/BMC-Teutates_Specification_V1.21.pdf
ftp://ftp.ts.fujitsu.com/pub/Mainboard-OEM-Sales/Services/Software&Tools/Linux_SystemMonitoring&Watchdog&GPIO/Fujitsu_mainboards-1-Sensors_HowTo-en-US.pdf
54 changes: 54 additions & 0 deletions Documentation/hwmon/ibm-cffps
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Kernel driver ibm-cffps
=======================

Supported chips:
* IBM Common Form Factor power supply

Author: Eddie James <eajames@us.ibm.com>

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

This driver supports IBM Common Form Factor (CFF) power supplies. This driver
is a client to the core PMBus driver.

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

This driver does not auto-detect devices. You will have to instantiate the
devices explicitly. Please see Documentation/i2c/instantiating-devices for
details.

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

The following attributes are supported:

curr1_alarm Output current over-current alarm.
curr1_input Measured output current in mA.
curr1_label "iout1"

fan1_alarm Fan 1 warning.
fan1_fault Fan 1 fault.
fan1_input Fan 1 speed in RPM.
fan2_alarm Fan 2 warning.
fan2_fault Fan 2 fault.
fan2_input Fan 2 speed in RPM.

in1_alarm Input voltage under-voltage alarm.
in1_input Measured input voltage in mV.
in1_label "vin"
in2_alarm Output voltage over-voltage alarm.
in2_input Measured output voltage in mV.
in2_label "vout1"

power1_alarm Input fault or alarm.
power1_input Measured input power in uW.
power1_label "pin"

temp1_alarm PSU inlet ambient temperature over-temperature alarm.
temp1_input Measured PSU inlet ambient temp in millidegrees C.
temp2_alarm Secondary rectifier temp over-temperature alarm.
temp2_input Measured secondary rectifier temp in millidegrees C.
temp3_alarm ORing FET temperature over-temperature alarm.
temp3_input Measured ORing FET temperature in millidegrees C.
9 changes: 7 additions & 2 deletions Documentation/hwmon/lm25066
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Supported chips:
Addresses scanned: -
Datasheet:
http://www.national.com/pf/LM/LM5066.html
* Texas Instruments LM5066I
Prefix: 'lm5066i'
Addresses scanned: -
Datasheet:
http://www.ti.com/product/LM5066I

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

Expand All @@ -37,8 +42,8 @@ Description
-----------

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

The driver is a client driver to the core PMBus driver. Please see
Documentation/hwmon/pmbus for details on PMBus client drivers.
Expand Down
8 changes: 8 additions & 0 deletions drivers/hwmon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ config SENSORS_ASB100

config SENSORS_ASPEED
tristate "ASPEED AST2400/AST2500 PWM and Fan tach driver"
depends on THERMAL || THERMAL=n
select REGMAP
help
This driver provides support for ASPEED AST2400/AST2500 PWM
Expand Down Expand Up @@ -790,6 +791,13 @@ config SENSORS_LTC4261
This driver can also be built as a module. If so, the module will
be called ltc4261.

config SENSORS_LTQ_CPUTEMP
bool "Lantiq cpu temperature sensor driver"
depends on LANTIQ
help
If you say yes here you get support for the temperature
sensor inside your CPU.

config SENSORS_MAX1111
tristate "Maxim MAX1111 Serial 8-bit ADC chip and compatibles"
depends on SPI_MASTER
Expand Down
1 change: 1 addition & 0 deletions drivers/hwmon/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ obj-$(CONFIG_SENSORS_LTC4222) += ltc4222.o
obj-$(CONFIG_SENSORS_LTC4245) += ltc4245.o
obj-$(CONFIG_SENSORS_LTC4260) += ltc4260.o
obj-$(CONFIG_SENSORS_LTC4261) += ltc4261.o
obj-$(CONFIG_SENSORS_LTQ_CPUTEMP) += ltq-cputemp.o
obj-$(CONFIG_SENSORS_MAX1111) += max1111.o
obj-$(CONFIG_SENSORS_MAX16065) += max16065.o
obj-$(CONFIG_SENSORS_MAX1619) += max1619.o
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/adc128d818.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ static struct attribute *adc128_attrs[] = {
NULL
};

static struct attribute_group adc128_group = {
static const struct attribute_group adc128_group = {
.attrs = adc128_attrs,
.is_visible = adc128_is_visible,
};
Expand Down
14 changes: 6 additions & 8 deletions drivers/hwmon/ads1015.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,24 +191,23 @@ static int ads1015_get_channels_config_of(struct i2c_client *client)
unsigned int data_rate = ADS1015_DEFAULT_DATA_RATE;

if (of_property_read_u32(node, "reg", &pval)) {
dev_err(&client->dev, "invalid reg on %s\n",
node->full_name);
dev_err(&client->dev, "invalid reg on %pOF\n", node);
continue;
}

channel = pval;
if (channel >= ADS1015_CHANNELS) {
dev_err(&client->dev,
"invalid channel index %d on %s\n",
channel, node->full_name);
"invalid channel index %d on %pOF\n",
channel, node);
continue;
}

if (!of_property_read_u32(node, "ti,gain", &pval)) {
pga = pval;
if (pga > 6) {
dev_err(&client->dev, "invalid gain on %s\n",
node->full_name);
dev_err(&client->dev, "invalid gain on %pOF\n",
node);
return -EINVAL;
}
}
Expand All @@ -217,8 +216,7 @@ static int ads1015_get_channels_config_of(struct i2c_client *client)
data_rate = pval;
if (data_rate > 7) {
dev_err(&client->dev,
"invalid data_rate on %s\n",
node->full_name);
"invalid data_rate on %pOF\n", node);
return -EINVAL;
}
}
Expand Down
16 changes: 8 additions & 8 deletions drivers/hwmon/adt7475.c
Original file line number Diff line number Diff line change
Expand Up @@ -1319,14 +1319,14 @@ static struct attribute *vid_attrs[] = {
NULL
};

static struct attribute_group adt7475_attr_group = { .attrs = adt7475_attrs };
static struct attribute_group fan4_attr_group = { .attrs = fan4_attrs };
static struct attribute_group pwm2_attr_group = { .attrs = pwm2_attrs };
static struct attribute_group in0_attr_group = { .attrs = in0_attrs };
static struct attribute_group in3_attr_group = { .attrs = in3_attrs };
static struct attribute_group in4_attr_group = { .attrs = in4_attrs };
static struct attribute_group in5_attr_group = { .attrs = in5_attrs };
static struct attribute_group vid_attr_group = { .attrs = vid_attrs };
static const struct attribute_group adt7475_attr_group = { .attrs = adt7475_attrs };
static const struct attribute_group fan4_attr_group = { .attrs = fan4_attrs };
static const struct attribute_group pwm2_attr_group = { .attrs = pwm2_attrs };
static const struct attribute_group in0_attr_group = { .attrs = in0_attrs };
static const struct attribute_group in3_attr_group = { .attrs = in3_attrs };
static const struct attribute_group in4_attr_group = { .attrs = in4_attrs };
static const struct attribute_group in5_attr_group = { .attrs = in5_attrs };
static const struct attribute_group vid_attr_group = { .attrs = vid_attrs };

static int adt7475_detect(struct i2c_client *client,
struct i2c_board_info *info)
Expand Down
4 changes: 2 additions & 2 deletions drivers/hwmon/asc7621.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ static ssize_t show_pwm_ac(struct device *dev,
{
SETUP_SHOW_DATA_PARAM(dev, attr);
u8 config, altbit, regval;
const u8 map[] = {
static const u8 map[] = {
0x01, 0x02, 0x04, 0x1f, 0x00, 0x06, 0x07, 0x10,
0x08, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f
};
Expand All @@ -533,7 +533,7 @@ static ssize_t store_pwm_ac(struct device *dev,
SETUP_STORE_DATA_PARAM(dev, attr);
unsigned long reqval;
u8 currval, config, altbit, newval;
const u16 map[] = {
static const u16 map[] = {
0x04, 0x00, 0x01, 0xff, 0x02, 0xff, 0x05, 0x06,
0x08, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
Expand Down
Loading

0 comments on commit fe91f28

Please sign in to comment.