aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-04-19 08:09:34 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-06-17 07:00:51 -0400
commit1f68d9c4b660487c5878c4800ff5a402abc6c005 (patch)
tree1309d1567c05c201739d93db178736d012a48eb2
parentd3923933930273a2c1f724c50fe1dd829e196b31 (diff)
OMAPDSS: combine omap_dss_output into omap_dss_device
We currently have omap_dss_device, which represents an external display device, sometimes an external encoder, sometimes a panel. Then we have omap_dss_output, which represents DSS's output encoder. In the future with new display device model, we construct a video pipeline from the display blocks. To accomplish this, all the blocks need to be presented by the same entity. Thus, this patch combines omap_dss_output into omap_dss_device. Some of the fields in omap_dss_output are already found in omap_dss_device, but some are not. This means we'll have DSS output specific fields in omap_dss_device, which is not very nice. However, it is easier to just keep those output specific fields there for now, and after transition to new display device model is made, they can be cleaned up easier than could be done now. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/gpu/drm/omapdrm/omap_crtc.c4
-rw-r--r--drivers/gpu/drm/omapdrm/omap_drv.c2
-rw-r--r--drivers/video/omap2/dss/apply.c6
-rw-r--r--drivers/video/omap2/dss/core.c4
-rw-r--r--drivers/video/omap2/dss/dpi.c12
-rw-r--r--drivers/video/omap2/dss/dsi.c18
-rw-r--r--drivers/video/omap2/dss/dss.h4
-rw-r--r--drivers/video/omap2/dss/hdmi.c12
-rw-r--r--drivers/video/omap2/dss/output.c32
-rw-r--r--drivers/video/omap2/dss/rfbi.c14
-rw-r--r--drivers/video/omap2/dss/sdi.c12
-rw-r--r--drivers/video/omap2/dss/venc.c12
-rw-r--r--include/video/omapdss.h66
13 files changed, 96 insertions, 102 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index b2ab2f5d3cb9..4cec678dba94 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -95,7 +95,7 @@ static struct omap_crtc *omap_crtcs[8];
95 95
96/* we can probably ignore these until we support command-mode panels: */ 96/* we can probably ignore these until we support command-mode panels: */
97static int omap_crtc_connect(struct omap_overlay_manager *mgr, 97static int omap_crtc_connect(struct omap_overlay_manager *mgr,
98 struct omap_dss_output *dst) 98 struct omap_dss_device *dst)
99{ 99{
100 if (mgr->output) 100 if (mgr->output)
101 return -EINVAL; 101 return -EINVAL;
@@ -110,7 +110,7 @@ static int omap_crtc_connect(struct omap_overlay_manager *mgr,
110} 110}
111 111
112static void omap_crtc_disconnect(struct omap_overlay_manager *mgr, 112static void omap_crtc_disconnect(struct omap_overlay_manager *mgr,
113 struct omap_dss_output *dst) 113 struct omap_dss_device *dst)
114{ 114{
115 mgr->output->manager = NULL; 115 mgr->output->manager = NULL;
116 mgr->output = NULL; 116 mgr->output = NULL;
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index c65dd0d6b01d..78a78c6ea576 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -259,7 +259,7 @@ static int omap_modeset_init(struct drm_device *dev)
259 struct drm_encoder *encoder = priv->encoders[i]; 259 struct drm_encoder *encoder = priv->encoders[i];
260 struct omap_dss_device *dssdev = 260 struct omap_dss_device *dssdev =
261 omap_encoder_get_dssdev(encoder); 261 omap_encoder_get_dssdev(encoder);
262 struct omap_dss_output *output; 262 struct omap_dss_device *output;
263 263
264 output = omapdss_find_output_from_display(dssdev); 264 output = omapdss_find_output_from_display(dssdev);
265 265
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index ced656ae7059..752b98592908 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -791,13 +791,13 @@ static void mgr_clear_shadow_dirty(struct omap_overlay_manager *mgr)
791} 791}
792 792
793static int dss_mgr_connect_compat(struct omap_overlay_manager *mgr, 793static int dss_mgr_connect_compat(struct omap_overlay_manager *mgr,
794 struct omap_dss_output *dst) 794 struct omap_dss_device *dst)
795{ 795{
796 return mgr->set_output(mgr, dst); 796 return mgr->set_output(mgr, dst);
797} 797}
798 798
799static void dss_mgr_disconnect_compat(struct omap_overlay_manager *mgr, 799static void dss_mgr_disconnect_compat(struct omap_overlay_manager *mgr,
800 struct omap_dss_output *dst) 800 struct omap_dss_device *dst)
801{ 801{
802 mgr->unset_output(mgr); 802 mgr->unset_output(mgr);
803} 803}
@@ -1166,7 +1166,7 @@ static void dss_mgr_get_info(struct omap_overlay_manager *mgr,
1166} 1166}
1167 1167
1168static int dss_mgr_set_output(struct omap_overlay_manager *mgr, 1168static int dss_mgr_set_output(struct omap_overlay_manager *mgr,
1169 struct omap_dss_output *output) 1169 struct omap_dss_device *output)
1170{ 1170{
1171 int r; 1171 int r;
1172 1172
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 7118449919c1..1aeb274e30fc 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -353,7 +353,7 @@ static int dss_driver_remove(struct device *dev)
353 353
354static int omapdss_default_connect(struct omap_dss_device *dssdev) 354static int omapdss_default_connect(struct omap_dss_device *dssdev)
355{ 355{
356 struct omap_dss_output *out; 356 struct omap_dss_device *out;
357 struct omap_overlay_manager *mgr; 357 struct omap_overlay_manager *mgr;
358 int r; 358 int r;
359 359
@@ -375,7 +375,7 @@ static int omapdss_default_connect(struct omap_dss_device *dssdev)
375 375
376static void omapdss_default_disconnect(struct omap_dss_device *dssdev) 376static void omapdss_default_disconnect(struct omap_dss_device *dssdev)
377{ 377{
378 struct omap_dss_output *out; 378 struct omap_dss_device *out;
379 struct omap_overlay_manager *mgr; 379 struct omap_overlay_manager *mgr;
380 380
381 out = dssdev->output; 381 out = dssdev->output;
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index e8cbf86eff9d..482b918757be 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -48,7 +48,7 @@ static struct {
48 struct dss_lcd_mgr_config mgr_config; 48 struct dss_lcd_mgr_config mgr_config;
49 int data_lines; 49 int data_lines;
50 50
51 struct omap_dss_output output; 51 struct omap_dss_device output;
52} dpi; 52} dpi;
53 53
54static struct platform_device *dpi_get_dsidev(enum omap_channel channel) 54static struct platform_device *dpi_get_dsidev(enum omap_channel channel)
@@ -347,7 +347,7 @@ static void dpi_config_lcd_manager(struct omap_overlay_manager *mgr)
347 347
348int omapdss_dpi_display_enable(struct omap_dss_device *dssdev) 348int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
349{ 349{
350 struct omap_dss_output *out = &dpi.output; 350 struct omap_dss_device *out = &dpi.output;
351 int r; 351 int r;
352 352
353 mutex_lock(&dpi.lock); 353 mutex_lock(&dpi.lock);
@@ -680,11 +680,11 @@ static int dpi_probe_pdata(struct platform_device *dpidev)
680 680
681static void dpi_init_output(struct platform_device *pdev) 681static void dpi_init_output(struct platform_device *pdev)
682{ 682{
683 struct omap_dss_output *out = &dpi.output; 683 struct omap_dss_device *out = &dpi.output;
684 684
685 out->pdev = pdev; 685 out->dev = &pdev->dev;
686 out->id = OMAP_DSS_OUTPUT_DPI; 686 out->id = OMAP_DSS_OUTPUT_DPI;
687 out->type = OMAP_DISPLAY_TYPE_DPI; 687 out->output_type = OMAP_DISPLAY_TYPE_DPI;
688 out->name = "dpi.0"; 688 out->name = "dpi.0";
689 out->dispc_channel = dpi_get_channel(); 689 out->dispc_channel = dpi_get_channel();
690 690
@@ -693,7 +693,7 @@ static void dpi_init_output(struct platform_device *pdev)
693 693
694static void __exit dpi_uninit_output(struct platform_device *pdev) 694static void __exit dpi_uninit_output(struct platform_device *pdev)
695{ 695{
696 struct omap_dss_output *out = &dpi.output; 696 struct omap_dss_device *out = &dpi.output;
697 697
698 dss_unregister_output(out); 698 dss_unregister_output(out);
699} 699}
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 26aa4c324c18..88780731f7a8 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -363,7 +363,7 @@ struct dsi_data {
363 enum omap_dss_dsi_mode mode; 363 enum omap_dss_dsi_mode mode;
364 struct omap_dss_dsi_videomode_timings vm_timings; 364 struct omap_dss_dsi_videomode_timings vm_timings;
365 365
366 struct omap_dss_output output; 366 struct omap_dss_device output;
367}; 367};
368 368
369struct dsi_packet_sent_handler_data { 369struct dsi_packet_sent_handler_data {
@@ -383,12 +383,12 @@ static inline struct dsi_data *dsi_get_dsidrv_data(struct platform_device *dside
383 383
384static inline struct platform_device *dsi_get_dsidev_from_dssdev(struct omap_dss_device *dssdev) 384static inline struct platform_device *dsi_get_dsidev_from_dssdev(struct omap_dss_device *dssdev)
385{ 385{
386 return dssdev->output->pdev; 386 return to_platform_device(dssdev->output->dev);
387} 387}
388 388
389struct platform_device *dsi_get_dsidev_from_id(int module) 389struct platform_device *dsi_get_dsidev_from_id(int module)
390{ 390{
391 struct omap_dss_output *out; 391 struct omap_dss_device *out;
392 enum omap_dss_output_id id; 392 enum omap_dss_output_id id;
393 393
394 switch (module) { 394 switch (module) {
@@ -404,7 +404,7 @@ struct platform_device *dsi_get_dsidev_from_id(int module)
404 404
405 out = omap_dss_get_output(id); 405 out = omap_dss_get_output(id);
406 406
407 return out ? out->pdev : NULL; 407 return out ? to_platform_device(out->dev) : NULL;
408} 408}
409 409
410static inline void dsi_write_reg(struct platform_device *dsidev, 410static inline void dsi_write_reg(struct platform_device *dsidev,
@@ -4133,7 +4133,7 @@ int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel)
4133 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 4133 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
4134 struct omap_overlay_manager *mgr = dsi->output.manager; 4134 struct omap_overlay_manager *mgr = dsi->output.manager;
4135 int bpp = dsi_get_pixel_size(dsi->pix_fmt); 4135 int bpp = dsi_get_pixel_size(dsi->pix_fmt);
4136 struct omap_dss_output *out = &dsi->output; 4136 struct omap_dss_device *out = &dsi->output;
4137 u8 data_type; 4137 u8 data_type;
4138 u16 word_count; 4138 u16 word_count;
4139 int r; 4139 int r;
@@ -5415,13 +5415,13 @@ static int dsi_probe_pdata(struct platform_device *dsidev)
5415static void dsi_init_output(struct platform_device *dsidev) 5415static void dsi_init_output(struct platform_device *dsidev)
5416{ 5416{
5417 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 5417 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
5418 struct omap_dss_output *out = &dsi->output; 5418 struct omap_dss_device *out = &dsi->output;
5419 5419
5420 out->pdev = dsidev; 5420 out->dev = &dsidev->dev;
5421 out->id = dsi->module_id == 0 ? 5421 out->id = dsi->module_id == 0 ?
5422 OMAP_DSS_OUTPUT_DSI1 : OMAP_DSS_OUTPUT_DSI2; 5422 OMAP_DSS_OUTPUT_DSI1 : OMAP_DSS_OUTPUT_DSI2;
5423 5423
5424 out->type = OMAP_DISPLAY_TYPE_DSI; 5424 out->output_type = OMAP_DISPLAY_TYPE_DSI;
5425 out->name = dsi->module_id == 0 ? "dsi.0" : "dsi.1"; 5425 out->name = dsi->module_id == 0 ? "dsi.0" : "dsi.1";
5426 out->dispc_channel = dsi_get_channel(dsi->module_id); 5426 out->dispc_channel = dsi_get_channel(dsi->module_id);
5427 5427
@@ -5431,7 +5431,7 @@ static void dsi_init_output(struct platform_device *dsidev)
5431static void dsi_uninit_output(struct platform_device *dsidev) 5431static void dsi_uninit_output(struct platform_device *dsidev)
5432{ 5432{
5433 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 5433 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
5434 struct omap_dss_output *out = &dsi->output; 5434 struct omap_dss_device *out = &dsi->output;
5435 5435
5436 dss_unregister_output(out); 5436 dss_unregister_output(out);
5437} 5437}
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 03d729ac8c42..67a509ea1fcb 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -180,8 +180,8 @@ void dss_copy_device_pdata(struct omap_dss_device *dst,
180 const struct omap_dss_device *src); 180 const struct omap_dss_device *src);
181 181
182/* output */ 182/* output */
183void dss_register_output(struct omap_dss_output *out); 183void dss_register_output(struct omap_dss_device *out);
184void dss_unregister_output(struct omap_dss_output *out); 184void dss_unregister_output(struct omap_dss_device *out);
185 185
186/* display */ 186/* display */
187int dss_suspend_all_devices(void); 187int dss_suspend_all_devices(void);
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 1804f1e28b97..1c1c1eee9990 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -70,7 +70,7 @@ static struct {
70 int ls_oe_gpio; 70 int ls_oe_gpio;
71 int hpd_gpio; 71 int hpd_gpio;
72 72
73 struct omap_dss_output output; 73 struct omap_dss_device output;
74} hdmi; 74} hdmi;
75 75
76/* 76/*
@@ -720,7 +720,7 @@ bool omapdss_hdmi_detect(void)
720 720
721int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev) 721int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev)
722{ 722{
723 struct omap_dss_output *out = &hdmi.output; 723 struct omap_dss_device *out = &hdmi.output;
724 int r = 0; 724 int r = 0;
725 725
726 DSSDBG("ENTER hdmi_display_enable\n"); 726 DSSDBG("ENTER hdmi_display_enable\n");
@@ -1035,11 +1035,11 @@ static int hdmi_probe_pdata(struct platform_device *pdev)
1035 1035
1036static void hdmi_init_output(struct platform_device *pdev) 1036static void hdmi_init_output(struct platform_device *pdev)
1037{ 1037{
1038 struct omap_dss_output *out = &hdmi.output; 1038 struct omap_dss_device *out = &hdmi.output;
1039 1039
1040 out->pdev = pdev; 1040 out->dev = &pdev->dev;
1041 out->id = OMAP_DSS_OUTPUT_HDMI; 1041 out->id = OMAP_DSS_OUTPUT_HDMI;
1042 out->type = OMAP_DISPLAY_TYPE_HDMI; 1042 out->output_type = OMAP_DISPLAY_TYPE_HDMI;
1043 out->name = "hdmi.0"; 1043 out->name = "hdmi.0";
1044 out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT; 1044 out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT;
1045 1045
@@ -1048,7 +1048,7 @@ static void hdmi_init_output(struct platform_device *pdev)
1048 1048
1049static void __exit hdmi_uninit_output(struct platform_device *pdev) 1049static void __exit hdmi_uninit_output(struct platform_device *pdev)
1050{ 1050{
1051 struct omap_dss_output *out = &hdmi.output; 1051 struct omap_dss_device *out = &hdmi.output;
1052 1052
1053 dss_unregister_output(out); 1053 dss_unregister_output(out);
1054} 1054}
diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c
index a53b08b2249b..cc81fec1626f 100644
--- a/drivers/video/omap2/dss/output.c
+++ b/drivers/video/omap2/dss/output.c
@@ -27,7 +27,7 @@
27static LIST_HEAD(output_list); 27static LIST_HEAD(output_list);
28static DEFINE_MUTEX(output_lock); 28static DEFINE_MUTEX(output_lock);
29 29
30int omapdss_output_set_device(struct omap_dss_output *out, 30int omapdss_output_set_device(struct omap_dss_device *out,
31 struct omap_dss_device *dssdev) 31 struct omap_dss_device *dssdev)
32{ 32{
33 int r; 33 int r;
@@ -41,7 +41,7 @@ int omapdss_output_set_device(struct omap_dss_output *out,
41 goto err; 41 goto err;
42 } 42 }
43 43
44 if (out->type != dssdev->type) { 44 if (out->output_type != dssdev->type) {
45 DSSERR("output type and display type don't match\n"); 45 DSSERR("output type and display type don't match\n");
46 r = -EINVAL; 46 r = -EINVAL;
47 goto err; 47 goto err;
@@ -60,7 +60,7 @@ err:
60} 60}
61EXPORT_SYMBOL(omapdss_output_set_device); 61EXPORT_SYMBOL(omapdss_output_set_device);
62 62
63int omapdss_output_unset_device(struct omap_dss_output *out) 63int omapdss_output_unset_device(struct omap_dss_device *out)
64{ 64{
65 int r; 65 int r;
66 66
@@ -92,19 +92,19 @@ err:
92} 92}
93EXPORT_SYMBOL(omapdss_output_unset_device); 93EXPORT_SYMBOL(omapdss_output_unset_device);
94 94
95void dss_register_output(struct omap_dss_output *out) 95void dss_register_output(struct omap_dss_device *out)
96{ 96{
97 list_add_tail(&out->list, &output_list); 97 list_add_tail(&out->list, &output_list);
98} 98}
99 99
100void dss_unregister_output(struct omap_dss_output *out) 100void dss_unregister_output(struct omap_dss_device *out)
101{ 101{
102 list_del(&out->list); 102 list_del(&out->list);
103} 103}
104 104
105struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id) 105struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id)
106{ 106{
107 struct omap_dss_output *out; 107 struct omap_dss_device *out;
108 108
109 list_for_each_entry(out, &output_list, list) { 109 list_for_each_entry(out, &output_list, list) {
110 if (out->id == id) 110 if (out->id == id)
@@ -115,9 +115,9 @@ struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id)
115} 115}
116EXPORT_SYMBOL(omap_dss_get_output); 116EXPORT_SYMBOL(omap_dss_get_output);
117 117
118struct omap_dss_output *omap_dss_find_output(const char *name) 118struct omap_dss_device *omap_dss_find_output(const char *name)
119{ 119{
120 struct omap_dss_output *out; 120 struct omap_dss_device *out;
121 121
122 list_for_each_entry(out, &output_list, list) { 122 list_for_each_entry(out, &output_list, list) {
123 if (strcmp(out->name, name) == 0) 123 if (strcmp(out->name, name) == 0)
@@ -128,12 +128,12 @@ struct omap_dss_output *omap_dss_find_output(const char *name)
128} 128}
129EXPORT_SYMBOL(omap_dss_find_output); 129EXPORT_SYMBOL(omap_dss_find_output);
130 130
131struct omap_dss_output *omap_dss_find_output_by_node(struct device_node *node) 131struct omap_dss_device *omap_dss_find_output_by_node(struct device_node *node)
132{ 132{
133 struct omap_dss_output *out; 133 struct omap_dss_device *out;
134 134
135 list_for_each_entry(out, &output_list, list) { 135 list_for_each_entry(out, &output_list, list) {
136 if (out->pdev->dev.of_node == node) 136 if (out->dev->of_node == node)
137 return out; 137 return out;
138 } 138 }
139 139
@@ -141,7 +141,7 @@ struct omap_dss_output *omap_dss_find_output_by_node(struct device_node *node)
141} 141}
142EXPORT_SYMBOL(omap_dss_find_output_by_node); 142EXPORT_SYMBOL(omap_dss_find_output_by_node);
143 143
144struct omap_dss_output *omapdss_find_output_from_display(struct omap_dss_device *dssdev) 144struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device *dssdev)
145{ 145{
146 return dssdev->output; 146 return dssdev->output;
147} 147}
@@ -149,7 +149,7 @@ EXPORT_SYMBOL(omapdss_find_output_from_display);
149 149
150struct omap_overlay_manager *omapdss_find_mgr_from_display(struct omap_dss_device *dssdev) 150struct omap_overlay_manager *omapdss_find_mgr_from_display(struct omap_dss_device *dssdev)
151{ 151{
152 struct omap_dss_output *out; 152 struct omap_dss_device *out;
153 153
154 out = omapdss_find_output_from_display(dssdev); 154 out = omapdss_find_output_from_display(dssdev);
155 155
@@ -180,14 +180,14 @@ void dss_uninstall_mgr_ops(void)
180EXPORT_SYMBOL(dss_uninstall_mgr_ops); 180EXPORT_SYMBOL(dss_uninstall_mgr_ops);
181 181
182int dss_mgr_connect(struct omap_overlay_manager *mgr, 182int dss_mgr_connect(struct omap_overlay_manager *mgr,
183 struct omap_dss_output *dst) 183 struct omap_dss_device *dst)
184{ 184{
185 return dss_mgr_ops->connect(mgr, dst); 185 return dss_mgr_ops->connect(mgr, dst);
186} 186}
187EXPORT_SYMBOL(dss_mgr_connect); 187EXPORT_SYMBOL(dss_mgr_connect);
188 188
189void dss_mgr_disconnect(struct omap_overlay_manager *mgr, 189void dss_mgr_disconnect(struct omap_overlay_manager *mgr,
190 struct omap_dss_output *dst) 190 struct omap_dss_device *dst)
191{ 191{
192 dss_mgr_ops->disconnect(mgr, dst); 192 dss_mgr_ops->disconnect(mgr, dst);
193} 193}
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 30ff0e0d4629..35836eb73a62 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -117,7 +117,7 @@ static struct {
117 int data_lines; 117 int data_lines;
118 struct rfbi_timings intf_timings; 118 struct rfbi_timings intf_timings;
119 119
120 struct omap_dss_output output; 120 struct omap_dss_device output;
121} rfbi; 121} rfbi;
122 122
123static inline void rfbi_write_reg(const struct rfbi_reg idx, u32 val) 123static inline void rfbi_write_reg(const struct rfbi_reg idx, u32 val)
@@ -890,7 +890,7 @@ static void rfbi_config_lcd_manager(struct omap_dss_device *dssdev)
890 890
891int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev) 891int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev)
892{ 892{
893 struct omap_dss_output *out = &rfbi.output; 893 struct omap_dss_device *out = &rfbi.output;
894 int r; 894 int r;
895 895
896 if (out == NULL || out->manager == NULL) { 896 if (out == NULL || out->manager == NULL) {
@@ -925,7 +925,7 @@ EXPORT_SYMBOL(omapdss_rfbi_display_enable);
925 925
926void omapdss_rfbi_display_disable(struct omap_dss_device *dssdev) 926void omapdss_rfbi_display_disable(struct omap_dss_device *dssdev)
927{ 927{
928 struct omap_dss_output *out = &rfbi.output; 928 struct omap_dss_device *out = &rfbi.output;
929 929
930 dss_mgr_unregister_framedone_handler(out->manager, 930 dss_mgr_unregister_framedone_handler(out->manager,
931 framedone_callback, NULL); 931 framedone_callback, NULL);
@@ -1013,11 +1013,11 @@ static int rfbi_probe_pdata(struct platform_device *rfbidev)
1013 1013
1014static void rfbi_init_output(struct platform_device *pdev) 1014static void rfbi_init_output(struct platform_device *pdev)
1015{ 1015{
1016 struct omap_dss_output *out = &rfbi.output; 1016 struct omap_dss_device *out = &rfbi.output;
1017 1017
1018 out->pdev = pdev; 1018 out->dev = &pdev->dev;
1019 out->id = OMAP_DSS_OUTPUT_DBI; 1019 out->id = OMAP_DSS_OUTPUT_DBI;
1020 out->type = OMAP_DISPLAY_TYPE_DBI; 1020 out->output_type = OMAP_DISPLAY_TYPE_DBI;
1021 out->name = "rfbi.0"; 1021 out->name = "rfbi.0";
1022 out->dispc_channel = OMAP_DSS_CHANNEL_LCD; 1022 out->dispc_channel = OMAP_DSS_CHANNEL_LCD;
1023 1023
@@ -1026,7 +1026,7 @@ static void rfbi_init_output(struct platform_device *pdev)
1026 1026
1027static void __exit rfbi_uninit_output(struct platform_device *pdev) 1027static void __exit rfbi_uninit_output(struct platform_device *pdev)
1028{ 1028{
1029 struct omap_dss_output *out = &rfbi.output; 1029 struct omap_dss_device *out = &rfbi.output;
1030 1030
1031 dss_unregister_output(out); 1031 dss_unregister_output(out);
1032} 1032}
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
index d4f3313bc378..5e81de58d932 100644
--- a/drivers/video/omap2/dss/sdi.c
+++ b/drivers/video/omap2/dss/sdi.c
@@ -40,7 +40,7 @@ static struct {
40 struct omap_video_timings timings; 40 struct omap_video_timings timings;
41 int datapairs; 41 int datapairs;
42 42
43 struct omap_dss_output output; 43 struct omap_dss_device output;
44} sdi; 44} sdi;
45 45
46struct sdi_clk_calc_ctx { 46struct sdi_clk_calc_ctx {
@@ -126,7 +126,7 @@ static void sdi_config_lcd_manager(struct omap_dss_device *dssdev)
126 126
127int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) 127int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
128{ 128{
129 struct omap_dss_output *out = &sdi.output; 129 struct omap_dss_device *out = &sdi.output;
130 struct omap_video_timings *t = &sdi.timings; 130 struct omap_video_timings *t = &sdi.timings;
131 struct dss_clock_info dss_cinfo; 131 struct dss_clock_info dss_cinfo;
132 struct dispc_clock_info dispc_cinfo; 132 struct dispc_clock_info dispc_cinfo;
@@ -335,11 +335,11 @@ static int sdi_probe_pdata(struct platform_device *sdidev)
335 335
336static void sdi_init_output(struct platform_device *pdev) 336static void sdi_init_output(struct platform_device *pdev)
337{ 337{
338 struct omap_dss_output *out = &sdi.output; 338 struct omap_dss_device *out = &sdi.output;
339 339
340 out->pdev = pdev; 340 out->dev = &pdev->dev;
341 out->id = OMAP_DSS_OUTPUT_SDI; 341 out->id = OMAP_DSS_OUTPUT_SDI;
342 out->type = OMAP_DISPLAY_TYPE_SDI; 342 out->output_type = OMAP_DISPLAY_TYPE_SDI;
343 out->name = "sdi.0"; 343 out->name = "sdi.0";
344 out->dispc_channel = OMAP_DSS_CHANNEL_LCD; 344 out->dispc_channel = OMAP_DSS_CHANNEL_LCD;
345 345
@@ -348,7 +348,7 @@ static void sdi_init_output(struct platform_device *pdev)
348 348
349static void __exit sdi_uninit_output(struct platform_device *pdev) 349static void __exit sdi_uninit_output(struct platform_device *pdev)
350{ 350{
351 struct omap_dss_output *out = &sdi.output; 351 struct omap_dss_device *out = &sdi.output;
352 352
353 dss_unregister_output(out); 353 dss_unregister_output(out);
354} 354}
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index d529a9249432..96c49bc7bdb4 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -304,7 +304,7 @@ static struct {
304 enum omap_dss_venc_type type; 304 enum omap_dss_venc_type type;
305 bool invert_polarity; 305 bool invert_polarity;
306 306
307 struct omap_dss_output output; 307 struct omap_dss_device output;
308} venc; 308} venc;
309 309
310static inline void venc_write_reg(int idx, u32 val) 310static inline void venc_write_reg(int idx, u32 val)
@@ -500,7 +500,7 @@ unsigned long venc_get_pixel_clock(void)
500 500
501int omapdss_venc_display_enable(struct omap_dss_device *dssdev) 501int omapdss_venc_display_enable(struct omap_dss_device *dssdev)
502{ 502{
503 struct omap_dss_output *out = &venc.output; 503 struct omap_dss_device *out = &venc.output;
504 int r; 504 int r;
505 505
506 DSSDBG("venc_display_enable\n"); 506 DSSDBG("venc_display_enable\n");
@@ -785,11 +785,11 @@ static int venc_probe_pdata(struct platform_device *vencdev)
785 785
786static void venc_init_output(struct platform_device *pdev) 786static void venc_init_output(struct platform_device *pdev)
787{ 787{
788 struct omap_dss_output *out = &venc.output; 788 struct omap_dss_device *out = &venc.output;
789 789
790 out->pdev = pdev; 790 out->dev = &pdev->dev;
791 out->id = OMAP_DSS_OUTPUT_VENC; 791 out->id = OMAP_DSS_OUTPUT_VENC;
792 out->type = OMAP_DISPLAY_TYPE_VENC; 792 out->output_type = OMAP_DISPLAY_TYPE_VENC;
793 out->name = "venc.0"; 793 out->name = "venc.0";
794 out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT; 794 out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT;
795 795
@@ -798,7 +798,7 @@ static void venc_init_output(struct platform_device *pdev)
798 798
799static void __exit venc_uninit_output(struct platform_device *pdev) 799static void __exit venc_uninit_output(struct platform_device *pdev)
800{ 800{
801 struct omap_dss_output *out = &venc.output; 801 struct omap_dss_device *out = &venc.output;
802 802
803 dss_unregister_output(out); 803 dss_unregister_output(out);
804} 804}
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 6a699f537a68..8e5035a54544 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -515,7 +515,7 @@ struct omap_overlay_manager {
515 enum omap_dss_output_id supported_outputs; 515 enum omap_dss_output_id supported_outputs;
516 516
517 /* dynamic fields */ 517 /* dynamic fields */
518 struct omap_dss_output *output; 518 struct omap_dss_device *output;
519 519
520 /* 520 /*
521 * The following functions do not block: 521 * The following functions do not block:
@@ -529,7 +529,7 @@ struct omap_overlay_manager {
529 */ 529 */
530 530
531 int (*set_output)(struct omap_overlay_manager *mgr, 531 int (*set_output)(struct omap_overlay_manager *mgr,
532 struct omap_dss_output *output); 532 struct omap_dss_device *output);
533 int (*unset_output)(struct omap_overlay_manager *mgr); 533 int (*unset_output)(struct omap_overlay_manager *mgr);
534 534
535 int (*set_manager_info)(struct omap_overlay_manager *mgr, 535 int (*set_manager_info)(struct omap_overlay_manager *mgr,
@@ -572,29 +572,6 @@ struct omap_dss_writeback_info {
572 u8 pre_mult_alpha; 572 u8 pre_mult_alpha;
573}; 573};
574 574
575struct omap_dss_output {
576 struct list_head list;
577
578 const char *name;
579
580 /* display type supported by the output */
581 enum omap_display_type type;
582
583 /* DISPC channel for this output */
584 enum omap_channel dispc_channel;
585
586 /* output instance */
587 enum omap_dss_output_id id;
588
589 /* output's platform device pointer */
590 struct platform_device *pdev;
591
592 /* dynamic fields */
593 struct omap_overlay_manager *manager;
594
595 struct omap_dss_device *device;
596};
597
598struct omap_dss_device { 575struct omap_dss_device {
599 /* old device, to be removed */ 576 /* old device, to be removed */
600 struct device old_dev; 577 struct device old_dev;
@@ -608,6 +585,7 @@ struct omap_dss_device {
608 char alias[16]; 585 char alias[16];
609 586
610 enum omap_display_type type; 587 enum omap_display_type type;
588 enum omap_display_type output_type;
611 589
612 /* obsolete, to be removed */ 590 /* obsolete, to be removed */
613 enum omap_channel channel; 591 enum omap_channel channel;
@@ -669,7 +647,7 @@ struct omap_dss_device {
669 647
670 enum omap_display_caps caps; 648 enum omap_display_caps caps;
671 649
672 struct omap_dss_output *output; 650 struct omap_dss_device *output;
673 651
674 enum omap_dss_display_state state; 652 enum omap_dss_display_state state;
675 653
@@ -680,6 +658,22 @@ struct omap_dss_device {
680 void (*platform_disable)(struct omap_dss_device *dssdev); 658 void (*platform_disable)(struct omap_dss_device *dssdev);
681 int (*set_backlight)(struct omap_dss_device *dssdev, int level); 659 int (*set_backlight)(struct omap_dss_device *dssdev, int level);
682 int (*get_backlight)(struct omap_dss_device *dssdev); 660 int (*get_backlight)(struct omap_dss_device *dssdev);
661
662
663 /* OMAP DSS output specific fields */
664
665 struct list_head list;
666
667 /* DISPC channel for this output */
668 enum omap_channel dispc_channel;
669
670 /* output instance */
671 enum omap_dss_output_id id;
672
673 /* dynamic fields */
674 struct omap_overlay_manager *manager;
675
676 struct omap_dss_device *device;
683}; 677};
684 678
685struct omap_dss_hdmi_data 679struct omap_dss_hdmi_data
@@ -798,14 +792,14 @@ struct omap_overlay_manager *omap_dss_get_overlay_manager(int num);
798int omap_dss_get_num_overlays(void); 792int omap_dss_get_num_overlays(void);
799struct omap_overlay *omap_dss_get_overlay(int num); 793struct omap_overlay *omap_dss_get_overlay(int num);
800 794
801struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id); 795struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id);
802struct omap_dss_output *omap_dss_find_output(const char *name); 796struct omap_dss_device *omap_dss_find_output(const char *name);
803struct omap_dss_output *omap_dss_find_output_by_node(struct device_node *node); 797struct omap_dss_device *omap_dss_find_output_by_node(struct device_node *node);
804int omapdss_output_set_device(struct omap_dss_output *out, 798int omapdss_output_set_device(struct omap_dss_device *out,
805 struct omap_dss_device *dssdev); 799 struct omap_dss_device *dssdev);
806int omapdss_output_unset_device(struct omap_dss_output *out); 800int omapdss_output_unset_device(struct omap_dss_device *out);
807 801
808struct omap_dss_output *omapdss_find_output_from_display(struct omap_dss_device *dssdev); 802struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device *dssdev);
809struct omap_overlay_manager *omapdss_find_mgr_from_display(struct omap_dss_device *dssdev); 803struct omap_overlay_manager *omapdss_find_mgr_from_display(struct omap_dss_device *dssdev);
810 804
811void omapdss_default_get_resolution(struct omap_dss_device *dssdev, 805void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
@@ -909,9 +903,9 @@ void omapdss_compat_uninit(void);
909 903
910struct dss_mgr_ops { 904struct dss_mgr_ops {
911 int (*connect)(struct omap_overlay_manager *mgr, 905 int (*connect)(struct omap_overlay_manager *mgr,
912 struct omap_dss_output *dst); 906 struct omap_dss_device *dst);
913 void (*disconnect)(struct omap_overlay_manager *mgr, 907 void (*disconnect)(struct omap_overlay_manager *mgr,
914 struct omap_dss_output *dst); 908 struct omap_dss_device *dst);
915 909
916 void (*start_update)(struct omap_overlay_manager *mgr); 910 void (*start_update)(struct omap_overlay_manager *mgr);
917 int (*enable)(struct omap_overlay_manager *mgr); 911 int (*enable)(struct omap_overlay_manager *mgr);
@@ -930,9 +924,9 @@ int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops);
930void dss_uninstall_mgr_ops(void); 924void dss_uninstall_mgr_ops(void);
931 925
932int dss_mgr_connect(struct omap_overlay_manager *mgr, 926int dss_mgr_connect(struct omap_overlay_manager *mgr,
933 struct omap_dss_output *dst); 927 struct omap_dss_device *dst);
934void dss_mgr_disconnect(struct omap_overlay_manager *mgr, 928void dss_mgr_disconnect(struct omap_overlay_manager *mgr,
935 struct omap_dss_output *dst); 929 struct omap_dss_device *dst);
936void dss_mgr_set_timings(struct omap_overlay_manager *mgr, 930void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
937 const struct omap_video_timings *timings); 931 const struct omap_video_timings *timings);
938void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr, 932void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,