From patchwork Mon Feb 28 17:48:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Icenowy Zheng X-Patchwork-Id: 547399 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AE71C433EF for ; Mon, 28 Feb 2022 18:20:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240143AbiB1SVZ (ORCPT ); Mon, 28 Feb 2022 13:21:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240149AbiB1SVM (ORCPT ); Mon, 28 Feb 2022 13:21:12 -0500 Received: from relay-us1.mymailcheap.com (relay-us1.mymailcheap.com [51.81.35.219]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FFED220D4; Mon, 28 Feb 2022 09:58:24 -0800 (PST) Received: from relay5.mymailcheap.com (relay5.mymailcheap.com [159.100.248.207]) by relay-us1.mymailcheap.com (Postfix) with ESMTPS id 4A326201F1; Mon, 28 Feb 2022 17:50:06 +0000 (UTC) Received: from relay4.mymailcheap.com (relay4.mymailcheap.com [137.74.80.156]) by relay5.mymailcheap.com (Postfix) with ESMTPS id 5886F267CE; Mon, 28 Feb 2022 17:49:35 +0000 (UTC) Received: from filter1.mymailcheap.com (filter1.mymailcheap.com [149.56.130.247]) by relay4.mymailcheap.com (Postfix) with ESMTPS id D602E2000E; Mon, 28 Feb 2022 17:49:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by filter1.mymailcheap.com (Postfix) with ESMTP id 3E3B62A378; Mon, 28 Feb 2022 17:49:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at filter1.mymailcheap.com Received: from filter1.mymailcheap.com ([127.0.0.1]) by localhost (filter1.mymailcheap.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c7fNPPvqKdGq; Mon, 28 Feb 2022 17:49:03 +0000 (UTC) Received: from mail20.mymailcheap.com (mail20.mymailcheap.com [51.83.111.147]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by filter1.mymailcheap.com (Postfix) with ESMTPS; Mon, 28 Feb 2022 17:49:02 +0000 (UTC) Received: from edelgard.icenowy.info (unknown [59.41.161.107]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail20.mymailcheap.com (Postfix) with ESMTPSA id 3A4FC405A4; Mon, 28 Feb 2022 17:48:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=aosc.io; s=default; t=1646070542; bh=LULP0zQ1ZvfvYvSVqa6XKbmkljj5l8VtkKiZl1WBvIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j5krynj2l3oFWH2XX0+o56R6rdO4tC9K6Fet3VAyOm/KrYj/an3u2NQphq0BQyAqg sJ+ACBugGcVBH/bRnFGq7uVbWOihxOty/50/A3U89qZSxYciouA2GhjTK6aT0tlhH4 kPhxodzy3jG6Q1IVetSpFjZR+rGyfCMyH0iI2WgA= From: Icenowy Zheng To: Rob Herring , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Icenowy Zheng Subject: [PATCH 2/2] riscv: dts: sifive: add pwm leds for HiFive Unleashed Date: Tue, 1 Mar 2022 01:48:37 +0800 Message-Id: <20220228174837.602758-2-icenowy@aosc.io> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220228174837.602758-1-icenowy@aosc.io> References: <20220228174837.602758-1-icenowy@aosc.io> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The PWM0 controller of HiFive Unleashed's FU540-C000 chip is connected to 4 LEDs. Add them to the device tree, with function and default trigger set from the triggers used in old kernels done by SiFive. Signed-off-by: Icenowy Zheng --- .../boot/dts/sifive/hifive-unleashed-a00.dts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts index 44824d7e50ac7..2935719ca169e 100644 --- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts +++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts @@ -3,6 +3,8 @@ #include "fu540-c000.dtsi" #include +#include +#include /* Clock frequency (in Hz) of the PCB crystal for rtcclk */ #define RTCCLK_FREQ 1000000 @@ -32,6 +34,46 @@ hfclk: hfclk { clock-output-names = "hfclk"; }; + led-controller { + compatible = "pwm-leds"; + + led-0 { + color = ; + pwms = <&pwm0 0 10000000 PWM_POLARITY_INVERTED>; + active-low; + max-brightness = <255>; + function = LED_FUNCTION_HEARTBEAT; + linux,default-trigger = "heartbeat"; + }; + + led-1 { + color = ; + pwms = <&pwm0 1 10000000 PWM_POLARITY_INVERTED>; + active-low; + max-brightness = <255>; + function = LED_FUNCTION_MTD; + linux,default-trigger = "mtd"; + }; + + led-2 { + color = ; + pwms = <&pwm0 2 10000000 PWM_POLARITY_INVERTED>; + active-low; + max-brightness = <255>; + function = LED_FUNCTION_LAN; + linux,default-trigger = "netdev"; + }; + + led-3 { + color = ; + pwms = <&pwm0 3 10000000 PWM_POLARITY_INVERTED>; + active-low; + max-brightness = <255>; + function = LED_FUNCTION_PANIC; + linux,default-trigger = "panic"; + }; + }; + memory@80000000 { device_type = "memory"; reg = <0x0 0x80000000 0x2 0x00000000>;