diff options
Diffstat (limited to 'drivers/video/omap2/dss/dispc.c')
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index eb1c9be20d0a..d19665e74e72 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -191,6 +191,23 @@ static const struct { | |||
191 | [DISPC_MGR_FLD_FIFOHANDCHECK] = { DISPC_CONFIG2, 16, 16 }, | 191 | [DISPC_MGR_FLD_FIFOHANDCHECK] = { DISPC_CONFIG2, 16, 16 }, |
192 | }, | 192 | }, |
193 | }, | 193 | }, |
194 | [OMAP_DSS_CHANNEL_LCD3] = { | ||
195 | .name = "LCD3", | ||
196 | .vsync_irq = DISPC_IRQ_VSYNC3, | ||
197 | .framedone_irq = DISPC_IRQ_FRAMEDONE3, | ||
198 | .sync_lost_irq = DISPC_IRQ_SYNC_LOST3, | ||
199 | .reg_desc = { | ||
200 | [DISPC_MGR_FLD_ENABLE] = { DISPC_CONTROL3, 0, 0 }, | ||
201 | [DISPC_MGR_FLD_STNTFT] = { DISPC_CONTROL3, 3, 3 }, | ||
202 | [DISPC_MGR_FLD_GO] = { DISPC_CONTROL3, 5, 5 }, | ||
203 | [DISPC_MGR_FLD_TFTDATALINES] = { DISPC_CONTROL3, 9, 8 }, | ||
204 | [DISPC_MGR_FLD_STALLMODE] = { DISPC_CONTROL3, 11, 11 }, | ||
205 | [DISPC_MGR_FLD_TCKENABLE] = { DISPC_CONFIG3, 10, 10 }, | ||
206 | [DISPC_MGR_FLD_TCKSELECTION] = { DISPC_CONFIG3, 11, 11 }, | ||
207 | [DISPC_MGR_FLD_CPR] = { DISPC_CONFIG3, 15, 15 }, | ||
208 | [DISPC_MGR_FLD_FIFOHANDCHECK] = { DISPC_CONFIG3, 16, 16 }, | ||
209 | }, | ||
210 | }, | ||
194 | }; | 211 | }; |
195 | 212 | ||
196 | static void _omap_dispc_set_irqs(void); | 213 | static void _omap_dispc_set_irqs(void); |
@@ -239,6 +256,10 @@ static void dispc_save_context(void) | |||
239 | SR(CONTROL2); | 256 | SR(CONTROL2); |
240 | SR(CONFIG2); | 257 | SR(CONFIG2); |
241 | } | 258 | } |
259 | if (dss_has_feature(FEAT_MGR_LCD3)) { | ||
260 | SR(CONTROL3); | ||
261 | SR(CONFIG3); | ||
262 | } | ||
242 | 263 | ||
243 | for (i = 0; i < dss_feat_get_num_mgrs(); i++) { | 264 | for (i = 0; i < dss_feat_get_num_mgrs(); i++) { |
244 | SR(DEFAULT_COLOR(i)); | 265 | SR(DEFAULT_COLOR(i)); |
@@ -352,6 +373,8 @@ static void dispc_restore_context(void) | |||
352 | RR(GLOBAL_ALPHA); | 373 | RR(GLOBAL_ALPHA); |
353 | if (dss_has_feature(FEAT_MGR_LCD2)) | 374 | if (dss_has_feature(FEAT_MGR_LCD2)) |
354 | RR(CONFIG2); | 375 | RR(CONFIG2); |
376 | if (dss_has_feature(FEAT_MGR_LCD3)) | ||
377 | RR(CONFIG3); | ||
355 | 378 | ||
356 | for (i = 0; i < dss_feat_get_num_mgrs(); i++) { | 379 | for (i = 0; i < dss_feat_get_num_mgrs(); i++) { |
357 | RR(DEFAULT_COLOR(i)); | 380 | RR(DEFAULT_COLOR(i)); |
@@ -437,6 +460,8 @@ static void dispc_restore_context(void) | |||
437 | RR(CONTROL); | 460 | RR(CONTROL); |
438 | if (dss_has_feature(FEAT_MGR_LCD2)) | 461 | if (dss_has_feature(FEAT_MGR_LCD2)) |
439 | RR(CONTROL2); | 462 | RR(CONTROL2); |
463 | if (dss_has_feature(FEAT_MGR_LCD3)) | ||
464 | RR(CONTROL3); | ||
440 | /* clear spurious SYNC_LOST_DIGIT interrupts */ | 465 | /* clear spurious SYNC_LOST_DIGIT interrupts */ |
441 | dispc_write_reg(DISPC_IRQSTATUS, DISPC_IRQ_SYNC_LOST_DIGIT); | 466 | dispc_write_reg(DISPC_IRQSTATUS, DISPC_IRQ_SYNC_LOST_DIGIT); |
442 | 467 | ||
@@ -476,7 +501,8 @@ void dispc_runtime_put(void) | |||
476 | static inline bool dispc_mgr_is_lcd(enum omap_channel channel) | 501 | static inline bool dispc_mgr_is_lcd(enum omap_channel channel) |
477 | { | 502 | { |
478 | if (channel == OMAP_DSS_CHANNEL_LCD || | 503 | if (channel == OMAP_DSS_CHANNEL_LCD || |
479 | channel == OMAP_DSS_CHANNEL_LCD2) | 504 | channel == OMAP_DSS_CHANNEL_LCD2 || |
505 | channel == OMAP_DSS_CHANNEL_LCD3) | ||
480 | return true; | 506 | return true; |
481 | else | 507 | else |
482 | return false; | 508 | return false; |
@@ -867,6 +893,15 @@ void dispc_ovl_set_channel_out(enum omap_plane plane, enum omap_channel channel) | |||
867 | chan = 0; | 893 | chan = 0; |
868 | chan2 = 1; | 894 | chan2 = 1; |
869 | break; | 895 | break; |
896 | case OMAP_DSS_CHANNEL_LCD3: | ||
897 | if (dss_has_feature(FEAT_MGR_LCD3)) { | ||
898 | chan = 0; | ||
899 | chan2 = 2; | ||
900 | } else { | ||
901 | BUG(); | ||
902 | return; | ||
903 | } | ||
904 | break; | ||
870 | default: | 905 | default: |
871 | BUG(); | 906 | BUG(); |
872 | return; | 907 | return; |
@@ -902,7 +937,14 @@ static enum omap_channel dispc_ovl_get_channel_out(enum omap_plane plane) | |||
902 | 937 | ||
903 | val = dispc_read_reg(DISPC_OVL_ATTRIBUTES(plane)); | 938 | val = dispc_read_reg(DISPC_OVL_ATTRIBUTES(plane)); |
904 | 939 | ||
905 | if (dss_has_feature(FEAT_MGR_LCD2)) { | 940 | if (dss_has_feature(FEAT_MGR_LCD3)) { |
941 | if (FLD_GET(val, 31, 30) == 0) | ||
942 | channel = FLD_GET(val, shift, shift); | ||
943 | else if (FLD_GET(val, 31, 30) == 1) | ||
944 | channel = OMAP_DSS_CHANNEL_LCD2; | ||
945 | else | ||
946 | channel = OMAP_DSS_CHANNEL_LCD3; | ||
947 | } else if (dss_has_feature(FEAT_MGR_LCD2)) { | ||
906 | if (FLD_GET(val, 31, 30) == 0) | 948 | if (FLD_GET(val, 31, 30) == 0) |
907 | channel = FLD_GET(val, shift, shift); | 949 | channel = FLD_GET(val, shift, shift); |
908 | else | 950 | else |
@@ -3587,6 +3629,8 @@ static void _omap_dispc_initialize_irq(void) | |||
3587 | dispc.irq_error_mask = DISPC_IRQ_MASK_ERROR; | 3629 | dispc.irq_error_mask = DISPC_IRQ_MASK_ERROR; |
3588 | if (dss_has_feature(FEAT_MGR_LCD2)) | 3630 | if (dss_has_feature(FEAT_MGR_LCD2)) |
3589 | dispc.irq_error_mask |= DISPC_IRQ_SYNC_LOST2; | 3631 | dispc.irq_error_mask |= DISPC_IRQ_SYNC_LOST2; |
3632 | if (dss_has_feature(FEAT_MGR_LCD3)) | ||
3633 | dispc.irq_error_mask |= DISPC_IRQ_SYNC_LOST3; | ||
3590 | if (dss_feat_get_num_ovls() > 3) | 3634 | if (dss_feat_get_num_ovls() > 3) |
3591 | dispc.irq_error_mask |= DISPC_IRQ_VID3_FIFO_UNDERFLOW; | 3635 | dispc.irq_error_mask |= DISPC_IRQ_VID3_FIFO_UNDERFLOW; |
3592 | 3636 | ||