summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0059-beaglebone-fix-pin-free-thinko-this-method-doesn-t-g.patch
blob: 1b55abffa523ec0c370f7b25f9158888edbb12f5 (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
From f0f728e400d0512788e59a2d7a17e3aa8584c033 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Tue, 22 May 2012 11:00:00 +0200
Subject: [PATCH 59/61] beaglebone: fix pin-free thinko, this method doesn't
 get called when there's a cape at 0x57

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 arch/arm/mach-omap2/board-am335xevm.c |   46 +++++++++++++++------------------
 1 files changed, 21 insertions(+), 25 deletions(-)

diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
index b079279..dfe8df5 100644
--- a/arch/arm/mach-omap2/board-am335xevm.c
+++ b/arch/arm/mach-omap2/board-am335xevm.c
@@ -2542,25 +2542,6 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
 	ret = mem_acc->read(mem_acc, (char *)&cape_config, 0, sizeof(cape_config));
 	if (ret != sizeof(cape_config)) {
 		pr_warning("BeagleBone cape EEPROM: could not read eeprom at address 0x%x\n", capecount + 0x53);
-		if (capecount > 3) {
-			if (beaglebone_tsadcpins_free == 1) {
-				pr_info("BeagleBone cape: exporting ADC pins to sysfs\n");
-				bone_tsc_init(0,0);
-				beaglebone_tsadcpins_free = 0;
-			}
-			if (beaglebone_leds_free == 1) {
-				boneleds_init(0,0);
-			}
-			if(beaglebone_spi1_free == 1) {
-				beaglebone_spi1_free = 0;
-				pr_info("BeagleBone cape: exporting SPI pins as spidev\n");
-				setup_pin_mux(spi1_pin_mux);
-				spi_register_board_info(bone_spidev2_info, ARRAY_SIZE(bone_spidev2_info));
-			}
-			if(beaglebone_w1gpio_free == 1) {
-				bonew1_gpio_init(0,0);
-			}
-		}
 		return;
 	}
 
@@ -2693,12 +2674,27 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
 		pr_info("BeagleBone cape: recognized Camera cape\n");
 		beaglebone_w1gpio_free = 0;
 	}
-	
-	if ((capecount > 3) && (beaglebone_tsadcpins_free == 1)) {
-		pr_info("BeagleBone cape: exporting ADC pins to sysfs\n");
-		bone_tsc_init(0,0);
-		beaglebone_tsadcpins_free = 0;
-	}
+
+	if (capecount > 3) {
+		if (beaglebone_tsadcpins_free == 1) {
+			pr_info("BeagleBone cape: exporting ADC pins to sysfs\n");
+			bone_tsc_init(0,0);
+			beaglebone_tsadcpins_free = 0;
+		}
+		if (beaglebone_leds_free == 1) {
+			pr_info("Beaglebone: initializing onboard LEDs");
+			boneleds_init(0,0);
+		}
+		if(beaglebone_spi1_free == 1) {
+			beaglebone_spi1_free = 0;
+			pr_info("BeagleBone cape: exporting SPI pins as spidev\n");
+			setup_pin_mux(spi1_pin_mux);
+			spi_register_board_info(bone_spidev2_info, ARRAY_SIZE(bone_spidev2_info));
+		}
+		if(beaglebone_w1gpio_free == 1) {
+			bonew1_gpio_init(0,0);
+		}
+	}	
 	
 	return;
 out:
-- 
1.7.7.6