linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] leds: fix /sys/class/leds/<led>/trigger and add new api
@ 2019-09-08 12:41 Akinobu Mita
  2019-09-08 12:41 ` [PATCH 1/5] leds: remove PAGE_SIZE limit of /sys/class/leds/<led>/trigger Akinobu Mita
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Akinobu Mita @ 2019-09-08 12:41 UTC (permalink / raw)
  To: linux-leds, linux-kernel
  Cc: Akinobu Mita, Greg Kroah-Hartman, Rafael J. Wysocki,
	Jacek Anaszewski, Pavel Machek, Dan Murphy

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


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-09-11 17:26 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-08 12:41 [PATCH 0/5] leds: fix /sys/class/leds/<led>/trigger and add new api Akinobu Mita
2019-09-08 12:41 ` [PATCH 1/5] leds: remove PAGE_SIZE limit of /sys/class/leds/<led>/trigger Akinobu Mita
2019-09-08 13:10   ` Greg Kroah-Hartman
2019-09-11 15:25     ` Akinobu Mita
2019-09-11 15:36       ` Greg Kroah-Hartman
2019-09-11 17:25         ` Akinobu Mita
2019-09-08 13:18   ` Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 2/5] leds: make sure leds_class is initialized before triggers are registered Akinobu Mita
2019-09-08 13:07   ` Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 3/5] driver core: class: add function to create /sys/class/<class>/foo directory Akinobu Mita
2019-09-08 13:08   ` Greg Kroah-Hartman
2019-09-08 13:11   ` Greg Kroah-Hartman
2019-09-08 20:26   ` Pavel Machek
2019-09-08 12:41 ` [PATCH 4/5] leds: add /sys/class/triggers/ that contains trigger sub-directories Akinobu Mita
2019-09-08 13:21   ` Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5/5] leds: add /sys/class/leds/<led>/current-trigger Akinobu Mita
2019-09-08 13:10   ` Greg Kroah-Hartman

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).