Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/mfd/gateworks-gsc.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: Gateworks System Controller
0008 
0009 description: |
0010   The Gateworks System Controller (GSC) is a device present across various
0011   Gateworks product families that provides a set of system related features
0012   such as the following (refer to the board hardware user manuals to see what
0013   features are present)
0014    - Watchdog Timer
0015    - GPIO
0016    - Pushbutton controller
0017    - Hardware monitor with ADC's for temperature and voltage rails and
0018      fan controller
0019 
0020 maintainers:
0021   - Tim Harvey <tharvey@gateworks.com>
0022 
0023 properties:
0024   $nodename:
0025     pattern: "gsc@[0-9a-f]{1,2}"
0026   compatible:
0027     const: gw,gsc
0028 
0029   reg:
0030     description: I2C device address
0031     maxItems: 1
0032 
0033   interrupts:
0034     maxItems: 1
0035 
0036   interrupt-controller: true
0037 
0038   "#interrupt-cells":
0039     const: 1
0040 
0041   "#address-cells":
0042     const: 1
0043 
0044   "#size-cells":
0045     const: 0
0046 
0047   adc:
0048     type: object
0049     description: Optional hardware monitoring module
0050 
0051     properties:
0052       compatible:
0053         const: gw,gsc-adc
0054 
0055       "#address-cells":
0056         const: 1
0057 
0058       "#size-cells":
0059         const: 0
0060 
0061     patternProperties:
0062       "^channel@[0-9]+$":
0063         type: object
0064         description: |
0065           Properties for a single ADC which can report cooked values
0066           (i.e. temperature sensor based on thermister), raw values
0067           (i.e. voltage rail with a pre-scaling resistor divider).
0068 
0069         properties:
0070           reg:
0071             description: Register of the ADC
0072             maxItems: 1
0073 
0074           label:
0075             description: Name of the ADC input
0076 
0077           gw,mode:
0078             description: |
0079               conversion mode:
0080                 0 - temperature, in C*10
0081                 1 - pre-scaled 24-bit voltage value
0082                 2 - scaled voltage based on an optional resistor divider
0083                     and optional offset
0084                 3 - pre-scaled 16-bit voltage value
0085                 4 - fan tach input to report RPM's
0086             $ref: /schemas/types.yaml#/definitions/uint32
0087             enum: [0, 1, 2, 3, 4]
0088 
0089           gw,voltage-divider-ohms:
0090             description: Values of resistors for divider on raw ADC input
0091             maxItems: 2
0092             items:
0093               minimum: 1000
0094               maximum: 1000000
0095 
0096           gw,voltage-offset-microvolt:
0097             description: |
0098               A positive voltage offset to apply to a raw ADC
0099               (i.e. to compensate for a diode drop).
0100             minimum: 0
0101             maximum: 1000000
0102 
0103         required:
0104           - gw,mode
0105           - reg
0106           - label
0107 
0108     required:
0109       - compatible
0110       - "#address-cells"
0111       - "#size-cells"
0112 
0113 patternProperties:
0114   "^fan-controller@[0-9a-f]+$":
0115     type: object
0116     description: Optional fan controller
0117 
0118     properties:
0119       compatible:
0120         const: gw,gsc-fan
0121 
0122       "#address-cells":
0123         const: 1
0124 
0125       "#size-cells":
0126         const: 0
0127 
0128       reg:
0129         description: The fan controller base address
0130         maxItems: 1
0131 
0132     required:
0133       - compatible
0134       - reg
0135       - "#address-cells"
0136       - "#size-cells"
0137 
0138 required:
0139   - compatible
0140   - reg
0141   - interrupts
0142   - interrupt-controller
0143   - "#interrupt-cells"
0144   - "#address-cells"
0145   - "#size-cells"
0146 
0147 additionalProperties: false
0148 
0149 examples:
0150   - |
0151     #include <dt-bindings/gpio/gpio.h>
0152     #include <dt-bindings/interrupt-controller/irq.h>
0153     i2c {
0154         #address-cells = <1>;
0155         #size-cells = <0>;
0156 
0157         gsc@20 {
0158             compatible = "gw,gsc";
0159             reg = <0x20>;
0160             interrupt-parent = <&gpio1>;
0161             interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
0162             interrupt-controller;
0163             #interrupt-cells = <1>;
0164             #address-cells = <1>;
0165             #size-cells = <0>;
0166 
0167             adc {
0168                 compatible = "gw,gsc-adc";
0169                 #address-cells = <1>;
0170                 #size-cells = <0>;
0171 
0172                 channel@0 { /* A0: Board Temperature */
0173                     reg = <0x00>;
0174                     label = "temp";
0175                     gw,mode = <0>;
0176                 };
0177 
0178                 channel@2 { /* A1: Input Voltage (raw ADC) */
0179                     reg = <0x02>;
0180                     label = "vdd_vin";
0181                     gw,mode = <1>;
0182                     gw,voltage-divider-ohms = <22100 1000>;
0183                     gw,voltage-offset-microvolt = <800000>;
0184                 };
0185 
0186                 channel@b { /* A2: Battery voltage */
0187                     reg = <0x0b>;
0188                     label = "vdd_bat";
0189                     gw,mode = <1>;
0190                 };
0191             };
0192 
0193             fan-controller@2c {
0194                 #address-cells = <1>;
0195                 #size-cells = <0>;
0196                 compatible = "gw,gsc-fan";
0197                 reg = <0x2c>;
0198             };
0199         };
0200     };