From: Ajay Kumar Subject: [PATCH 2/7] drm/panel: add pre_enable routine to drm panel Date: Wed, 16 Apr 2014 20:03:01 +0530 Message-ID: <1397658786-26138-3-git-send-email-ajaykumar.rs@samsung.com> References: <1397658786-26138-1-git-send-email-ajaykumar.rs@samsung.com> Return-path: In-reply-to: <1397658786-26138-1-git-send-email-ajaykumar.rs@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: inki.dae@samsung.com, a.hajda@samsung.com, treding@nvidia.com, kyungmin.park@samsung.com, seanpaul@google.com, abrestic@chromium.org, rahul.sharma@samsung.com, ajaynumb@gmail.com, joshi@samsung.com, prashanth.g@samsung.com, Ajay Kumar List-Id: dri-devel@lists.freedesktop.org Most of the panels need an init sequence as mentioned below: -- poweron LCD unit/LCD_EN -- start video data -- poweron LED unit/BL_EN With existing callbacks for drm panel, we cannot accomodate such panels, since only one callback, i.e "panel_enable" is supported. This patch adds a "pre_enable" callback which can be called before the actual video data is on, and then call the "enable" callback after the video data is available. Signed-off-by: Ajay Kumar --- include/drm/drm_panel.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index c2ab77a..89210bf 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -32,6 +32,7 @@ struct drm_panel; struct drm_panel_funcs { int (*disable)(struct drm_panel *panel); + int (*pre_enable)(struct drm_panel *panel); int (*enable)(struct drm_panel *panel); int (*get_modes)(struct drm_panel *panel); }; @@ -54,6 +55,14 @@ static inline int drm_panel_disable(struct drm_panel *panel) return panel ? -ENOSYS : -EINVAL; } +static inline int drm_panel_pre_enable(struct drm_panel *panel) +{ + if (panel && panel->funcs && panel->funcs->pre_enable) + return panel->funcs->pre_enable(panel); + + return panel ? -ENOSYS : -EINVAL; +} + static inline int drm_panel_enable(struct drm_panel *panel) { if (panel && panel->funcs && panel->funcs->enable) -- 1.8.1.2