]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-omap-2.6.39/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch
linux-omap 2.6.39: refresh patchset
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-omap-2.6.39 / beagle / 0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch
1 From 8fc22425fa39908fd4a9a0f1954b66fecaf2058a Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@dominion.thruhere.net>
3 Date: Fri, 20 May 2011 12:48:37 +0200
4 Subject: [PATCH 1/3] OMAP3: beagle: add support for beagleboard xM revision C
6 The USB enable GPIO has been inverted and the USER button moved.
8 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
9 ---
10  arch/arm/mach-omap2/board-omap3beagle.c |   32 +++++++++++++++++++++++-------
11  1 files changed, 24 insertions(+), 8 deletions(-)
13 diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
14 index 2de4b02..1eb1e8e 100644
15 --- a/arch/arm/mach-omap2/board-omap3beagle.c
16 +++ b/arch/arm/mach-omap2/board-omap3beagle.c
17 @@ -62,7 +62,9 @@
18   *     AXBX    = GPIO173, GPIO172, GPIO171: 1 1 1
19   *     C1_3    = GPIO173, GPIO172, GPIO171: 1 1 0
20   *     C4      = GPIO173, GPIO172, GPIO171: 1 0 1
21 - *     XM      = GPIO173, GPIO172, GPIO171: 0 0 0
22 + *     XMA     = GPIO173, GPIO172, GPIO171: 0 0 0
23 + *     XMB     = GPIO173, GPIO172, GPIO171: 0 0 1
24 + *  XMC = GPIO173, GPIO172, GPIO171: 0 1 0
25   */
26  enum {
27         OMAP3BEAGLE_BOARD_UNKN = 0,
28 @@ -70,6 +72,7 @@ enum {
29         OMAP3BEAGLE_BOARD_C1_3,
30         OMAP3BEAGLE_BOARD_C4,
31         OMAP3BEAGLE_BOARD_XM,
32 +       OMAP3BEAGLE_BOARD_XMC,
33  };
34  
35  static u8 omap3_beagle_version;
36 @@ -124,9 +127,17 @@ static void __init omap3_beagle_init_rev(void)
37                 printk(KERN_INFO "OMAP3 Beagle Rev: xM\n");
38                 omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
39                 break;
40 +       case 1:
41 +               printk(KERN_INFO "OMAP3 Beagle Rev: xM B\n");
42 +               omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
43 +               break;
44 +       case 2:
45 +               printk(KERN_INFO "OMAP3 Beagle Rev: xM C\n");
46 +               omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
47 +               break;
48         default:
49 -               printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
50 -               omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
51 +               printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd, assuming xM C or newer\n", beagle_rev);
52 +               omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
53         }
54  
55         return;
56 @@ -278,7 +289,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
57  {
58         int r;
59  
60 -       if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
61 +       if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM || omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XMC) {
62                 mmc[0].gpio_wp = -EINVAL;
63         } else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
64                 (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
65 @@ -298,7 +309,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
66         /* REVISIT: need ehci-omap hooks for external VBUS
67          * power switch and overcurrent detect
68          */
69 -       if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM) {
70 +       if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM && omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XMC) {
71                 r = gpio_request(gpio + 1, "EHCI_nOC");
72                 if (!r) {
73                         r = gpio_direction_input(gpio + 1);
74 @@ -320,7 +331,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
75                 gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
76  
77         /* DVI reset GPIO is different between beagle revisions */
78 -       if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
79 +       if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM || omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XMC)
80                 beagle_dvi_device.reset_gpio = 129;
81         else
82                 beagle_dvi_device.reset_gpio = 170;
83 @@ -334,7 +345,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
84          * P7/P8 revisions(prototype): Camera EN
85          * A2+ revisions (production): LDO (supplies DVI, serial, led blocks)
86          */
87 -       if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
88 +       if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM || omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XMC) {
89                 r = gpio_request(gpio + 1, "nDVI_PWR_EN");
90                 if (!r) {
91                         r = gpio_direction_output(gpio + 1, 0);
92 @@ -625,7 +636,7 @@ static void __init beagle_opp_init(void)
93         }
94  
95         /* Custom OPP enabled for XM */
96 -       if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
97 +       if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM || omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XMC) {
98                 struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
99                 struct omap_hwmod *dh = omap_hwmod_lookup("iva");
100                 struct device *dev;
101 @@ -665,6 +676,11 @@ static void __init omap3_beagle_init(void)
102         omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
103         omap3_beagle_init_rev();
104         omap3_beagle_i2c_init();
106 +       if (cpu_is_omap3630()) {
107 +               gpio_buttons[0].gpio = 4;
108 +       }
110         platform_add_devices(omap3_beagle_devices,
111                         ARRAY_SIZE(omap3_beagle_devices));
112         omap_display_init(&beagle_dss_data);
113 -- 
114 1.6.6.1