Skip to content

Commit fd40749

Browse files
flamingradiansuperna9999
authored andcommitted
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 <mailingradian@gmail.com> Tested-by: Caleb Connolly <caleb@connolly.tech> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20230116224909.23884-3-mailingradian@gmail.com
1 parent c9d27c6 commit fd40749

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

drivers/gpu/drm/panel/panel-samsung-sofef00.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <linux/of.h>
1111
#include <linux/of_device.h>
1212
#include <linux/regulator/consumer.h>
13-
#include <linux/swab.h>
1413
#include <linux/backlight.h>
1514

1615
#include <video/mipi_display.h>
@@ -213,13 +212,9 @@ static int sofef00_panel_bl_update_status(struct backlight_device *bl)
213212
{
214213
struct mipi_dsi_device *dsi = bl_get_data(bl);
215214
int err;
216-
u16 brightness;
215+
u16 brightness = (u16)backlight_get_brightness(bl);
217216

218-
brightness = (u16)backlight_get_brightness(bl);
219-
// This panel needs the high and low bytes swapped for the brightness value
220-
brightness = __swab16(brightness);
221-
222-
err = mipi_dsi_dcs_set_display_brightness(dsi, brightness);
217+
err = mipi_dsi_dcs_set_display_brightness_large(dsi, brightness);
223218
if (err < 0)
224219
return err;
225220

0 commit comments

Comments
 (0)