Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2185346imw; Wed, 6 Jul 2022 01:21:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1up6IQHcig2KojKSG5FMb62EJlmWLNQUqraNZEEBrb8jfSCa6NVDwfMTaucKv8DqdpV0ZMJ X-Received: by 2002:a17:907:6e03:b0:726:a6a3:7515 with SMTP id sd3-20020a1709076e0300b00726a6a37515mr38984645ejc.676.1657095711738; Wed, 06 Jul 2022 01:21:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657095711; cv=none; d=google.com; s=arc-20160816; b=OJw12dWGQvVOFpT7B3yTeUhcH58RxKFFkBuGEqASLKE08wELtnMFw1SClni2gbwpVw ZJUez2UOfF1bdewULW5S8cf+ydTddy01+HxqCdk5/ucLKZCnoRY4rJy6NTZDxi5TlOZq tEml8ed6Ybj/bamdQsYkpn1Ma4EUkEX/5lAY+2Q1Vov7ZgVSO3Cliu6HzYVfljw+iN5N ltzELKtmgDPNA5QIKXekvGi8jvyZ9xwSVKzm5snBBY9H0duS+4GizmgDXmTP+jd/LL3x w/b+rR0I9rykCNZ2i/kL3iBt2QveEEQ4koIBUjZpb1UnsqjCQhYvJK2Ntykhj/wsIMGJ Chfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=nFnExDmVG8iUyhRWe8k5w8cOxRLhlolbcIWrBxu+DeM=; b=uZXxaMIV4pcFqYBetP27NgaNk86HKIPzMvOXVwcIUs5E8a3U96AZMC7g/CgE5Tgwj1 bLAvjpxdkkder1USvSbnlJ9UZUGGkl1sQMRClZJinFsjpsGoRkDeL6CsEAYO9RW/YjOz tjp9W/PXSiKb7fJHU65QB3tpuGLMIS56Qz0zQldJ7oSBuMLEV8QuHTDnU79O3F3BF71W QQ8ZVDj+n/rXeFjtXUJkgsZVVpoCmWkgJCyHxdk0zhCgaeNC5TuCB+pg+h3ZdufNwWFf QrWog0W9Wdxt0ndx20UzKhm7xiHVNELdAsJrYl/5wmIBqSvRk1//M99zumGnuzAVgz8G W2ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cr15-20020a170906d54f00b006f4b2a8c255si23645482ejc.113.2022.07.06.01.21.26; Wed, 06 Jul 2022 01:21:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230153AbiGFH4d (ORCPT + 99 others); Wed, 6 Jul 2022 03:56:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbiGFH4b (ORCPT ); Wed, 6 Jul 2022 03:56:31 -0400 Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5CE3BC9E; Wed, 6 Jul 2022 00:56:30 -0700 (PDT) Received: by mail-qk1-f176.google.com with SMTP id k20so10502239qkj.1; Wed, 06 Jul 2022 00:56:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nFnExDmVG8iUyhRWe8k5w8cOxRLhlolbcIWrBxu+DeM=; b=KN3V6kqJKP2UMm7lQMcZQ/+mqOmA7MxnFAAZuv1d3KNR2ef6BdVCBXzERn9Cg6IG0O iXZVTjHl0YLyIohzIcmClmVVBQIEAZLBmcEcCkNIp47MIDS9ets1FhiiPFqty6Fp333s O4RCr3aKgZtey2Scfb2ymZaTob927bsLP3Dkfn70dj7MLDIo3897IWBYgKwjrRefIMwX KSc4G23L6AdX1t0FF+157ABgJNxpvs8GzaCvLw5OOnVrOg/5etiZyp/xmluuNNtUNA1v WnFfd5i/Z5wrlf4GnMzED4T0OnQb3sQFXDPzwpK2q539soh/bLeGZqCJmZ6f3X2e+mZT BIZQ== X-Gm-Message-State: AJIora8ZGko2K0eVye/BBxFiuDSQHJfjSz0TaR3p7VzE/tgIlpCCMpac iFenS/X/M8JFCZHIAlJUqG2UE4hnp+fb9w== X-Received: by 2002:a05:620a:2296:b0:6af:46d:1671 with SMTP id o22-20020a05620a229600b006af046d1671mr26200088qkh.417.1657094189544; Wed, 06 Jul 2022 00:56:29 -0700 (PDT) Received: from mail-yb1-f172.google.com (mail-yb1-f172.google.com. [209.85.219.172]) by smtp.gmail.com with ESMTPSA id l21-20020a37f915000000b006b470422c78sm5849140qkj.121.2022.07.06.00.56.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Jul 2022 00:56:28 -0700 (PDT) Received: by mail-yb1-f172.google.com with SMTP id o2so20747130yba.7; Wed, 06 Jul 2022 00:56:28 -0700 (PDT) X-Received: by 2002:a05:6902:a:b0:65c:b38e:6d9f with SMTP id l10-20020a056902000a00b0065cb38e6d9fmr44011964ybh.36.1657094187854; Wed, 06 Jul 2022 00:56:27 -0700 (PDT) MIME-Version: 1.0 References: <20220705210143.315151-1-emil.renner.berthing@canonical.com> <20220705210143.315151-5-emil.renner.berthing@canonical.com> In-Reply-To: <20220705210143.315151-5-emil.renner.berthing@canonical.com> From: Geert Uytterhoeven Date: Wed, 6 Jul 2022 09:56:16 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 4/4] riscv: dts: sifive unmatched: Add PWM controlled LEDs To: Emil Renner Berthing Cc: Linux Kernel Mailing List , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Vincent Pelletier , Bin Meng , Aurelien Jarno , Ron Economos , Qiu Wenbo , Stephen L Arnold , Jianlong Huang , Mark Kettenis , Sven Schwermer , Andy Shevchenko , David Abdurachmanov , linux-leds , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-riscv Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Emil, On Tue, Jul 5, 2022 at 11:01 PM Emil Renner Berthing wrote: > 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 Thanks for your patch! > --- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts > +++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts > @@ -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; The first thing that came into my mind was "why not drop the PWM_POLARITY_INVERTED flag instead?". But it turns out drivers/pwm/pwm-sifive.c does not support non-inverted PWMs, and returns -EINVAL if PWM_POLARITY_INVERSED (no typo) is not set. I think it would be good if Documentation/devicetree/bindings/pwm/pwm-sifive.yaml would mention this limitation, and perhaps even enforce it, if possible? I didn't check this against the schematics, but the generic structure LGTM, so Reviewed-by: Geert Uytterhoeven Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds