diff options
Diffstat (limited to 'drivers/video/omap2/dss/hdmi.c')
-rw-r--r-- | drivers/video/omap2/dss/hdmi.c | 278 |
1 files changed, 126 insertions, 152 deletions
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index a36b934b2db4..c4b4f6950a92 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c | |||
@@ -58,8 +58,6 @@ | |||
58 | #define EDID_SIZE_BLOCK0_TIMING_DESCRIPTOR 4 | 58 | #define EDID_SIZE_BLOCK0_TIMING_DESCRIPTOR 4 |
59 | #define EDID_SIZE_BLOCK1_TIMING_DESCRIPTOR 4 | 59 | #define EDID_SIZE_BLOCK1_TIMING_DESCRIPTOR 4 |
60 | 60 | ||
61 | #define OMAP_HDMI_TIMINGS_NB 34 | ||
62 | |||
63 | #define HDMI_DEFAULT_REGN 16 | 61 | #define HDMI_DEFAULT_REGN 16 |
64 | #define HDMI_DEFAULT_REGM2 1 | 62 | #define HDMI_DEFAULT_REGM2 1 |
65 | 63 | ||
@@ -68,8 +66,6 @@ static struct { | |||
68 | struct omap_display_platform_data *pdata; | 66 | struct omap_display_platform_data *pdata; |
69 | struct platform_device *pdev; | 67 | struct platform_device *pdev; |
70 | struct hdmi_ip_data ip_data; | 68 | struct hdmi_ip_data ip_data; |
71 | int code; | ||
72 | int mode; | ||
73 | 69 | ||
74 | struct clk *sys_clk; | 70 | struct clk *sys_clk; |
75 | } hdmi; | 71 | } hdmi; |
@@ -88,77 +84,46 @@ static struct { | |||
88 | * map it to corresponding CEA or VESA index. | 84 | * map it to corresponding CEA or VESA index. |
89 | */ | 85 | */ |
90 | 86 | ||
91 | static const struct hdmi_timings cea_vesa_timings[OMAP_HDMI_TIMINGS_NB] = { | 87 | static const struct hdmi_config cea_timings[] = { |
92 | { {640, 480, 25200, 96, 16, 48, 2, 10, 33} , 0 , 0}, | 88 | { {640, 480, 25200, 96, 16, 48, 2, 10, 33, 0, 0, 0}, {1, HDMI_HDMI} }, |
93 | { {1280, 720, 74250, 40, 440, 220, 5, 5, 20}, 1, 1}, | 89 | { {720, 480, 27027, 62, 16, 60, 6, 9, 30, 0, 0, 0}, {2, HDMI_HDMI} }, |
94 | { {1280, 720, 74250, 40, 110, 220, 5, 5, 20}, 1, 1}, | 90 | { {1280, 720, 74250, 40, 110, 220, 5, 5, 20, 1, 1, 0}, {4, HDMI_HDMI} }, |
95 | { {720, 480, 27027, 62, 16, 60, 6, 9, 30}, 0, 0}, | 91 | { {1920, 540, 74250, 44, 88, 148, 5, 2, 15, 1, 1, 1}, {5, HDMI_HDMI} }, |
96 | { {2880, 576, 108000, 256, 48, 272, 5, 5, 39}, 0, 0}, | 92 | { {1440, 240, 27027, 124, 38, 114, 3, 4, 15, 0, 0, 1}, {6, HDMI_HDMI} }, |
97 | { {1440, 240, 27027, 124, 38, 114, 3, 4, 15}, 0, 0}, | 93 | { {1920, 1080, 148500, 44, 88, 148, 5, 4, 36, 1, 1, 0}, {16, HDMI_HDMI} }, |
98 | { {1440, 288, 27000, 126, 24, 138, 3, 2, 19}, 0, 0}, | 94 | { {720, 576, 27000, 64, 12, 68, 5, 5, 39, 0, 0, 0}, {17, HDMI_HDMI} }, |
99 | { {1920, 540, 74250, 44, 528, 148, 5, 2, 15}, 1, 1}, | 95 | { {1280, 720, 74250, 40, 440, 220, 5, 5, 20, 1, 1, 0}, {19, HDMI_HDMI} }, |
100 | { {1920, 540, 74250, 44, 88, 148, 5, 2, 15}, 1, 1}, | 96 | { {1920, 540, 74250, 44, 528, 148, 5, 2, 15, 1, 1, 1}, {20, HDMI_HDMI} }, |
101 | { {1920, 1080, 148500, 44, 88, 148, 5, 4, 36}, 1, 1}, | 97 | { {1440, 288, 27000, 126, 24, 138, 3, 2, 19, 0, 0, 1}, {21, HDMI_HDMI} }, |
102 | { {720, 576, 27000, 64, 12, 68, 5, 5, 39}, 0, 0}, | 98 | { {1440, 576, 54000, 128, 24, 136, 5, 5, 39, 0, 0, 0}, {29, HDMI_HDMI} }, |
103 | { {1440, 576, 54000, 128, 24, 136, 5, 5, 39}, 0, 0}, | 99 | { {1920, 1080, 148500, 44, 528, 148, 5, 4, 36, 1, 1, 0}, {31, HDMI_HDMI} }, |
104 | { {1920, 1080, 148500, 44, 528, 148, 5, 4, 36}, 1, 1}, | 100 | { {1920, 1080, 74250, 44, 638, 148, 5, 4, 36, 1, 1, 0}, {32, HDMI_HDMI} }, |
105 | { {2880, 480, 108108, 248, 64, 240, 6, 9, 30}, 0, 0}, | 101 | { {2880, 480, 108108, 248, 64, 240, 6, 9, 30, 0, 0, 0}, {35, HDMI_HDMI} }, |
106 | { {1920, 1080, 74250, 44, 638, 148, 5, 4, 36}, 1, 1}, | 102 | { {2880, 576, 108000, 256, 48, 272, 5, 5, 39, 0, 0, 0}, {37, HDMI_HDMI} }, |
107 | /* VESA From Here */ | ||
108 | { {640, 480, 25175, 96, 16, 48, 2 , 11, 31}, 0, 0}, | ||
109 | { {800, 600, 40000, 128, 40, 88, 4 , 1, 23}, 1, 1}, | ||
110 | { {848, 480, 33750, 112, 16, 112, 8 , 6, 23}, 1, 1}, | ||
111 | { {1280, 768, 79500, 128, 64, 192, 7 , 3, 20}, 1, 0}, | ||
112 | { {1280, 800, 83500, 128, 72, 200, 6 , 3, 22}, 1, 0}, | ||
113 | { {1360, 768, 85500, 112, 64, 256, 6 , 3, 18}, 1, 1}, | ||
114 | { {1280, 960, 108000, 112, 96, 312, 3 , 1, 36}, 1, 1}, | ||
115 | { {1280, 1024, 108000, 112, 48, 248, 3 , 1, 38}, 1, 1}, | ||
116 | { {1024, 768, 65000, 136, 24, 160, 6, 3, 29}, 0, 0}, | ||
117 | { {1400, 1050, 121750, 144, 88, 232, 4, 3, 32}, 1, 0}, | ||
118 | { {1440, 900, 106500, 152, 80, 232, 6, 3, 25}, 1, 0}, | ||
119 | { {1680, 1050, 146250, 176 , 104, 280, 6, 3, 30}, 1, 0}, | ||
120 | { {1366, 768, 85500, 143, 70, 213, 3, 3, 24}, 1, 1}, | ||
121 | { {1920, 1080, 148500, 44, 148, 80, 5, 4, 36}, 1, 1}, | ||
122 | { {1280, 768, 68250, 32, 48, 80, 7, 3, 12}, 0, 1}, | ||
123 | { {1400, 1050, 101000, 32, 48, 80, 4, 3, 23}, 0, 1}, | ||
124 | { {1680, 1050, 119000, 32, 48, 80, 6, 3, 21}, 0, 1}, | ||
125 | { {1280, 800, 79500, 32, 48, 80, 6, 3, 14}, 0, 1}, | ||
126 | { {1280, 720, 74250, 40, 110, 220, 5, 5, 20}, 1, 1} | ||
127 | }; | ||
128 | |||
129 | /* | ||
130 | * This is a static mapping array which maps the timing values | ||
131 | * with corresponding CEA / VESA code | ||
132 | */ | ||
133 | static const int code_index[OMAP_HDMI_TIMINGS_NB] = { | ||
134 | 1, 19, 4, 2, 37, 6, 21, 20, 5, 16, 17, 29, 31, 35, 32, | ||
135 | /* <--15 CEA 17--> vesa*/ | ||
136 | 4, 9, 0xE, 0x17, 0x1C, 0x27, 0x20, 0x23, 0x10, 0x2A, | ||
137 | 0X2F, 0x3A, 0X51, 0X52, 0x16, 0x29, 0x39, 0x1B | ||
138 | }; | 103 | }; |
139 | 104 | static const struct hdmi_config vesa_timings[] = { | |
140 | /* | 105 | /* VESA From Here */ |
141 | * This is reverse static mapping which maps the CEA / VESA code | 106 | { {640, 480, 25175, 96, 16, 48, 2 , 11, 31, 0, 0, 0}, {4, HDMI_DVI} }, |
142 | * to the corresponding timing values | 107 | { {800, 600, 40000, 128, 40, 88, 4 , 1, 23, 1, 1, 0}, {9, HDMI_DVI} }, |
143 | */ | 108 | { {848, 480, 33750, 112, 16, 112, 8 , 6, 23, 1, 1, 0}, {0xE, HDMI_DVI} }, |
144 | static const int code_cea[39] = { | 109 | { {1280, 768, 79500, 128, 64, 192, 7 , 3, 20, 1, 0, 0}, {0x17, HDMI_DVI} }, |
145 | -1, 0, 3, 3, 2, 8, 5, 5, -1, -1, | 110 | { {1280, 800, 83500, 128, 72, 200, 6 , 3, 22, 1, 0, 0}, {0x1C, HDMI_DVI} }, |
146 | -1, -1, -1, -1, -1, -1, 9, 10, 10, 1, | 111 | { {1360, 768, 85500, 112, 64, 256, 6 , 3, 18, 1, 1, 0}, {0x27, HDMI_DVI} }, |
147 | 7, 6, 6, -1, -1, -1, -1, -1, -1, 11, | 112 | { {1280, 960, 108000, 112, 96, 312, 3 , 1, 36, 1, 1, 0}, {0x20, HDMI_DVI} }, |
148 | 11, 12, 14, -1, -1, 13, 13, 4, 4 | 113 | { {1280, 1024, 108000, 112, 48, 248, 3 , 1, 38, 1, 1, 0}, {0x23, HDMI_DVI} }, |
114 | { {1024, 768, 65000, 136, 24, 160, 6, 3, 29, 0, 0, 0}, {0x10, HDMI_DVI} }, | ||
115 | { {1400, 1050, 121750, 144, 88, 232, 4, 3, 32, 1, 0, 0}, {0x2A, HDMI_DVI} }, | ||
116 | { {1440, 900, 106500, 152, 80, 232, 6, 3, 25, 1, 0, 0}, {0x2F, HDMI_DVI} }, | ||
117 | { {1680, 1050, 146250, 176 , 104, 280, 6, 3, 30, 1, 0, 0}, {0x3A, HDMI_DVI} }, | ||
118 | { {1366, 768, 85500, 143, 70, 213, 3, 3, 24, 1, 1, 0}, {0x51, HDMI_DVI} }, | ||
119 | { {1920, 1080, 148500, 44, 148, 80, 5, 4, 36, 1, 1, 0}, {0x52, HDMI_DVI} }, | ||
120 | { {1280, 768, 68250, 32, 48, 80, 7, 3, 12, 0, 1, 0}, {0x16, HDMI_DVI} }, | ||
121 | { {1400, 1050, 101000, 32, 48, 80, 4, 3, 23, 0, 1, 0}, {0x29, HDMI_DVI} }, | ||
122 | { {1680, 1050, 119000, 32, 48, 80, 6, 3, 21, 0, 1, 0}, {0x39, HDMI_DVI} }, | ||
123 | { {1280, 800, 79500, 32, 48, 80, 6, 3, 14, 0, 1, 0}, {0x1B, HDMI_DVI} }, | ||
124 | { {1280, 720, 74250, 40, 110, 220, 5, 5, 20, 1, 1, 0}, {0x55, HDMI_DVI} } | ||
149 | }; | 125 | }; |
150 | 126 | ||
151 | static const int code_vesa[85] = { | ||
152 | -1, -1, -1, -1, 15, -1, -1, -1, -1, 16, | ||
153 | -1, -1, -1, -1, 17, -1, 23, -1, -1, -1, | ||
154 | -1, -1, 29, 18, -1, -1, -1, 32, 19, -1, | ||
155 | -1, -1, 21, -1, -1, 22, -1, -1, -1, 20, | ||
156 | -1, 30, 24, -1, -1, -1, -1, 25, -1, -1, | ||
157 | -1, -1, -1, -1, -1, -1, -1, 31, 26, -1, | ||
158 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | ||
159 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, | ||
160 | -1, 27, 28, -1, 33}; | ||
161 | |||
162 | static int hdmi_runtime_get(void) | 127 | static int hdmi_runtime_get(void) |
163 | { | 128 | { |
164 | int r; | 129 | int r; |
@@ -210,88 +175,89 @@ int hdmi_init_display(struct omap_dss_device *dssdev) | |||
210 | return 0; | 175 | return 0; |
211 | } | 176 | } |
212 | 177 | ||
213 | static int get_timings_index(void) | 178 | static const struct hdmi_config *hdmi_find_timing( |
179 | const struct hdmi_config *timings_arr, | ||
180 | int len) | ||
214 | { | 181 | { |
215 | int code; | 182 | int i; |
216 | 183 | ||
217 | if (hdmi.mode == 0) | 184 | for (i = 0; i < len; i++) { |
218 | code = code_vesa[hdmi.code]; | 185 | if (timings_arr[i].cm.code == hdmi.ip_data.cfg.cm.code) |
219 | else | 186 | return &timings_arr[i]; |
220 | code = code_cea[hdmi.code]; | 187 | } |
188 | return NULL; | ||
189 | } | ||
221 | 190 | ||
222 | if (code == -1) { | 191 | static const struct hdmi_config *hdmi_get_timings(void) |
223 | /* HDMI code 4 corresponds to 640 * 480 VGA */ | 192 | { |
224 | hdmi.code = 4; | 193 | const struct hdmi_config *arr; |
225 | /* DVI mode 1 corresponds to HDMI 0 to DVI */ | 194 | int len; |
226 | hdmi.mode = HDMI_DVI; | 195 | |
196 | if (hdmi.ip_data.cfg.cm.mode == HDMI_DVI) { | ||
197 | arr = vesa_timings; | ||
198 | len = ARRAY_SIZE(vesa_timings); | ||
199 | } else { | ||
200 | arr = cea_timings; | ||
201 | len = ARRAY_SIZE(cea_timings); | ||
202 | } | ||
203 | |||
204 | return hdmi_find_timing(arr, len); | ||
205 | } | ||
206 | |||
207 | static bool hdmi_timings_compare(struct omap_video_timings *timing1, | ||
208 | const struct hdmi_video_timings *timing2) | ||
209 | { | ||
210 | int timing1_vsync, timing1_hsync, timing2_vsync, timing2_hsync; | ||
227 | 211 | ||
228 | code = code_vesa[hdmi.code]; | 212 | if ((timing2->pixel_clock == timing1->pixel_clock) && |
213 | (timing2->x_res == timing1->x_res) && | ||
214 | (timing2->y_res == timing1->y_res)) { | ||
215 | |||
216 | timing2_hsync = timing2->hfp + timing2->hsw + timing2->hbp; | ||
217 | timing1_hsync = timing1->hfp + timing1->hsw + timing1->hbp; | ||
218 | timing2_vsync = timing2->vfp + timing2->vsw + timing2->vbp; | ||
219 | timing1_vsync = timing2->vfp + timing2->vsw + timing2->vbp; | ||
220 | |||
221 | DSSDBG("timing1_hsync = %d timing1_vsync = %d"\ | ||
222 | "timing2_hsync = %d timing2_vsync = %d\n", | ||
223 | timing1_hsync, timing1_vsync, | ||
224 | timing2_hsync, timing2_vsync); | ||
225 | |||
226 | if ((timing1_hsync == timing2_hsync) && | ||
227 | (timing1_vsync == timing2_vsync)) { | ||
228 | return true; | ||
229 | } | ||
229 | } | 230 | } |
230 | return code; | 231 | return false; |
231 | } | 232 | } |
232 | 233 | ||
233 | static struct hdmi_cm hdmi_get_code(struct omap_video_timings *timing) | 234 | static struct hdmi_cm hdmi_get_code(struct omap_video_timings *timing) |
234 | { | 235 | { |
235 | int i = 0, code = -1, temp_vsync = 0, temp_hsync = 0; | 236 | int i; |
236 | int timing_vsync = 0, timing_hsync = 0; | ||
237 | struct hdmi_video_timings temp; | ||
238 | struct hdmi_cm cm = {-1}; | 237 | struct hdmi_cm cm = {-1}; |
239 | DSSDBG("hdmi_get_code\n"); | 238 | DSSDBG("hdmi_get_code\n"); |
240 | 239 | ||
241 | for (i = 0; i < OMAP_HDMI_TIMINGS_NB; i++) { | 240 | for (i = 0; i < ARRAY_SIZE(cea_timings); i++) { |
242 | temp = cea_vesa_timings[i].timings; | 241 | if (hdmi_timings_compare(timing, &cea_timings[i].timings)) { |
243 | if ((temp.pixel_clock == timing->pixel_clock) && | 242 | cm = cea_timings[i].cm; |
244 | (temp.x_res == timing->x_res) && | 243 | goto end; |
245 | (temp.y_res == timing->y_res)) { | 244 | } |
246 | 245 | } | |
247 | temp_hsync = temp.hfp + temp.hsw + temp.hbp; | 246 | for (i = 0; i < ARRAY_SIZE(vesa_timings); i++) { |
248 | timing_hsync = timing->hfp + timing->hsw + timing->hbp; | 247 | if (hdmi_timings_compare(timing, &vesa_timings[i].timings)) { |
249 | temp_vsync = temp.vfp + temp.vsw + temp.vbp; | 248 | cm = vesa_timings[i].cm; |
250 | timing_vsync = timing->vfp + timing->vsw + timing->vbp; | 249 | goto end; |
251 | |||
252 | DSSDBG("temp_hsync = %d , temp_vsync = %d" | ||
253 | "timing_hsync = %d, timing_vsync = %d\n", | ||
254 | temp_hsync, temp_hsync, | ||
255 | timing_hsync, timing_vsync); | ||
256 | |||
257 | if ((temp_hsync == timing_hsync) && | ||
258 | (temp_vsync == timing_vsync)) { | ||
259 | code = i; | ||
260 | cm.code = code_index[i]; | ||
261 | if (code < 14) | ||
262 | cm.mode = HDMI_HDMI; | ||
263 | else | ||
264 | cm.mode = HDMI_DVI; | ||
265 | DSSDBG("Hdmi_code = %d mode = %d\n", | ||
266 | cm.code, cm.mode); | ||
267 | break; | ||
268 | } | ||
269 | } | 250 | } |
270 | } | 251 | } |
271 | 252 | ||
272 | return cm; | 253 | end: return cm; |
273 | } | ||
274 | 254 | ||
275 | static void update_hdmi_timings(struct hdmi_config *cfg, | ||
276 | struct omap_video_timings *timings, int code) | ||
277 | { | ||
278 | cfg->timings.timings.x_res = timings->x_res; | ||
279 | cfg->timings.timings.y_res = timings->y_res; | ||
280 | cfg->timings.timings.hbp = timings->hbp; | ||
281 | cfg->timings.timings.hfp = timings->hfp; | ||
282 | cfg->timings.timings.hsw = timings->hsw; | ||
283 | cfg->timings.timings.vbp = timings->vbp; | ||
284 | cfg->timings.timings.vfp = timings->vfp; | ||
285 | cfg->timings.timings.vsw = timings->vsw; | ||
286 | cfg->timings.timings.pixel_clock = timings->pixel_clock; | ||
287 | cfg->timings.vsync_pol = cea_vesa_timings[code].vsync_pol; | ||
288 | cfg->timings.hsync_pol = cea_vesa_timings[code].hsync_pol; | ||
289 | } | 255 | } |
290 | 256 | ||
291 | unsigned long hdmi_get_pixel_clock(void) | 257 | unsigned long hdmi_get_pixel_clock(void) |
292 | { | 258 | { |
293 | /* HDMI Pixel Clock in Mhz */ | 259 | /* HDMI Pixel Clock in Mhz */ |
294 | return hdmi.ip_data.cfg.timings.timings.pixel_clock * 1000; | 260 | return hdmi.ip_data.cfg.timings.pixel_clock * 1000; |
295 | } | 261 | } |
296 | 262 | ||
297 | static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy, | 263 | static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy, |
@@ -312,24 +278,24 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy, | |||
312 | 278 | ||
313 | refclk = clkin / pi->regn; | 279 | refclk = clkin / pi->regn; |
314 | 280 | ||
315 | /* | ||
316 | * multiplier is pixel_clk/ref_clk | ||
317 | * Multiplying by 100 to avoid fractional part removal | ||
318 | */ | ||
319 | pi->regm = (phy * 100 / (refclk)) / 100; | ||
320 | |||
321 | if (dssdev->clocks.hdmi.regm2 == 0) | 281 | if (dssdev->clocks.hdmi.regm2 == 0) |
322 | pi->regm2 = HDMI_DEFAULT_REGM2; | 282 | pi->regm2 = HDMI_DEFAULT_REGM2; |
323 | else | 283 | else |
324 | pi->regm2 = dssdev->clocks.hdmi.regm2; | 284 | pi->regm2 = dssdev->clocks.hdmi.regm2; |
325 | 285 | ||
326 | /* | 286 | /* |
287 | * multiplier is pixel_clk/ref_clk | ||
288 | * Multiplying by 100 to avoid fractional part removal | ||
289 | */ | ||
290 | pi->regm = phy * pi->regm2 / refclk; | ||
291 | |||
292 | /* | ||
327 | * fractional multiplier is remainder of the difference between | 293 | * fractional multiplier is remainder of the difference between |
328 | * multiplier and actual phy(required pixel clock thus should be | 294 | * multiplier and actual phy(required pixel clock thus should be |
329 | * multiplied by 2^18(262144) divided by the reference clock | 295 | * multiplied by 2^18(262144) divided by the reference clock |
330 | */ | 296 | */ |
331 | mf = (phy - pi->regm * refclk) * 262144; | 297 | mf = (phy - pi->regm / pi->regm2 * refclk) * 262144; |
332 | pi->regmf = mf / (refclk); | 298 | pi->regmf = pi->regm2 * mf / refclk; |
333 | 299 | ||
334 | /* | 300 | /* |
335 | * Dcofreq should be set to 1 if required pixel clock | 301 | * Dcofreq should be set to 1 if required pixel clock |
@@ -347,7 +313,8 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy, | |||
347 | 313 | ||
348 | static int hdmi_power_on(struct omap_dss_device *dssdev) | 314 | static int hdmi_power_on(struct omap_dss_device *dssdev) |
349 | { | 315 | { |
350 | int r, code = 0; | 316 | int r; |
317 | const struct hdmi_config *timing; | ||
351 | struct omap_video_timings *p; | 318 | struct omap_video_timings *p; |
352 | unsigned long phy; | 319 | unsigned long phy; |
353 | 320 | ||
@@ -363,9 +330,16 @@ static int hdmi_power_on(struct omap_dss_device *dssdev) | |||
363 | dssdev->panel.timings.x_res, | 330 | dssdev->panel.timings.x_res, |
364 | dssdev->panel.timings.y_res); | 331 | dssdev->panel.timings.y_res); |
365 | 332 | ||
366 | code = get_timings_index(); | 333 | timing = hdmi_get_timings(); |
367 | update_hdmi_timings(&hdmi.ip_data.cfg, p, code); | 334 | if (timing == NULL) { |
368 | 335 | /* HDMI code 4 corresponds to 640 * 480 VGA */ | |
336 | hdmi.ip_data.cfg.cm.code = 4; | ||
337 | /* DVI mode 1 corresponds to HDMI 0 to DVI */ | ||
338 | hdmi.ip_data.cfg.cm.mode = HDMI_DVI; | ||
339 | hdmi.ip_data.cfg = vesa_timings[0]; | ||
340 | } else { | ||
341 | hdmi.ip_data.cfg = *timing; | ||
342 | } | ||
369 | phy = p->pixel_clock; | 343 | phy = p->pixel_clock; |
370 | 344 | ||
371 | hdmi_compute_pll(dssdev, phy, &hdmi.ip_data.pll_data); | 345 | hdmi_compute_pll(dssdev, phy, &hdmi.ip_data.pll_data); |
@@ -385,8 +359,6 @@ static int hdmi_power_on(struct omap_dss_device *dssdev) | |||
385 | goto err; | 359 | goto err; |
386 | } | 360 | } |
387 | 361 | ||
388 | hdmi.ip_data.cfg.cm.mode = hdmi.mode; | ||
389 | hdmi.ip_data.cfg.cm.code = hdmi.code; | ||
390 | hdmi.ip_data.ops->video_configure(&hdmi.ip_data); | 362 | hdmi.ip_data.ops->video_configure(&hdmi.ip_data); |
391 | 363 | ||
392 | /* Make selection of HDMI in DSS */ | 364 | /* Make selection of HDMI in DSS */ |
@@ -453,8 +425,8 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev) | |||
453 | struct hdmi_cm cm; | 425 | struct hdmi_cm cm; |
454 | 426 | ||
455 | cm = hdmi_get_code(&dssdev->panel.timings); | 427 | cm = hdmi_get_code(&dssdev->panel.timings); |
456 | hdmi.code = cm.code; | 428 | hdmi.ip_data.cfg.cm.code = cm.code; |
457 | hdmi.mode = cm.mode; | 429 | hdmi.ip_data.cfg.cm.mode = cm.mode; |
458 | 430 | ||
459 | if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) { | 431 | if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) { |
460 | int r; | 432 | int r; |
@@ -717,13 +689,15 @@ static int hdmi_audio_hw_params(struct snd_pcm_substream *substream, | |||
717 | if (dss_has_feature(FEAT_HDMI_CTS_SWMODE)) { | 689 | if (dss_has_feature(FEAT_HDMI_CTS_SWMODE)) { |
718 | core_cfg.aud_par_busclk = 0; | 690 | core_cfg.aud_par_busclk = 0; |
719 | core_cfg.cts_mode = HDMI_AUDIO_CTS_MODE_SW; | 691 | core_cfg.cts_mode = HDMI_AUDIO_CTS_MODE_SW; |
720 | core_cfg.use_mclk = false; | 692 | core_cfg.use_mclk = dss_has_feature(FEAT_HDMI_AUDIO_USE_MCLK); |
721 | } else { | 693 | } else { |
722 | core_cfg.aud_par_busclk = (((128 * 31) - 1) << 8); | 694 | core_cfg.aud_par_busclk = (((128 * 31) - 1) << 8); |
723 | core_cfg.cts_mode = HDMI_AUDIO_CTS_MODE_HW; | 695 | core_cfg.cts_mode = HDMI_AUDIO_CTS_MODE_HW; |
724 | core_cfg.use_mclk = true; | 696 | core_cfg.use_mclk = true; |
725 | core_cfg.mclk_mode = HDMI_AUDIO_MCLK_128FS; | ||
726 | } | 697 | } |
698 | |||
699 | if (core_cfg.use_mclk) | ||
700 | core_cfg.mclk_mode = HDMI_AUDIO_MCLK_128FS; | ||
727 | core_cfg.layout = HDMI_AUDIO_LAYOUT_2CH; | 701 | core_cfg.layout = HDMI_AUDIO_LAYOUT_2CH; |
728 | core_cfg.en_spdif = false; | 702 | core_cfg.en_spdif = false; |
729 | /* Use sample frequency from channel status word */ | 703 | /* Use sample frequency from channel status word */ |
@@ -756,7 +730,7 @@ static int hdmi_audio_hw_params(struct snd_pcm_substream *substream, | |||
756 | static int hdmi_audio_startup(struct snd_pcm_substream *substream, | 730 | static int hdmi_audio_startup(struct snd_pcm_substream *substream, |
757 | struct snd_soc_dai *dai) | 731 | struct snd_soc_dai *dai) |
758 | { | 732 | { |
759 | if (!hdmi.mode) { | 733 | if (!hdmi.ip_data.cfg.cm.mode) { |
760 | pr_err("Current video settings do not support audio.\n"); | 734 | pr_err("Current video settings do not support audio.\n"); |
761 | return -EIO; | 735 | return -EIO; |
762 | } | 736 | } |