60ea05545694f79a054ce690caddd1f75b120353
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / beaglebone / 0026-beaglebone-fix-3.5-lcd-cape-support.patch
1 From 23c8aaf1d86378c6d4325b88ec85ac7d8130e86a Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@dominion.thruhere.net>
3 Date: Wed, 29 Feb 2012 17:25:22 +0100
4 Subject: [PATCH 26/33] beaglebone: fix 3.5" lcd cape support
6 * proper timings
7 * fix gpio conflict
9 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
10 ---
11 arch/arm/mach-omap2/board-am335xevm.c | 42 ++++++++++++++++++++++++++++++++-
12 drivers/video/da8xx-fb.c | 14 +++++++++++
13 2 files changed, 55 insertions(+), 1 deletion(-)
15 diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
16 index 36b0c85..127516f 100644
17 --- a/arch/arm/mach-omap2/board-am335xevm.c
18 +++ b/arch/arm/mach-omap2/board-am335xevm.c
19 @@ -216,6 +216,29 @@ struct da8xx_lcdc_platform_data bbtoys7_pdata = {
20 .type = "TFC_S9700RTWV35TR_01B",
21 };
23 +static struct lcd_ctrl_config bbtoys35_cfg = {
24 + &bbtoys7_panel,
25 + .ac_bias = 255,
26 + .ac_bias_intrpt = 0,
27 + .dma_burst_sz = 16,
28 + .bpp = 16,
29 + .fdd = 0x80,
30 + .tft_alt_mode = 0,
31 + .stn_565_mode = 0,
32 + .mono_8bit_mode = 0,
33 + .invert_line_clock = 1,
34 + .invert_frm_clock = 1,
35 + .sync_edge = 0,
36 + .sync_ctrl = 1,
37 + .raster_order = 0,
38 +};
39 +
40 +struct da8xx_lcdc_platform_data bbtoys35_pdata = {
41 + .manu_name = "BBToys",
42 + .controller_data = &bbtoys35_cfg,
43 + .type = "CDTech_S035Q01",
44 +};
45 +
46 static const struct display_panel dvi_panel = {
47 WVGA,
48 16,
49 @@ -1488,6 +1511,23 @@ static void bbtoys7lcd_init(int evm_id, int profile)
50 return;
51 }
53 +static void bbtoys35lcd_init(int evm_id, int profile)
54 +{
55 + setup_pin_mux(bbtoys7_pin_mux);
56 +
57 + // we are being stupid and setting pixclock from here instead of da8xx-fb.c
58 + if (conf_disp_pll(16000000)) {
59 + pr_info("Failed to set pixclock to 16000000, not attempting to"
60 + "register LCD cape\n");
61 + return;
62 + }
63 +
64 + if (am33xx_register_lcdc(&bbtoys35_pdata))
65 + pr_info("Failed to register Beagleboardtoys 3.5\" LCD cape device\n");
66 +
67 + return;
68 +}
69 +
70 #define BEAGLEBONEDVI_PDn GPIO_TO_PIN(1, 7)
72 static void dvi_init(int evm_id, int profile)
73 @@ -2103,7 +2143,7 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
75 if (!strncmp("BB-BONE-LCD3-01", cape_config.partnumber, 15)) {
76 pr_info("BeagleBone cape: initializing LCD cape\n");
77 - bbtoys7lcd_init(0,0);
78 + bbtoys35lcd_init(0,0);
79 pr_info("BeagleBone cape: initializing LCD cape touchscreen\n");
80 tsc_init(0,0);
81 beaglebone_tsadcpins_free = 0;
82 diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
83 index b01f15b..86b19ac 100644
84 --- a/drivers/video/da8xx-fb.c
85 +++ b/drivers/video/da8xx-fb.c
86 @@ -286,6 +286,20 @@ static struct da8xx_panel known_lcd_panels[] = {
87 .pxl_clk = 56000000,
88 .invert_pxl_clk = 0,
89 },
90 + [4] = {
91 + /* CDTech S035Q01 */
92 + .name = "CDTech_S035Q01",
93 + .width = 320,
94 + .height = 240,
95 + .hfp = 58,
96 + .hbp = 21,
97 + .hsw = 47,
98 + .vfp = 23,
99 + .vbp = 11,
100 + .vsw = 2,
101 + .pxl_clk = 8000000,
102 + .invert_pxl_clk = 0,
103 + },
104 };
106 /* Enable the Raster Engine of the LCD Controller */
107 --
108 1.7.10