summaryrefslogtreecommitdiffstats
path: root/include/drm/drm_panel.h
diff options
context:
space:
mode:
authorRajeev Nandan <rajeevny@codeaurora.org>2021-06-26 22:21:03 +0530
committerDouglas Anderson <dianders@chromium.org>2021-07-09 06:47:11 -0700
commit10f7b40e4f3050cd22a161f46a47564e8c5ce91f (patch)
tree5db098905663cf4aa649a6c5bd243f32f818f223 /include/drm/drm_panel.h
parent60f800b2bdfafa350e642c4e77dc646a008f2111 (diff)
downloadlinux-10f7b40e4f3050cd22a161f46a47564e8c5ce91f.tar.bz2
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
Diffstat (limited to 'include/drm/drm_panel.h')
-rw-r--r--include/drm/drm_panel.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
index 33605c3f0eba..71aac751a032 100644
--- a/include/drm/drm_panel.h
+++ b/include/drm/drm_panel.h
@@ -32,6 +32,7 @@ struct backlight_device;
struct device_node;
struct drm_connector;
struct drm_device;
+struct drm_dp_aux;
struct drm_panel;
struct display_timing;
@@ -64,8 +65,8 @@ enum drm_panel_orientation;
* the panel. This is the job of the .unprepare() function.
*
* Backlight can be handled automatically if configured using
- * drm_panel_of_backlight(). Then the driver does not need to implement the
- * functionality to enable/disable backlight.
+ * drm_panel_of_backlight() or drm_panel_dp_aux_backlight(). Then the driver
+ * does not need to implement the functionality to enable/disable backlight.
*/
struct drm_panel_funcs {
/**
@@ -144,8 +145,8 @@ struct drm_panel {
* Backlight device, used to turn on backlight after the call
* to enable(), and to turn off backlight before the call to
* disable().
- * backlight is set by drm_panel_of_backlight() and drivers
- * shall not assign it.
+ * backlight is set by drm_panel_of_backlight() or
+ * drm_panel_dp_aux_backlight() and drivers shall not assign it.
*/
struct backlight_device *backlight;
@@ -208,11 +209,18 @@ static inline int of_drm_get_panel_orientation(const struct device_node *np,
#if IS_ENABLED(CONFIG_DRM_PANEL) && (IS_BUILTIN(CONFIG_BACKLIGHT_CLASS_DEVICE) || \
(IS_MODULE(CONFIG_DRM) && IS_MODULE(CONFIG_BACKLIGHT_CLASS_DEVICE)))
int drm_panel_of_backlight(struct drm_panel *panel);
+int drm_panel_dp_aux_backlight(struct drm_panel *panel, struct drm_dp_aux *aux);
#else
static inline int drm_panel_of_backlight(struct drm_panel *panel)
{
return 0;
}
+
+static inline int drm_panel_dp_aux_backlight(struct drm_panel *panel,
+ struct drm_dp_aux *aux)
+{
+ return 0;
+}
#endif
#endif