devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: Rob Herring <robh@kernel.org>
Cc: "Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Pavel Machek" <pavel@ucw.cz>, "Lee Jones" <lee@kernel.org>,
	"Jacek Anaszewski" <jacek.anaszewski@gmail.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	devicetree@vger.kernel.org, linux-leds@vger.kernel.org,
	"Rafał Miłecki" <rafal@milecki.pl>
Subject: Re: [PATCH] dt-bindings: leds: add "usbport" trigger
Date: Wed, 1 Mar 2023 14:52:10 +0100	[thread overview]
Message-ID: <6426345d-783e-007d-79db-2b376bcea12d@gmail.com> (raw)
In-Reply-To: <CAL_JsqJzrgS1PH77RkAiqAs=QqXPGG04sCG3X_i-GKWSqPORSQ@mail.gmail.com>

On 1.03.2023 14:43, Rob Herring wrote:
> On Wed, Mar 1, 2023 at 1:27 AM Rafał Miłecki <zajec5@gmail.com> wrote:
>>
>> On 1.03.2023 01:02, Rob Herring wrote:
>>> On Tue, Feb 28, 2023 at 03:49:33PM +0100, Rafał Miłecki wrote:
>>>> From: Rafał Miłecki <rafal@milecki.pl>
>>>>
>>>> It's a trigger used on many home routers that have LEDs to indicate
>>>> specific USB port state.
>>>>
>>>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>>>> ---
>>>>    Documentation/devicetree/bindings/leds/common.yaml | 1 +
>>>>    1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml
>>>> index 15e3f6645682..95b316ee3146 100644
>>>> --- a/Documentation/devicetree/bindings/leds/common.yaml
>>>> +++ b/Documentation/devicetree/bindings/leds/common.yaml
>>>> @@ -99,6 +99,7 @@ properties:
>>>>              - pattern
>>>>              - usb-gadget
>>>>              - usb-host
>>>> +          - usbport
>>>
>>> Can we stop adding entries which are clearly likely to have multiple
>>> instances. We have a better binding to map the trigger source...
>>
>> I'm sorry, I really don't understand this.
>> I'm not sure what do you mean by multuple "usbport" instances.
>> Could you point me to that better place, please?
> 
> Suppose I have a device with 4 USB ports and 4 LEDs for each one. How
> would one define the connection of LEDs to USB ports? Extend this to
> usbport[0-9]? No.
> 
>> This is probably something obvious but I really can't figure it out
>> since yesterday.
> 
> "trigger-sources"

Ah, I suppose that "usbport" LED trigger in Linux can be confusing.

So: no matter how many USB ports you have, Linux *doesn't* create one
trigger per USB port. There is only one trigger. It's called exactly
"usbport".

Once you choose "usbport" trigger in Linux, you can choose which ports
should it "monitor". That can be done using procfs (ABI). The default
set of ports to monitor can be specified using "trigger-sources".

For decision details behind this see 0f247626cbbf ("usb: core: Introduce
a USB port LED trigger").

So Linux on home routers needs both:
1. linux,default-trigger (for selecting default trigger)
2. trigger-sources (for providing default set of ports to monitor)

Does it make more sense? Should I improve commit description and resend
it? Or should we still rework it somehow?

  reply	other threads:[~2023-03-01 13:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28 14:49 [PATCH] dt-bindings: leds: add "usbport" trigger Rafał Miłecki
2023-02-28 21:21 ` Pavel Machek
2023-03-01  0:02 ` Rob Herring
2023-03-01  7:26   ` Rafał Miłecki
2023-03-01 13:43     ` Rob Herring
2023-03-01 13:52       ` Rafał Miłecki [this message]
2023-03-08  0:40         ` Rob Herring

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=6426345d-783e-007d-79db-2b376bcea12d@gmail.com \
    --to=zajec5@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=jacek.anaszewski@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rafal@milecki.pl \
    --cc=robh@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;
as well as URLs for NNTP newsgroup(s).