18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci%YAML 1.2
38c2ecf20Sopenharmony_ci---
48c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/power/reset/syscon-poweroff.yaml#
58c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_cititle: Generic SYSCON mapped register poweroff driver
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_cimaintainers:
108c2ecf20Sopenharmony_ci  - Sebastian Reichel <sre@kernel.org>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_cidescription: |+
138c2ecf20Sopenharmony_ci  This is a generic poweroff driver using syscon to map the poweroff register.
148c2ecf20Sopenharmony_ci  The poweroff is generally performed with a write to the poweroff register
158c2ecf20Sopenharmony_ci  defined by the register map pointed by syscon reference plus the offset
168c2ecf20Sopenharmony_ci  with the value and mask defined in the poweroff node.
178c2ecf20Sopenharmony_ci  Default will be little endian mode, 32 bit access only.
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ciproperties:
208c2ecf20Sopenharmony_ci  compatible:
218c2ecf20Sopenharmony_ci    const: syscon-poweroff
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci  mask:
248c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
258c2ecf20Sopenharmony_ci    description: Update only the register bits defined by the mask (32 bit).
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci  offset:
288c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
298c2ecf20Sopenharmony_ci    description: Offset in the register map for the poweroff register (in bytes).
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci  regmap:
328c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/phandle
338c2ecf20Sopenharmony_ci    description: Phandle to the register map node.
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci  value:
368c2ecf20Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
378c2ecf20Sopenharmony_ci    description: The poweroff value written to the poweroff register (32 bit access).
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_cirequired:
408c2ecf20Sopenharmony_ci  - compatible
418c2ecf20Sopenharmony_ci  - regmap
428c2ecf20Sopenharmony_ci  - offset
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ciadditionalProperties: false
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ciallOf:
478c2ecf20Sopenharmony_ci  - if:
488c2ecf20Sopenharmony_ci      not:
498c2ecf20Sopenharmony_ci        required:
508c2ecf20Sopenharmony_ci          - mask
518c2ecf20Sopenharmony_ci    then:
528c2ecf20Sopenharmony_ci      required:
538c2ecf20Sopenharmony_ci        - value
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ciexamples:
568c2ecf20Sopenharmony_ci  - |
578c2ecf20Sopenharmony_ci    poweroff {
588c2ecf20Sopenharmony_ci        compatible = "syscon-poweroff";
598c2ecf20Sopenharmony_ci        regmap = <&regmapnode>;
608c2ecf20Sopenharmony_ci        offset = <0x0>;
618c2ecf20Sopenharmony_ci        mask = <0x7a>;
628c2ecf20Sopenharmony_ci    };
63