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 <gre...@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <raf...@kernel.org>
Cc: Jacek Anaszewski <jacek.anaszew...@gmail.com>
Cc: Pavel Machek <pa...@ucw.cz>
Cc: Dan Murphy <dmur...@ti.com>
-- 
2.7.4

Reply via email to