diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2019-12-07 15:03:29 +0100 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2019-12-09 22:57:26 +0100 |
commit | 5dce87a91970bf7c7ef3de5e2bff08b695d858a3 (patch) | |
tree | fabf03a65d13058b7525a12f80be8771d2d171db /include | |
parent | drm/gma500: add a missed gma_power_end in error path (diff) | |
download | linux-5dce87a91970bf7c7ef3de5e2bff08b695d858a3.tar.xz linux-5dce87a91970bf7c7ef3de5e2bff08b695d858a3.zip |
drm/drm_panel: no error when no callback
The callbacks in drm_panel_funcs are optional, so do not
return an error just because no callback is assigned.
v2:
- Document what functions in drm_panel_funcs are optional (Laurent)
- Return -EOPNOTSUPP if get_modes() is not assigned (Laurent)
(Sam: -EOPNOTSUPP seems to best error code in this situation)
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20191207140353.23967-2-sam@ravnborg.org
Diffstat (limited to 'include')
-rw-r--r-- | include/drm/drm_panel.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index ce8da64022b4..2bd1d806dbeb 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -65,6 +65,8 @@ struct drm_panel_funcs { * @prepare: * * Turn on panel and perform set up. + * + * This function is optional. */ int (*prepare)(struct drm_panel *panel); @@ -72,6 +74,8 @@ struct drm_panel_funcs { * @enable: * * Enable panel (turn on back light, etc.). + * + * This function is optional. */ int (*enable)(struct drm_panel *panel); @@ -79,6 +83,8 @@ struct drm_panel_funcs { * @disable: * * Disable panel (turn off back light, etc.). + * + * This function is optional. */ int (*disable)(struct drm_panel *panel); @@ -86,14 +92,18 @@ struct drm_panel_funcs { * @unprepare: * * Turn off panel. + * + * This function is optional. */ int (*unprepare)(struct drm_panel *panel); /** * @get_modes: * - * Add modes to the connector that the panel is attached to and - * return the number of modes added. + * Add modes to the connector that the panel is attached to + * and returns the number of modes added. + * + * This function is mandatory. */ int (*get_modes)(struct drm_panel *panel); @@ -102,6 +112,8 @@ struct drm_panel_funcs { * * Copy display timings into the provided array and return * the number of display timings available. + * + * This function is optional. */ int (*get_timings)(struct drm_panel *panel, unsigned int num_timings, struct display_timing *timings); |