162306a36Sopenharmony_ci# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
262306a36Sopenharmony_ci%YAML 1.2
362306a36Sopenharmony_ci---
462306a36Sopenharmony_ci$id: http://devicetree.org/schemas/watchdog/linux,wdt-gpio.yaml#
562306a36Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
662306a36Sopenharmony_ci
762306a36Sopenharmony_cititle: GPIO-controlled Watchdog
862306a36Sopenharmony_ci
962306a36Sopenharmony_cimaintainers:
1062306a36Sopenharmony_ci  - Guenter Roeck <linux@roeck-us.net>
1162306a36Sopenharmony_ci  - Robert Marko <robert.marko@sartura.hr>
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ciproperties:
1462306a36Sopenharmony_ci  compatible:
1562306a36Sopenharmony_ci    const: linux,wdt-gpio
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci  gpios:
1862306a36Sopenharmony_ci    description: gpio connection to WDT reset pin
1962306a36Sopenharmony_ci    maxItems: 1
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci  hw_algo:
2262306a36Sopenharmony_ci    description: The algorithm used by the driver.
2362306a36Sopenharmony_ci    oneOf:
2462306a36Sopenharmony_ci      - description:
2562306a36Sopenharmony_ci          Either a high-to-low or a low-to-high transition clears the WDT counter.
2662306a36Sopenharmony_ci          The watchdog timer is disabled when GPIO is left floating or connected
2762306a36Sopenharmony_ci          to a three-state buffer.
2862306a36Sopenharmony_ci        const: toggle
2962306a36Sopenharmony_ci      - description:
3062306a36Sopenharmony_ci          Low or high level starts counting WDT timeout, the opposite level
3162306a36Sopenharmony_ci          disables the WDT.
3262306a36Sopenharmony_ci          Active level is determined by the GPIO flags.
3362306a36Sopenharmony_ci        const: level
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci  hw_margin_ms:
3662306a36Sopenharmony_ci    description: Maximum time to reset watchdog circuit (milliseconds).
3762306a36Sopenharmony_ci    $ref: /schemas/types.yaml#/definitions/uint32
3862306a36Sopenharmony_ci    minimum: 2
3962306a36Sopenharmony_ci    maximum: 65535
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci  always-running:
4262306a36Sopenharmony_ci    type: boolean
4362306a36Sopenharmony_ci    description:
4462306a36Sopenharmony_ci      If the watchdog timer cannot be disabled, add this flag to have the driver
4562306a36Sopenharmony_ci      keep toggling the signal without a client.
4662306a36Sopenharmony_ci      It will only cease to toggle the signal when the device is open and the
4762306a36Sopenharmony_ci      timeout elapsed.
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_cirequired:
5062306a36Sopenharmony_ci  - compatible
5162306a36Sopenharmony_ci  - gpios
5262306a36Sopenharmony_ci  - hw_algo
5362306a36Sopenharmony_ci  - hw_margin_ms
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ciallOf:
5662306a36Sopenharmony_ci  - $ref: watchdog.yaml#
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ciunevaluatedProperties: false
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ciexamples:
6162306a36Sopenharmony_ci  - |
6262306a36Sopenharmony_ci    #include <dt-bindings/gpio/gpio.h>
6362306a36Sopenharmony_ci    watchdog {
6462306a36Sopenharmony_ci        compatible = "linux,wdt-gpio";
6562306a36Sopenharmony_ci        gpios = <&gpio3 9 GPIO_ACTIVE_LOW>;
6662306a36Sopenharmony_ci        hw_algo = "toggle";
6762306a36Sopenharmony_ci        hw_margin_ms = <1600>;
6862306a36Sopenharmony_ci    };
69