xnux.eu - site map - news

PinePhone Flash LED

z3ntu mainlined a driver for a flash controller (sgm3140) used in Pinephone.

The driver is part of the LED framework, and thus you can control the flash LED via sysfs.

To turn on the flashlight:

echo 1 > /sys/class/leds/white:flash/brightness

And to turn it off:

echo 0 > /sys/class/leds/white:flash/brightness

It is possible to enable/disable the flash LED in continuous flashlight mode, or in a one-shot high powered high intensity mode (mostly for camera use). The driver is integrated with video4linux2 APIs, so that apps using v4l2 API can find and use the correct flash LED.