]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0068-beaglebone-add-support-for-the-4.3-lcd-cape-with-res.patch
linux-ti33x-psp 3.2: switch ADC to 16x averaging, disable 275MHz, add 4.3" LCD support
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / beaglebone / 0068-beaglebone-add-support-for-the-4.3-lcd-cape-with-res.patch
1 From 6b69dbc7cee48dfa9ff281ae918cc468ed38a537 Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@dominion.thruhere.net>
3 Date: Tue, 29 May 2012 14:12:44 +0200
4 Subject: [PATCH 68/68] beaglebone: add support for the 4.3" lcd cape with
5  resistive touchscreen
7 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
8 ---
9  arch/arm/mach-omap2/board-am335xevm.c |   48 +++++++++++++++++++++++++++-----
10  1 files changed, 40 insertions(+), 8 deletions(-)
12 diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
13 index 58c2754..bb6049a 100644
14 --- a/arch/arm/mach-omap2/board-am335xevm.c
15 +++ b/arch/arm/mach-omap2/board-am335xevm.c
16 @@ -272,6 +272,12 @@ struct da8xx_lcdc_platform_data bbtoys35_pdata = {
17         .type                   = "CDTech_S035Q01",
18  };
19  
20 +struct da8xx_lcdc_platform_data bbtoys43_pdata = {
21 +       .manu_name              = "BBToys",
22 +       .controller_data        = &lcd_cfg,
23 +       .type                   = "NHD-4.3-ATXI#-T-1",
24 +};
25 +
26  static const struct display_panel dvi_panel = {
27         WVGA,
28         16,
29 @@ -562,14 +568,14 @@ static struct pinmux_config batterycape_pin_mux[] = {
30         
31  /* Module pin mux for LCDC */
32  static struct pinmux_config lcdc_pin_mux[] = {
33 -       {"gpmc_ad8.lcd_data16",         OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
34 -       {"gpmc_ad9.lcd_data17",         OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
35 -       {"gpmc_ad10.lcd_data18",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
36 -       {"gpmc_ad11.lcd_data19",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
37 -       {"gpmc_ad12.lcd_data20",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
38 -       {"gpmc_ad13.lcd_data21",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
39 -       {"gpmc_ad14.lcd_data22",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
40 -       {"gpmc_ad15.lcd_data23",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
41 +       {"gpmc_ad8.lcd_data23",         OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
42 +       {"gpmc_ad9.lcd_data22",         OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
43 +       {"gpmc_ad10.lcd_data21",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
44 +       {"gpmc_ad11.lcd_data20",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
45 +       {"gpmc_ad12.lcd_data19",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
46 +       {"gpmc_ad13.lcd_data18",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
47 +       {"gpmc_ad14.lcd_data17",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
48 +       {"gpmc_ad15.lcd_data16",        OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT},
49         {NULL, 0},
50  };
51  
52 @@ -1659,6 +1665,24 @@ static void bbtoys35lcd_init(int evm_id, int profile)
53         return;
54  }
55  
56 +static void bbtoys43lcd_init(int evm_id, int profile)
57 +{
58 +       setup_pin_mux(lcdc16_pin_mux);
59 +       setup_pin_mux(lcdc_pin_mux);
60 +       
61 +       // we are being stupid and setting pixclock from here instead of da8xx-fb.c
62 +       if (conf_disp_pll(18000000)) {
63 +               pr_info("Failed to set pixclock to 18000000, not attempting to"
64 +                               "register LCD cape\n");
65 +               return;
66 +       }
67 +       
68 +       if (am33xx_register_lcdc(&bbtoys43_pdata))
69 +               pr_info("Failed to register Beagleboardtoys 4.3\" LCD cape device\n");
70 +       
71 +       return;
72 +}
73 +
74  #define BEAGLEBONEDVI_PDn_A1  GPIO_TO_PIN(1, 7)
75  #define BEAGLEBONEDVI_PDn_A2  GPIO_TO_PIN(1, 31)
76  
77 @@ -2672,6 +2696,14 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
78                 beaglebone_leds_free = 0;
79                 lcd3leds_init(0,0);
80         }
81 +
82 +       if (!strncmp("BB-BONE-LCD4-01", cape_config.partnumber, 15)) {
83 +               pr_info("BeagleBone cape: initializing LCD cape\n");
84 +               bbtoys43lcd_init(0,0);
85 +               pr_info("BeagleBone cape: initializing LCD cape touchscreen\n");
86 +               tsc_init(0,0);
87 +               beaglebone_tsadcpins_free = 0;
88 +       }
89         
90         if (!strncmp("BB-BONE-VGA-01", cape_config.partnumber, 14)) {
91                 pr_info("BeagleBone cape: initializing VGA cape\n");
92 -- 
93 1.7.7.6