From patchwork Tue Jul 5 21:01:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 587623 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 2D5E3CCA47C for ; Tue, 5 Jul 2022 21:01:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232276AbiGEVBx (ORCPT ); Tue, 5 Jul 2022 17:01:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231196AbiGEVBv (ORCPT ); Tue, 5 Jul 2022 17:01:51 -0400 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 803A92B4 for ; Tue, 5 Jul 2022 14:01:50 -0700 (PDT) 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 1591540A9B for ; Tue, 5 Jul 2022 21:01:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1657054907; bh=bQMwaeYKMT6usnwDyo75UwU6twU1bHQlELRjvpkCaBs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lK1lQTBf8Tbaa1/LDM+pOCGZOUWU0jDHdZUI8aomWLnlYPFkws2WHrFbJzmg7vrL/ Uo6Fdp5RdJ/9PVssQQTRd/XJZaGIy6v59KxeSPAtoMEdkb1gogVEdL9JPzQsy8Mb36 qVXcw3CRVe2nfP9r9Gdn6ho0CwnrK0AwPcR68p2xnreM4TmxunH8Xdf27KPHIUG9yc HERR+Uts/3wm1dGXYxEzW++XElnWNUBXKYxij4Pt6S357pyPMfdqBcY5Iyv1nkT9kQ yZTokfs+ChLQ90BPp+sBMy7mjKq5illHZtVY7yQDzRaBMYpkv2d6sqtJ9b10MOBh9n iNYfdbx0agCkA== Received: by mail-wm1-f72.google.com with SMTP id r206-20020a1c44d7000000b003a2bfaf8d3dso145406wma.0 for ; Tue, 05 Jul 2022 14:01:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bQMwaeYKMT6usnwDyo75UwU6twU1bHQlELRjvpkCaBs=; b=sQJGjV1TUfDi4VqgBsY91sqa6Z2f1ZtvVjKCXk97ClOG3MvYMfNvCxtyhkgoJlUeVX G+4gf5noEQQQec/WXih/ZHjAJjaBjl9TOqP54XY4pT9vDIkaujhly0GykUvfb4rcuoY6 ojesU0ELTjn1x/hu7mqktC38ECOWCDiMGmVOrFvIUGXGd0OOTc4Z1UhJ56TfN6BwyKsj IH821WnPGC1qp7dgj5um2HBxSH9hsTRfQNzsipSah9XlJaO1SR6hun+OEPBF5yscqOX4 kfQ+kPPgfeKbvHn3ihpp2tnNNM8qvtAHtsR7/y7rZ3NIinb5kdo27rcAclEeNXDOP97M ydZw== X-Gm-Message-State: AJIora+yWdycYcDezWninsPewXa3VibB4/fdjfWSF3ZgHMVaaSRoW6dg 9hJV67PfZBKjnRH2+ZvPfpnx5Xb/TrPAcq+v7EdCwEzQTl3Rvr5bbCWcS1ojHMNxUDVJyf44raX 8XVsqprKkj4Buuuzx/IcG3q4L4Wy7dDgaKgDOFgM= X-Received: by 2002:a05:600c:3caa:b0:394:8fb8:716 with SMTP id bg42-20020a05600c3caa00b003948fb80716mr39682331wmb.105.1657054906761; Tue, 05 Jul 2022 14:01:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tZxXj9wYCQn8xRiwSdoNr+XF9lf5AtfECiLDauDGWvaTlvbMHbvHq3GJc+TGPSmAuxJVR2KQ== X-Received: by 2002:a05:600c:3caa:b0:394:8fb8:716 with SMTP id bg42-20020a05600c3caa00b003948fb80716mr39682293wmb.105.1657054906543; Tue, 05 Jul 2022 14:01:46 -0700 (PDT) Received: from stitch.. (80.71.140.73.ipv4.parknet.dk. [80.71.140.73]) by smtp.gmail.com with ESMTPSA id r15-20020a0560001b8f00b0021d74906683sm2517667wru.28.2022.07.05.14.01.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 14:01:46 -0700 (PDT) From: Emil Renner Berthing To: linux-kernel@vger.kernel.org Cc: Pavel Machek , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Vincent Pelletier , Bin Meng , Aurelien Jarno , Ron Economos , Qiu Wenbo , Geert Uytterhoeven , Stephen L Arnold , Jianlong Huang , Mark Kettenis , Sven Schwermer , Andy Shevchenko , David Abdurachmanov , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v1 1/4] leds: pwm-multicolor: Don't show -EPROBE_DEFER as errors Date: Tue, 5 Jul 2022 23:01:40 +0200 Message-Id: <20220705210143.315151-2-emil.renner.berthing@canonical.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220705210143.315151-1-emil.renner.berthing@canonical.com> References: <20220705210143.315151-1-emil.renner.berthing@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org When requesting a PWM it might return -EPROBE_DEFER if it hasn't probed yet. This is not an error, so just propagate the -EPROBE_DEFER without logging anything. There is already dev_err_probe for exactly this situation. Fixes: 9fa2762110dd ("leds: Add PWM multicolor driver") Signed-off-by: Emil Renner Berthing --- drivers/leds/rgb/leds-pwm-multicolor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/leds/rgb/leds-pwm-multicolor.c b/drivers/leds/rgb/leds-pwm-multicolor.c index 45e38708ecb1..eb67b89d28e9 100644 --- a/drivers/leds/rgb/leds-pwm-multicolor.c +++ b/drivers/leds/rgb/leds-pwm-multicolor.c @@ -72,8 +72,7 @@ static int iterate_subleds(struct device *dev, struct pwm_mc_led *priv, pwmled = &priv->leds[priv->mc_cdev.num_colors]; pwmled->pwm = devm_fwnode_pwm_get(dev, fwnode, NULL); if (IS_ERR(pwmled->pwm)) { - ret = PTR_ERR(pwmled->pwm); - dev_err(dev, "unable to request PWM: %d\n", ret); + ret = dev_err_probe(dev, PTR_ERR(pwmled->pwm), "unable to request PWM\n"); goto release_fwnode; } pwm_init_state(pwmled->pwm, &pwmled->state); From patchwork Tue Jul 5 21:01:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 587622 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 9DB70CCA47C for ; Tue, 5 Jul 2022 21:02:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232409AbiGEVCC (ORCPT ); Tue, 5 Jul 2022 17:02:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232258AbiGEVCA (ORCPT ); Tue, 5 Jul 2022 17:02:00 -0400 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7407B65D9 for ; Tue, 5 Jul 2022 14:01:54 -0700 (PDT) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (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 E945940AAF for ; Tue, 5 Jul 2022 21:01:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1657054911; bh=AoMSkRbSsal7DXav6tHJCoGyFX+s+KqI3+R+nsluk4Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pq+i759s1MMIuM8KXCy0nSQLmIEOddZl1NwwLUzj+gcmP2ev/tCZiW18mueKImxPc zRXSUMvUfRMzNkZ63mkN5mlUp9/wUaeRKWBavTtYFEZnL9NAG0Wm3pT3jhUzY/ZlgU YIJp57eK5hIZLuuFdUDPJ0mL7VQ89JCefN+IIh+L/D4Afszx6T13e/oOVO2R1L1INt QbynsJb+BYqVVBQV3pBLuVbQkv5QvhKTa+FZ8mG7uBK2C4+dj+v558Vm6wyGLRe8Ye 1McpJCe6Lhws7L4FDKVl7K/NF5693zHHbi9CR7qLp8PCjgz+zIUaTvIfhVFOWZ6fJJ DdNfekfzy73yg== Received: by mail-wm1-f69.google.com with SMTP id z11-20020a05600c0a0b00b003a043991610so7280850wmp.8 for ; Tue, 05 Jul 2022 14:01:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AoMSkRbSsal7DXav6tHJCoGyFX+s+KqI3+R+nsluk4Y=; b=I+zXp8XEgCpF9dMr7eBR+t/MVpXCvpBl3jsPXlhGsdE1egLaEdKxasEayfDM+ARm+1 fxIz5Jjz+FOlmOXGwANkRlUiwhQoA/dMrGItlNemnYhYy0dnxcY2JNePr2DKMGPW0cN9 qQXsM/gKbMg459SEq//4hOTKz2VhlZUwO8Bmr484pZdchdfsmTQd5LMZNcYjaESD5iGw qeLcd3DyFSXlUloiZ5K/BxeG5u+ZAj3Hxpin72dNfkKOwZ7Sv12vvq+1EpY26USIdpV7 +Oju/1tqkyuVpfEnbgnqflCECobOyGMzL0RQFNWgRkCcVheZcGCoHUmVEsFgCPnodJCo bWhg== X-Gm-Message-State: AJIora/J76eFf473ZJqzKCYP14DxAmdqUAtxc1KBTUbMBY6ElPmmMIXt 0p/MmyrbCvYpXo3rdgFx/3NDVqItYEW6ujBF6fPeDle7XyXToI4lRnl1HG+tUiUE7+w4vpou8Co 6sabiS608trPADiRimcjE+P48+vQtzqaelKRMdcI= X-Received: by 2002:a5d:64ad:0:b0:21b:b412:a34b with SMTP id m13-20020a5d64ad000000b0021bb412a34bmr34737453wrp.161.1657054910464; Tue, 05 Jul 2022 14:01:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1utl+vdlW/hT+y0u8P/5xgHHhGX/aEi5Iu3pv5PVf+eB3fFB+ZuQGqJZ0/RfxSFhjz/+hEgCA== X-Received: by 2002:a5d:64ad:0:b0:21b:b412:a34b with SMTP id m13-20020a5d64ad000000b0021bb412a34bmr34737424wrp.161.1657054910311; Tue, 05 Jul 2022 14:01:50 -0700 (PDT) Received: from stitch.. (80.71.140.73.ipv4.parknet.dk. [80.71.140.73]) by smtp.gmail.com with ESMTPSA id r15-20020a0560001b8f00b0021d74906683sm2517667wru.28.2022.07.05.14.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 14:01:50 -0700 (PDT) From: Emil Renner Berthing To: linux-kernel@vger.kernel.org Cc: Pavel Machek , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Vincent Pelletier , Bin Meng , Aurelien Jarno , Ron Economos , Qiu Wenbo , Geert Uytterhoeven , Stephen L Arnold , Jianlong Huang , Mark Kettenis , Sven Schwermer , Andy Shevchenko , David Abdurachmanov , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v1 4/4] riscv: dts: sifive unmatched: Add PWM controlled LEDs Date: Tue, 5 Jul 2022 23:01:43 +0200 Message-Id: <20220705210143.315151-5-emil.renner.berthing@canonical.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220705210143.315151-1-emil.renner.berthing@canonical.com> References: <20220705210143.315151-1-emil.renner.berthing@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org This adds the two PWM controlled LEDs to the HiFive Unmatched device tree. D12 is just a regular green diode, but D2 is an RGB diode with 3 PWM inputs controlling the three different colours. Signed-off-by: Emil Renner Berthing Reviewed-by: Geert Uytterhoeven Tested-by: Ron Economos Acked-by: Pavel Machek --- .../boot/dts/sifive/hifive-unmatched-a00.dts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts index c4ed9efdff03..beaefe74755a 100644 --- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts +++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts @@ -4,6 +4,8 @@ #include "fu740-c000.dtsi" #include #include +#include +#include /* Clock frequency (in Hz) of the PCB crystal for rtcclk */ #define RTCCLK_FREQ 1000000 @@ -44,6 +46,46 @@ gpio-poweroff { compatible = "gpio-poweroff"; gpios = <&gpio 2 GPIO_ACTIVE_LOW>; }; + + led-controller-1 { + compatible = "pwm-leds"; + + led-d12 { + pwms = <&pwm0 0 7812500 PWM_POLARITY_INVERTED>; + active-low; + color = ; + max-brightness = <255>; + label = "d12"; + }; + }; + + led-controller-2 { + compatible = "pwm-leds-multicolor"; + + multi-led { + color = ; + max-brightness = <255>; + label = "d2"; + + led-red { + pwms = <&pwm0 2 7812500 PWM_POLARITY_INVERTED>; + active-low; + color = ; + }; + + led-green { + pwms = <&pwm0 1 7812500 PWM_POLARITY_INVERTED>; + active-low; + color = ; + }; + + led-blue { + pwms = <&pwm0 3 7812500 PWM_POLARITY_INVERTED>; + active-low; + color = ; + }; + }; + }; }; &uart0 {