summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJassi Brar <jaswinder.singh@linaro.org>2011-06-22 20:40:06 +0100
committerAndy Green <andy.green@linaro.org>2011-06-22 20:40:06 +0100
commit5b925e492f322cbadc7576d976e0aaaf708e908e (patch)
tree928e9850344fce3337a06f98b7c2592fadbb3804
parentb3f64baa816be1db9498bd31fa62abf03381758d (diff)
Subject: [PATCH 04/19] OMAP: DSS2: Add is_detected() driver API
The API should return whether the device is detected, and if applicable whether the cable is plugged in. For non-hot-plug devices, it simply means "is the display/panel present". For hot-plug devices it means "is the cable plugged in". Signed-off-by: Rob Clark <rob@ti.com> Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
-rw-r--r--drivers/video/omap2/dss/core.c2
-rw-r--r--drivers/video/omap2/dss/display.c12
-rw-r--r--include/video/omapdss.h8
3 files changed, 22 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index d052b674d76..14004536edb 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -439,6 +439,8 @@ int omap_dss_register_driver(struct omap_dss_driver *dssdriver)
dssdriver->check_timings = omapdss_default_check_timings;
if (!dssdriver->get_timings)
dssdriver->get_timings = omapdss_default_get_timings;
+ if (!dssdriver->is_detected)
+ dssdriver->is_detected = omapdss_default_is_detected;
return driver_register(&dssdriver->driver);
}
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index 31c3e773ebe..b73f96ee066 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -341,6 +341,18 @@ int omapdss_default_check_timings(struct omap_dss_device *dssdev,
}
EXPORT_SYMBOL(omapdss_default_check_timings);
+bool omapdss_default_is_detected(struct omap_dss_device *dssdev)
+{
+ if (dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED) {
+ /* show resume info for suspended displays */
+ return dssdev->activate_after_resume;
+ } else {
+ return dssdev->state != OMAP_DSS_DISPLAY_DISABLED;
+ }
+}
+EXPORT_SYMBOL(omapdss_default_is_detected);
+
+
void default_get_overlay_fifo_thresholds(enum omap_plane plane,
u32 fifo_size, enum omap_burst_size *burst_size,
u32 *fifo_low, u32 *fifo_high)
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 0a1a0ba44c6..7bbf57ca500 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -569,6 +569,13 @@ struct omap_dss_driver {
/* return raw EDID.. len indicates the max number of bytes of the
* EDID to read */
int (*get_edid)(struct omap_dss_device *dssdev, u8 *edid, int len);
+
+ /* is this display physically present / plugged-in? For hot-plug
+ * type displays (DVI, HDMI), this means is the cable plugged in.
+ * For displays like LCD panels, this means is the display present
+ * on the board.
+ */
+ bool (*is_detected)(struct omap_dss_device *dssdev);
};
int omap_dss_register_driver(struct omap_dss_driver *);
@@ -606,6 +613,7 @@ void omapdss_default_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings);
int omapdss_default_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings);
+bool omapdss_default_is_detected(struct omap_dss_device *dssdev);
void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
u16 *xres, u16 *yres);
int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev);