Introduce generic "outputs" DTS binding

Replaces previous "switch" and "pwm-out" bindings and allows to reference
either gpio or pwm handle and specify maximum current.

Also replacing CONFIG_HAS_LOAD and CONFIG_HAS_USB_PWR with DT_ variants.
This commit is contained in:
Martin Jäger
2020-05-06 12:53:26 +02:00
parent 90c1e7fcf5
commit ce7f63b888
29 changed files with 142 additions and 160 deletions
+26
View File
@@ -0,0 +1,26 @@
# Copyright (c) 2020 Martin Jäger / Libre Solar
# SPDX-License-Identifier: Apache-2.0
description: GPIOs used for digital output (either on/off type or PWM signal)
compatible: "outputs"
child-binding:
description: GPIO digital outputs child node
properties:
gpios:
type: phandle-array
description: GPIO handle for on/off type output
pwms:
type: phandle-array
description: PWM handle for PWM type output
current-max:
type: int
description: Maximum current of driven power switch (A)
label:
type: string
required: true
description: Human readable string describing the device (used by Zephyr for API name)
present:
type: int
default: 1
-17
View File
@@ -1,17 +0,0 @@
# Copyright (c) 2020 Martin Jäger / Libre Solar
# SPDX-License-Identifier: Apache-2.0
description: GPIO pins to generate a PWM signal
compatible: "pwm-out"
child-binding:
description: PWM output child node
properties:
pwms:
type: phandle-array
required: true
label:
type: string
required: true
description: Human readable string describing the device (used by Zephyr for API name)
-17
View File
@@ -1,17 +0,0 @@
# Copyright (c) 2020 Martin Jäger / Libre Solar
# SPDX-License-Identifier: Apache-2.0
description: GPIO pins to switch something on or off
compatible: "switch"
child-binding:
description: GPIO switch child node
properties:
gpios:
type: phandle-array
required: true
label:
type: string
required: true
description: Human readable string describing the device (used by Zephyr for API name)
+2 -2
View File
@@ -37,8 +37,8 @@
/delete-node/ c;
};
switches {
compatible = "switch";
outputs {
compatible = "outputs";
load {
gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
label = "Load enable";