lkml.org 
[lkml]   [2019]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH 0/5] leds: fix /sys/class/leds/<led>/trigger and add new api
Date
Reading /sys/class/leds/<led>/trigger returns all available LED triggers.
However, the size of this file is limited to PAGE_SIZE because of the
limitation for sysfs attribute.

Enabling LED CPU trigger on systems with thousands of CPUs easily hits
PAGE_SIZE limit, and makes it impossible to see all available LED triggers
and which trigger is currently activated.

The first patch in this series converts /sys/class/leds/<led>/trigger to
bin attribute and removes the PAGE_SIZE limitation.

The rest of series provides a new /sys/class/triggers/ directory and
/sys/class/leds/<led>/current-trigger. The new api follows the "one value
per file" rule of sysfs.

Akinobu Mita (5):
leds: remove PAGE_SIZE limit of /sys/class/leds/<led>/trigger
leds: make sure leds_class is initialized before triggers are
registered
driver core: class: add function to create /sys/class/<class>/foo
directory
leds: add /sys/class/triggers/ that contains trigger sub-directories
leds: add /sys/class/leds/<led>/current-trigger

Documentation/ABI/testing/sysfs-class-led | 22 +++++
drivers/base/class.c | 7 ++
drivers/leds/led-class.c | 49 +++++++++--
drivers/leds/led-triggers.c | 139 +++++++++++++++++++++++++-----
drivers/leds/leds.h | 12 +++
include/linux/device.h | 3 +
include/linux/leds.h | 6 +-
7 files changed, 207 insertions(+), 31 deletions(-)

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Dan Murphy <dmurphy@ti.com>
--
2.7.4

\
 
 \ /
  Last update: 2019-09-08 14:43    [W:0.087 / U:1.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site