linux-ti33x-psp 3.2: i2c and cape fixes
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / beaglebone / 0059-beaglebone-fix-pin-free-thinko-this-method-doesn-t-g.patch
1 From f0f728e400d0512788e59a2d7a17e3aa8584c033 Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@dominion.thruhere.net>
3 Date: Tue, 22 May 2012 11:00:00 +0200
4 Subject: [PATCH 59/61] beaglebone: fix pin-free thinko, this method doesn't
5  get called when there's a cape at 0x57
7 Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
8 ---
9  arch/arm/mach-omap2/board-am335xevm.c |   46 +++++++++++++++------------------
10  1 files changed, 21 insertions(+), 25 deletions(-)
12 diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
13 index b079279..dfe8df5 100644
14 --- a/arch/arm/mach-omap2/board-am335xevm.c
15 +++ b/arch/arm/mach-omap2/board-am335xevm.c
16 @@ -2542,25 +2542,6 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
17         ret = mem_acc->read(mem_acc, (char *)&cape_config, 0, sizeof(cape_config));
18         if (ret != sizeof(cape_config)) {
19                 pr_warning("BeagleBone cape EEPROM: could not read eeprom at address 0x%x\n", capecount + 0x53);
20 -               if (capecount > 3) {
21 -                       if (beaglebone_tsadcpins_free == 1) {
22 -                               pr_info("BeagleBone cape: exporting ADC pins to sysfs\n");
23 -                               bone_tsc_init(0,0);
24 -                               beaglebone_tsadcpins_free = 0;
25 -                       }
26 -                       if (beaglebone_leds_free == 1) {
27 -                               boneleds_init(0,0);
28 -                       }
29 -                       if(beaglebone_spi1_free == 1) {
30 -                               beaglebone_spi1_free = 0;
31 -                               pr_info("BeagleBone cape: exporting SPI pins as spidev\n");
32 -                               setup_pin_mux(spi1_pin_mux);
33 -                               spi_register_board_info(bone_spidev2_info, ARRAY_SIZE(bone_spidev2_info));
34 -                       }
35 -                       if(beaglebone_w1gpio_free == 1) {
36 -                               bonew1_gpio_init(0,0);
37 -                       }
38 -               }
39                 return;
40         }
41  
42 @@ -2693,12 +2674,27 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
43                 pr_info("BeagleBone cape: recognized Camera cape\n");
44                 beaglebone_w1gpio_free = 0;
45         }
46 -       
47 -       if ((capecount > 3) && (beaglebone_tsadcpins_free == 1)) {
48 -               pr_info("BeagleBone cape: exporting ADC pins to sysfs\n");
49 -               bone_tsc_init(0,0);
50 -               beaglebone_tsadcpins_free = 0;
51 -       }
52 +
53 +       if (capecount > 3) {
54 +               if (beaglebone_tsadcpins_free == 1) {
55 +                       pr_info("BeagleBone cape: exporting ADC pins to sysfs\n");
56 +                       bone_tsc_init(0,0);
57 +                       beaglebone_tsadcpins_free = 0;
58 +               }
59 +               if (beaglebone_leds_free == 1) {
60 +                       pr_info("Beaglebone: initializing onboard LEDs");
61 +                       boneleds_init(0,0);
62 +               }
63 +               if(beaglebone_spi1_free == 1) {
64 +                       beaglebone_spi1_free = 0;
65 +                       pr_info("BeagleBone cape: exporting SPI pins as spidev\n");
66 +                       setup_pin_mux(spi1_pin_mux);
67 +                       spi_register_board_info(bone_spidev2_info, ARRAY_SIZE(bone_spidev2_info));
68 +               }
69 +               if(beaglebone_w1gpio_free == 1) {
70 +                       bonew1_gpio_init(0,0);
71 +               }
72 +       }       
73         
74         return;
75  out:
76 -- 
77 1.7.7.6