netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>,
	Christian Marangi <ansuelsmth@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] leds: trigger: netdev: skip setting baseline state in activate if hw-controlled
Date: Wed, 6 Dec 2023 19:32:54 +0100	[thread overview]
Message-ID: <fa5b40de-3e5c-4986-b533-e8417dd992d9@gmail.com> (raw)
In-Reply-To: <a53883cd-f843-45a5-82d3-483d80e9a806@lunn.ch>

On 06.12.2023 18:45, Andrew Lunn wrote:
>>>> I actually think we need to define some best practices, ordered on
>>>> what the hardware can do.
>>>>
>>>> 1) With software control, set_brightness should do what you expect,
>>>> not return an error.
>>>>
>>>> 2) Without full software control, but there is a mechanism to report a
>>>> problem, like constant blinking, or off, do that, and return
>>>> -EOPNOTSUPP.
>>>>
>>>> 3) Really dumb hardware like this, set_brightness should be a NULL
>>>> pointer. The core returns -EOPNOTSUPP.
>>>>
>>>> The core should return this -EOPNOTSUPP to user space, but it should
>>>> accept the configuration change. So the user can put it into an
>>>> invalid state, in order to get to a valid state with further
>>>> configuration.
>>>>
>>> Sounds good to me. Let me come up with a RFC patch.
>>>
>>>> I don't see an easy way to let the user know what the valid states
>>>> are. We currently have a 10bit state. I don't think we can put all the
>>>> valid ones in a /sysfs file, especially when QCA8K pretty much
>>>> supports everything.
>>>>
>>>> 	 Andrew
>>>
>>> Heiner
>>
>> Patch is so simple that I send it this way. What do you think?
> 
> That is simpler than i expected.
> 
> But i think we need to document our expectations. What do we expect an
> LED driver to do when it cannot support software blinking. So please
> could you add a comment somewhere. Maybe extend the
> 
> /*
>  *Configurable sysfs attributes:
>  *
> 
> section?
> 
Yes, this is a good place IMO. I'll submit a patch including the functional
change and the extended comment.

> Thanks
> 	Andrew

Heiner

      reply	other threads:[~2023-12-06 18:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29 10:41 [PATCH] leds: trigger: netdev: skip setting baseline state in activate if hw-controlled Heiner Kallweit
2023-11-29 16:36 ` Andrew Lunn
2023-11-29 21:50   ` Heiner Kallweit
2023-11-29 22:02     ` Andrew Lunn
2023-12-01 22:32       ` Heiner Kallweit
2023-12-05  3:00         ` Andrew Lunn
2023-12-05 12:40           ` Heiner Kallweit
2023-12-05 12:57             ` Heiner Kallweit
2023-12-06 17:45               ` Andrew Lunn
2023-12-06 18:32                 ` Heiner Kallweit [this message]

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=fa5b40de-3e5c-4986-b533-e8417dd992d9@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=kuba@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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).