diff options
Diffstat (limited to 'drivers/video/omap2/dss/rfbi.c')
-rw-r--r-- | drivers/video/omap2/dss/rfbi.c | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c index 7985fa12b9b4..7c087424b634 100644 --- a/drivers/video/omap2/dss/rfbi.c +++ b/drivers/video/omap2/dss/rfbi.c | |||
@@ -300,10 +300,11 @@ void omap_rfbi_write_pixels(const void __iomem *buf, int scr_width, | |||
300 | } | 300 | } |
301 | EXPORT_SYMBOL(omap_rfbi_write_pixels); | 301 | EXPORT_SYMBOL(omap_rfbi_write_pixels); |
302 | 302 | ||
303 | static void rfbi_transfer_area(struct omap_dss_device *dssdev, u16 width, | 303 | static int rfbi_transfer_area(struct omap_dss_device *dssdev, u16 width, |
304 | u16 height, void (*callback)(void *data), void *data) | 304 | u16 height, void (*callback)(void *data), void *data) |
305 | { | 305 | { |
306 | u32 l; | 306 | u32 l; |
307 | int r; | ||
307 | struct omap_video_timings timings = { | 308 | struct omap_video_timings timings = { |
308 | .hsw = 1, | 309 | .hsw = 1, |
309 | .hfp = 1, | 310 | .hfp = 1, |
@@ -322,7 +323,9 @@ static void rfbi_transfer_area(struct omap_dss_device *dssdev, u16 width, | |||
322 | 323 | ||
323 | dss_mgr_set_timings(dssdev->manager, &timings); | 324 | dss_mgr_set_timings(dssdev->manager, &timings); |
324 | 325 | ||
325 | dispc_mgr_enable(dssdev->manager->id, true); | 326 | r = dss_mgr_enable(dssdev->manager); |
327 | if (r) | ||
328 | return r; | ||
326 | 329 | ||
327 | rfbi.framedone_callback = callback; | 330 | rfbi.framedone_callback = callback; |
328 | rfbi.framedone_callback_data = data; | 331 | rfbi.framedone_callback_data = data; |
@@ -335,6 +338,8 @@ static void rfbi_transfer_area(struct omap_dss_device *dssdev, u16 width, | |||
335 | l = FLD_MOD(l, 1, 4, 4); /* ITE */ | 338 | l = FLD_MOD(l, 1, 4, 4); /* ITE */ |
336 | 339 | ||
337 | rfbi_write_reg(RFBI_CONTROL, l); | 340 | rfbi_write_reg(RFBI_CONTROL, l); |
341 | |||
342 | return 0; | ||
338 | } | 343 | } |
339 | 344 | ||
340 | static void framedone_callback(void *data, u32 mask) | 345 | static void framedone_callback(void *data, u32 mask) |
@@ -814,8 +819,11 @@ int omap_rfbi_update(struct omap_dss_device *dssdev, | |||
814 | u16 x, u16 y, u16 w, u16 h, | 819 | u16 x, u16 y, u16 w, u16 h, |
815 | void (*callback)(void *), void *data) | 820 | void (*callback)(void *), void *data) |
816 | { | 821 | { |
817 | rfbi_transfer_area(dssdev, w, h, callback, data); | 822 | int r; |
818 | return 0; | 823 | |
824 | r = rfbi_transfer_area(dssdev, w, h, callback, data); | ||
825 | |||
826 | return r; | ||
819 | } | 827 | } |
820 | EXPORT_SYMBOL(omap_rfbi_update); | 828 | EXPORT_SYMBOL(omap_rfbi_update); |
821 | 829 | ||
@@ -859,6 +867,22 @@ static void rfbi_dump_regs(struct seq_file *s) | |||
859 | #undef DUMPREG | 867 | #undef DUMPREG |
860 | } | 868 | } |
861 | 869 | ||
870 | static void rfbi_config_lcd_manager(struct omap_dss_device *dssdev) | ||
871 | { | ||
872 | struct dss_lcd_mgr_config mgr_config; | ||
873 | |||
874 | mgr_config.io_pad_mode = DSS_IO_PAD_MODE_RFBI; | ||
875 | |||
876 | mgr_config.stallmode = true; | ||
877 | /* Do we need fifohandcheck for RFBI? */ | ||
878 | mgr_config.fifohandcheck = false; | ||
879 | |||
880 | mgr_config.video_port_width = dssdev->ctrl.pixel_size; | ||
881 | mgr_config.lcden_sig_polarity = 0; | ||
882 | |||
883 | dss_mgr_set_lcd_config(dssdev->manager, &mgr_config); | ||
884 | } | ||
885 | |||
862 | int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev) | 886 | int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev) |
863 | { | 887 | { |
864 | int r; | 888 | int r; |
@@ -885,13 +909,7 @@ int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev) | |||
885 | goto err1; | 909 | goto err1; |
886 | } | 910 | } |
887 | 911 | ||
888 | dispc_mgr_set_lcd_display_type(dssdev->manager->id, | 912 | rfbi_config_lcd_manager(dssdev); |
889 | OMAP_DSS_LCD_DISPLAY_TFT); | ||
890 | |||
891 | dispc_mgr_set_io_pad_mode(DSS_IO_PAD_MODE_RFBI); | ||
892 | dispc_mgr_enable_stallmode(dssdev->manager->id, true); | ||
893 | |||
894 | dispc_mgr_set_tft_data_lines(dssdev->manager->id, dssdev->ctrl.pixel_size); | ||
895 | 913 | ||
896 | rfbi_configure(dssdev->phy.rfbi.channel, | 914 | rfbi_configure(dssdev->phy.rfbi.channel, |
897 | dssdev->ctrl.pixel_size, | 915 | dssdev->ctrl.pixel_size, |