[glsdk/meta-ti-glsdk.git] / recipes-bsp / linux / linux-omap-psp-2.6.32 / 0008-ARM-OMAP-beagleboard-pre-export-GPIOs-to-userspace-w.patch
1 From 35b951339ea47b542c548e102768817d4123a24b Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@dominion.thruhere.net>
3 Date: Mon, 3 May 2010 21:38:34 +0200
4 Subject: [PATCH 08/45] ARM: OMAP: beagleboard: pre-export GPIOs to userspace when using a Tincantools trainerboard
6 This really needs a for loop, patches welcome
7 ---
8 arch/arm/mach-omap2/board-omap3beagle.c | 33 ++++++++++++++++++++++++++++++-
9 1 files changed, 32 insertions(+), 1 deletions(-)
11 diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
12 index 8223763..abbc1b2 100644
13 --- a/arch/arm/mach-omap2/board-omap3beagle.c
14 +++ b/arch/arm/mach-omap2/board-omap3beagle.c
15 @@ -706,7 +706,38 @@ static void __init omap3_beagle_init(void)
16 mmc[1].gpio_wp = 141;
17 mmc[1].gpio_cd = 162;
18 }
19 -
20 +
21 + if(!strcmp(expansionboard_name, "trainer"))
22 + {
23 + printk(KERN_INFO "Beagle expansionboard: exporting GPIOs 130-141,162 to userspace\n");
24 + gpio_request(130, "sysfs");
25 + gpio_export(130, 1);
26 + gpio_request(131, "sysfs");
27 + gpio_export(131, 1);
28 + gpio_request(132, "sysfs");
29 + gpio_export(132, 1);
30 + gpio_request(133, "sysfs");
31 + gpio_export(133, 1);
32 + gpio_request(134, "sysfs");
33 + gpio_export(134, 1);
34 + gpio_request(135, "sysfs");
35 + gpio_export(135, 1);
36 + gpio_request(136, "sysfs");
37 + gpio_export(136, 1);
38 + gpio_request(137, "sysfs");
39 + gpio_export(137, 1);
40 + gpio_request(138, "sysfs");
41 + gpio_export(138, 1);
42 + gpio_request(139, "sysfs");
43 + gpio_export(139, 1);
44 + gpio_request(140, "sysfs");
45 + gpio_export(140, 1);
46 + gpio_request(141, "sysfs");
47 + gpio_export(141, 1);
48 + gpio_request(162, "sysfs");
49 + gpio_export(162, 1);
50 + }
51 +
52 usb_musb_init();
53 usb_ehci_init(&ehci_pdata);
54 omap3beagle_flash_init();
55 --
56 1.6.6.1