From 6f82ce8b4cd239aa7b262e0a0b62d42545b9d21b Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 29 Feb 2012 17:25:22 +0100 Subject: [PATCH 26/79] beaglebone: fix 3.5" lcd cape support * proper timings * fix gpio conflict Signed-off-by: Koen Kooi --- arch/arm/mach-omap2/board-am335xevm.c | 42 ++++++++++++++++++++++++++++++++- drivers/video/da8xx-fb.c | 14 +++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c index 36b0c85..127516f 100644 --- a/arch/arm/mach-omap2/board-am335xevm.c +++ b/arch/arm/mach-omap2/board-am335xevm.c @@ -216,6 +216,29 @@ struct da8xx_lcdc_platform_data bbtoys7_pdata = { .type = "TFC_S9700RTWV35TR_01B", }; +static struct lcd_ctrl_config bbtoys35_cfg = { + &bbtoys7_panel, + .ac_bias = 255, + .ac_bias_intrpt = 0, + .dma_burst_sz = 16, + .bpp = 16, + .fdd = 0x80, + .tft_alt_mode = 0, + .stn_565_mode = 0, + .mono_8bit_mode = 0, + .invert_line_clock = 1, + .invert_frm_clock = 1, + .sync_edge = 0, + .sync_ctrl = 1, + .raster_order = 0, +}; + +struct da8xx_lcdc_platform_data bbtoys35_pdata = { + .manu_name = "BBToys", + .controller_data = &bbtoys35_cfg, + .type = "CDTech_S035Q01", +}; + static const struct display_panel dvi_panel = { WVGA, 16, @@ -1488,6 +1511,23 @@ static void bbtoys7lcd_init(int evm_id, int profile) return; } +static void bbtoys35lcd_init(int evm_id, int profile) +{ + setup_pin_mux(bbtoys7_pin_mux); + + // we are being stupid and setting pixclock from here instead of da8xx-fb.c + if (conf_disp_pll(16000000)) { + pr_info("Failed to set pixclock to 16000000, not attempting to" + "register LCD cape\n"); + return; + } + + if (am33xx_register_lcdc(&bbtoys35_pdata)) + pr_info("Failed to register Beagleboardtoys 3.5\" LCD cape device\n"); + + return; +} + #define BEAGLEBONEDVI_PDn GPIO_TO_PIN(1, 7) static void dvi_init(int evm_id, int profile) @@ -2103,7 +2143,7 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context if (!strncmp("BB-BONE-LCD3-01", cape_config.partnumber, 15)) { pr_info("BeagleBone cape: initializing LCD cape\n"); - bbtoys7lcd_init(0,0); + bbtoys35lcd_init(0,0); pr_info("BeagleBone cape: initializing LCD cape touchscreen\n"); tsc_init(0,0); beaglebone_tsadcpins_free = 0; diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index b01f15b..86b19ac 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c @@ -286,6 +286,20 @@ static struct da8xx_panel known_lcd_panels[] = { .pxl_clk = 56000000, .invert_pxl_clk = 0, }, + [4] = { + /* CDTech S035Q01 */ + .name = "CDTech_S035Q01", + .width = 320, + .height = 240, + .hfp = 58, + .hbp = 21, + .hsw = 47, + .vfp = 23, + .vbp = 11, + .vsw = 2, + .pxl_clk = 8000000, + .invert_pxl_clk = 0, + }, }; /* Enable the Raster Engine of the LCD Controller */ -- 1.7.10