[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-omap / 0001-beagleboard-hack-in-support-from-xM-rev-C.patch
1 From d9c289c5f98bb109aa7a9e5a802638ba89639e70 Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@dominion.thruhere.net>
3 Date: Thu, 10 Mar 2011 13:15:38 +0100
4 Subject: [PATCH] beagleboard: hack in support from xM rev C
6 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
7 ---
8 arch/arm/mach-omap2/board-omap3beagle.c | 20 +++++++++++++-------
9 1 files changed, 13 insertions(+), 7 deletions(-)
11 diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
12 index 6abb79a..731f4b5 100644
13 --- a/arch/arm/mach-omap2/board-omap3beagle.c
14 +++ b/arch/arm/mach-omap2/board-omap3beagle.c
15 @@ -64,6 +64,7 @@
16 * C4 = GPIO173, GPIO172, GPIO171: 1 0 1
17 * XMA = GPIO173, GPIO172, GPIO171: 0 0 0
18 * XMB = GPIO173, GPIO172, GPIO171: 0 0 1
19 + * XMC = GPIO173, GPIO172, GPIO171: 0 1 0
20 */
21 enum {
22 OMAP3BEAGLE_BOARD_UNKN = 0,
23 @@ -71,6 +72,7 @@ enum {
24 OMAP3BEAGLE_BOARD_C1_3,
25 OMAP3BEAGLE_BOARD_C4,
26 OMAP3BEAGLE_BOARD_XM,
27 + OMAP3BEAGLE_BOARD_XMC,
28 };
30 static u8 omap3_beagle_version;
31 @@ -129,9 +131,13 @@ static void __init omap3_beagle_init_rev(void)
32 printk(KERN_INFO "OMAP3 Beagle Rev: xM B\n");
33 omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
34 break;
35 + case 2:
36 + printk(KERN_INFO "OMAP3 Beagle Rev: xM C\n");
37 + omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
38 + break;
39 default:
40 - printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
41 - omap3_beagle_version = OMAP3BEAGLE_BOARD_UNKN;
42 + printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd, assuming xM C or newer\n", beagle_rev);
43 + omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
44 }
46 return;
47 @@ -484,7 +490,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
48 {
49 int r;
51 - if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
52 + if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM || omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XMC) {
53 mmc[0].gpio_wp = -EINVAL;
54 } else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
55 (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
56 @@ -517,7 +523,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
57 /* REVISIT: need ehci-omap hooks for external VBUS
58 * power switch and overcurrent detect
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 r = gpio_request(gpio + 1, "EHCI_nOC");
63 if (!r) {
64 r = gpio_direction_input(gpio + 1);
65 @@ -539,7 +545,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
66 gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
68 /* DVI reset GPIO is different between beagle revisions */
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 beagle_dvi_device.reset_gpio = 129;
72 else
73 beagle_dvi_device.reset_gpio = 170;
74 @@ -553,7 +559,7 @@ static int beagle_twl_gpio_setup(struct device *dev,
75 * P7/P8 revisions(prototype): Camera EN
76 * A2+ revisions (production): LDO (supplies DVI, serial, led blocks)
77 */
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 r = gpio_request(gpio + 1, "nDVI_PWR_EN");
81 if (!r) {
82 r = gpio_direction_output(gpio + 1, 0);
83 @@ -899,7 +905,7 @@ static void __init beagle_opp_init(void)
84 }
86 /* Custom OPP enabled for XM */
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 struct omap_hwmod *mh = omap_hwmod_lookup("mpu");
90 struct omap_hwmod *dh = omap_hwmod_lookup("iva");
91 struct device *dev;
92 --
93 1.6.6.1