Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3250534rdb; Wed, 13 Sep 2023 06:49:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHFYGe/QbBgoXJru+9sGiFJrC3mwKZ4nC+3U/qX1IYnjzmm+wm5neNxubYPEj58iEAJShMS X-Received: by 2002:a17:902:c404:b0:1c1:fafd:d17c with SMTP id k4-20020a170902c40400b001c1fafdd17cmr3601619plk.6.1694612973554; Wed, 13 Sep 2023 06:49:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694612973; cv=none; d=google.com; s=arc-20160816; b=qFGCmoUSx4f5Oq//HU+gVu8tHea2GTVU/csq0WHa6oMCwkY7Bu4FSun3sSNeydmtj7 dPz9khnyCfCjxjXbyRnK8ElM+71ijHCBJ/RnPXO4uJ27dDP5AA02NLJj0Ef/VDIhHTNe BiQwtyWIZTHwnt4OnoJho/zLQ8zKgwGVQGNn2vpX+LZsrrmmync0w9s3vVDp8o2eoOHI 2SLMyiHvRHsAKqY0xIR2GlOxvt90Ch6WD5Gx+qcPKdnxgd9Iw/r6JgdOJlscsncCh6mk hMygjenuy7YW8TlalUsjhcSRHytl+d8/idrpeiEpawWeh2Z2EMM9eJJnsOEXTVzkbLQb 49dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+ymobDUfUuqwfvbjBSIVG7t1ShrBn2FdgWOqdtHC3jU=; fh=2npxsdirJnDAqhuyPPDX+JWYwKUA4f6QPrNKDfKzDQQ=; b=0vPtdz2+yC8R0mbP3DzJnhdKt/TZx2j3FJCivQdWXc1LQUZNy60c5fAirK0BlZYyVq Ri0Ntl0/FFT6id8U0YgdwUD3M5FuI2J5/uy4IVG7OcilRQaYPmLBQMaC9DqWcl65j+Jl mJ1PyHMXWX/ZxALMdgRTHOXKGaB6Cs+lm+btqNT5ToIUf3gUvfTULu80tVEbkZ4uuHyo 8AmTOEHkvYMW4FgaDS2taNm+zNQgmYkPafJtZWZ2Vmm9oXAFAruJMP97D6NNUCKMwp82 0pENWszxhWYASAVE8g1XLP/RXsfwV673E6ESL1nL69jhPyVpkjGvFWuWzXYbbvba+90/ BBpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MAFWhsjG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id d17-20020a170903209100b001bf0b29d935si9842875plc.34.2023.09.13.06.49.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 06:49:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MAFWhsjG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id EC10483649C4; Wed, 13 Sep 2023 06:35:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240961AbjIMNe7 (ORCPT + 99 others); Wed, 13 Sep 2023 09:34:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240950AbjIMNe5 (ORCPT ); Wed, 13 Sep 2023 09:34:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C707C1BC2; Wed, 13 Sep 2023 06:34:53 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7736DC433C7; Wed, 13 Sep 2023 13:34:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694612093; bh=MFeimr0DIDPO6o9ZoxuaDIxx2Q83zZVFEoaPaVha1Xs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MAFWhsjGgOaFx6m3fEdBnZ8zllzmp1PsOQ2YRNblZyV5oteDXkCZ3ljKi02ctQQ5L ZnaZ5St3rUUbQLTCUtwwuNLNjg9XA/9vqZitiQLIXWIf3Ma71jFt4Pn6PeeOOqdXl5 6llM1ZKU55Niu6JIk5ciEiOMLjckqIg5V3qyrFIniTFTqyjKFTwEFxmDe8r2a2Ak55 23sZwasiRTXw/9RY9EPxVxVTzbCIyH6iqyRjloIoQys72KG9PB3yF1Nk5kiEQhAby0 w8s4YTTJqThLOEtN0WS/79wCJVNbZbc0+vc8KJpNvFvJN17iNqNZRMSQt3vgn+dsSc v/9cg5kpFVowg== Received: (nullmailer pid 2855562 invoked by uid 1000); Wed, 13 Sep 2023 13:34:51 -0000 Date: Wed, 13 Sep 2023 08:34:51 -0500 From: Rob Herring To: Linus Walleij Cc: Jan =?iso-8859-1?Q?Kundr=E1t?= , Pavel Machek , Lee Jones , Krzysztof Kozlowski , Conor Dooley , Jacek Anaszewski , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] dt-bindings: leds: Mention GPIO triggers Message-ID: <20230913133451.GA2841610-robh@kernel.org> References: <20230912-gpio-led-trigger-dt-v1-0-1b50e3756dda@linaro.org> <20230912-gpio-led-trigger-dt-v1-1-1b50e3756dda@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230912-gpio-led-trigger-dt-v1-1-1b50e3756dda@linaro.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 13 Sep 2023 06:35:11 -0700 (PDT) X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email On Tue, Sep 12, 2023 at 03:44:30PM +0200, Linus Walleij wrote: > We reuse the trigger-sources phandle to just point to > GPIOs we may want to use as LED triggers. > > Example: > > gpio: gpio@0 { > compatible "my-gpio"; > gpio-controller; > #gpio-cells = <2>; > interrupt-controller; > #interrupt-cells = <2>; > #trigger-source-cells = <2>; BTW, this is not documented for any GPIO binding. If we want to specify the cell size, then it has to be added to every GPIO controller binding. If not, we then need to reference gpio.yaml in every GPIO controller binding (along with unevaluatedProperties). Doesn't have to be done for this patch to go in though. > }; > > leds { > compatible = "gpio-leds"; > led-my-gpio { > label = "device:blue:myled"; > gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; > default-state = "off"; > linux,default-trigger = "gpio"; > trigger-sources = <&gpio 1 GPIO_ACTIVE_HIGH>; > }; > }; > > Signed-off-by: Linus Walleij > --- > Documentation/devicetree/bindings/leds/common.yaml | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml > index 5fb7007f3618..b42950643b9d 100644 > --- a/Documentation/devicetree/bindings/leds/common.yaml > +++ b/Documentation/devicetree/bindings/leds/common.yaml > @@ -191,6 +191,8 @@ properties: > each of them having its own LED assigned (assuming they are not > hardwired). In such cases this property should contain phandle(s) of > related source device(s). > + Another example is a GPIO line that will be monitored and mirror the > + state of the line (with or without inversion flags) to the LED. > In many cases LED can be related to more than one device (e.g. one USB LED > vs. multiple USB ports). Each source should be represented by a node in > the device tree and be referenced by a phandle and a set of phandle > > -- > 2.34.1 >