Re: [PATCH v5 01/14] dt-bindings: trigger-source: add generic GPIO trigger source

Conor Dooley
2025-04-11T16:41:55Z

[-- Attachment #1: Type: text/plain, Size: 1966 bytes --]

On Fri, Apr 11, 2025 at 12:56:04PM -0300, Jonathan Santos wrote:
> Inspired by pwn-trigger, create a new binding for using a GPIO
> pin as a trigger source.
>
> Signed-off-by: Jonathan Santos <Jonathan.Santos@analog.com>
> ---
> v5 Changes:
> * New patch in v5.
> ---
> .../bindings/trigger-source/gpio-trigger.yaml | 40 +++++++++++++++++++
> 1 file changed, 40 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/trigger-source/gpio-trigger.yaml
>
> diff --git a/Documentation/devicetree/bindings/trigger-source/gpio-trigger.yaml b/Documentation/devicetree/bindings/trigger-source/gpio-trigger.yaml
> new file mode 100644
> index 000000000000..d77d62050179
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/trigger-source/gpio-trigger.yaml
> @@ -0,0 +1,40 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/trigger-source/gpio-trigger.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Generic trigger source using GPIO
> +

> +description: Remaps a GPIO pin as a trigger source.

Just a minor comment about the description, "remaps" is a very software
term, I think you can just say "A GPIO used as a trigger source" and be
fine.

> +
> +maintainers:
> + - Jonathan Santos <Jonathan.Santos@analog.com>
> +
> +properties:
> + compatible:
> + const: gpio-trigger
> +
> + '#trigger-source-cells':
> + const: 0
> +
> + gpios:
> + maxItems: 1
> + description: GPIO to be used as a trigger source.
> +
> +required:
> + - compatible
> + - '#trigger-source-cells'
> + - gpios
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> +
> + trigger {
> + compatible = "gpio-trigger";
> + #trigger-source-cells = <0>;
> + gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
> + };
> --
> 2.34.1
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]