backlight: rt4831: Apply ocp level from devicetree
authorChiYuan Huang <cy_huang@richtek.com>
Tue, 21 Jun 2022 10:36:28 +0000 (18:36 +0800)
committerLee Jones <lee.jones@linaro.org>
Mon, 27 Jun 2022 14:07:47 +0000 (15:07 +0100)
commit8b0bce056351bb9abd06a09cffff1ff0d84ee580
tree0d8cd0ff5235ab35e971f20cb78d95b0f9fae019
parent27e5c6546333bc7bbbb58b1a823ef21a6317b546
backlight: rt4831: Apply ocp level from devicetree

Add 'richtek,bled-ocp-microamp' property parsing in
device_property_init function.

This value may configure prior to the kernel driver. If it's not specified in
devicetree, keep the original setting. Else, use clamp to align the
value in min/max range and also roundup to choose the best selector.

Reported-by: Lucas Tsai <lucas_tsai@richtek.com>
Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/1655807788-24511-3-git-send-email-u0084500@gmail.com
drivers/video/backlight/rt4831-backlight.c