linux-ti335x-psp: add 3.2 based on 3.2-staging branch
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 0006-more-beaglebone-merges.patch
1 From 873c06849ccdb685b5cab1e6e809eda260427d42 Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@dominion.thruhere.net>
3 Date: Tue, 31 Jan 2012 10:04:03 +0100
4 Subject: [PATCH 06/16] more beaglebone merges
6 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
7 ---
8  arch/arm/mach-omap2/board-am335xevm.c |   63 +++++++++++++++++++++++++++++++--
9  1 files changed, 60 insertions(+), 3 deletions(-)
11 diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
12 index e0c20c5..177ab9e 100644
13 --- a/arch/arm/mach-omap2/board-am335xevm.c
14 +++ b/arch/arm/mach-omap2/board-am335xevm.c
15 @@ -248,6 +248,11 @@ static struct resource tsc_resources[]  = {
16  static struct tsc_data am335x_touchscreen_data  = {
17         .wires  = 4,
18         .x_plate_resistance = 200,
19 +       .mode = TI_TSCADC_TSCMODE,
20 +};
21 +
22 +static struct tsc_data bone_touchscreen_data  = {
23 +       .mode = TI_TSCADC_GENMODE,
24  };
25  
26  static struct platform_device tsc_device = {
27 @@ -260,6 +265,16 @@ static struct platform_device tsc_device = {
28         .resource       = tsc_resources,
29  };
30  
31 +static struct platform_device bone_tsc_device = {
32 +       .name   = "tsc",
33 +       .id     = -1,
34 +       .dev    = {
35 +                       .platform_data  = &bone_touchscreen_data,
36 +       },
37 +       .num_resources  = ARRAY_SIZE(tsc_resources),
38 +       .resource       = tsc_resources,
39 +};
40 +
41  static u8 am335x_iis_serializer_direction1[] = {
42         INACTIVE_MODE,  INACTIVE_MODE,  TX_MODE,        RX_MODE,
43         INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,  INACTIVE_MODE,
44 @@ -404,7 +419,7 @@ static bool beaglebone_cape_detected;
45  static int capecount = 0;
46  static bool beaglebone_tsadcpins_free = 1;
47  
48 -
49 +#define GP_EVM_REV_IS_1_0              0x1
50  #define GP_EVM_REV_IS_1_0A             0x1
51  #define GP_EVM_REV_IS_1_1A             0x2
52  #define GP_EVM_REV_IS_UNKNOWN          0xFF
53 @@ -1000,6 +1015,47 @@ static struct pinmux_config profibus_pin_mux[] = {
54         {NULL, 0},
55  };
56  
57 +/* LEDS - gpio1_21 -> gpio1_24 */
58 +
59 +#define BEAGLEBONE_USR1_LED  GPIO_TO_PIN(1, 21)
60 +#define BEAGLEBONE_USR2_LED  GPIO_TO_PIN(1, 22)
61 +#define BEAGLEBONE_USR3_LED  GPIO_TO_PIN(1, 23)
62 +#define BEAGLEBONE_USR4_LED  GPIO_TO_PIN(1, 24)
63 +
64 +static struct gpio_led bone_gpio_leds[] = {
65 +       {
66 +               .name                   = "beaglebone::usr0",
67 +               .default_trigger        = "heartbeat",
68 +               .gpio                   = BEAGLEBONE_USR1_LED,
69 +       },
70 +       {
71 +               .name                   = "beaglebone::usr1",
72 +               .default_trigger        = "mmc0",
73 +               .gpio                   = BEAGLEBONE_USR2_LED,
74 +       },
75 +       {
76 +               .name                   = "beaglebone::usr2",
77 +               .gpio                   = BEAGLEBONE_USR3_LED,
78 +       },
79 +       {
80 +               .name           = "beaglebone::usr3",
81 +               .gpio           = BEAGLEBONE_USR4_LED,
82 +       },
83 +};
84 +
85 +static struct gpio_led_platform_data bone_gpio_led_info = {
86 +       .leds           = bone_gpio_leds,
87 +       .num_leds       = ARRAY_SIZE(bone_gpio_leds),
88 +};
89 +
90 +static struct platform_device bone_leds_gpio = {
91 +       .name   = "leds-gpio",
92 +       .id     = -1,
93 +       .dev    = {
94 +               .platform_data  = &bone_gpio_led_info,
95 +       },
96 +};
97 +
98  
99  #define BEAGLEBONEDVI_USR0_LED  GPIO_TO_PIN(1, 18)
100  #define BEAGLEBONEDVI_USR1_LED  GPIO_TO_PIN(1, 19)
101 @@ -1703,11 +1759,11 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
102         snprintf(tmp, sizeof(cape_config.partnumber) + 1, "%s", cape_config.partnumber);
103         pr_info("BeagleBone cape partnumber: %s\n", tmp);   
104  
105 -       if (!strncmp("BB-BONE-DVID-01", cape_config.partnumber, 5)) {
106 +       if (!strncmp("BB-BONE-DVID-01", cape_config.partnumber, 15)) {
107                         pr_info("BeagleBone cape: initializing DVI cape\n");
108                         dvi_init(0,0);
109         }
110 -       if (!strncmp("LCD01", cape_config.partnumber, 5)) {
111 +       if (!strncmp("BB-BONE-LCD7-01", cape_config.partnumber, 15)) {
112                 pr_info("BeagleBone cape: initializing LCD cape\n");
113                 bbtoys7lcd_init(0,0);
114                 pr_info("BeagleBone cape: initializing LCD cape touchscreen\n");
115 @@ -2154,6 +2210,7 @@ static void setup_general_purpose_evm(void)
116         pr_info("The board is general purpose EVM in profile %d\n", prof_sel);
117  
118         if (!strncmp("1.1A", config.version, 4)) {
119 +               pr_info("EVM version is %s\n", config.version);
120                 gp_evm_revision = GP_EVM_REV_IS_1_1A;
121         } else if (!strncmp("1.0", config.version, 3)) {
122                 gp_evm_revision = GP_EVM_REV_IS_1_0;
123 -- 
124 1.7.7.5