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:
@@ -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
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -37,8 +37,8 @@
|
||||
/delete-node/ c;
|
||||
};
|
||||
|
||||
switches {
|
||||
compatible = "switch";
|
||||
outputs {
|
||||
compatible = "outputs";
|
||||
load {
|
||||
gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
|
||||
label = "Load enable";
|
||||
|
||||
Reference in New Issue
Block a user