Skip to content

Commit 129b9a5

Browse files
committed
Merge tag 'hwmon-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon updates from Guenter Roeck: "Infrastructure: - Add notification support New drivers: - Baikal-T1 PVT sensor driver - amd_energy driver to report energy counters - Driver for Maxim MAX16601 - Gateworks System Controller Various: - applesmc: avoid overlong udelay() - dell-smm: Use one DMI match for all XPS models - ina2xx: Implement alert functions - lm70: Add support for ACPI - lm75: Fix coding-style warnings - lm90: Add max6654 support to lm90 driver - nct7802: Replace container_of() API - nct7904: Set default timeout - nct7904: Add watchdog function - pmbus: Improve initialization of 'currpage' and 'currphase'" * tag 'hwmon-for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (24 commits) hwmon: Add Baikal-T1 PVT sensor driver hwmon: Add notification support dt-bindings: hwmon: Add Baikal-T1 PVT sensor binding hwmon: (applesmc) avoid overlong udelay() hwmon: (nct7904) Set default timeout hwmon: (amd_energy) Missing platform_driver_unregister() on error in amd_energy_init() MAINTAINERS: add entry for AMD energy driver hwmon: (amd_energy) Add documentation hwmon: Add amd_energy driver to report energy counters hwmon: (nct7802) Replace container_of() API hwmon: (lm90) Add max6654 support to lm90 driver hwmon : (nct6775) Use kobj_to_dev() API hwmon: (pmbus) Driver for Maxim MAX16601 hwmon: (pmbus) Improve initialization of 'currpage' and 'currphase' hwmon: (adt7411) update contact email hwmon: (lm75) Fix all coding-style warnings on lm75 driver hwmon: Reduce indentation level in __hwmon_device_register() hwmon: (ina2xx) Implement alert functions hwmon: (lm70) Add support for ACPI hwmon: (dell-smm) Use one DMI match for all XPS models ...
2 parents b6f91ab + 87976ce commit 129b9a5

38 files changed

+4342
-106
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
# Copyright (C) 2020 BAIKAL ELECTRONICS, JSC
3+
%YAML 1.2
4+
---
5+
$id: http://devicetree.org/schemas/hwmon/baikal,bt1-pvt.yaml#
6+
$schema: http://devicetree.org/meta-schemas/core.yaml#
7+
8+
title: Baikal-T1 PVT Sensor
9+
10+
maintainers:
11+
- Serge Semin <[email protected]>
12+
13+
description: |
14+
Baikal-T1 SoC provides an embedded process, voltage and temperature
15+
sensor to monitor an internal SoC environment (chip temperature, supply
16+
voltage and process monitor) and on time detect critical situations,
17+
which may cause the system instability and even damages. The IP-block
18+
is based on the Analog Bits PVT sensor, but is equipped with a dedicated
19+
control wrapper, which provides a MMIO registers-based access to the
20+
sensor core functionality (APB3-bus based) and exposes an additional
21+
functions like thresholds/data ready interrupts, its status and masks,
22+
measurements timeout. Its internal structure is depicted on the next
23+
diagram:
24+
25+
Analog Bits core Bakal-T1 PVT control block
26+
+--------------------+ +------------------------+
27+
| Temperature sensor |-+ +------| Sensors control |
28+
|--------------------| |<---En---| |------------------------|
29+
| Voltage sensor |-|<--Mode--| +--->| Sampled data |
30+
|--------------------| |<--Trim--+ | |------------------------|
31+
| Low-Vt sensor |-| | +--| Thresholds comparator |
32+
|--------------------| |---Data----| | |------------------------|
33+
| High-Vt sensor |-| | +->| Interrupts status |
34+
|--------------------| |--Valid--+-+ | |------------------------|
35+
| Standard-Vt sensor |-+ +---+--| Interrupts mask |
36+
+--------------------+ |------------------------|
37+
^ | Interrupts timeout |
38+
| +------------------------+
39+
| ^ ^
40+
Rclk-----+----------------------------------------+ |
41+
APB3-------------------------------------------------+
42+
43+
This bindings describes the external Baikal-T1 PVT control interfaces
44+
like MMIO registers space, interrupt request number and clocks source.
45+
These are then used by the corresponding hwmon device driver to
46+
implement the sysfs files-based access to the sensors functionality.
47+
48+
properties:
49+
compatible:
50+
const: baikal,bt1-pvt
51+
52+
reg:
53+
maxItems: 1
54+
55+
interrupts:
56+
maxItems: 1
57+
58+
clocks:
59+
items:
60+
- description: PVT reference clock
61+
- description: APB3 interface clock
62+
63+
clock-names:
64+
items:
65+
- const: ref
66+
- const: pclk
67+
68+
"#thermal-sensor-cells":
69+
description: Baikal-T1 can be referenced as the CPU thermal-sensor
70+
const: 0
71+
72+
baikal,pvt-temp-offset-millicelsius:
73+
description: |
74+
Temperature sensor trimming factor. It can be used to manually adjust the
75+
temperature measurements within 7.130 degrees Celsius.
76+
maxItems: 1
77+
items:
78+
default: 0
79+
minimum: 0
80+
maximum: 7130
81+
82+
unevaluatedProperties: false
83+
84+
required:
85+
- compatible
86+
- reg
87+
- interrupts
88+
- clocks
89+
- clock-names
90+
91+
examples:
92+
- |
93+
#include <dt-bindings/interrupt-controller/mips-gic.h>
94+
95+
pvt@1f200000 {
96+
compatible = "baikal,bt1-pvt";
97+
reg = <0x1f200000 0x1000>;
98+
#thermal-sensor-cells = <0>;
99+
100+
interrupts = <GIC_SHARED 31 IRQ_TYPE_LEVEL_HIGH>;
101+
102+
baikal,pvt-temp-trim-millicelsius = <1000>;
103+
104+
clocks = <&ccu_sys>, <&ccu_sys>;
105+
clock-names = "ref", "pclk";
106+
};
107+
...
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/mfd/gateworks-gsc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Gateworks System Controller
8+
9+
description: |
10+
The Gateworks System Controller (GSC) is a device present across various
11+
Gateworks product families that provides a set of system related features
12+
such as the following (refer to the board hardware user manuals to see what
13+
features are present)
14+
- Watchdog Timer
15+
- GPIO
16+
- Pushbutton controller
17+
- Hardware monitor with ADC's for temperature and voltage rails and
18+
fan controller
19+
20+
maintainers:
21+
- Tim Harvey <[email protected]>
22+
- Robert Jones <[email protected]>
23+
24+
properties:
25+
$nodename:
26+
pattern: "gsc@[0-9a-f]{1,2}"
27+
compatible:
28+
const: gw,gsc
29+
30+
reg:
31+
description: I2C device address
32+
maxItems: 1
33+
34+
interrupts:
35+
maxItems: 1
36+
37+
interrupt-controller: true
38+
39+
"#interrupt-cells":
40+
const: 1
41+
42+
"#address-cells":
43+
const: 1
44+
45+
"#size-cells":
46+
const: 0
47+
48+
adc:
49+
type: object
50+
description: Optional hardware monitoring module
51+
52+
properties:
53+
compatible:
54+
const: gw,gsc-adc
55+
56+
"#address-cells":
57+
const: 1
58+
59+
"#size-cells":
60+
const: 0
61+
62+
patternProperties:
63+
"^channel@[0-9]+$":
64+
type: object
65+
description: |
66+
Properties for a single ADC which can report cooked values
67+
(i.e. temperature sensor based on thermister), raw values
68+
(i.e. voltage rail with a pre-scaling resistor divider).
69+
70+
properties:
71+
reg:
72+
description: Register of the ADC
73+
maxItems: 1
74+
75+
label:
76+
description: Name of the ADC input
77+
78+
gw,mode:
79+
description: |
80+
conversion mode:
81+
0 - temperature, in C*10
82+
1 - pre-scaled voltage value
83+
2 - scaled voltage based on an optional resistor divider
84+
and optional offset
85+
$ref: /schemas/types.yaml#/definitions/uint32
86+
enum: [0, 1, 2]
87+
88+
gw,voltage-divider-ohms:
89+
description: Values of resistors for divider on raw ADC input
90+
maxItems: 2
91+
items:
92+
minimum: 1000
93+
maximum: 1000000
94+
95+
gw,voltage-offset-microvolt:
96+
description: |
97+
A positive voltage offset to apply to a raw ADC
98+
(i.e. to compensate for a diode drop).
99+
minimum: 0
100+
maximum: 1000000
101+
102+
required:
103+
- gw,mode
104+
- reg
105+
- label
106+
107+
required:
108+
- compatible
109+
- "#address-cells"
110+
- "#size-cells"
111+
112+
patternProperties:
113+
"^fan-controller@[0-9a-f]+$":
114+
type: object
115+
description: Optional fan controller
116+
117+
properties:
118+
compatible:
119+
const: gw,gsc-fan
120+
121+
"#address-cells":
122+
const: 1
123+
124+
"#size-cells":
125+
const: 0
126+
127+
reg:
128+
description: The fan controller base address
129+
maxItems: 1
130+
131+
required:
132+
- compatible
133+
- reg
134+
- "#address-cells"
135+
- "#size-cells"
136+
137+
required:
138+
- compatible
139+
- reg
140+
- interrupts
141+
- interrupt-controller
142+
- "#interrupt-cells"
143+
- "#address-cells"
144+
- "#size-cells"
145+
146+
examples:
147+
- |
148+
#include <dt-bindings/gpio/gpio.h>
149+
i2c {
150+
#address-cells = <1>;
151+
#size-cells = <0>;
152+
153+
gsc@20 {
154+
compatible = "gw,gsc";
155+
reg = <0x20>;
156+
interrupt-parent = <&gpio1>;
157+
interrupts = <4 GPIO_ACTIVE_LOW>;
158+
interrupt-controller;
159+
#interrupt-cells = <1>;
160+
#address-cells = <1>;
161+
#size-cells = <0>;
162+
163+
adc {
164+
compatible = "gw,gsc-adc";
165+
#address-cells = <1>;
166+
#size-cells = <0>;
167+
168+
channel@0 { /* A0: Board Temperature */
169+
reg = <0x00>;
170+
label = "temp";
171+
gw,mode = <0>;
172+
};
173+
174+
channel@2 { /* A1: Input Voltage (raw ADC) */
175+
reg = <0x02>;
176+
label = "vdd_vin";
177+
gw,mode = <1>;
178+
gw,voltage-divider-ohms = <22100 1000>;
179+
gw,voltage-offset-microvolt = <800000>;
180+
};
181+
182+
channel@b { /* A2: Battery voltage */
183+
reg = <0x0b>;
184+
label = "vdd_bat";
185+
gw,mode = <1>;
186+
};
187+
};
188+
189+
fan-controller@2c {
190+
#address-cells = <1>;
191+
#size-cells = <0>;
192+
compatible = "gw,gsc-fan";
193+
reg = <0x2c>;
194+
};
195+
};
196+
};

0 commit comments

Comments
 (0)