backlight: qcom-wled: Override default length with qcom,enabled-strings
authorMarijn Suijten <marijn.suijten@somainline.org>
Mon, 15 Nov 2021 20:34:55 +0000 (21:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:03:46 +0000 (11:03 +0100)
commit18a8dd081b8161d3421a4ebaea3b3bd9f8631b05
tree30f6896faafdc62dae50a2e4fd6ab177f5d63102
parent37b61692f27b61d2c3d3ca3e7f444f5e8c6631bf
backlight: qcom-wled: Override default length with qcom,enabled-strings

[ Upstream commit 2b4b49602f9feca7b7a84eaa33ad9e666c8aa695 ]

The length of qcom,enabled-strings as property array is enough to
determine the number of strings to be enabled, without needing to set
qcom,num-strings to override the default number of strings when less
than the default (which is also the maximum) is provided in DT.

This also introduces an extra warning when qcom,num-strings is set,
denoting that it is not necessary to set both anymore.  It is usually
more concise to set just qcom,num-length when a zero-based, contiguous
range of strings is needed (the majority of the cases), or to only set
qcom,enabled-strings when a specific set of indices is desired.

Fixes: 775d2ffb4af6 ("backlight: qcom-wled: Restructure the driver for WLED3")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211115203459.1634079-6-marijn.suijten@somainline.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/backlight/qcom-wled.c