mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martin Kurbanov <mmkurbanov@salutedevices.com>
To: Lee Jones <lee@kernel.org>
Cc: Pavel Machek <pavel@ucw.cz>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	<linux-kernel@vger.kernel.org>, <linux-leds@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-doc@vger.kernel.org>,
	<kernel@salutedevices.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v1 1/2] leds: aw200xx: support for hw pattern controllers
Date: Fri, 12 Jan 2024 14:43:16 +0300	[thread overview]
Message-ID: <85c89859-ae03-4692-9c09-5779e4c40eae@salutedevices.com> (raw)
In-Reply-To: <20231221161011.GO10102@google.com>

Hello Lee,

On 21.12.2023 19:10, Lee Jones wrote:
> On Thu, 07 Dec 2023, Martin Kurbanov wrote:
> 
>> This led-controller supports 3 pattern controllers for auto breathing or
>> group dimming control. Each pattern controller can work in auto
>> breathing or manual control mode. All breathing parameters including
>> rising/falling slope, on/off time, repeat times, min/max brightness
>> and so on are configurable.
>>
>> Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com>
>> ---
>>  .../testing/sysfs-class-led-driver-aw200xx    | 108 +++
>>  Documentation/leds/leds-aw200xx.rst           | 274 ++++++++
>>  drivers/leds/leds-aw200xx.c                   | 649 ++++++++++++++++++
>>  3 files changed, 1031 insertions(+)
>>  create mode 100644 Documentation/leds/leds-aw200xx.rst
> 
> This interface is bananas.  Exposing an entire register interface to
> sysfs does not sit will with me at all.  When we add support to a sysfs
> class, we usually require it to be generic and work across all devices.
> Adding device specific interfaces is generally decried and to be
> avoided.  Don't forget, once we commit something to sysfs, it becomes
> ABI and we have to support it forever.
> 
> A far better approach would be to add support for this in userspace
> instead  You can use the standard I2C character device API to achieve
> the same result.  That way we don't have the same level of commitment
> and is generally a much more flexible/future-proof.
> 

I used sysfs similarly to other LED drivers (for example, leds-lm3533).
Additionally, the controller has interrupts about the completion of the pattern,
which is best to handle in the kernel. In the case of implementation in user
mode, there may be synchronization problems, as the controller has several
memory pages that can be switched by writing the page number to register 0xF0.

-- 
Best Regards,
Martin Kurbanov

  reply	other threads:[~2024-01-12 11:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 12:59 [PATCH v1 0/2] " Martin Kurbanov
2023-12-07 12:59 ` [PATCH v1 1/2] " Martin Kurbanov
2023-12-21 16:10   ` Lee Jones
2024-01-12 11:43     ` Martin Kurbanov [this message]
2024-01-25 13:00       ` Lee Jones
2024-01-26 12:23         ` Dmitry Rokosov
2024-01-26 14:09           ` Greg Kroah-Hartman
2024-01-29 14:13             ` Dmitry Rokosov
2024-02-05 10:57               ` Dmitry Rokosov
2024-02-08 13:58                 ` Lee Jones
2024-01-26 23:21     ` Pavel Machek
2024-01-29 14:19       ` Dmitry Rokosov
2024-02-08 13:59         ` Lee Jones
2023-12-07 12:59 ` [PATCH v1 2/2] dt-bindings: leds: aw200xx: add 'interrupts' property Martin Kurbanov
2023-12-07 17:18   ` Conor Dooley

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=85c89859-ae03-4692-9c09-5779e4c40eae@salutedevices.com \
    --to=mmkurbanov@salutedevices.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@salutedevices.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@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

all inboxes | Powered by JetHome®