Hello,
This adds the folowing:
- LED driver for AW2026 chip
- Document Awinic AW2026 DT bindings
Datasheet file can be found here:
https://www.awinic.com/en/productDetail/AW2026DNR#tech-docs
Vladimir Barinov (2):
[1/2] leds: Add Awinic AW2026 LED driver
[2/2] dt-bindings: leds: Document Awinic AW2026 bindings
---
This patchset is against the 'kernel/git/lee/leds.git' repo, 'for-leds-next' branch.
Documentation/devicetree/bindings/leds/awinic,aw2026.yaml | 93 ++
drivers/leds/Kconfig | 10
drivers/leds/Makefile | 1
drivers/leds/leds-aw2026.c | 578 ++++++++++++++
4 files changed, 682 insertions(+)
Add Awinic AW2026 binding documentation
Signed-off-by: Vladimir Barinov <[email protected]>
---
Changes in version 2:
- fixed typos in patch header 2016 -> 2026
- fixed typo in example section that break dt_binding_check
.../bindings/leds/awinic,aw2026.yaml | 92 +++++++++++++++++++
1 file changed, 92 insertions(+)
create mode 100644 Documentation/devicetree/bindings/leds/awinic,aw2026.yaml
diff --git a/Documentation/devicetree/bindings/leds/awinic,aw2026.yaml b/Documentation/devicetree/bindings/leds/awinic,aw2026.yaml
new file mode 100664
index 000000000000..abacf746677b
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/awinic,aw2026.yaml
@@ -0,0 +1,93 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/awinic,aw2026.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Awinic AW2026 3-channel LED Driver
+
+maintainers:
+ - Vladimir Barinov <[email protected]>
+
+description: |
+ The AW2026 is a 3-channel LED driver with I2C interface. It can control
+ LED brightness with PWM output. It supports hardware blinking and
+ hardware patterns.
+
+properties:
+ compatible:
+ const: awinic,aw2026
+
+ reg:
+ maxItems: 1
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 0
+
+ awinic,led-max-microamp:
+ description:
+ Maximum current at LED output
+ enum:
+ [3000, 6375, 12750, 25500]
+
+ vcc-supply:
+ description: Regulator providing power to the "VBAT" pin.
+
+patternProperties:
+ "^led@[0-2]$":
+ type: object
+ $ref: common.yaml#
+
+ properties:
+ reg:
+ description: Index of the LED.
+ minimum: 0
+ maximum: 2
+
+required:
+ - compatible
+ - reg
+ - "#address-cells"
+ - "#size-cells"
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/leds/common.h>
+
+ i2c0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ led-controller@64 {
+ compatible = "awinic,aw2026";
+ reg = <0x64>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ awinic,led-max-microamp = <6375>;
+ vcc-supply = <&vcc_3v3_s0>;
+
+ led@0 {
+ reg = <0>;
+ function = LED_FUNCTION_INDICATOR;
+ color = <LED_COLOR_ID_RED>;
+ };
+
+ led@1 {
+ reg = <1>;
+ function = LED_FUNCTION_INDICATOR;
+ color = <LED_COLOR_ID_BLUE>;
+ };
+
+ led@2 {
+ reg = <2>;
+ function = LED_FUNCTION_INDICATOR;
+ color = <LED_COLOR_ID_GREEN>;
+ };
+ };
+ };
+...
--
2.34.1
On 25/05/2023 12:14, Vladimir Barinov wrote:
> Add Awinic AW2026 binding documentation
>
> Signed-off-by: Vladimir Barinov <[email protected]>
> ---
> Changes in version 2:
> - fixed typos in patch header 2016 -> 2026
> - fixed typo in example section that break dt_binding_check
>
> .../bindings/leds/awinic,aw2026.yaml | 92 +++++++++++++++++++
> 1 file changed, 92 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/leds/awinic,aw2026.yaml
>
> diff --git a/Documentation/devicetree/bindings/leds/awinic,aw2026.yaml b/Documentation/devicetree/bindings/leds/awinic,aw2026.yaml
> new file mode 100664
> index 000000000000..abacf746677b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/leds/awinic,aw2026.yaml
> @@ -0,0 +1,93 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/leds/awinic,aw2026.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Awinic AW2026 3-channel LED Driver
> +
> +maintainers:
> + - Vladimir Barinov <[email protected]>
> +
> +description: |
Do not need '|' unless you need to preserve formatting.
> + The AW2026 is a 3-channel LED driver with I2C interface. It can control
> + LED brightness with PWM output. It supports hardware blinking and
> + hardware patterns.
> +
> +properties:
> + compatible:
> + const: awinic,aw2026
> +
> + reg:
> + maxItems: 1
> +
> + "#address-cells":
> + const: 1
> +
> + "#size-cells":
> + const: 0
> +
> + awinic,led-max-microamp:
microamp is per sub-LED, not per entire device. This is already
expressed by common bindings. Drop entire property and use common one in
children.
> + description:
> + Maximum current at LED output
> + enum:
> + [3000, 6375, 12750, 25500]
> +
> + vcc-supply:
> + description: Regulator providing power to the "VBAT" pin.
> +
> +patternProperties:
> + "^led@[0-2]$":
> + type: object
> + $ref: common.yaml#
unevaluatedProperties: false
Just open existing bindings and do not code it differently...
> +
> + properties:
> + reg:
> + description: Index of the LED.
> + minimum: 0
> + maximum: 2
> +
> +required:
> + - compatible
> + - reg
> + - "#address-cells"
> + - "#size-cells"
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/leds/common.h>
> +
> + i2c0 {
i2c
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + led-controller@64 {
> + compatible = "awinic,aw2026";
> + reg = <0x64>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> + awinic,led-max-microamp = <6375>;
> + vcc-supply = <&vcc_3v3_s0>;
> +
> + led@0 {
> + reg = <0>;
Wrong indenration.
Use 4 spaces for example indentation.
> + function = LED_FUNCTION_INDICATOR;
> + color = <LED_COLOR_ID_RED>;
> + };
Best regards,
Krzysztof