Skip to content

Commit 8054ead

Browse files
committed
Merge tag 'ib-mfd-hwmon-v5.8' into hwmon-next
Immutable branch between MFD and HWMON due for the v5.8 merge window
2 parents 4e17f63 + 3bce537 commit 8054ead

File tree

12 files changed

+1074
-0
lines changed

12 files changed

+1074
-0
lines changed
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+
};

Documentation/hwmon/gsc-hwmon.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
Kernel driver gsc-hwmon
4+
=======================
5+
6+
Supported chips: Gateworks GSC
7+
Datasheet: http://trac.gateworks.com/wiki/gsc
8+
Author: Tim Harvey <[email protected]>
9+
10+
Description:
11+
------------
12+
13+
This driver supports hardware monitoring for the temperature sensor,
14+
various ADC's connected to the GSC, and optional FAN controller available
15+
on some boards.
16+
17+
18+
Voltage Monitoring
19+
------------------
20+
21+
The voltage inputs are scaled either internally or by the driver depending
22+
on the GSC version and firmware. The values returned by the driver do not need
23+
further scaling. The voltage input labels provide the voltage rail name:
24+
25+
inX_input Measured voltage (mV).
26+
inX_label Name of voltage rail.
27+
28+
29+
Temperature Monitoring
30+
----------------------
31+
32+
Temperatures are measured with 12-bit or 10-bit resolution and are scaled
33+
either internally or by the driver depending on the GSC version and firmware.
34+
The values returned by the driver reflect millidegree Celcius:
35+
36+
tempX_input Measured temperature.
37+
tempX_label Name of temperature input.
38+
39+
40+
PWM Output Control
41+
------------------
42+
43+
The GSC features 1 PWM output that operates in automatic mode where the
44+
PWM value will be scalled depending on 6 temperature boundaries.
45+
The tempeature boundaries are read-write and in millidegree Celcius and the
46+
read-only PWM values range from 0 (off) to 255 (full speed).
47+
Fan speed will be set to minimum (off) when the temperature sensor reads
48+
less than pwm1_auto_point1_temp and maximum when the temperature sensor
49+
equals or exceeds pwm1_auto_point6_temp.
50+
51+
pwm1_auto_point[1-6]_pwm PWM value.
52+
pwm1_auto_point[1-6]_temp Temperature boundary.
53+

Documentation/hwmon/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Hardware Monitoring Kernel Drivers
6161
ftsteutates
6262
g760a
6363
g762
64+
gsc-hwmon
6465
gl518sm
6566
hih6130
6667
ibmaem

MAINTAINERS

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7035,6 +7035,17 @@ F: kernel/futex.c
70357035
F: tools/perf/bench/futex*
70367036
F: tools/testing/selftests/futex/
70377037

7038+
GATEWORKS SYSTEM CONTROLLER (GSC) DRIVER
7039+
M: Tim Harvey <[email protected]>
7040+
M: Robert Jones <[email protected]>
7041+
S: Maintained
7042+
F: Documentation/devicetree/bindings/mfd/gateworks-gsc.yaml
7043+
F: drivers/mfd/gateworks-gsc.c
7044+
F: include/linux/mfd/gsc.h
7045+
F: Documentation/hwmon/gsc-hwmon.rst
7046+
F: drivers/hwmon/gsc-hwmon.c
7047+
F: include/linux/platform_data/gsc_hwmon.h
7048+
70387049
GASKET DRIVER FRAMEWORK
70397050
M: Rob Springer <[email protected]>
70407051
M: Todd Poynor <[email protected]>

drivers/hwmon/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,15 @@ config SENSORS_F75375S
533533
This driver can also be built as a module. If so, the module
534534
will be called f75375s.
535535

536+
config SENSORS_GSC
537+
tristate "Gateworks System Controller ADC"
538+
depends on MFD_GATEWORKS_GSC
539+
help
540+
Support for the Gateworks System Controller A/D converters.
541+
542+
To compile this driver as a module, choose M here:
543+
the module will be called gsc-hwmon.
544+
536545
config SENSORS_MC13783_ADC
537546
tristate "Freescale MC13783/MC13892 ADC"
538547
depends on MFD_MC13XXX

drivers/hwmon/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ obj-$(CONFIG_SENSORS_G760A) += g760a.o
7575
obj-$(CONFIG_SENSORS_G762) += g762.o
7676
obj-$(CONFIG_SENSORS_GL518SM) += gl518sm.o
7777
obj-$(CONFIG_SENSORS_GL520SM) += gl520sm.o
78+
obj-$(CONFIG_SENSORS_GSC) += gsc-hwmon.o
7879
obj-$(CONFIG_SENSORS_GPIO_FAN) += gpio-fan.o
7980
obj-$(CONFIG_SENSORS_HIH6130) += hih6130.o
8081
obj-$(CONFIG_SENSORS_ULTRA45) += ultra45_env.o

0 commit comments

Comments
 (0)