Skip to content
Commit c9d27c6b authored by Daniel Mentz's avatar Daniel Mentz Committed by Neil Armstrong
Browse files

drm/mipi-dsi: Fix byte order of 16-bit DCS set/get brightness



The MIPI DCS specification demands that brightness values are sent in
big endian byte order. It also states that one parameter (i.e. one byte)
shall be sent/received for 8 bit wide values, and two parameters shall
be used for values that are between 9 and 16 bits wide.

Add new functions to properly handle 16-bit brightness in big endian,
since the two 8- and 16-bit cases are distinct from each other.

[richard: use separate functions instead of switch/case]
[richard: split into 16-bit component]

Fixes: 1a9d7593 ("drm/dsi: Implement DCS set/get display brightness")
Signed-off-by: default avatarDaniel Mentz <danielmentz@google.com>
Link: https://android.googlesource.com/kernel/msm/+/754affd62d0ee268c686c53169b1dbb7deac8550


[richard: fix 16-bit brightness_get]
Signed-off-by: default avatarRichard Acayan <mailingradian@gmail.com>
Tested-by: default avatarCaleb Connolly <caleb@connolly.tech>
Reviewed-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230116224909.23884-2-mailingradian@gmail.com
parent 13acb368
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment