[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / beaglebone / 0064-beaglebone-always-execute-the-pin-free-checks.patch
1 From b7349f4b517f8736efcc1a2c1469b07d7361ee5f Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@dominion.thruhere.net>
3 Date: Wed, 23 May 2012 17:39:12 +0200
4 Subject: [PATCH 64/79] beaglebone: always execute the pin free checks
6 This code needs to run when there are no capes and when there are capes present.
8 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
9 ---
10 arch/arm/mach-omap2/board-am335xevm.c | 26 +++++++++++++-------------
11 1 file changed, 13 insertions(+), 13 deletions(-)
13 diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
14 index 1f2d1fd..da6020b 100644
15 --- a/arch/arm/mach-omap2/board-am335xevm.c
16 +++ b/arch/arm/mach-omap2/board-am335xevm.c
17 @@ -2589,7 +2589,7 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
18 ret = mem_acc->read(mem_acc, (char *)&cape_config, 0, sizeof(cape_config));
19 if (ret != sizeof(cape_config)) {
20 pr_warning("BeagleBone cape EEPROM: could not read eeprom at address 0x%x\n", capecount + 0x53);
21 - return;
22 + goto out2;
23 }
25 if (cape_config.header != AM335X_EEPROM_HEADER) {
26 @@ -2724,6 +2724,16 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
27 beaglebone_w1gpio_free = 0;
28 }
30 + goto out2;
31 +out:
32 + /*
33 + * If the EEPROM hasn't been programed or an incorrect header
34 + * or board name are read, assume this is an old beaglebone board
35 + * (< Rev A3)
36 + */
37 + pr_err("Could not detect BeagleBone cape properly\n");
38 + beaglebone_cape_detected = false;
39 +out2:
40 if (capecount > 3) {
41 if (beaglebone_tsadcpins_free == 1) {
42 pr_info("BeagleBone cape: exporting ADC pins to sysfs\n");
43 @@ -2741,20 +2751,10 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
44 spi_register_board_info(bone_spidev2_info, ARRAY_SIZE(bone_spidev2_info));
45 }
46 if(beaglebone_w1gpio_free == 1) {
47 + pr_info("BeagleBone cape: initializing w1-gpio\n");
48 bonew1_gpio_init(0,0);
49 }
50 - }
51 -
52 - return;
53 -out:
54 - /*
55 - * If the EEPROM hasn't been programed or an incorrect header
56 - * or board name are read, assume this is an old beaglebone board
57 - * (< Rev A3)
58 - */
59 - pr_err("Could not detect BeagleBone cape properly\n");
60 - beaglebone_cape_detected = false;
61 -
62 + }
63 }
65 static struct at24_platform_data cape_eeprom_info = {
66 --
67 1.7.10