]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
BCM270x_DT: Add pwr_led, and the required "input" trigger
authorPhil Elwell <phil@raspberrypi.org>
Fri, 6 Feb 2015 13:50:57 +0000 (13:50 +0000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 15 Aug 2018 17:22:46 +0000 (19:22 +0200)
commit0aba98f95ec99f80a509be38577ac6b3dc6ef641
tree0beaf8b67499bcdcb5e2d01ba4d8a44b467e3356
parent2f060b25bcbb884b4b6a6fec721df4d70dc5a2dd
BCM270x_DT: Add pwr_led, and the required "input" trigger

The "input" trigger makes the associated GPIO an input.  This is to support
the Raspberry Pi PWR LED, which is driven by external hardware in normal use.

N.B. pwr_led is not available on Model A or B boards.

leds-gpio: Implement the brightness_get method

The power LED uses some clever logic that means it is driven
by a voltage measuring circuit when configured as input, otherwise
it is driven by the GPIO output value. This patch wires up the
brightness_get method for leds-gpio so that user-space can monitor
the LED value via /sys/class/gpio/led1/brightness. Using the input
trigger this returns an indication of the system power health,
otherwise it is just whatever value the trigger has written most
recently.

See: https://github.com/raspberrypi/linux/issues/1064
drivers/leds/leds-gpio.c
drivers/leds/trigger/Kconfig
drivers/leds/trigger/Makefile
drivers/leds/trigger/ledtrig-input.c [new file with mode: 0644]
include/linux/leds.h