194 lines · yaml
1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause2%YAML 1.23---4$id: http://devicetree.org/schemas/mfd/gateworks-gsc.yaml#5$schema: http://devicetree.org/meta-schemas/core.yaml#6 7title: Gateworks System Controller8 9description: |10 The Gateworks System Controller (GSC) is a device present across various11 Gateworks product families that provides a set of system related features12 such as the following (refer to the board hardware user manuals to see what13 features are present)14 - Watchdog Timer15 - GPIO16 - Pushbutton controller17 - Hardware monitor with ADC's for temperature and voltage rails and18 fan controller19 20maintainers:21 - Tim Harvey <tharvey@gateworks.com>22 23properties:24 $nodename:25 pattern: "gsc@[0-9a-f]{1,2}"26 compatible:27 const: gw,gsc28 29 reg:30 description: I2C device address31 maxItems: 132 33 interrupts:34 maxItems: 135 36 interrupt-controller: true37 38 "#interrupt-cells":39 const: 140 41 "#address-cells":42 const: 143 44 "#size-cells":45 const: 046 47 adc:48 type: object49 additionalProperties: false50 description: Optional hardware monitoring module51 52 properties:53 compatible:54 const: gw,gsc-adc55 56 "#address-cells":57 const: 158 59 "#size-cells":60 const: 061 62 patternProperties:63 "^channel@[0-9a-f]+$":64 type: object65 additionalProperties: false66 description: |67 Properties for a single ADC which can report cooked values68 (i.e. temperature sensor based on thermister), raw values69 (i.e. voltage rail with a pre-scaling resistor divider).70 71 properties:72 reg:73 description: Register of the ADC74 maxItems: 175 76 label:77 description: Name of the ADC input78 79 gw,mode:80 description: |81 conversion mode:82 0 - temperature, in C*1083 1 - pre-scaled 24-bit voltage value84 2 - scaled voltage based on an optional resistor divider85 and optional offset86 3 - pre-scaled 16-bit voltage value87 4 - fan tach input to report RPM's88 $ref: /schemas/types.yaml#/definitions/uint3289 enum: [0, 1, 2, 3, 4]90 91 gw,voltage-divider-ohms:92 description: Values of resistors for divider on raw ADC input93 maxItems: 294 items:95 minimum: 100096 maximum: 100000097 98 gw,voltage-offset-microvolt:99 description: |100 A positive voltage offset to apply to a raw ADC101 (i.e. to compensate for a diode drop).102 minimum: 0103 maximum: 1000000104 105 required:106 - gw,mode107 - reg108 - label109 110 required:111 - compatible112 - "#address-cells"113 - "#size-cells"114 115patternProperties:116 "^fan-controller@[0-9a-f]+$":117 type: object118 additionalProperties: false119 description: Optional fan controller120 121 properties:122 compatible:123 const: gw,gsc-fan124 125 reg:126 description: The fan controller base address127 maxItems: 1128 129 required:130 - compatible131 - reg132 133required:134 - compatible135 - reg136 - interrupts137 - interrupt-controller138 - "#interrupt-cells"139 - "#address-cells"140 - "#size-cells"141 142additionalProperties: false143 144examples:145 - |146 #include <dt-bindings/gpio/gpio.h>147 #include <dt-bindings/interrupt-controller/irq.h>148 i2c {149 #address-cells = <1>;150 #size-cells = <0>;151 152 gsc@20 {153 compatible = "gw,gsc";154 reg = <0x20>;155 interrupt-parent = <&gpio1>;156 interrupts = <4 IRQ_TYPE_LEVEL_LOW>;157 interrupt-controller;158 #interrupt-cells = <1>;159 #address-cells = <1>;160 #size-cells = <0>;161 162 adc {163 compatible = "gw,gsc-adc";164 #address-cells = <1>;165 #size-cells = <0>;166 167 channel@0 { /* A0: Board Temperature */168 reg = <0x00>;169 label = "temp";170 gw,mode = <0>;171 };172 173 channel@2 { /* A1: Input Voltage (raw ADC) */174 reg = <0x02>;175 label = "vdd_vin";176 gw,mode = <1>;177 gw,voltage-divider-ohms = <22100 1000>;178 gw,voltage-offset-microvolt = <800000>;179 };180 181 channel@b { /* A2: Battery voltage */182 reg = <0x0b>;183 label = "vdd_bat";184 gw,mode = <1>;185 };186 };187 188 fan-controller@2c {189 compatible = "gw,gsc-fan";190 reg = <0x2c>;191 };192 };193 };194