Hi Fenglin,
On Tue Oct 18, 2022 at 3:40 AM CEST, Fenglin Wu wrote:
Initial driver and binding document changes for supporting flash LED
module in Qualcomm Technologies, Inc. PMICs.
Thanks for these patches, it's really nice to see drivers like this
being sent upstream!
I've just tried these patches on pm6150l which also is compatible with
this driver (and used on sm7225-fairphone-fp4).
The two different flash LEDs on the device I could adjust as expected
using sysfs:
$ echo 255 > /sys/class/leds/yellow:flash-0/brightness
$ echo 255 > /sys/class/leds/white:flash-0/brightness
Also lower brightness values resulted in lower brightness on the LED, so
all is good here!
But for flash usage, I couldn't figure out how to use it, doing the
following resulted in no change on the LED.
$ cat /sys/class/leds/white:flash-0/max_flash_brightness
1000000
$ echo 1000000 > /sys/class/leds/white:flash-0/flash_brightness
Here's my LED definition:
led-0 {
function = LED_FUNCTION_FLASH;
color = <LED_COLOR_ID_YELLOW>;
led-sources = <1>;
led-max-microamp = <180000>;
flash-max-microamp = <1000000>;
flash-max-timeout-us = <1280000>;
};
From values are from msm-4.19 kernel:
qcom,flash_0 {
qcom,current-ma = <1000>; // => flash-max-microamp
qcom,duration-ms = <1280>; // => flash-max-timeout-us
qcom,id = <0>; // => led-sources?
};
qcom,torch_0 {
qcom,current-ma = <180>; // => led-max-microamp
qcom,id = <0>; // => led-sources?
};
Could you please let me know how flash is supposed to work or if I
maybe have messed up some setting here?
Regards
Luca
Changes in V3:
1. Updated the driver to use regmap_field for register access.
2. Adressed the review comments in binding document change.
Changes in V2:
1. Addressed review comments in binding change, thanks Krzysztof!
2. Updated driver to address the compilation issue reported by
kernel test robot.
Fenglin Wu (2):
leds: flash: add driver to support flash LED module in QCOM PMICs
dt-bindings: add bindings for QCOM flash LED
.../bindings/leds/qcom,spmi-flash-led.yaml | 116 +++
drivers/leds/flash/Kconfig | 15 +
drivers/leds/flash/Makefile | 1 +
drivers/leds/flash/leds-qcom-flash.c | 700 ++++++++++++++++++
4 files changed, 832 insertions(+)
create mode 100644 Documentation/devicetree/bindings/leds/qcom,spmi-flash-led.yaml
create mode 100644 drivers/leds/flash/leds-qcom-flash.c
--
2.25.1