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/google,cros-ec.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006 
0007 title: ChromeOS Embedded Controller
0008 
0009 maintainers:
0010   - Benson Leung <bleung@chromium.org>
0011   - Guenter Roeck <groeck@chromium.org>
0012 
0013 description:
0014   Google's ChromeOS EC is a microcontroller which talks to the AP and
0015   implements various functions such as keyboard and battery charging.
0016   The EC can be connected through various interfaces (I2C, SPI, and others)
0017   and the compatible string specifies which interface is being used.
0018 
0019 properties:
0020   compatible:
0021     oneOf:
0022       - description:
0023           For implementations of the EC is connected through I2C.
0024         const: google,cros-ec-i2c
0025       - description:
0026           For implementations of the EC is connected through SPI.
0027         const: google,cros-ec-spi
0028       - description:
0029           For implementations of the EC is connected through RPMSG.
0030         const: google,cros-ec-rpmsg
0031 
0032   controller-data:
0033     description:
0034       SPI controller data, see bindings/spi/samsung,spi-peripheral-props.yaml
0035     type: object
0036 
0037   google,cros-ec-spi-pre-delay:
0038     description:
0039       This property specifies the delay in usecs between the
0040       assertion of the CS and the first clock pulse.
0041     $ref: /schemas/types.yaml#/definitions/uint32
0042     default: 0
0043 
0044   google,cros-ec-spi-msg-delay:
0045     description:
0046       This property specifies the delay in usecs between messages.
0047     $ref: /schemas/types.yaml#/definitions/uint32
0048     default: 0
0049 
0050   google,has-vbc-nvram:
0051     description:
0052       Some implementations of the EC include a small nvram space used to
0053       store verified boot context data. This boolean flag is used to specify
0054       whether this nvram is present or not.
0055     type: boolean
0056 
0057   mediatek,rpmsg-name:
0058     description:
0059       Must be defined if the cros-ec is a rpmsg device for a Mediatek
0060       ARM Cortex M4 Co-processor. Contains the name of the rpmsg
0061       device. Used to match the subnode to the rpmsg device announced by
0062       the SCP.
0063     $ref: "/schemas/types.yaml#/definitions/string"
0064 
0065   spi-max-frequency:
0066     description: Maximum SPI frequency of the device in Hz.
0067 
0068   reg:
0069     maxItems: 1
0070 
0071   interrupts:
0072     maxItems: 1
0073 
0074   wakeup-source:
0075     description: Button can wake-up the system.
0076 
0077   '#address-cells':
0078     const: 1
0079 
0080   '#size-cells':
0081     const: 0
0082 
0083   typec:
0084     $ref: "/schemas/chrome/google,cros-ec-typec.yaml#"
0085 
0086   ec-pwm:
0087     $ref: "/schemas/pwm/google,cros-ec-pwm.yaml#"
0088     deprecated: true
0089 
0090   pwm:
0091     $ref: "/schemas/pwm/google,cros-ec-pwm.yaml#"
0092 
0093   kbd-led-backlight:
0094     $ref: "/schemas/chrome/google,cros-kbd-led-backlight.yaml#"
0095 
0096   keyboard-controller:
0097     $ref: "/schemas/input/google,cros-ec-keyb.yaml#"
0098 
0099   proximity:
0100     $ref: "/schemas/iio/proximity/google,cros-ec-mkbp-proximity.yaml#"
0101 
0102   codecs:
0103     type: object
0104     additionalProperties: false
0105 
0106     properties:
0107       '#address-cells':
0108         const: 2
0109 
0110       '#size-cells':
0111         const: 1
0112 
0113     patternProperties:
0114       "^ec-codec@[a-f0-9]+$":
0115         type: object
0116         $ref: "/schemas/sound/google,cros-ec-codec.yaml#"
0117 
0118     required:
0119       - "#address-cells"
0120       - "#size-cells"
0121 
0122   cbas:
0123     type: object
0124 
0125     description:
0126       This device is used to signal when a detachable base is attached
0127       to a Chrome OS tablet. This device cannot be detected at runtime.
0128 
0129     properties:
0130       compatible:
0131         const: google,cros-cbas
0132 
0133     required:
0134       - compatible
0135 
0136     additionalProperties: false
0137 
0138 patternProperties:
0139   "^i2c-tunnel[0-9]*$":
0140     type: object
0141     $ref: "/schemas/i2c/google,cros-ec-i2c-tunnel.yaml#"
0142 
0143   "^regulator@[0-9]+$":
0144     type: object
0145     $ref: "/schemas/regulator/google,cros-ec-regulator.yaml#"
0146 
0147   "^extcon[0-9]*$":
0148     type: object
0149     $ref: "/schemas/extcon/extcon-usbc-cros-ec.yaml#"
0150 
0151 required:
0152   - compatible
0153 
0154 allOf:
0155   - if:
0156       properties:
0157         compatible:
0158           contains:
0159             enum:
0160               - google,cros-ec-i2c
0161               - google,cros-ec-rpmsg
0162     then:
0163       properties:
0164         google,cros-ec-spi-pre-delay: false
0165         google,cros-ec-spi-msg-delay: false
0166         spi-max-frequency: false
0167     else:
0168       $ref: /schemas/spi/spi-peripheral-props.yaml
0169 
0170 additionalProperties: false
0171 
0172 examples:
0173   # Example for I2C
0174   - |
0175     #include <dt-bindings/gpio/gpio.h>
0176     #include <dt-bindings/interrupt-controller/irq.h>
0177 
0178     i2c0 {
0179         #address-cells = <1>;
0180         #size-cells = <0>;
0181 
0182         cros-ec@1e {
0183             compatible = "google,cros-ec-i2c";
0184             reg = <0x1e>;
0185             interrupts = <6 0>;
0186             interrupt-parent = <&gpio0>;
0187         };
0188     };
0189 
0190   # Example for SPI
0191   - |
0192     #include <dt-bindings/gpio/gpio.h>
0193     #include <dt-bindings/interrupt-controller/irq.h>
0194 
0195     spi0 {
0196         #address-cells = <1>;
0197         #size-cells = <0>;
0198 
0199         cros-ec@0 {
0200             compatible = "google,cros-ec-spi";
0201             reg = <0x0>;
0202             google,cros-ec-spi-msg-delay = <30>;
0203             google,cros-ec-spi-pre-delay = <10>;
0204             interrupts = <99 0>;
0205             interrupt-parent = <&gpio7>;
0206             spi-max-frequency = <5000000>;
0207 
0208             proximity {
0209                 compatible = "google,cros-ec-mkbp-proximity";
0210             };
0211 
0212             cbas {
0213                 compatible = "google,cros-cbas";
0214             };
0215         };
0216     };
0217 
0218   # Example for RPMSG
0219   - |
0220     scp0 {
0221         cros-ec {
0222             compatible = "google,cros-ec-rpmsg";
0223         };
0224     };
0225 ...