From patchwork Fri Feb 25 20:32:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitri John Ledkov X-Patchwork-Id: 1597849 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=acGe8yVV; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K51gz4KbWz9sG5 for ; Sat, 26 Feb 2022 07:33:35 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nNhHM-0007U6-4V; Fri, 25 Feb 2022 20:33:28 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1nNhHB-0007Be-AV for kernel-team@lists.ubuntu.com; Fri, 25 Feb 2022 20:33:17 +0000 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 1667D3F1B7 for ; Fri, 25 Feb 2022 20:33:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1645821197; bh=OYHgIoWs46t6jBh1h7PjsWuA9h2CYt37dEdJ010NYps=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=acGe8yVVzpGZxqYw2sAvfAHP6G965Bypr3EEe8x8Ekc6I88EUoJ2L2j2aZtBvVvVG vtOlyxBFNU9BExB2q2nNq7D/2kCMLfzFECPSq4uBHIwOyXkEbSw+MbMOR1bAIeMdCz zx/CW8S+Er7MtxVdNN3BavCwr31YOgZc2LrgVybWcFuoUedGXgdNDIGRgRZ9vjID4z ERguirl+ApOMJBeFHvs/NWHVMtgudpRSGWZc1LHMx0Un+SePuNdHXFCOds/+/M80CG x9ltIBwQhdP7Z6pqmUzn2Asq+xy5OwjOSUgHOa8u5za4STHMDQ8Ggxd3uzIgJercKs Pshx3/X36G11A== Received: by mail-wm1-f72.google.com with SMTP id l31-20020a05600c1d1f00b00380e3425ba7so1861953wms.9 for ; Fri, 25 Feb 2022 12:33:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OYHgIoWs46t6jBh1h7PjsWuA9h2CYt37dEdJ010NYps=; b=WCfQm1nw6zeVwK7M8SkSUx2q/oImWWHcG7hqynal5oJHsaNflNJfgbyjElN2DuapbM 8HBbGDB26pJ1GG/c4AN3UjDJksmL9C+ti5CN3gVA2Og3fDuwstAgTavHKEyhta7PP0KK DepBrSAM5lkGp4injfVzNn1OAHDIGE4J1yr/6Bsd57tgFjjsx+H/GuAR9XxqQUmdKJZJ zn71r9yiDvPIXTqWQJq9VQKVktFpjLpgBOR4kd8nY3pysZKqaQxboAzZf/pVFuCmZ5nM XdSVdWPJX523lYlSjA914C0o/L5wcNCHzVNA1D7LT8O6lWOxCBY9QkRPKgH0bFYRvBcj +KMw== X-Gm-Message-State: AOAM53004GVfgdgaTCkQIP3cRhO7Ps5Vt0aVx5sTlTAqej0szA7yQsi7 8yCWTzKSZdpOBxL2JSnHRhGNqYNK/0LK0o5+EZZp8w5zca6Y2487+yoKYY3s2fdS5hGQkqITjbc 9fA5elHdJuYLyFJzhd5nfnNH9d+ZXfMsKcSgn0yWmQA== X-Received: by 2002:a05:600c:3b02:b0:37c:91fa:c9d3 with SMTP id m2-20020a05600c3b0200b0037c91fac9d3mr4087228wms.70.1645821196491; Fri, 25 Feb 2022 12:33:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxT6p1wBR/lM4oCvoT0bhoOMbvUhdkVukX89UcrqHW/Jait4fSs8lknBjUl+kBcI2YRMbckSA== X-Received: by 2002:a05:600c:3b02:b0:37c:91fa:c9d3 with SMTP id m2-20020a05600c3b0200b0037c91fac9d3mr4087216wms.70.1645821196132; Fri, 25 Feb 2022 12:33:16 -0800 (PST) Received: from localhost ([2a01:4b00:85fd:d700:5ec7:56fa:4ff4:7c95]) by smtp.gmail.com with ESMTPSA id l12-20020a05600c4f0c00b00352cf3078e6sm7632479wmq.22.2022.02.25.12.33.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 12:33:15 -0800 (PST) From: Dimitri John Ledkov To: kernel-team@lists.ubuntu.com Subject: [linux-riscv][J][PATCH 05/17] SiFive HiFive Unleashed: Add PWM LEDs (D1, D2, D3, D4) Date: Fri, 25 Feb 2022 20:32:49 +0000 Message-Id: <20220225203301.20851-6-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220225203301.20851-1-dimitri.ledkov@canonical.com> References: <20220225203301.20851-1-dimitri.ledkov@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: David Abdurachmanov BugLink: https://bugs.launchpad.net/bugs/1910965 By default no functions are assigned to LEDs. It's up to user/distribution to provide udev rules to configure them. Signed-off-by: David Abdurachmanov (backported from https://github.com/sifive/meta-sifive/blob/2020.11/recipes-kernel/linux/files/freedom-u540/0007-Add-PWM-LEDs-D1-D2-D3-D4.patch) Signed-off-by: Colin Ian King Signed-off-by: Andrea Righi (adjust backport for v5.17 removal of soc() node upstream) Signed-off-by: Dimitri John Ledkov --- .../boot/dts/sifive/hifive-unleashed-a00.dts | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts index ced0d4e479..c7a3740ea6 100644 --- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts +++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts @@ -3,6 +3,7 @@ #include "fu540-c000.dtsi" #include +#include /* Clock frequency (in Hz) of the PCB crystal for rtcclk */ #define RTCCLK_FREQ 1000000 @@ -25,6 +26,38 @@ memory@80000000 { reg = <0x0 0x80000000 0x2 0x00000000>; }; + pwmleds { + compatible = "pwm-leds"; + d1 { + label = "green:d1"; + pwms = <&pwm0 0 7812500 PWM_POLARITY_INVERTED>; + active-low = <1>; + max-brightness = <255>; + linux,default-trigger = "none"; + }; + d2 { + label = "green:d2"; + pwms = <&pwm0 1 7812500 PWM_POLARITY_INVERTED>; + active-low = <1>; + max-brightness = <255>; + linux,default-trigger = "none"; + }; + d3 { + label = "green:d3"; + pwms = <&pwm0 2 7812500 PWM_POLARITY_INVERTED>; + active-low = <1>; + max-brightness = <255>; + linux,default-trigger = "none"; + }; + d4 { + label = "green:d4"; + pwms = <&pwm0 3 7812500 PWM_POLARITY_INVERTED>; + active-low = <1>; + max-brightness = <255>; + linux,default-trigger = "none"; + }; + }; + hfclk: hfclk { #clock-cells = <0>; compatible = "fixed-clock";