aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2014-01-02 04:19:52 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-01-09 08:17:25 -0500
commitcc823bdcfb468808467a9f23186a10404f573fc4 (patch)
tree80b9227aacc592b5f1c540488099c90056ffc48a
parent3a01ab255637fdc2fbc97cf356f1b971c3fc0c64 (diff)
drm/omap: fix: disconnect devices when omapdrm module is removed
At omapdrm probe, we install manager ops and connect omapdss devices. This needs to be undone when omapdrm module is removed so that omapdss is in a clean state. This ensures that we can re-insert omapdrm module, or some other module which uses omapdss(like omapfb/omap_vout). Currently, omapdrm's remove neither uninstalls manager ops, or disconnects omapdss devices. We make sure that this is done in pdev_remove. omapdrm establishes connections for omap_dss_device devices when probed. It should also be responsible to disconnect the devices. Keeping the devices connected can prevent the panel driver modules from unloading, it also causes issues when we try to remove or re-insert omapdrm module. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/gpu/drm/omapdrm/omap_drv.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 651f9022308f..fca5667d3bf5 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -86,6 +86,13 @@ static bool channel_used(struct drm_device *dev, enum omap_channel channel)
86 86
87 return false; 87 return false;
88} 88}
89static void omap_disconnect_dssdevs(void)
90{
91 struct omap_dss_device *dssdev = NULL;
92
93 for_each_dss_dev(dssdev)
94 dssdev->driver->disconnect(dssdev);
95}
89 96
90static int omap_connect_dssdevs(void) 97static int omap_connect_dssdevs(void)
91{ 98{
@@ -116,10 +123,7 @@ cleanup:
116 * if we are deferring probe, we disconnect the devices we previously 123 * if we are deferring probe, we disconnect the devices we previously
117 * connected 124 * connected
118 */ 125 */
119 dssdev = NULL; 126 omap_disconnect_dssdevs();
120
121 for_each_dss_dev(dssdev)
122 dssdev->driver->disconnect(dssdev);
123 127
124 return r; 128 return r;
125} 129}
@@ -693,6 +697,9 @@ static int pdev_remove(struct platform_device *device)
693 DBG(""); 697 DBG("");
694 drm_platform_exit(&omap_drm_driver, device); 698 drm_platform_exit(&omap_drm_driver, device);
695 699
700 omap_disconnect_dssdevs();
701 omap_crtc_pre_uninit();
702
696 platform_driver_unregister(&omap_dmm_driver); 703 platform_driver_unregister(&omap_dmm_driver);
697 return 0; 704 return 0;
698} 705}