Message ID | 20231209014828.28194-1-ansuelsmth@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5829179vqy; Fri, 8 Dec 2023 17:48:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFLaa/DG/AVEU/dj2TapXdDVlFfmVhFEqqCTh2QtsVUF7qJ75svOVh2vMla2Cc56I1qEX/b X-Received: by 2002:a05:6e02:1949:b0:35d:5797:4d32 with SMTP id x9-20020a056e02194900b0035d57974d32mr1493993ilu.23.1702086524236; Fri, 08 Dec 2023 17:48:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702086524; cv=none; d=google.com; s=arc-20160816; b=spyg4VPP4ZXcbgFnuabCJPSKoytVuPiEa6MMUw1xD2PEuT3RZIyrThc8Wnqcos3HU8 8Nwjbbc8gA8zJ7Ek9PmAFsyaw3A9s5MAug2WCDMUdNvdaBxziInVQm3sTjP6xnW9iQOD 03+o6Jmt0suPP3Jlt5GAhOmUqCpQGGb57bFyStqceyc7L7MN6U7Xj0p6fjczIkiZobCp aJlD8Dvb36LvFBg5W6UdrqdepXU4xukHxZ/KDZjvSTp5IBzXuvNR3v3+xsKjlwtyKntX PRrSB0SVcM3+rezkDR4vgQtv817vbJT1d5iV82PYgolIvmb2Ko3xSWIKHAtRIjlEM/wQ 5bjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=b5TEoN9vdBbfGAJM/hB7+1BTZHwjSbPnt7yiTcrzTj8=; fh=kQ7oJdLVsTGRRsBGxp1TQ+LbiibGrFxoFtHDIr4oQOk=; b=0ggYO+DGgX6h2k2oFsVeS3yddnWzsA1cWCcxBmVBuR+W1fBKYQ2191X/Sp1aY2NvfJ BbQ1TbPbi2n6Lk/teUqYXiWyG9gaRVP5N+khX9ttBKQIILVLRFxtA6M/ueHcSc0FnrBU Ys7u1EDy5f+4v18jSbWif2uOjUjXh7Pm/DfnEmZfHsnQERqGoQ/umK6/6wBIykrl6tTZ dBpql2uIab1/0j3vMbRbKfsSN8O09WUsf7AgMNjuXSpyH7+m3EvT+5kQZ7u4tkG1YwIV 6Q2tsZ/eJpU+PmHxBps2mMSQlV0FIVX6h5dY2iYFPuB+tTPqv9pbg3+ZP7oprAymgfd+ N6wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hXOgtvFL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id j7-20020a654287000000b00578d3f8d4d4si2332023pgp.448.2023.12.08.17.48.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 17:48:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hXOgtvFL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 532A9827175F; Fri, 8 Dec 2023 17:48:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235979AbjLIBsc (ORCPT <rfc822;makky5685@gmail.com> + 99 others); Fri, 8 Dec 2023 20:48:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229884AbjLIBsb (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 8 Dec 2023 20:48:31 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89455E3; Fri, 8 Dec 2023 17:48:37 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40c39e936b4so4022705e9.1; Fri, 08 Dec 2023 17:48:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702086516; x=1702691316; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=b5TEoN9vdBbfGAJM/hB7+1BTZHwjSbPnt7yiTcrzTj8=; b=hXOgtvFLcBvivpUwVYMwm5L6MDNM+kaQ3Zy7eUMIu7ORLBQimNWl8CouKnm+alvD99 1YBrA6aa5eHoGRWv6/Bn+uc/9T6NDfaBqOZzgZmVvZA92gbbyx/pQ8e7vhLY9jsveHUP ZhJojQA+sWWgMvzZwWun4hgAbg+O0vYrQ0KULvfjmJqAeSSQQYoCuX/GIOxwu3C7UuYn b4cwGgS//DsUAdf7S4ZbzimJDhuV4Vm2OhrDl22JAKplBL+wQn5/w27kD3yNuelf8EBc S6f42bUIVYEiTfXtNzBNokc3SmETDd/4i6SIsjORlBIJPU6Rfdh9WBELQFXwLOk6vFVL eUBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702086516; x=1702691316; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=b5TEoN9vdBbfGAJM/hB7+1BTZHwjSbPnt7yiTcrzTj8=; b=JTnmO/63q91bTZzf7UsjLw6JOBd7F6pyntJAe+hrSKCI7U8iW3oITyV1vpwJOFLmzM pozWxJkgtqqs29YW480G3uSEjTwUntgRb4PMShF+2FGPvaqu/DNt4glX5ghtJiBe3vDU k4PZnrBcCXcJ/5HrfwZYmeDgfqz8DJnE2hH21Tz7QyQxUtZKU13kU0vGvcEJ9JZ3VEXf hg9De9ssVgZK8qIGTpalEuPKntWlm7h/bcgzbz7NgFz2RdNGGipZdSYGu82du4/955XY Tw4NruC25SVk0cwkgFMqXNvO4mPyu3501bg6h8eUgrtUXTOcTYkdIzBaociv/7QRGX5f nSlw== X-Gm-Message-State: AOJu0Yw1f2D5Lob7pENCisoYxp+VjPb3wly8MN4ibvlllQoHUa09F/PO MusO9iPacWj47w26dxmXNLo= X-Received: by 2002:a05:600c:1ca7:b0:40b:5e59:f726 with SMTP id k39-20020a05600c1ca700b0040b5e59f726mr202635wms.152.1702086515720; Fri, 08 Dec 2023 17:48:35 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id n18-20020a05600c501200b0040c26a459b4sm1218118wmr.0.2023.12.08.17.48.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 17:48:35 -0800 (PST) From: Christian Marangi <ansuelsmth@gmail.com> To: "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk>, Christian Marangi <ansuelsmth@gmail.com>, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [net-next PATCH 1/2] dt-bindings: Document QCA808x PHYs Date: Sat, 9 Dec 2023 02:48:27 +0100 Message-Id: <20231209014828.28194-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 08 Dec 2023 17:48:41 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784767079033366380 X-GMAIL-MSGID: 1784767079033366380 |
Series |
[net-next,1/2] dt-bindings: Document QCA808x PHYs
|
|
Commit Message
Christian Marangi
Dec. 9, 2023, 1:48 a.m. UTC
Add Documentation for QCA808x PHYs for the additional property for the
active high LED setting and also document the LED configuration for this
PHY.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
.../devicetree/bindings/net/qca,qca808x.yaml | 66 +++++++++++++++++++
1 file changed, 66 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/qca,qca808x.yaml
Comments
On 09/12/2023 02:48, Christian Marangi wrote: > Add Documentation for QCA808x PHYs for the additional property for the > active high LED setting and also document the LED configuration for this > PHY. > Please use subject prefixes matching the subsystem. You can get them for example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory your patch is touching. > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> > --- > .../devicetree/bindings/net/qca,qca808x.yaml | 66 +++++++++++++++++++ > 1 file changed, 66 insertions(+) > create mode 100644 Documentation/devicetree/bindings/net/qca,qca808x.yaml > > diff --git a/Documentation/devicetree/bindings/net/qca,qca808x.yaml b/Documentation/devicetree/bindings/net/qca,qca808x.yaml > new file mode 100644 > index 000000000000..73cfff357311 > --- /dev/null > +++ b/Documentation/devicetree/bindings/net/qca,qca808x.yaml > @@ -0,0 +1,66 @@ > +# SPDX-License-Identifier: GPL-2.0+ Dual license as checkpath and writing-bindings ask. > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/net/qca,qca808x.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Qualcomm Atheros QCA808X PHY > + > +maintainers: > + - Christian Marangi <ansuelsmth@gmail.com> > + > +description: > + Bindings for Qualcomm Atheros QCA808X PHYs Drop "Bindings for" and then entire sentence seems not useful. > + > + QCA808X PHYs can have up to 3 LEDs attached. > + All 3 LEDs are disabled by default. > + 2 LEDs have dedicated pins with the 3rd LED having the > + double function of Interrupt LEDs/GPIO or additional LED. > + > + By default this special PIN is set to LED function. > + > +allOf: > + - $ref: ethernet-phy.yaml# > + > +select: > + properties: > + compatible: > + contains: > + enum: > + - ethernet-phy-id004d.d101 I have impression that this is continuation of some other patchset... Anyway, id004d.d101 is specific to QCA808x? > + required: > + - compatible > + > +properties: > + qca,led-active-high: > + description: Set all the LEDs to active high to be turned on. > + type: boolean Best regards, Krzysztof
On Mon, Dec 11, 2023 at 11:19:50AM +0100, Krzysztof Kozlowski wrote: > On 09/12/2023 02:48, Christian Marangi wrote: > > Add Documentation for QCA808x PHYs for the additional property for the > > active high LED setting and also document the LED configuration for this > > PHY. > > > > Please use subject prefixes matching the subsystem. You can get them for > example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory > your patch is touching. > Yes sorry. > > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> > > --- > > .../devicetree/bindings/net/qca,qca808x.yaml | 66 +++++++++++++++++++ > > 1 file changed, 66 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/net/qca,qca808x.yaml > > > > diff --git a/Documentation/devicetree/bindings/net/qca,qca808x.yaml b/Documentation/devicetree/bindings/net/qca,qca808x.yaml > > new file mode 100644 > > index 000000000000..73cfff357311 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/net/qca,qca808x.yaml > > @@ -0,0 +1,66 @@ > > +# SPDX-License-Identifier: GPL-2.0+ > > Dual license as checkpath and writing-bindings ask. > Oh didn't notice the warning. > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/net/qca,qca808x.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Qualcomm Atheros QCA808X PHY > > + > > +maintainers: > > + - Christian Marangi <ansuelsmth@gmail.com> > > + > > +description: > > + Bindings for Qualcomm Atheros QCA808X PHYs > > Drop "Bindings for" and then entire sentence seems not useful. > Was following the pattern used for other qcom PHY. Ok will drop! > > + > > + QCA808X PHYs can have up to 3 LEDs attached. > > + All 3 LEDs are disabled by default. > > + 2 LEDs have dedicated pins with the 3rd LED having the > > + double function of Interrupt LEDs/GPIO or additional LED. > > + > > + By default this special PIN is set to LED function. > > + > > +allOf: > > + - $ref: ethernet-phy.yaml# > > + > > +select: > > + properties: > > + compatible: > > + contains: > > + enum: > > + - ethernet-phy-id004d.d101 > > I have impression that this is continuation of some other patchset... > Anyway, id004d.d101 is specific to QCA808x? > I used enum assuming eventually more qca808x PHY will come... Yes that ID is specific and it's the id of QCA8081. Better to use const? > > + required: > > + - compatible > > + > > +properties: > > + qca,led-active-high: > > + description: Set all the LEDs to active high to be turned on. > > + type: boolean > > > Best regards, > Krzysztof >
> +properties: > + qca,led-active-high: > + description: Set all the LEDs to active high to be turned on. > + type: boolean I would of expected active high is the default. An active low property would make more sense. It should also be a generic property, not a vendor property. As such, we either want the phylib core to parse it, or the LED core. Andrew
On Mon, Dec 11, 2023 at 04:44:06PM +0100, Andrew Lunn wrote: > > +properties: > > + qca,led-active-high: > > + description: Set all the LEDs to active high to be turned on. > > + type: boolean > > I would of expected active high is the default. An active low property > would make more sense. It should also be a generic property, not a > vendor property. As such, we either want the phylib core to parse it, > or the LED core. > Mhhh with a generic property and LED core or phylib handling it... How it would work applying that setting on PHY side? Adding the check to the set_brightness set_blink hw_control API?
On Mon, Dec 11, 2023 at 04:44:06PM +0100, Andrew Lunn wrote: > > +properties: > > + qca,led-active-high: > > + description: Set all the LEDs to active high to be turned on. > > + type: boolean > > I would of expected active high is the default. An active low property > would make more sense. It should also be a generic property, not a > vendor property. As such, we either want the phylib core to parse it, > or the LED core. > Also sorry for the double email... Any help for the problem of the missing link_2500 define in net-next? (merged in Lee tree?)
On Mon, Dec 11, 2023 at 04:49:00PM +0100, Christian Marangi wrote: > On Mon, Dec 11, 2023 at 04:44:06PM +0100, Andrew Lunn wrote: > > > +properties: > > > + qca,led-active-high: > > > + description: Set all the LEDs to active high to be turned on. > > > + type: boolean > > > > I would of expected active high is the default. An active low property > > would make more sense. It should also be a generic property, not a > > vendor property. As such, we either want the phylib core to parse it, > > or the LED core. > > > > Also sorry for the double email... Any help for the problem of the > missing link_2500 define in net-next? (merged in Lee tree?) You need to email Lee and Jakub, ask for a stable branch which can be pulled into net-next. Andrew
> Mhhh with a generic property and LED core or phylib handling it... How > it would work applying that setting on PHY side? Add a .led_set_polarity callback to the PHY driver structure? Take a look at other LED drivers. Does anything similar already exist? It is unlikely that PHYs are the only sort of LED to have a polarity. Andrew
On Mon, Dec 11, 2023 at 04:51:56PM +0100, Andrew Lunn wrote: > On Mon, Dec 11, 2023 at 04:49:00PM +0100, Christian Marangi wrote: > > On Mon, Dec 11, 2023 at 04:44:06PM +0100, Andrew Lunn wrote: > > > > +properties: > > > > + qca,led-active-high: > > > > + description: Set all the LEDs to active high to be turned on. > > > > + type: boolean > > > > > > I would of expected active high is the default. An active low property > > > would make more sense. It should also be a generic property, not a > > > vendor property. As such, we either want the phylib core to parse it, > > > or the LED core. > > > > > > > Also sorry for the double email... Any help for the problem of the > > missing link_2500 define in net-next? (merged in Lee tree?) > > You need to email Lee and Jakub, ask for a stable branch which can be > pulled into net-next. > Thanks I sent a followup email to the merged series.
On 11/12/2023 13:18, Christian Marangi wrote: >>> + QCA808X PHYs can have up to 3 LEDs attached. >>> + All 3 LEDs are disabled by default. >>> + 2 LEDs have dedicated pins with the 3rd LED having the >>> + double function of Interrupt LEDs/GPIO or additional LED. >>> + >>> + By default this special PIN is set to LED function. >>> + >>> +allOf: >>> + - $ref: ethernet-phy.yaml# >>> + >>> +select: >>> + properties: >>> + compatible: >>> + contains: >>> + enum: >>> + - ethernet-phy-id004d.d101 >> >> I have impression that this is continuation of some other patchset... >> Anyway, id004d.d101 is specific to QCA808x? >> > > I used enum assuming eventually more qca808x PHY will come... Yes that > ID is specific and it's the id of QCA8081. Better to use const? No, it is fine. I just wanted to be sure that this will not be matched by other bindings. Best regards, Krzysztof
On Mon, Dec 11, 2023 at 04:54:12PM +0100, Andrew Lunn wrote: > > Mhhh with a generic property and LED core or phylib handling it... How > > it would work applying that setting on PHY side? > > Add a .led_set_polarity callback to the PHY driver structure? > > Take a look at other LED drivers. Does anything similar already exist? > It is unlikely that PHYs are the only sort of LED to have a polarity. > Interesting topic... With a quick grep on Documentation for polarity of high, I can't find any use of it... Also main problem is that the thing is controlled globally and not per LED. (can be handled internally to the driver with some priv and check magic) Is it worth to impemement the additional API to control this? And I guess a egenric binding should be added to ethernet-phy? Or should it be added to LEDs?
On Mon, Dec 11, 2023 at 06:19:46PM +0100, Christian Marangi wrote: > On Mon, Dec 11, 2023 at 04:54:12PM +0100, Andrew Lunn wrote: > > > Mhhh with a generic property and LED core or phylib handling it... How > > > it would work applying that setting on PHY side? > > > > Add a .led_set_polarity callback to the PHY driver structure? > > > > Take a look at other LED drivers. Does anything similar already exist? > > It is unlikely that PHYs are the only sort of LED to have a polarity. > > > > Interesting topic... With a quick grep on Documentation for polarity of > high, I can't find any use of it... As i said, active-high is the default. So there is no need to specify it. But if you look in Documentation/devicetree/binding/leds for 'active-low' you will find a few examples. > Also main problem is that the thing is controlled globally and not per > LED. (can be handled internally to the driver with some priv and check > magic) Ah, missed that. Marvell PHYs have polarity per LED. It would be better to describe this correctly, so one property at a higher level. We can then in the future add an 'active-low' property per PHY. > Is it worth to impemement the additional API to control this? And I > guess a egenric binding should be added to ethernet-phy? Or should it be > added to LEDs? Since it is above individual LEDs, i would not add it to the generic LED binding. But it could go inside the leds object of ethernet-phy.yaml. leds { #address-cells = <1>; #size-cells = <0>; active-low; led@0 { reg = <0>; color = <LED_COLOR_ID_WHITE>; function = LED_FUNCTION_LAN; default-state = "keep"; }; Andrew
On Mon, Dec 11, 2023 at 06:49:02PM +0100, Andrew Lunn wrote: > On Mon, Dec 11, 2023 at 06:19:46PM +0100, Christian Marangi wrote: > > On Mon, Dec 11, 2023 at 04:54:12PM +0100, Andrew Lunn wrote: > > > > Mhhh with a generic property and LED core or phylib handling it... How > > > > it would work applying that setting on PHY side? > > > > > > Add a .led_set_polarity callback to the PHY driver structure? > > > > > > Take a look at other LED drivers. Does anything similar already exist? > > > It is unlikely that PHYs are the only sort of LED to have a polarity. > > > > > > > Interesting topic... With a quick grep on Documentation for polarity of > > high, I can't find any use of it... > > As i said, active-high is the default. So there is no need to specify > it. But if you look in Documentation/devicetree/binding/leds for > 'active-low' you will find a few examples. > Yes I was searching more and I just notice active-low and led-active-low usage for bcm6358. > > Also main problem is that the thing is controlled globally and not per > > LED. (can be handled internally to the driver with some priv and check > > magic) > > Ah, missed that. Marvell PHYs have polarity per LED. > > It would be better to describe this correctly, so one property at a > higher level. We can then in the future add an 'active-low' property > per PHY. > > > Is it worth to impemement the additional API to control this? And I > > guess a egenric binding should be added to ethernet-phy? Or should it be > > added to LEDs? > > Since it is above individual LEDs, i would not add it to the generic > LED binding. But it could go inside the leds object of > ethernet-phy.yaml. > > leds { > #address-cells = <1>; > #size-cells = <0>; > > active-low; > > led@0 { > reg = <0>; > color = <LED_COLOR_ID_WHITE>; > function = LED_FUNCTION_LAN; > default-state = "keep"; > }; > Ok! And I guess the additional API will (initially to be later expanded for other usage?) take this value and call the set polarity based on this correct? bool active_low = of_property_read_bool(leds_node, "active-low"); .led_set_polarity(struct phy_device *phydev, bool active_low); Maybe a more flexible approach might be scan for both. (either in leds node or in the led subnode) .led_set_polarity(struct phy_device *phydev, int index, bool active_low); Where index is -1 if it's global and the led index if it's in the led node? PHY driver will know what to ignore/use as I can't immagine to have a PHY that have both global and per LED polarity. What do you think?
On Sat, Dec 09, 2023 at 02:48:27AM +0100, Christian Marangi wrote: > Add Documentation for QCA808x PHYs for the additional property for the > active high LED setting and also document the LED configuration for this > PHY. > > Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> > --- > .../devicetree/bindings/net/qca,qca808x.yaml | 66 +++++++++++++++++++ > 1 file changed, 66 insertions(+) > create mode 100644 Documentation/devicetree/bindings/net/qca,qca808x.yaml > > diff --git a/Documentation/devicetree/bindings/net/qca,qca808x.yaml b/Documentation/devicetree/bindings/net/qca,qca808x.yaml > new file mode 100644 > index 000000000000..73cfff357311 > --- /dev/null > +++ b/Documentation/devicetree/bindings/net/qca,qca808x.yaml > @@ -0,0 +1,66 @@ > +# SPDX-License-Identifier: GPL-2.0+ Dual license as checkpatch.pl points out. > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/net/qca,qca808x.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Qualcomm Atheros QCA808X PHY > + > +maintainers: > + - Christian Marangi <ansuelsmth@gmail.com> > + > +description: > + Bindings for Qualcomm Atheros QCA808X PHYs > + > + QCA808X PHYs can have up to 3 LEDs attached. > + All 3 LEDs are disabled by default. > + 2 LEDs have dedicated pins with the 3rd LED having the > + double function of Interrupt LEDs/GPIO or additional LED. > + > + By default this special PIN is set to LED function. > + > +allOf: > + - $ref: ethernet-phy.yaml# > + > +select: > + properties: > + compatible: > + contains: > + enum: > + - ethernet-phy-id004d.d101 Move this to properties and drop the select. > + required: > + - compatible > + > +properties: > + qca,led-active-high: > + description: Set all the LEDs to active high to be turned on. > + type: boolean > + > +unevaluatedProperties: false > + > +examples: > + - | > + #include <dt-bindings/leds/common.h> > + > + mdio { > + #address-cells = <1>; > + #size-cells = <0>; > + > + ethernet-phy@0 { > + compatible = "ethernet-phy-id004d.d101"; > + reg = <0>; > + qca,led-active-high; > + > + leds { > + #address-cells = <1>; > + #size-cells = <0>; > + > + led@0 { > + reg = <0>; > + color = <LED_COLOR_ID_GREEN>; > + function = LED_FUNCTION_WAN; > + default-state = "keep"; > + }; > + }; > + }; > + }; > -- > 2.40.1 >
diff --git a/Documentation/devicetree/bindings/net/qca,qca808x.yaml b/Documentation/devicetree/bindings/net/qca,qca808x.yaml new file mode 100644 index 000000000000..73cfff357311 --- /dev/null +++ b/Documentation/devicetree/bindings/net/qca,qca808x.yaml @@ -0,0 +1,66 @@ +# SPDX-License-Identifier: GPL-2.0+ +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/qca,qca808x.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Qualcomm Atheros QCA808X PHY + +maintainers: + - Christian Marangi <ansuelsmth@gmail.com> + +description: + Bindings for Qualcomm Atheros QCA808X PHYs + + QCA808X PHYs can have up to 3 LEDs attached. + All 3 LEDs are disabled by default. + 2 LEDs have dedicated pins with the 3rd LED having the + double function of Interrupt LEDs/GPIO or additional LED. + + By default this special PIN is set to LED function. + +allOf: + - $ref: ethernet-phy.yaml# + +select: + properties: + compatible: + contains: + enum: + - ethernet-phy-id004d.d101 + required: + - compatible + +properties: + qca,led-active-high: + description: Set all the LEDs to active high to be turned on. + type: boolean + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/leds/common.h> + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + ethernet-phy@0 { + compatible = "ethernet-phy-id004d.d101"; + reg = <0>; + qca,led-active-high; + + leds { + #address-cells = <1>; + #size-cells = <0>; + + led@0 { + reg = <0>; + color = <LED_COLOR_ID_GREEN>; + function = LED_FUNCTION_WAN; + default-state = "keep"; + }; + }; + }; + };