drm/panel: add basic DP AUX backlight support
authorRajeev Nandan <rajeevny@codeaurora.org>
Sat, 26 Jun 2021 16:51:03 +0000 (22:21 +0530)
committerDouglas Anderson <dianders@chromium.org>
Fri, 9 Jul 2021 13:47:11 +0000 (06:47 -0700)
commit10f7b40e4f3050cd22a161f46a47564e8c5ce91f
tree5db098905663cf4aa649a6c5bd243f32f818f223
parent60f800b2bdfafa350e642c4e77dc646a008f2111
drm/panel: add basic DP AUX backlight support

Some panels support backlight control over DP AUX channel using
VESA's standard backlight control interface.
Using new DRM eDP backlight helpers, add support to create and
register a backlight for those panels in drm_panel to simplify
the panel drivers.

The panel driver with access to "struct drm_dp_aux" can create and
register a backlight device using following code snippet in its
probe() function:

err = drm_panel_dp_aux_backlight(panel, aux);
if (err)
return err;

Then drm_panel will handle backlight_(enable|disable) calls
similar to the case when drm_panel_of_backlight() is used.

Currently, we are not supporting one feature where the source
device can combine the backlight brightness levels set through
DP AUX and the BL_PWM_DIM eDP connector pin. Since it's not
required for the basic backlight controls, it can be added later.

Signed-off-by: Rajeev Nandan <rajeevny@codeaurora.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Lyude Paul <lyude@redhat.com>
[dianders: added blank line for warning when applying]
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1624726268-14869-2-git-send-email-rajeevny@codeaurora.org
drivers/gpu/drm/drm_panel.c
include/drm/drm_panel.h