Skip to content

Commit 3bce537

Browse files
GateworksLee Jones
authored andcommitted
hwmon: Add Gateworks System Controller support
The Gateworks System Controller has a hwmon sub-component that exposes up to 16 ADC's, some of which are temperature sensors, others which are voltage inputs. The ADC configuration (register mapping and name) is configured via device-tree and varies board to board. Signed-off-by: Tim Harvey <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Lee Jones <[email protected]>
1 parent d852349 commit 3bce537

File tree

7 files changed

+501
-0
lines changed

7 files changed

+501
-0
lines changed

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
@@ -60,6 +60,7 @@ Hardware Monitoring Kernel Drivers
6060
ftsteutates
6161
g760a
6262
g762
63+
gsc-hwmon
6364
gl518sm
6465
hih6130
6566
ibmaem

MAINTAINERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7035,6 +7035,9 @@ S: Maintained
70357035
F: Documentation/devicetree/bindings/mfd/gateworks-gsc.yaml
70367036
F: drivers/mfd/gateworks-gsc.c
70377037
F: include/linux/mfd/gsc.h
7038+
F: Documentation/hwmon/gsc-hwmon.rst
7039+
F: drivers/hwmon/gsc-hwmon.c
7040+
F: include/linux/platform_data/gsc_hwmon.h
70387041

70397042
GASKET DRIVER FRAMEWORK
70407043
M: Rob Springer <[email protected]>

drivers/hwmon/Kconfig

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

526+
config SENSORS_GSC
527+
tristate "Gateworks System Controller ADC"
528+
depends on MFD_GATEWORKS_GSC
529+
help
530+
Support for the Gateworks System Controller A/D converters.
531+
532+
To compile this driver as a module, choose M here:
533+
the module will be called gsc-hwmon.
534+
526535
config SENSORS_MC13783_ADC
527536
tristate "Freescale MC13783/MC13892 ADC"
528537
depends on MFD_MC13XXX

drivers/hwmon/Makefile

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

0 commit comments

Comments
 (0)