summaryrefslogtreecommitdiff
path: root/drivers/video/omap2/dss/display.c
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-09-10 09:04:16 (GMT)
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-26 11:58:33 (GMT)
commit3224827630f1823c1181e562af9d36951f6cbd11 (patch)
treeff71a396a6e9b0c15bb6a8eb6ba45b3d2e9e4150 /drivers/video/omap2/dss/display.c
parent23e2aa644f39fbc8121f49dd50ce85590cc4e4b7 (diff)
downloadlinux-fsl-qoriq-3224827630f1823c1181e562af9d36951f6cbd11.tar.xz
OMAPDSS: Create links between managers, outputs and devices
Links between DSS entities are made in dss_init_connections() when a panel device is registered, and are removed in dss_uninit_connections() when the device is unregistered. Modify these functions to incorporate the addition of outputs. The fields in omap_dss_device struct gives information on which output and manager to connect to. The desired manager and output pointers are retrieved and prepared to form the desired links. The output is linked to the device, and then the manager to the output. A helper function omapdss_get_output_from_device() is created to retrieve the output from the display by checking it's type, and the module id in case of DSI. Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/display.c')
-rw-r--r--drivers/video/omap2/dss/display.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index db83ae8..ccf8550 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -327,22 +327,35 @@ EXPORT_SYMBOL(omapdss_default_get_timings);
*/
static int dss_init_connections(struct omap_dss_device *dssdev, bool force)
{
+ struct omap_dss_output *out;
struct omap_overlay_manager *mgr;
int i, r;
- WARN_ON(dssdev->manager);
+ out = omapdss_get_output_from_dssdev(dssdev);
+
+ WARN_ON(dssdev->output);
+ WARN_ON(out->device);
+
+ r = omapdss_output_set_device(out, dssdev);
+ if (r) {
+ DSSERR("failed to connect output to new device\n");
+ return r;
+ }
mgr = omap_dss_get_overlay_manager(dssdev->channel);
- if (mgr->device && !force)
+ if (mgr->output && !force)
return 0;
- if (mgr->device)
- mgr->unset_device(mgr);
+ if (mgr->output)
+ mgr->unset_output(mgr);
- r = mgr->set_device(mgr, dssdev);
+ r = mgr->set_output(mgr, out);
if (r) {
- DSSERR("failed to set initial manager\n");
+ DSSERR("failed to connect manager to output of new device\n");
+
+ /* remove the output-device connection we just made */
+ omapdss_output_unset_device(out);
return r;
}
@@ -366,8 +379,14 @@ static int dss_init_connections(struct omap_dss_device *dssdev, bool force)
static void dss_uninit_connections(struct omap_dss_device *dssdev)
{
- if (dssdev->manager)
- dssdev->manager->unset_device(dssdev->manager);
+ if (dssdev->output) {
+ struct omap_overlay_manager *mgr = dssdev->output->manager;
+
+ if (mgr)
+ mgr->unset_output(mgr);
+
+ omapdss_output_unset_device(dssdev->output);
+ }
}
int dss_init_device(struct platform_device *pdev,