LED setup via devicetree

- New charlieplexing-leds binding
- board.dts files updated
- Pin and LED setup removed from pinmux.c and board.h files
This commit is contained in:
Martin Jäger
2020-07-23 17:34:41 +02:00
parent a584904470
commit 27cdcb3bf6
24 changed files with 345 additions and 374 deletions
@@ -0,0 +1,19 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2020 Martin Jäger / Libre Solar
description: Description for an ADC input including gain (multiplier/divider) and offset
compatible: "charlieplexing-leds"
properties:
gpios:
type: phandle-array
description: GPIO handle of pin
child-binding:
description: GPIO child node
properties:
states:
type: array
description: |
Pin states to switch on LED identified by child node. 1=on, 0=off, 2=floating
+22 -17
View File
@@ -11,42 +11,47 @@
};
leds {
compatible = "gpio-leds";
gnd {
gpios = <&gpiob 14 GPIO_ACTIVE_HIGH>;
label = "LED GND";
compatible = "charlieplexing-leds";
gpios = <&gpiob 14 GPIO_ACTIVE_HIGH>, /* GND */
<&gpiob 13 GPIO_ACTIVE_HIGH>, /* SOC_12 */
<&gpiob 2 GPIO_ACTIVE_HIGH>, /* SOC_3 */
<&gpiob 11 GPIO_ACTIVE_HIGH>, /* RXTX */
<&gpiob 10 GPIO_ACTIVE_HIGH>; /* LOAD */
soc_1 {
states = <1 0 0 0 0>;
};
soc12 {
gpios = <&gpiob 13 GPIO_ACTIVE_HIGH>;
label = "LED SOC12";
soc_2 {
states = <0 1 0 0 0>;
};
soc3 {
gpios = <&gpiob 2 GPIO_ACTIVE_HIGH>;
label = "LED SOC3";
soc_3 {
states = <0 0 1 0 0>;
};
rxtx {
gpios = <&gpiob 11 GPIO_ACTIVE_HIGH>;
label = "LED RXTX";
states = <0 0 0 1 0>;
};
load {
gpios = <&gpiob 10 GPIO_ACTIVE_HIGH>;
label = "LED Load";
states = <0 0 0 0 1>;
};
/delete-node/ a;
/delete-node/ b;
/delete-node/ c;
};
outputs {
compatible = "outputs";
load {
gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
label = "Load enable";
};
usb-pwr {
gpios = <&gpiob 12 GPIO_ACTIVE_HIGH>;
label = "USB charging port enable";
};
/delete-node/ v-solar;
/delete-node/ boot0;
};
-2
View File
@@ -36,5 +36,3 @@ CONFIG_EXT_THINGSET_SERIAL=y
CONFIG_REBOOT=y
CONFIG_WATCHDOG=y
CONFIG_LEGACY_DEVICETREE_MACROS=y