backlight: qcom-wled: Add auto string detection logic
authorKiran Gunda <kgunda@codeaurora.org>
Fri, 1 Nov 2019 06:27:04 +0000 (11:57 +0530)
committerLee Jones <lee.jones@linaro.org>
Fri, 1 Nov 2019 08:11:39 +0000 (08:11 +0000)
commit8663c188beeacf35d4865185a6713d6e8ded4fea
treeb533dc0bfb48f7bfac0ef84f0fabc3f472c3a4f0
parentfeeab87b30726ee3fc0522945c8efaa86a06d48b
backlight: qcom-wled: Add auto string detection logic

The auto string detection algorithm checks if the current WLED
sink configuration is valid. It tries enabling every sink and
checks if the OVP fault is observed. Based on this information
it detects and enables the valid sink configuration.
Auto calibration will be triggered when the OVP fault interrupts
are seen frequently thereby it tries to fix the sink configuration.

The auto-detection also kicks in when the connected LED string
of the display-backlight malfunctions (because of damage) and
requires the damaged string to be turned off to prevent the
complete panel and/or board from being damaged.

Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/video/backlight/qcom-wled.c