Commit 63c4f17b2f8017d22241522a48c765073b8791b0
Committed by
Anatolij Gustschin
1 parent
f109a6e73e
Exists in
master
and in
50 other branches
cm_t35: use scf0403 driver
Use scf0403 driver to add scf0403x LCD support for cm-t35 and cm-t3730 boards. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Showing 3 changed files with 59 additions and 2 deletions Side-by-side Diff
board/compulab/cm_t35/cm_t35.c
... | ... | @@ -268,6 +268,9 @@ |
268 | 268 | /* DVI enable */ |
269 | 269 | MUX_VAL(CP(GPMC_NCS3), (IDIS | PTU | DIS | M4));/*GPMC_nCS3*/ |
270 | 270 | |
271 | + /* DataImage backlight */ | |
272 | + MUX_VAL(CP(GPMC_NCS7), (IDIS | PTU | DIS | M4));/*GPIO_58*/ | |
273 | + | |
271 | 274 | /* CM-T3x Ethernet */ |
272 | 275 | MUX_VAL(CP(GPMC_NCS5), (IDIS | PTU | DIS | M0)); /*GPMC_nCS5*/ |
273 | 276 | MUX_VAL(CP(GPMC_CLK), (IEN | PTD | DIS | M4)); /*GPIO_59*/ |
... | ... | @@ -374,6 +377,15 @@ |
374 | 377 | MUX_VAL(CP(MMC1_DAT1), (IEN | PTU | EN | M0)); /*MMC1_DAT1*/ |
375 | 378 | MUX_VAL(CP(MMC1_DAT2), (IEN | PTU | EN | M0)); /*MMC1_DAT2*/ |
376 | 379 | MUX_VAL(CP(MMC1_DAT3), (IEN | PTU | EN | M0)); /*MMC1_DAT3*/ |
380 | + | |
381 | + /* SPI */ | |
382 | + MUX_VAL(CP(MCBSP1_CLKR), (IEN | PTD | DIS | M1)); /*MCSPI4_CLK*/ | |
383 | + MUX_VAL(CP(MCBSP1_DX), (IEN | PTD | DIS | M1)); /*MCSPI4_SIMO*/ | |
384 | + MUX_VAL(CP(MCBSP1_DR), (IEN | PTD | DIS | M1)); /*MCSPI4_SOMI*/ | |
385 | + MUX_VAL(CP(MCBSP1_FSX), (IEN | PTU | EN | M1)); /*MCSPI4_CS0*/ | |
386 | + | |
387 | + /* display controls */ | |
388 | + MUX_VAL(CP(MCBSP1_FSR), (IDIS | PTU | DIS | M4)); /*GPIO_157*/ | |
377 | 389 | } |
378 | 390 | |
379 | 391 | static void cm_t35_set_muxconf(void) |
board/compulab/common/omap3_display.c
... | ... | @@ -14,6 +14,7 @@ |
14 | 14 | #include <stdio_dev.h> |
15 | 15 | #include <asm/arch/dss.h> |
16 | 16 | #include <lcd.h> |
17 | +#include <scf0403_lcd.h> | |
17 | 18 | #include <asm/arch-omap3/dss.h> |
18 | 19 | |
19 | 20 | DECLARE_GLOBAL_DATA_PTR; |
... | ... | @@ -22,6 +23,7 @@ |
22 | 23 | NONE, |
23 | 24 | DVI, |
24 | 25 | DVI_CUSTOM, |
26 | + DATA_IMAGE, /* #define CONFIG_SCF0403_LCD to use */ | |
25 | 27 | }; |
26 | 28 | |
27 | 29 | #define CMAP_ADDR 0x80100000 |
... | ... | @@ -119,6 +121,18 @@ |
119 | 121 | .gfx_format = GFXFORMAT_RGB16, |
120 | 122 | }; |
121 | 123 | |
124 | +static const struct panel_config preset_dataimage_480X800 = { | |
125 | + .lcd_size = PANEL_LCD_SIZE(480, 800), | |
126 | + .timing_h = DSS_HBP(2) | DSS_HFP(2) | DSS_HSW(2), | |
127 | + .timing_v = DSS_VBP(17) | DSS_VFP(20) | DSS_VSW(3), | |
128 | + .pol_freq = DSS_IVS | DSS_IHS | DSS_IPC | DSS_ONOFF, | |
129 | + .divisor = 10 | (1 << 10), | |
130 | + .data_lines = LCD_INTERFACE_18_BIT, | |
131 | + .panel_type = ACTIVE_DISPLAY, | |
132 | + .load_mode = 2, | |
133 | + .gfx_format = GFXFORMAT_RGB16, | |
134 | +}; | |
135 | + | |
122 | 136 | /* |
123 | 137 | * set_resolution_params() |
124 | 138 | * |
... | ... | @@ -146,6 +160,13 @@ |
146 | 160 | return DVI; |
147 | 161 | } |
148 | 162 | |
163 | +static enum display_type set_dataimage_preset(const struct panel_config preset, | |
164 | + int x_res, int y_res) | |
165 | +{ | |
166 | + set_preset(preset, x_res, y_res); | |
167 | + return DATA_IMAGE; | |
168 | +} | |
169 | + | |
149 | 170 | /* |
150 | 171 | * parse_mode() - parse the mode parameter of custom lcd settings |
151 | 172 | * |
... | ... | @@ -369,6 +390,8 @@ |
369 | 390 | return set_dvi_preset(preset_dvi_1280X960, 1280, 960); |
370 | 391 | else if (!strncmp(displaytype, "dvi1280x1024", 12)) |
371 | 392 | return set_dvi_preset(preset_dvi_1280X1024, 1280, 1024); |
393 | + else if (!strncmp(displaytype, "dataimage480x800", 16)) | |
394 | + return set_dataimage_preset(preset_dataimage_480X800, 480, 800); | |
372 | 395 | |
373 | 396 | return NONE; |
374 | 397 | } |
375 | 398 | |
376 | 399 | |
377 | 400 | |
... | ... | @@ -401,12 +424,31 @@ |
401 | 424 | clrsetbits_le32(&prcm->clksel_dss, 0xF, 3); |
402 | 425 | } |
403 | 426 | |
427 | +#ifdef CONFIG_SCF0403_LCD | |
428 | +static void scf0403_enable(void) | |
429 | +{ | |
430 | + gpio_direction_output(58, 1); | |
431 | + scf0403_init(157); | |
432 | +} | |
433 | +#else | |
434 | +static inline void scf0403_enable(void) {} | |
435 | +#endif | |
436 | + | |
404 | 437 | void lcd_enable(void) |
405 | 438 | { |
406 | - if (lcd_def == DVI || lcd_def == DVI_CUSTOM) { | |
439 | + switch (lcd_def) { | |
440 | + case NONE: | |
441 | + return; | |
442 | + case DVI: | |
443 | + case DVI_CUSTOM: | |
407 | 444 | gpio_direction_output(54, 0); /* Turn on DVI */ |
408 | - omap3_dss_enable(); | |
445 | + break; | |
446 | + case DATA_IMAGE: | |
447 | + scf0403_enable(); | |
448 | + break; | |
409 | 449 | } |
450 | + | |
451 | + omap3_dss_enable(); | |
410 | 452 | } |
411 | 453 | |
412 | 454 | void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue) {} |