diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-07-25 04:55:46 -0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-07-25 04:55:46 -0400 |
commit | d9053b487965042b9c849ce40c7f1fb7a0b84b39 (patch) | |
tree | 1fbb2559dd8fd400cf1dff5711cc5e408ea79ef6 /drivers/video/omap2/dss/sdi.c | |
parent | 4c5b1fb8a1348542afb153aef72f6067989f578e (diff) | |
parent | 974a65825e0b5fbda49605f0416a2c975d66e9e6 (diff) |
Merge branch 'for-florian' of git://gitorious.org/linux-omap-dss2/linux into fbdev-next
Conflicts:
drivers/video/omap2/dss/core.c
drivers/video/omap2/dss/dispc.c
Diffstat (limited to 'drivers/video/omap2/dss/sdi.c')
-rw-r--r-- | drivers/video/omap2/dss/sdi.c | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c index 3a43dc2a9b46..5d31699fbd3c 100644 --- a/drivers/video/omap2/dss/sdi.c +++ b/drivers/video/omap2/dss/sdi.c | |||
@@ -32,19 +32,21 @@ | |||
32 | static struct { | 32 | static struct { |
33 | bool update_enabled; | 33 | bool update_enabled; |
34 | struct regulator *vdds_sdi_reg; | 34 | struct regulator *vdds_sdi_reg; |
35 | } sdi; | ||
36 | 35 | ||
37 | static void sdi_basic_init(struct omap_dss_device *dssdev) | 36 | struct dss_lcd_mgr_config mgr_config; |
37 | } sdi; | ||
38 | 38 | ||
39 | static void sdi_config_lcd_manager(struct omap_dss_device *dssdev) | ||
39 | { | 40 | { |
40 | dispc_mgr_set_io_pad_mode(DSS_IO_PAD_MODE_BYPASS); | 41 | sdi.mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS; |
41 | dispc_mgr_enable_stallmode(dssdev->manager->id, false); | 42 | |
43 | sdi.mgr_config.stallmode = false; | ||
44 | sdi.mgr_config.fifohandcheck = false; | ||
42 | 45 | ||
43 | dispc_mgr_set_lcd_display_type(dssdev->manager->id, | 46 | sdi.mgr_config.video_port_width = 24; |
44 | OMAP_DSS_LCD_DISPLAY_TFT); | 47 | sdi.mgr_config.lcden_sig_polarity = 1; |
45 | 48 | ||
46 | dispc_mgr_set_tft_data_lines(dssdev->manager->id, 24); | 49 | dss_mgr_set_lcd_config(dssdev->manager, &sdi.mgr_config); |
47 | dispc_lcd_enable_signal_polarity(1); | ||
48 | } | 50 | } |
49 | 51 | ||
50 | int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) | 52 | int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) |
@@ -52,8 +54,6 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) | |||
52 | struct omap_video_timings *t = &dssdev->panel.timings; | 54 | struct omap_video_timings *t = &dssdev->panel.timings; |
53 | struct dss_clock_info dss_cinfo; | 55 | struct dss_clock_info dss_cinfo; |
54 | struct dispc_clock_info dispc_cinfo; | 56 | struct dispc_clock_info dispc_cinfo; |
55 | u16 lck_div, pck_div; | ||
56 | unsigned long fck; | ||
57 | unsigned long pck; | 57 | unsigned long pck; |
58 | int r; | 58 | int r; |
59 | 59 | ||
@@ -76,24 +76,17 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) | |||
76 | if (r) | 76 | if (r) |
77 | goto err_get_dispc; | 77 | goto err_get_dispc; |
78 | 78 | ||
79 | sdi_basic_init(dssdev); | ||
80 | |||
81 | /* 15.5.9.1.2 */ | 79 | /* 15.5.9.1.2 */ |
82 | dssdev->panel.config |= OMAP_DSS_LCD_RF | OMAP_DSS_LCD_ONOFF; | 80 | dssdev->panel.timings.data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; |
83 | 81 | dssdev->panel.timings.sync_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; | |
84 | dispc_mgr_set_pol_freq(dssdev->manager->id, dssdev->panel.config, | ||
85 | dssdev->panel.acbi, dssdev->panel.acb); | ||
86 | 82 | ||
87 | r = dss_calc_clock_div(1, t->pixel_clock * 1000, | 83 | r = dss_calc_clock_div(t->pixel_clock * 1000, &dss_cinfo, &dispc_cinfo); |
88 | &dss_cinfo, &dispc_cinfo); | ||
89 | if (r) | 84 | if (r) |
90 | goto err_calc_clock_div; | 85 | goto err_calc_clock_div; |
91 | 86 | ||
92 | fck = dss_cinfo.fck; | 87 | sdi.mgr_config.clock_info = dispc_cinfo; |
93 | lck_div = dispc_cinfo.lck_div; | ||
94 | pck_div = dispc_cinfo.pck_div; | ||
95 | 88 | ||
96 | pck = fck / lck_div / pck_div / 1000; | 89 | pck = dss_cinfo.fck / dispc_cinfo.lck_div / dispc_cinfo.pck_div / 1000; |
97 | 90 | ||
98 | if (pck != t->pixel_clock) { | 91 | if (pck != t->pixel_clock) { |
99 | DSSWARN("Could not find exact pixel clock. Requested %d kHz, " | 92 | DSSWARN("Could not find exact pixel clock. Requested %d kHz, " |
@@ -110,9 +103,7 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) | |||
110 | if (r) | 103 | if (r) |
111 | goto err_set_dss_clock_div; | 104 | goto err_set_dss_clock_div; |
112 | 105 | ||
113 | r = dispc_mgr_set_clock_div(dssdev->manager->id, &dispc_cinfo); | 106 | sdi_config_lcd_manager(dssdev); |
114 | if (r) | ||
115 | goto err_set_dispc_clock_div; | ||
116 | 107 | ||
117 | dss_sdi_init(dssdev->phy.sdi.datapairs); | 108 | dss_sdi_init(dssdev->phy.sdi.datapairs); |
118 | r = dss_sdi_enable(); | 109 | r = dss_sdi_enable(); |
@@ -129,7 +120,6 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) | |||
129 | err_mgr_enable: | 120 | err_mgr_enable: |
130 | dss_sdi_disable(); | 121 | dss_sdi_disable(); |
131 | err_sdi_enable: | 122 | err_sdi_enable: |
132 | err_set_dispc_clock_div: | ||
133 | err_set_dss_clock_div: | 123 | err_set_dss_clock_div: |
134 | err_calc_clock_div: | 124 | err_calc_clock_div: |
135 | dispc_runtime_put(); | 125 | dispc_runtime_put(); |