From: Ajay Kumar <ajaykumar.rs@samsung.com>
To: dri-devel@lists.freedesktop.org,
linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org
Cc: inki.dae@samsung.com, seanpaul@google.com, ajaynumb@gmail.com,
robdclark@gmail.com, daniel.vetter@ffwll.ch,
thierry.reding@gmail.com, joshi@samsung.com,
prashanth.g@samsung.com, marcheu@chromium.org,
Ajay Kumar <ajaykumar.rs@samsung.com>
Subject: [PATCH V4 02/10] drm/panel: add prepare and unprepare routines
Date: Wed, 11 Jun 2014 23:57:00 +0530 [thread overview]
Message-ID: <1402511228-18945-3-git-send-email-ajaykumar.rs@samsung.com> (raw)
In-Reply-To: <1402511228-18945-1-git-send-email-ajaykumar.rs@samsung.com>
Most of the panels need an init sequence as mentioned below:
-- poweron LCD unit/LCD_EN
-- start video data
-- poweron LED unit/BACKLIGHT_EN
And, a de-init sequence as mentioned below:
-- poweroff LED unit/BACKLIGHT_EN
-- stop video data
-- poweroff LCD unit/LCD_EN
With existing callbacks for drm panel, we cannot accomodate such panels,
since only two callbacks, i.e "panel_enable" and panel_disable are supported.
This patch adds:
-- "prepare" callback which can be called before
the actual video data is on, and then call the "enable"
callback after the video data is available.
-- "unprepare" callback which can be called after
the video data is off, and use "disable" callback
to do something before switching off the video data.
Now, we can easily map the above scenario as shown below:
poweron LCD unit/LCD_EN = "prepare" callback
poweron LED unit/BACKLIGHT_EN = "enable" callback
poweroff LED unit/BACKLIGHT_EN = "disable" callback
poweroff LCD unit/LCD_EN = "unprepare" callback
Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
---
include/drm/drm_panel.h | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
index c2ab77a..9addc69 100644
--- a/include/drm/drm_panel.h
+++ b/include/drm/drm_panel.h
@@ -31,7 +31,9 @@ struct drm_device;
struct drm_panel;
struct drm_panel_funcs {
+ int (*unprepare)(struct drm_panel *panel);
int (*disable)(struct drm_panel *panel);
+ int (*prepare)(struct drm_panel *panel);
int (*enable)(struct drm_panel *panel);
int (*get_modes)(struct drm_panel *panel);
};
@@ -46,6 +48,14 @@ struct drm_panel {
struct list_head list;
};
+static inline int drm_panel_unprepare(struct drm_panel *panel)
+{
+ if (panel && panel->funcs && panel->funcs->unprepare)
+ return panel->funcs->unprepare(panel);
+
+ return panel ? -ENOSYS : -EINVAL;
+}
+
static inline int drm_panel_disable(struct drm_panel *panel)
{
if (panel && panel->funcs && panel->funcs->disable)
@@ -54,6 +64,14 @@ static inline int drm_panel_disable(struct drm_panel *panel)
return panel ? -ENOSYS : -EINVAL;
}
+static inline int drm_panel_prepare(struct drm_panel *panel)
+{
+ if (panel && panel->funcs && panel->funcs->prepare)
+ return panel->funcs->prepare(panel);
+
+ return panel ? -ENOSYS : -EINVAL;
+}
+
static inline int drm_panel_enable(struct drm_panel *panel)
{
if (panel && panel->funcs && panel->funcs->enable)
--
1.7.9.5
next prev parent reply other threads:[~2014-06-11 18:27 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-11 18:26 [PATCH V4 00/10] drm: exynos: few patches to enhance bridge chip support Ajay Kumar
2014-06-11 18:26 ` [PATCH V4 01/10] drm/exynos: Move DP setup out of hotplug workqueue Ajay Kumar
2014-06-20 8:07 ` Ajay kumar
2014-06-11 18:27 ` Ajay Kumar [this message]
2014-06-20 8:07 ` [PATCH V4 02/10] drm/panel: add prepare and unprepare routines Ajay kumar
2014-06-11 18:27 ` [PATCH V4 03/10] drm/exynos: dp: modify driver to support drm_panel Ajay Kumar
2014-06-20 8:08 ` Ajay kumar
2014-06-11 18:27 ` [PATCH V4 04/10] drm/panel: Add driver for lvds/edp based panels Ajay Kumar
2014-06-20 8:07 ` Ajay kumar
[not found] ` <1402511228-18945-5-git-send-email-ajaykumar.rs-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-06-23 15:30 ` Javier Martinez Canillas
2014-06-24 8:18 ` Ajay kumar
2014-06-23 16:55 ` Christian Gmeiner
2014-06-24 8:22 ` Ajay kumar
2014-06-11 18:27 ` [PATCH V4 05/10] drm/bridge: add helper functions to support bridge chain Ajay Kumar
2014-06-20 8:07 ` Ajay kumar
2014-06-11 18:27 ` [PATCH V4 06/10] drm/bridge: Add a driver which binds drm_bridge with drm_panel Ajay Kumar
[not found] ` <1402511228-18945-7-git-send-email-ajaykumar.rs-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-06-20 8:08 ` Ajay kumar
2014-06-11 18:27 ` [PATCH V4 07/10] drm/bridge: ptn3460: Support bridge chaining Ajay Kumar
2014-06-20 8:09 ` Ajay kumar
2014-06-11 18:27 ` [PATCH V4 08/10] drm/exynos: dp: create bridge chain using ptn3460 and panel_binder Ajay Kumar
2014-06-20 8:09 ` Ajay kumar
2014-06-11 18:27 ` [PATCH V4 09/10] drm/bridge: Add ps8622/ps8625 bridge driver Ajay Kumar
2014-06-20 8:09 ` Ajay kumar
2014-06-23 16:05 ` Javier Martinez Canillas
2014-06-24 8:15 ` Ajay kumar
2014-06-11 18:27 ` [PATCH V4 10/10] drm/exynos: Add ps8622 lvds bridge discovery to DP driver Ajay Kumar
2014-06-20 8:09 ` Ajay kumar
2014-06-20 8:06 ` [PATCH V4 00/10] drm: exynos: few patches to enhance bridge chip support Ajay kumar
2014-06-20 15:51 ` Inki Dae
2014-06-23 13:58 ` Rahul Sharma
2014-06-23 14:38 ` Tomasz Figa
2014-06-24 3:25 ` Rahul Sharma
2014-06-23 16:15 ` Javier Martinez Canillas
2014-07-03 5:19 ` Andreas Färber
2014-07-03 14:55 ` Ajay kumar
2014-07-04 13:06 ` Andreas Färber
2014-07-07 20:27 ` Doug Anderson
2014-07-07 20:46 ` Doug Anderson
2014-07-09 6:11 ` Ajay kumar
2014-07-14 17:22 ` Olof Johansson
2014-07-15 5:37 ` Inki Dae
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1402511228-18945-3-git-send-email-ajaykumar.rs@samsung.com \
--to=ajaykumar.rs@samsung.com \
--cc=ajaynumb@gmail.com \
--cc=daniel.vetter@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=inki.dae@samsung.com \
--cc=joshi@samsung.com \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=marcheu@chromium.org \
--cc=prashanth.g@samsung.com \
--cc=robdclark@gmail.com \
--cc=seanpaul@google.com \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.