aboutsummaryrefslogtreecommitdiff
path: root/recipes/linux/linux-omap-psp-2.6.32/beagleboard-xmc/0008-omap3-beagle-cleaned-up-board-revision-conditions.patch
blob: 513a1019c22059135203424bef1017501d7fd9e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
From 8bd3ffb5755c49aaffecb20b9bd43f955ac26251 Mon Sep 17 00:00:00 2001
From: Jason Kridner <jkridner@beagleboard.org>
Date: Wed, 16 Mar 2011 09:21:06 -0500
Subject: [PATCH 08/10] omap3: beagle: cleaned up board revision conditions

---
 arch/arm/mach-omap2/board-omap3beagle.c |   70 ++++++++++++++-----------------
 1 files changed, 32 insertions(+), 38 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 4bde54b..664a9c6 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -191,7 +191,7 @@ enum {
 	OMAP3BEAGLE_BOARD_AXBX,
 	OMAP3BEAGLE_BOARD_C1_3,
 	OMAP3BEAGLE_BOARD_C4,
-	OMAP3BEAGLE_BOARD_XM,
+	OMAP3BEAGLE_BOARD_XMAB,
 	OMAP3BEAGLE_BOARD_XMC,
 };
 
@@ -245,11 +245,11 @@ static void __init omap3_beagle_init_rev(void)
 		break;
 	case 0:
 		printk(KERN_INFO "OMAP3 Beagle Rev: xM A\n");
-		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
+		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMAB;
 		break;
 	case 1:
 		printk(KERN_INFO "OMAP3 Beagle Rev: xM B\n");
-		omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
+		omap3_beagle_version = OMAP3BEAGLE_BOARD_XMAB;
 		break;
 	case 2:
 		printk(KERN_INFO "OMAP3 Beagle Rev: xM C\n");
@@ -458,13 +458,18 @@ static int beagle_twl_gpio_setup(struct device *dev,
 {
 	int r;
 
-	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+	switch(omap3_beagle_get_rev())
+	{
+	case OMAP3BEAGLE_BOARD_XMAB:
+	case OMAP3BEAGLE_BOARD_XMC:
 		mmc[0].gpio_wp = -EINVAL;
-	} else if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C1_3) ||
-		(omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_C4)) {
+		break;
+	case OMAP3BEAGLE_BOARD_C1_3:
+	case OMAP3BEAGLE_BOARD_C4:
 		omap_mux_init_gpio(23, OMAP_PIN_INPUT);
 		mmc[0].gpio_wp = 23;
-	} else {
+		break;
+	default:
 		omap_mux_init_gpio(29, OMAP_PIN_INPUT);
 	}
 	/* gpio + 0 is "mmc0_cd" (input/IRQ) */
@@ -479,7 +484,8 @@ static int beagle_twl_gpio_setup(struct device *dev,
 	 * power switch and overcurrent detect
 	 */
 
-	if (omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XM) {
+	if ((omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XMAB) &&
+		(omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XMC)) {
 		r = gpio_request(gpio + 1, "EHCI_nOC");
 		if (!r) {
 			r = gpio_direction_input(gpio + 1);
@@ -490,54 +496,41 @@ static int beagle_twl_gpio_setup(struct device *dev,
 			pr_err("%s: unable to configure EHCI_nOC\n", __func__);
 	}
 
-	if (cpu_is_omap3630()) {
-		/* Power on DVI, Serial and PWR led */
- 		gpio_request(gpio + 1, "nDVI_PWR_EN");
-		gpio_direction_output(gpio + 1, 0);
-
-		/* Power on camera interface */
-		gpio_request(gpio + 2, "CAM_EN");
-		gpio_direction_output(gpio + 2, 1);
-
-		/* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
-		gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
-		gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1);
-	}
-	else {
-		gpio_request(gpio + 1, "EHCI_nOC");
-		gpio_direction_input(gpio + 1);
-
-		/* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
-		gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
-		gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
-	}
-
 	/*
-	 * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active
+	 * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, xM Ax/Bx active
 	 * high / others active low)
 	 */
 	gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
-	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
+	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XMAB)
 		gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1);
 	else
 		gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
 
 	/* DVI reset GPIO is different between beagle revisions */
-	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM)
-		beagle_dvi_device.reset_gpio = 129;
-	else
+	switch(omap3_beagle_get_rev())
+	{
+	case OMAP3BEAGLE_BOARD_AXBX:
+	case OMAP3BEAGLE_BOARD_C1_3:
+	case OMAP3BEAGLE_BOARD_C4:
 		beagle_dvi_device.reset_gpio = 170;
+		break;
+	case OMAP3BEAGLE_BOARD_XMAB:
+	case OMAP3BEAGLE_BOARD_XMC:
+	default:
+		beagle_dvi_device.reset_gpio = 129;
+	}
 
 	/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
 	gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
 
 	/*
-	 * gpio + 1 on Xm controls the TFP410's enable line (active low)
+	 * gpio + 1 on xM controls the TFP410's enable line (active low)
 	 * gpio + 2 control varies depending on the board rev as follows:
 	 * P7/P8 revisions(prototype): Camera EN
 	 * A2+ revisions (production): LDO (supplies DVI, serial, led blocks)
 	 */
-	if (omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XM) {
+	if ((omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XMAB) ||
+		(omap3_beagle_get_rev() == OMAP3BEAGLE_BOARD_XMC)) {
 		r = gpio_request(gpio + 1, "nDVI_PWR_EN");
 		if (!r) {
 			r = gpio_direction_output(gpio + 1, 0);
@@ -1013,7 +1006,8 @@ static void __init omap3_beagle_init(void)
 	omap3_beagle_init_rev();
 	omap3_beagle_i2c_init();
 
-	if (cpu_is_omap3630()) {
+	if ((omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XMAB) &&
+		(omap3_beagle_get_rev() != OMAP3BEAGLE_BOARD_XMC)) {
 		gpio_buttons[0].gpio = 4;
 	}
 
-- 
1.6.6.1