[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7e73d616-9326-ff03-639f-b3b264e64a26@infradead.org>
Date: Sun, 7 Nov 2021 18:29:05 -0800
From: Randy Dunlap <rdunlap@...radead.org>
To: Ansuel Smith <ansuelsmth@...il.com>, Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Jonathan Corbet <corbet@....net>, Pavel Machek <pavel@....cz>,
John Crispin <john@...ozen.org>, netdev@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, linux-leds@...r.kernel.org
Cc: Marek BehĂșn <kabel@...nel.org>
Subject: Re: [RFC PATCH v2 1/5] leds: trigger: add API for HW offloading of
triggers
On 11/7/21 4:24 PM, Ansuel Smith wrote:
> From: Marek BehĂșn <kabel@...nel.org>
>
> ---
> Documentation/leds/leds-class.rst | 20 +++++++++++++++++++
> drivers/leds/led-triggers.c | 1 +
> drivers/leds/trigger/Kconfig | 10 ++++++++++
> include/linux/leds.h | 33 +++++++++++++++++++++++++++++++
> 4 files changed, 64 insertions(+)
>
> diff --git a/Documentation/leds/leds-class.rst b/Documentation/leds/leds-class.rst
> index cd155ead8703..5bf6e5d471ce 100644
> --- a/Documentation/leds/leds-class.rst
> +++ b/Documentation/leds/leds-class.rst
> @@ -169,6 +169,26 @@ Setting the brightness to zero with brightness_set() callback function
> should completely turn off the LED and cancel the previously programmed
> hardware blinking function, if any.
>
> +Hardware offloading of LED triggers
> +===================================
> +
> +Some LEDs can be driven by hardware triggers (for example a LED connected to
> +an ethernet PHY or an ethernet switch can be configured to blink on activity on
> +the network, which in software is done by the netdev trigger).
> +
> +To do such offloading, LED driver must support this and a deficated offload
dedicated
> +trigger must be used. The LED must implement the trigger_offload() method and
> +the trigger code must try to call this method (via led_trigger_offload()
> +function) to set the LED to this particular mode. (and disable any software
> +blinking)
> +
> +The implementation of the trigger_offload() method by the LED driver must return
> +0 if the offload is successful and -EOPNOTSUPP if the requested trigger
> +configuration is not supported.
> +
> +If the second argument (enable) to the trigger_offload() method is false, any
> +active HW offloading must be deactivated. In this case errors are not permitted
Preferably s/HW/hardware/ and s/SW/software/ throughout documentation and Kconfig
files.
> +in the trigger_offload() method and the driver will be set to the new trigger.
>
> Known Issues
> ============
> diff --git a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig
> index dc6816d36d06..33aba8defeab 100644
> --- a/drivers/leds/trigger/Kconfig
> +++ b/drivers/leds/trigger/Kconfig
> @@ -9,6 +9,16 @@ menuconfig LEDS_TRIGGERS
>
> if LEDS_TRIGGERS
>
> +config LEDS_OFFLOAD_TRIGGERS
> + bool "LED Offload Trigger support"
> + help
> + This option enabled offload triggers support used by leds that
enables LEDs
> + can be driven in hardware by declaring some specific triggers.
> + A offload trigger will expose a sysfs dir to configure the
> + different blinking trigger and the available hardware triggers.
> +
> + If unsure, say Y.
--
~Randy
Powered by blists - more mailing lists