diff options
author | Richard Acayan <[email protected]> | 2023-01-16 17:49:08 -0500 |
---|---|---|
committer | Neil Armstrong <[email protected]> | 2023-01-19 08:21:57 +0100 |
commit | fd40749a4f62a03d0aebe6eb446ea84a9901795a (patch) | |
tree | 0b4ece38d197b90267c57941e85ea5bfc4a34fbf | |
parent | c9d27c6be518b4ef2966d9564654ef99292ea1b3 (diff) |
drm/panel: sofef00: Use 16-bit brightness function
These panels communicate brightness in big endian. This is not a quirk
of the panels themselves, but rather, a part of the MIPI standard. Use
the new mipi_dsi_dcs_set_display_brightness_large() function that
properly handles 16-bit brightness instead of doing special processing
of the brightness values.
Signed-off-by: Richard Acayan <[email protected]>
Tested-by: Caleb Connolly <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Reviewed-by: Sam Ravnborg <[email protected]>
Signed-off-by: Neil Armstrong <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r-- | drivers/gpu/drm/panel/panel-samsung-sofef00.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/gpu/drm/panel/panel-samsung-sofef00.c b/drivers/gpu/drm/panel/panel-samsung-sofef00.c index 9db49a028930..1ebb79e3103c 100644 --- a/drivers/gpu/drm/panel/panel-samsung-sofef00.c +++ b/drivers/gpu/drm/panel/panel-samsung-sofef00.c @@ -10,7 +10,6 @@ #include <linux/of.h> #include <linux/of_device.h> #include <linux/regulator/consumer.h> -#include <linux/swab.h> #include <linux/backlight.h> #include <video/mipi_display.h> @@ -213,13 +212,9 @@ static int sofef00_panel_bl_update_status(struct backlight_device *bl) { struct mipi_dsi_device *dsi = bl_get_data(bl); int err; - u16 brightness; + u16 brightness = (u16)backlight_get_brightness(bl); - brightness = (u16)backlight_get_brightness(bl); - // This panel needs the high and low bytes swapped for the brightness value - brightness = __swab16(brightness); - - err = mipi_dsi_dcs_set_display_brightness(dsi, brightness); + err = mipi_dsi_dcs_set_display_brightness_large(dsi, brightness); if (err < 0) return err; |