From: Andrew Lunn <andrew@lunn.ch>
To: "Marek Behún" <kabel@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>, Pavel Machek <pavel@ucw.cz>,
Jacek Anaszewski <jacek.anaszewski@gmail.com>,
"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: lets settle the LED `function` property regarding the netdev trigger
Date: Tue, 5 Oct 2021 23:52:29 +0200 [thread overview]
Message-ID: <YVzJHZXjQ04T2hmk@lunn.ch> (raw)
In-Reply-To: <20211005223014.3891f041@thinkpad>
> I really don't think we should be registering any LEDs in the PHY driver
> if the driver does not know whether there are LEDs connected to the PHY.
>
> If this information is not available (via device-tree or some other
> method, for example USB vendor/device table), then we can't register a
> LED and let user control it.
>
> What if the pin is used for something different on a board?
There is some danger here. Some hardware misuse LED outputs for WoL
interrupts. There is even m88e1318_set_wol() which sets up LED2 for
WoL. So i will need to review the PHY drivers to look out for this,
and maybe add some restrictions.
But i think we have little choice but to export all the LEDs a PHY
supports. USB vendor/product, PCI vendor/product does not give us
anything useful. How many OEMs take a lan78xx chip, created a USB
dongle and shipped it using USB enumeration data:
LAN78XX_USB_VENDOR_ID:LAN7800_USB_PRODUCT_ID. How many motherboards
have a r8169 PCIe device using realteks PCI enumeration data? There is
no useful source of information in devices like this. But what we do
know is that the PHY can control X LED output pins, and we know what
patterns it can blink those LED pins. So we export them, and let the
user figure it out. This is the general case.
If we have DT, or ACPI, or some other source, we can then refine this
representation. If we have LED information, but a specific LED is
missing from DT, don't export it. If the colour is available, use that
in the name. If the default mode information is available, configure
it that way, etc.
Now, it could be we don't start with this, we just export those that
do have DT. But i will want to ensure that the API/ABI we define is
generic enough to support this. We need to start somewhere, get some
basic support merged, and then do incremental improvements.
Andrew
next prev parent reply other threads:[~2021-10-05 21:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-01 12:36 lets settle the LED `function` property regarding the netdev trigger Marek Behún
2021-10-03 18:56 ` Andrew Lunn
2021-10-03 19:26 ` Marek Behún
2021-10-04 14:50 ` Andrew Lunn
2021-10-04 15:08 ` Marek Behún
2021-10-04 17:28 ` Andrew Lunn
2021-10-05 20:30 ` Marek Behún
2021-10-05 21:52 ` Andrew Lunn [this message]
2021-10-05 19:58 ` Jacek Anaszewski
2021-10-05 20:12 ` Andrew Lunn
2021-10-05 20:26 ` Marek Behún
2021-10-05 21:01 ` Andrew Lunn
2021-10-05 21:43 ` Marek Behún
2021-10-05 22:06 ` Andrew Lunn
2021-10-05 23:06 ` Marek Behún
2021-10-06 12:57 ` Andrew Lunn
2021-10-07 17:13 ` Marek Behún
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YVzJHZXjQ04T2hmk@lunn.ch \
--to=andrew@lunn.ch \
--cc=devicetree@vger.kernel.org \
--cc=jacek.anaszewski@gmail.com \
--cc=kabel@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox