From patchwork Sun Oct 9 12:26:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Guido_G=C3=BCnther?= X-Patchwork-Id: 613688 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 90BDFC433F5 for ; Sun, 9 Oct 2022 12:36:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229909AbiJIMgs (ORCPT ); Sun, 9 Oct 2022 08:36:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229617AbiJIMgr (ORCPT ); Sun, 9 Oct 2022 08:36:47 -0400 Received: from honk.sigxcpu.org (honk.sigxcpu.org [24.134.29.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC90B2983F; Sun, 9 Oct 2022 05:36:45 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id F2D93FB02; Sun, 9 Oct 2022 14:27:00 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0lfdrkTZG03R; Sun, 9 Oct 2022 14:26:59 +0200 (CEST) From: =?utf-8?q?Guido_G=C3=BCnther?= To: Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Catalin Marinas , Will Deacon , Alexander Stein , =?utf-8?q?Guido_G=C3=BCn?= =?utf-8?q?ther?= , Markus Niebel , Bjorn Andersson , Dmitry Baryshkov , Marcel Ziswiler , Vinod Koul , Arnd Bergmann , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, phone-devel@vger.kernel.org, kernel@puri.sm Subject: [PATCH v1 1/3] arm64: defconfig: Enable pattern LED trigger Date: Sun, 9 Oct 2022 14:26:53 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org This allows devices to easily use LED patterns from userspace. Signed-off-by: Guido Günther --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 5b167649097e..68642b8aac3f 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -956,6 +956,7 @@ CONFIG_LEDS_TRIGGER_HEARTBEAT=y CONFIG_LEDS_TRIGGER_CPU=y CONFIG_LEDS_TRIGGER_DEFAULT_ON=y CONFIG_LEDS_TRIGGER_PANIC=y +CONFIG_LEDS_TRIGGER_PATTERN=m CONFIG_EDAC=y CONFIG_EDAC_GHES=y CONFIG_EDAC_LAYERSCAPE=m From patchwork Sun Oct 9 12:26:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Guido_G=C3=BCnther?= X-Patchwork-Id: 614021 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 94BB0C4167E for ; Sun, 9 Oct 2022 12:36:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230104AbiJIMgv (ORCPT ); Sun, 9 Oct 2022 08:36:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229728AbiJIMgr (ORCPT ); Sun, 9 Oct 2022 08:36:47 -0400 Received: from honk.sigxcpu.org (honk.sigxcpu.org [24.134.29.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BCA829C86; Sun, 9 Oct 2022 05:36:45 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id 34B91FB03; Sun, 9 Oct 2022 14:27:02 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id stLLPOUzZBli; Sun, 9 Oct 2022 14:27:00 +0200 (CEST) From: =?utf-8?q?Guido_G=C3=BCnther?= To: Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Catalin Marinas , Will Deacon , Alexander Stein , =?utf-8?q?Guido_G=C3=BCn?= =?utf-8?q?ther?= , Markus Niebel , Bjorn Andersson , Dmitry Baryshkov , Marcel Ziswiler , Vinod Koul , Arnd Bergmann , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, phone-devel@vger.kernel.org, kernel@puri.sm Subject: [PATCH v1 2/3] arm64: dts: librem5-devkit: Make LED use PWM Date: Sun, 9 Oct 2022 14:26:54 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org We can use PWM instead of just GPIO allowing us to control brightness. Signed-off-by: Guido Günther --- .../dts/freescale/imx8mq-librem5-devkit.dts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts index 6445c6b90b5b..7e4b6d65fd89 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts @@ -61,14 +61,12 @@ button-3 { }; leds { - compatible = "gpio-leds"; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_gpio_leds>; + compatible = "pwm-leds"; led1 { label = "LED 1"; - gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; - default-state = "off"; + max-brightness = <248>; + pwms = <&pwm2 0 50000 0>; }; }; @@ -615,9 +613,9 @@ MX8MQ_IOMUXC_GPIO1_IO05_GPIO1_IO5 0x19 /* TOUCH RST */ >; }; - pinctrl_gpio_leds: gpioledgrp { + pinctrl_pwm_led: pwmledgrp { fsl,pins = < - MX8MQ_IOMUXC_GPIO1_IO13_GPIO1_IO13 0x16 + MX8MQ_IOMUXC_GPIO1_IO13_PWM2_OUT 0x16 >; }; @@ -920,6 +918,12 @@ &pwm1 { status = "okay"; }; +&pwm2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pwm_led>; + status = "okay"; +}; + &snvs_pwrkey { status = "okay"; }; From patchwork Sun Oct 9 12:26:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Guido_G=C3=BCnther?= X-Patchwork-Id: 614022 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 8C9A6C4321E for ; Sun, 9 Oct 2022 12:36:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230093AbiJIMgt (ORCPT ); Sun, 9 Oct 2022 08:36:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbiJIMgr (ORCPT ); Sun, 9 Oct 2022 08:36:47 -0400 Received: from honk.sigxcpu.org (honk.sigxcpu.org [24.134.29.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45D9D29C8E; Sun, 9 Oct 2022 05:36:46 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id E7884FB04; Sun, 9 Oct 2022 14:27:02 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id adMfwQC8mj8s; Sun, 9 Oct 2022 14:27:01 +0200 (CEST) From: =?utf-8?q?Guido_G=C3=BCnther?= To: Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Catalin Marinas , Will Deacon , Alexander Stein , =?utf-8?q?Guido_G=C3=BCn?= =?utf-8?q?ther?= , Markus Niebel , Bjorn Andersson , Dmitry Baryshkov , Marcel Ziswiler , Vinod Koul , Arnd Bergmann , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, phone-devel@vger.kernel.org, kernel@puri.sm Subject: [PATCH v1 3/3] arm64: dts: librem5-devkit: Use function and color rather than label Date: Sun, 9 Oct 2022 14:26:55 +0200 Message-Id: <2d249e5fbb3a77a6ca8eb6ecbbf97ac8ce3ef371.1665318256.git.agx@sigxcpu.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Use predefined colors and function rather than making up a random label. Signed-off-by: Guido Günther --- arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts index 7e4b6d65fd89..4c8904fba1c1 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts +++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts @@ -7,6 +7,7 @@ #include "dt-bindings/input/input.h" #include +#include #include "dt-bindings/pwm/pwm.h" #include "dt-bindings/usb/pd.h" #include "imx8mq.dtsi" @@ -64,7 +65,8 @@ leds { compatible = "pwm-leds"; led1 { - label = "LED 1"; + function = LED_FUNCTION_STATUS; + color = ; max-brightness = <248>; pwms = <&pwm2 0 50000 0>; };