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: 12907061 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 83DEFC433EF for ; Tue, 5 Jul 2022 21:10:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qRzQZ2roOfFxb4K4JHkrvfpwgDgBMtYMQpxbCWdxbnk=; b=ERWiYUQ86Fozir View8WKsX5wRhEKgEOD9fM+DdO1o/Mz3/g0ohyR/+qDS2aMrBmq48F1BbTeHYRgss4xtin8ZJ5yFk txu8BkTgPjVKWIADPKUla85bPUM10Vxr72M4k8GDeWEV9f913OaPr8sMXJqoW9Es1Q3lvca2xiFnt AsKcb6C9i4XYbu6MpxRWlOby56+5bmBUGSj7HpnE8Z2LKQ/2Qf4qPQ4kWPrhXVq5AivjqfWVN8dW4 mq2gIuo928Z1JV981f6O5NSdLKEPOcHKvyGE1WncZffRHTOr2AyyTXF7gXplY22jDITJn0HTAyUKp vGoZDRTIoHzTbCQ8MlxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8poe-002qPI-UY; Tue, 05 Jul 2022 21:10:41 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8pgC-002nIO-RC for linux-riscv@lists.infradead.org; Tue, 05 Jul 2022 21:01:58 +0000 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (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 2732040A98 for ; Tue, 5 Jul 2022 21:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1657054909; bh=bQMwaeYKMT6usnwDyo75UwU6twU1bHQlELRjvpkCaBs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MJNHhJA6xLXtRlxAJ6d+Ku5q9zmFXFuG256+5KoQdf0F86q8w9MgLQAxrJSmc44mx QsHQM/iMnGD8NWQI4J74m+m/ysiVEN7fMWAUgcJIpdS+qsQ8iaZn4g+qiOvVs9+OqH D+NPrt9/dVv6svaP9RLc6FfmrDaL0wC1xm3LvhCkTHY+wdSgGsWPNvLhGKFgPYyr+S 1suZ1i7cCDnuqxguERcpkM6z6BXEsKLz4O8NgcEKq63WaKBTpRsB0WcdDih3P1Cn8E 9kQvXiqd58VHyyz/dsqI/BCgt5i9BinPpCGo4DUE9w8ldHNzTUEBs3EvhKgY9elLrq CWG0KwlUj3t2w== Received: by mail-wm1-f70.google.com with SMTP id i184-20020a1c3bc1000000b003a026f48333so5737665wma.4 for ; Tue, 05 Jul 2022 14:01:49 -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=68pbniVuDBUyZ86x1kPlkstGbCHKKX1BnV3jUlfJf/rsMESFEScduSzNiZGK28VJMe mrya1n+o+z9vyhDl7/K4ndxw2kF7mZNEeC2j59Y2Ez3MFPIQz0UX442a2eYldPO9aEKg yeySd87/O6wPpCa7o7Z+0lchKSh/K1zyFnWo2HxrZLMfBJwqYvhNBfI0rrEC0Hiklqhq rXufmLCxGZ5K+f1vm/J+UcZn2xDs0ycobraEMKR/0XMhJGHxVpgTFUxFj2+EDDvX9alj 8e9MBvjYD3RzCpxCxG3JtxSp3WYi7msbgl0/zMWC3nHjTIIZYIgxTT/llsK+WI/5QSvt GeRQ== X-Gm-Message-State: AJIora/E5m3E8ci1OPhfZoeQHpTbTawNBre2iBOCglcHiDgx9GiEe706 5lm/Xr2dUCu3BGvGPrEHfnoKgxr9lcQhqw2vD2oHcQMG69ESU7arQHH6VbNqfSLPP4M85ZygHMY 85q7T6lz4yBmoyxTTurp4/rqyQ7ScJOYg/sPqEUCl8bMzLQ== X-Received: by 2002:a05:600c:3caa:b0:394:8fb8:716 with SMTP id bg42-20020a05600c3caa00b003948fb80716mr39682318wmb.105.1657054906726; 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220705_140157_072162_F7C67E7F X-CRM114-Status: GOOD ( 12.42 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.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 Reviewed-by: Geert Uytterhoeven --- 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:41 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: 12907062 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4AC51C433EF for ; Tue, 5 Jul 2022 21:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SdbavdUgh6XU0C7PnXgRxauc6xEDOFdWNqRkFANLF5Y=; b=rKrJwq0gri8gAl w0MgsF0DoYVAP7aLBO00TplTdsnfSuici2OqY6HjZLn7A9uYtztqQL5w/IGjSaeVnhvw1d9JWI6Fq 1Qb9aHtbOXx9n0mZD7JDrkktYFI0DiBby5tlXKBK+z+QEuU5vewFloHo7Oak0kChWVBw3uxe9BEZU K6THB/uJKOJY4hFkWrSrAEEXfmqRfH9nOKkJZrkKzWD07vXPa2SfRrEzH0/FsM4hE1w/I2MGsOwVL AXM56bM48GymymekqP3y3c0ecABNeUika6geR03IO7cl/K8j7FYJeHeFjR6D2qXwYDWZopyRGNCWq 5mfbcWpp9ecSOAuqTzLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8pos-002qUo-H4; Tue, 05 Jul 2022 21:10:54 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8pgC-002nIp-RK for linux-riscv@lists.infradead.org; Tue, 05 Jul 2022 21:01:59 +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 C840840A9A for ; Tue, 5 Jul 2022 21:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1657054909; bh=/+iqepEXJiQtf1kCLKBlcRYR4nyv6+zJPzgNc4qYD7Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tuwF+40dDEmeii9OYygVHsCAsWo0/mPU9e/ETx6+bJuCD7O/tLLlsTXSqobw2azVX g87xpNpGWrsII8jiDat956WjQwzaEnhR/KUyKu33TLkPecv5uTRw9BX6v4l9I8PB4S xdXX6VP67oFSEKSGlxq6tvV965RN9xniLIAwl3whAQcND6uNzqCk07qVze+mAtUlKv RYTxw0C518tWqDPN6O0baEjFGQYDIOQ9f0ykwjFywAzsGK03BqN6SKRaJu5VBebE0c 7hGcUjLAX4oZG4Y8Kw5h84CoxtpDjQvLN1gHK0Vp82YIHiXNeajHPbSwG8adxP0WdP MAMlgqcQ97cBQ== Received: by mail-wm1-f72.google.com with SMTP id v8-20020a05600c214800b003a1819451b1so7286357wml.7 for ; Tue, 05 Jul 2022 14:01:49 -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=/+iqepEXJiQtf1kCLKBlcRYR4nyv6+zJPzgNc4qYD7Q=; b=jwCcorXvXc9QDuIRZqZlf3sp/whnvTetd/Q73EPl3yd1vxxvIM3aRvdpbghajEZMr9 KnIJxqWINKkxW21z3+HmY27Wd1ADqdKrWOZF/ar/w8ZsKnG2afeiaovQlSE6TO2/i9R2 BNZoHvSvaroswcKOQJrC2k8awzYiTn7ffnv10rdv8gD0lZNvnQ9t+Mb5Nte/SjDD51Ct jOTI1+lIJSm+emINJPbaerbAEboaU0Nbj18VSkO9BoOFr2HFGUnG0gfDqfnmHxChJ7E4 xD8nF01W+6WpzJN+iiSZj+ib+6PbQMDS9XWhU6TJYWnk9OWkjdhQb+B9lhVt0oRtKN0o Qo3A== X-Gm-Message-State: AJIora/aqv+/PBxh6PMAPn2L6FAFE6ug+2NB307q2HvYPe8C5KV2Dp8B ABxHAaYzb1QAj1TuLdoH0CiXBlnhW29gE6UggsC42E4gYPDjW+7PuHVn39iA/RdQqSOQGMvRR35 BJa78bCeXvmmebmMhuAQJ2/gojp52YFiCgiKMpmR2uPZ3GA== X-Received: by 2002:a5d:5f05:0:b0:21b:8ca0:6d3d with SMTP id cl5-20020a5d5f05000000b0021b8ca06d3dmr33987892wrb.382.1657054907933; Tue, 05 Jul 2022 14:01:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1voNkjmJLsItk4qX2FcCqMMV0I2vwoygxRWgEn1u2iRJAbKSZJmuQVNG8KjvMDWpNkZS4aZLA== X-Received: by 2002:a5d:5f05:0:b0:21b:8ca0:6d3d with SMTP id cl5-20020a5d5f05000000b0021b8ca06d3dmr33987869wrb.382.1657054907727; Tue, 05 Jul 2022 14:01:47 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 14:01:47 -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 2/4] dt-bindings: leds: pwm-multicolor: Add active-low property Date: Tue, 5 Jul 2022 23:01:41 +0200 Message-Id: <20220705210143.315151-3-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220705_140157_072372_1AA35FC3 X-CRM114-Status: UNSURE ( 9.77 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add the active-low property to LEDs that are part of a multicolor LED just like the regular PWM LEDs have. Signed-off-by: Emil Renner Berthing Reviewed-by: Geert Uytterhoeven Reviewed-by: Rob Herring --- .../devicetree/bindings/leds/leds-pwm-multicolor.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/leds/leds-pwm-multicolor.yaml b/Documentation/devicetree/bindings/leds/leds-pwm-multicolor.yaml index 6625a528f727..8d614eaf5c5e 100644 --- a/Documentation/devicetree/bindings/leds/leds-pwm-multicolor.yaml +++ b/Documentation/devicetree/bindings/leds/leds-pwm-multicolor.yaml @@ -33,6 +33,10 @@ properties: pwm-names: true + active-low: + description: For PWMs where the LED is wired to supply rather than ground. + type: boolean + color: true required: From patchwork Tue Jul 5 21:01:42 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: 12907060 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 93E6ACCA481 for ; Tue, 5 Jul 2022 21:10:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4DXQnxGdy+lzGIo052S4JS+gA9g8SNVfSmmguP0u81Q=; b=ohm92i8SjBfe3n AzHVCF/QMajITgK7qtZwTGXYuVP8TKCjYybNYA+jHP8sLIQkxDaBrZ6pUGT00YX1Eye8uOpe/R4C1 bKea45T9a0OaMvOwQk38MSQ1b0XFJM1Mue9ZgCAajrnKn4HGZAn5u2WRkQk1hr90dnbyo+crY3A/v kD+O+qQL6HkNAy9sMKghdcD/EOt5r6VnPZzQL2u7mckEhSetuo/gQ/9Mzqq3szQ0QLWRG7mMW37cz zANRF3X36Fda4osa4Y+YEQB+aVIYRTNFwwx+x19+IE9j/QWFta0f28iCqU/zHWmoiJTmMdKrwiHH4 sJ4h4Lh/T3vVWapnEj/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8poW-002qN5-Mp; Tue, 05 Jul 2022 21:10:32 +0000 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8pg6-002nIF-VD for linux-riscv@lists.infradead.org; Tue, 05 Jul 2022 21:01:52 +0000 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-0.canonical.com (Postfix) with ESMTPS id 562E542450 for ; Tue, 5 Jul 2022 21:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1657054909; bh=EI3mxEAHkgT2vU1OOl7PeFFTw9+zwdjdFkAEZQkp71M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=dSz4cd2tFkr3LwJF6mzXRHMLCRYAZXql/m3onj8t7TN3GrGE5OuUS6+cPlIFdxDLl M1BRPDO6Gy1XraS1SZVqALPlvn0JiqZR9+VXVHc9gUUn5RLj1MzrSntfH4bfVaaOUT OOl7QQlnyQ7e+6fHnuvFhaboVEkj6PknWtIyKdakxXaCCOV/valcW5Vr8YZ77zsSWq 6iKqBFW4pIX4ws0lD+5m+Ei4l/+QQMnu3CvqYh7ZFBkAyIDjRhH5nLxERoF23Y8kC6 o5lvo2WJcZqwPqTP40cyYjhQp7F8BrbGAInvkFpA0cPYlBVlbc06tkq6ZcWNFlaBz9 LLjs9ksAQWTCA== Received: by mail-wm1-f69.google.com with SMTP id bg6-20020a05600c3c8600b003a03d5d19e4so7300164wmb.1 for ; Tue, 05 Jul 2022 14:01:49 -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=EI3mxEAHkgT2vU1OOl7PeFFTw9+zwdjdFkAEZQkp71M=; b=I+osFzy5O8llVCt20G//+gmzxZ2KhK9Z8kvQD/o5INpALDf9+vM69kiQeKg3n8QHUm cs9QHavMeeEVyfc/krMgWsgDWbeXzKhPf/dw++QZfZHfpbzo+1dCSwyNRuvWeC/lgbIU GQC4C3e/WCouOc6nQj/gjxfSY5drb3Ry34keKyzQySFGrPvzDcNIHZ/P0TOEweTdlir5 wzwghPjQhztiZE4ObzWAC4BZm8Mc5zIBSSkCbKhgaAaS4ZIkNecxJBLfsxVCuRgZTW9u WuzzGFIM4Bf+dsFZHjClQM3W6KijwiFeFMod2tRZ0eBNV34jMmiUKo5fAjeOeIiuA8Jj 5e3g== X-Gm-Message-State: AJIora9/JROipk9WnbAOyWQrLYIijeonJ/2QHfvKfa81y3QsFGLe6TgN OgVd9VJE+RpDG8Tq0vl+JlFHtOEgOJu4O4OvbB//6f4Oq0EuvGxGrZ6xHgtkKz9cxyqz4MnwEI5 OnEXos1t9jauxgHSyZIlKzIAd5I9NvDsfgAJEXwMiP+zJxw== X-Received: by 2002:a05:6000:1445:b0:21b:a919:7d3 with SMTP id v5-20020a056000144500b0021ba91907d3mr33143879wrx.545.1657054909197; Tue, 05 Jul 2022 14:01:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tpGtr585A4zBiBrqeprE38gSsAvDrw/l/xt/heeVYnerThl9ghX7+cZz4Gy93kTP7evrM9SQ== X-Received: by 2002:a05:6000:1445:b0:21b:a919:7d3 with SMTP id v5-20020a056000144500b0021ba91907d3mr33143858wrx.545.1657054908987; Tue, 05 Jul 2022 14:01:48 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 14:01:48 -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 3/4] leds: pwm-multicolor: Support active-low LEDs Date: Tue, 5 Jul 2022 23:01:42 +0200 Message-Id: <20220705210143.315151-4-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220705_140151_200210_39C48EED X-CRM114-Status: GOOD ( 12.66 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add support for LEDs wired up to light when the PWM output is low, just like the regular PWM LEDs. Signed-off-by: Emil Renner Berthing Reviewed-by: Geert Uytterhoeven --- drivers/leds/rgb/leds-pwm-multicolor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/leds/rgb/leds-pwm-multicolor.c b/drivers/leds/rgb/leds-pwm-multicolor.c index eb67b89d28e9..da9d2218ae18 100644 --- a/drivers/leds/rgb/leds-pwm-multicolor.c +++ b/drivers/leds/rgb/leds-pwm-multicolor.c @@ -19,6 +19,7 @@ struct pwm_led { struct pwm_device *pwm; struct pwm_state state; + bool active_low; }; struct pwm_mc_led { @@ -45,6 +46,9 @@ static int led_pwm_mc_set(struct led_classdev *cdev, duty *= mc_cdev->subled_info[i].brightness; do_div(duty, cdev->max_brightness); + if (priv->leds[i].active_low) + duty = priv->leds[i].state.period - duty; + priv->leds[i].state.duty_cycle = duty; priv->leds[i].state.enabled = duty > 0; ret = pwm_apply_state(priv->leds[i].pwm, @@ -76,6 +80,7 @@ static int iterate_subleds(struct device *dev, struct pwm_mc_led *priv, goto release_fwnode; } pwm_init_state(pwmled->pwm, &pwmled->state); + pwmled->active_low = fwnode_property_read_bool(fwnode, "active-low"); ret = fwnode_property_read_u32(fwnode, "color", &color); if (ret) { 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: 12907063 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B7955C43334 for ; Tue, 5 Jul 2022 21:11:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=x9Aby79GwmHvXDAvtbHxDM6XQX17FejSZZmDbBWrAFI=; b=NmdVDZWhVyq3PI PBaP7m4hmSl5ZGW+nT26KXbFw1sEFrxqvxx4KISgvPVV9it33/heu5CnC8OxdG4k3ypMHM9wJ1IXZ eXE1uHIdWjLAIpEMYKlpa7hTLFQZs0jCCh7ahy1M+HD27iCHoss6j3kkxmUWP5DMx98s+sigfEnEn BiHRp5IuF5ePIZBEYVoTXmwNCDMAx/JBJNoi8sUZ1GagSn3o84QLF3931x+JKnMZMZgHEBXbEGUZA RRq8uTXGtWIMU9Zhe5TMbmdlgjNrPtp7m6LY3DyHbaRD8o9TF280w2mXUZpv+RDIRwDOsr6TITyyb BVAU0q5bTOLVIPQHOtbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8pp8-002qaf-T6; Tue, 05 Jul 2022 21:11:11 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8pgC-002nKB-RH for linux-riscv@lists.infradead.org; Tue, 05 Jul 2022 21:01:59 +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 DE8DE40AAE 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=1657054910; bh=AoMSkRbSsal7DXav6tHJCoGyFX+s+KqI3+R+nsluk4Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EZTV/g9pLZ7rlM3n6yiDtLZYy1oC+hcEXYERbK2b8kK/rj8Qm8CRLXwQ+PghI4H2g 7LIDwqYC+onvsnFd8xDqpWiyA/LkVzqo46Ok4SIBmzaNzgUrHx0UgmgOsDPZi0M+PN WLbePTS1kftpdjutRBkwoI0XjKSfzI4SMmDyzzULl4IlAkQiwgoMbuhB80860a9ZPh +6rUDZmt4oJkAaAYQHZVqvChtLXUB3MuThBHooR3ztMdqalolkm6E90MPBe6oTiYZo TJwvXqAB1O23IwBGopAbbvKjX3NX2WXDfmp1tjdGGUitnw6OCLx+2kXqtEp2Fns8nQ eCFiGKnpzA/XQ== Received: by mail-wm1-f72.google.com with SMTP id 18-20020a05600c021200b003a19b2beb0aso3439905wmi.1 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=joZM3tE9lf69j0N0Koi44rUOnzMv+aH2JB5V0bCU5BpSbwaBWD+YomONwXL5cS+P3X bgDkKhnjmDgC3k52HjTyTG6z7qnFKP95injCBkO/tQI6QBlpcFfFQRP92e8m3dL9AL0A M4V7mrYOQPY+1bdyqMOvSQFxPoPphE5u2TRym6IcpkQS1Al580fYox+wbpgeaICtmgn+ 10zNMgDDMZ2PNXc3gpkAvO/xfYdQTxLkyiV3SGQYAeoEbsbFtoktbAdZGvgQ6aBWiYiO qHFx1iCSYPCapYpeAkqO1drRAz96EKmZmj5zCoIBQp/SuJqEsLkt1cpPsP+ZU8SWvWyu 4sag== X-Gm-Message-State: AJIora/5sT0sfFoFjLa6GtKFxJaWmhFxwFktz8m06fqZfPfKhuoSefX2 rUnJfHc2CSNTydBLW9egsGA4iZqswcZioA32Hko40mCJEuUnZ6l3bSFSNkFxtM9UcpH8jvwlw7B BiAQebxyFYENzbhT3LPb+TSOa0+u1HlheQ4kXIPaj0DuRXw== X-Received: by 2002:a5d:64ad:0:b0:21b:b412:a34b with SMTP id m13-20020a5d64ad000000b0021bb412a34bmr34737451wrp.161.1657054910462; 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220705_140157_106755_F84A7E25 X-CRM114-Status: GOOD ( 11.46 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.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 {