From e6eb041b2099ec3d07a4ec391a06e86d7697c9d1 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Thu, 11 Aug 2022 23:03:01 -0500 Subject: [PATCH 058/117] riscv: dts: allwinner: d1: Add RGB LEDs to boards Some D1-based boards feature an onboard RGB LED. Enable them. Commit-changes: 5 - New patch for v5 Series-version: 5 Series-to: Pavel Machek Series-to: Chen-Yu Tsai Series-to: Jernej Skrabec Series-to: linux-leds@vger.kernel.org Series-cc: Krzysztof Kozlowski Series-cc: Rob Herring Series-cc: devicetree@vger.kernel.org Series-cc: linux-arm-kernel@lists.infradead.org Series-cc: linux-kernel@vger.kernel.org Series-cc: linux-riscv@lists.infradead.org Series-cc: linux-sunxi@lists.linux.dev Cover-letter: leds: Allwinner A100 LED controller support This series adds bindings and a driver for the RGB LED controller found in some Allwinner SoCs, starting with A100. The hardware in the R329 and D1 SoCs appears to be identical. Patch 3 is included because the LED controller binding requires the DMA properties. That patch was sent previously[1], but never got merged. Patches 5-6 depend on the D1 devicetree series[2], but the rest of this series can be merged without them. This driver was tested on the D1 Nezha board. [1]: https://lore.kernel.org/linux-arm-kernel/20201110040553.1381-7-frank@allwinnertech.com/ [2]: https://lore.kernel.org/linux-riscv/20220815050815.22340-1-samuel@sholland.org/ END Signed-off-by: Samuel Holland --- .../boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dts | 12 ++++++++++++ arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts | 13 +++++++++++++ 2 files changed, 25 insertions(+) --- a/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dts +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dts @@ -58,6 +58,18 @@ status = "okay"; }; +&ledc { + pinctrl-0 = <&ledc_pc0_pin>; + pinctrl-names = "default"; + status = "okay"; + + multi-led@0 { + reg = <0x0>; + color = ; + function = LED_FUNCTION_STATUS; + }; +}; + &lradc { status = "okay"; --- a/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts @@ -5,6 +5,7 @@ #include #include +#include #include "sun20i-d1.dtsi" #include "sun20i-d1-common-regulators.dtsi" @@ -90,6 +91,18 @@ }; }; +&ledc { + pinctrl-0 = <&ledc_pc0_pin>; + pinctrl-names = "default"; + status = "okay"; + + multi-led@0 { + reg = <0x0>; + color = ; + function = LED_FUNCTION_STATUS; + }; +}; + &lradc { status = "okay";