aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-07-04 04:18:34 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-26 07:58:34 -0400
commit400e65d1c9946c9bf4d87a94d71f7d7423d03b62 (patch)
treed6e99b339e9ee87b2a35ae70841899d630328ea3 /drivers/video/omap2
parent5d512fcdf6dc27ea34734fbdcab812d207b89ebb (diff)
OMAPDSS: DSI: Remove dsi_pdev_map global struct
dsi_pdev_map is a struct visible globally in the DSI driver to get the platform device pointer of the DSI device corresponding to it's module ID. This was required because there was no clean way to derive the platform device from the DSI module instance number or from the connected panel. With the new output entity, it is possible to retrieve the platform device pointer if the omap_dss_output pointer is available. Modify the functions dsi_get_dsidev_from_dssdev() dsi_get_dsidev_from_id() so that they use output instead of dsi_pdev_map to retrieve the dsi platform device pointer. Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/dss/dsi.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 55748bc081e..dbe7d3ec843 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -345,8 +345,6 @@ struct dsi_packet_sent_handler_data {
345 struct completion *completion; 345 struct completion *completion;
346}; 346};
347 347
348static struct platform_device *dsi_pdev_map[MAX_NUM_DSI];
349
350#ifdef DEBUG 348#ifdef DEBUG
351static bool dsi_perf; 349static bool dsi_perf;
352module_param(dsi_perf, bool, 0644); 350module_param(dsi_perf, bool, 0644);
@@ -359,12 +357,19 @@ static inline struct dsi_data *dsi_get_dsidrv_data(struct platform_device *dside
359 357
360static inline struct platform_device *dsi_get_dsidev_from_dssdev(struct omap_dss_device *dssdev) 358static inline struct platform_device *dsi_get_dsidev_from_dssdev(struct omap_dss_device *dssdev)
361{ 359{
362 return dsi_pdev_map[dssdev->phy.dsi.module]; 360 return dssdev->output->pdev;
363} 361}
364 362
365struct platform_device *dsi_get_dsidev_from_id(int module) 363struct platform_device *dsi_get_dsidev_from_id(int module)
366{ 364{
367 return dsi_pdev_map[module]; 365 struct omap_dss_output *out;
366 enum omap_dss_output_id id;
367
368 id = module == 0 ? OMAP_DSS_OUTPUT_DSI1 : OMAP_DSS_OUTPUT_DSI2;
369
370 out = omap_dss_get_output(id);
371
372 return out->pdev;
368} 373}
369 374
370static inline void dsi_write_reg(struct platform_device *dsidev, 375static inline void dsi_write_reg(struct platform_device *dsidev,
@@ -5194,7 +5199,6 @@ static int __init omap_dsihw_probe(struct platform_device *dsidev)
5194 5199
5195 dsi->module_id = dsidev->id; 5200 dsi->module_id = dsidev->id;
5196 dsi->pdev = dsidev; 5201 dsi->pdev = dsidev;
5197 dsi_pdev_map[dsi->module_id] = dsidev;
5198 dev_set_drvdata(&dsidev->dev, dsi); 5202 dev_set_drvdata(&dsidev->dev, dsi);
5199 5203
5200 spin_lock_init(&dsi->irq_lock); 5204 spin_lock_init(&dsi->irq_lock);