summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-mainline-3.2/beagle/0014-expansion-add-wifi.patch
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2012-05-04 08:40:06 +0200
committerDenys Dmytriyenko <denys@ti.com>2012-05-10 15:28:57 -0400
commitab56c86b96efdea799438b437d7faa139a407fe3 (patch)
tree5bb275f0ef0233b8edbe4bc0c51fc22826115d44 /recipes-kernel/linux/linux-mainline-3.2/beagle/0014-expansion-add-wifi.patch
parent7b8b1fe4b8c56593faeb19413adf44d2acbd730d (diff)
downloadmeta-ti-ab56c86b96efdea799438b437d7faa139a407fe3.tar.gz
linux-mainline 3.2: add support for beagleboard wifi expansion board
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Diffstat (limited to 'recipes-kernel/linux/linux-mainline-3.2/beagle/0014-expansion-add-wifi.patch')
-rw-r--r--recipes-kernel/linux/linux-mainline-3.2/beagle/0014-expansion-add-wifi.patch142
1 files changed, 142 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-mainline-3.2/beagle/0014-expansion-add-wifi.patch b/recipes-kernel/linux/linux-mainline-3.2/beagle/0014-expansion-add-wifi.patch
new file mode 100644
index 00000000..fe175c08
--- /dev/null
+++ b/recipes-kernel/linux/linux-mainline-3.2/beagle/0014-expansion-add-wifi.patch
@@ -0,0 +1,142 @@
1From cd3ddffcde4c2b2c8c66389abed3b890b12f31c2 Mon Sep 17 00:00:00 2001
2From: Robert Nelson <robertcnelson@gmail.com>
3Date: Mon, 16 Apr 2012 10:56:17 -0500
4Subject: [PATCH 14/14] expansion: add wifi
5
6Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
7---
8 arch/arm/mach-omap2/board-omap3beagle.c | 103 +++++++++++++++++++++++++++++++
9 1 files changed, 103 insertions(+), 0 deletions(-)
10
11diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
12index 0299d47..a7d81fc 100644
13--- a/arch/arm/mach-omap2/board-omap3beagle.c
14+++ b/arch/arm/mach-omap2/board-omap3beagle.c
15@@ -166,6 +166,90 @@ static void __init omap3_beagle_init_rev(void)
16 char expansionboard_name[16];
17 char expansionboard2_name[16];
18
19+#if defined(CONFIG_WL12XX) || defined(CONFIG_WL12XX_MODULE)
20+#include <linux/regulator/fixed.h>
21+#include <linux/ti_wilink_st.h>
22+#include <linux/wl12xx.h>
23+
24+#define OMAP_BEAGLE_WLAN_EN_GPIO (139)
25+#define OMAP_BEAGLE_BT_EN_GPIO (138)
26+#define OMAP_BEAGLE_WLAN_IRQ_GPIO (137)
27+#define OMAP_BEAGLE_FM_EN_BT_WU (136)
28+
29+struct wl12xx_platform_data omap_beagle_wlan_data __initdata = {
30+ .irq = OMAP_GPIO_IRQ(OMAP_BEAGLE_WLAN_IRQ_GPIO),
31+ .board_ref_clock = 2, /* 38.4 MHz */
32+};
33+
34+static struct ti_st_plat_data wilink_platform_data = {
35+ .nshutdown_gpio = OMAP_BEAGLE_BT_EN_GPIO,
36+ .dev_name = "/dev/ttyO1",
37+ .flow_cntrl = 1,
38+ .baud_rate = 3000000,
39+ .chip_enable = NULL,
40+ .suspend = NULL,
41+ .resume = NULL,
42+};
43+
44+static struct platform_device wl12xx_device = {
45+ .name = "kim",
46+ .id = -1,
47+ .dev.platform_data = &wilink_platform_data,
48+};
49+
50+static struct platform_device btwilink_device = {
51+ .name = "btwilink",
52+ .id = -1,
53+};
54+
55+static struct omap2_hsmmc_info mmcbbt[] = {
56+ {
57+ .mmc = 1,
58+ .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
59+ .gpio_wp = -EINVAL,
60+ },
61+ {
62+ .name = "wl1271",
63+ .mmc = 2,
64+ .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
65+ .gpio_wp = -EINVAL,
66+ .gpio_cd = -EINVAL,
67+ .ocr_mask = MMC_VDD_165_195,
68+ .nonremovable = true,
69+ },
70+ {} /* Terminator */
71+};
72+
73+static struct regulator_consumer_supply beagle_vmmc2_supply =
74+ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1");
75+
76+static struct regulator_init_data beagle_vmmc2 = {
77+ .constraints = {
78+ .valid_ops_mask = REGULATOR_CHANGE_STATUS,
79+ },
80+ .num_consumer_supplies = 1,
81+ .consumer_supplies = &beagle_vmmc2_supply,
82+};
83+
84+static struct fixed_voltage_config beagle_vwlan = {
85+ .supply_name = "vwl1271",
86+ .microvolts = 1800000, /* 1.8V */
87+ .gpio = OMAP_BEAGLE_WLAN_EN_GPIO,
88+ .startup_delay = 70000, /* 70ms */
89+ .enable_high = 1,
90+ .enabled_at_boot = 0,
91+ .init_data = &beagle_vmmc2,
92+};
93+
94+static struct platform_device omap_vwlan_device = {
95+ .name = "reg-fixed-voltage",
96+ .id = 1,
97+ .dev = {
98+ .platform_data = &beagle_vwlan,
99+ },
100+};
101+#endif
102+
103 #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
104
105 #include <plat/mcspi.h>
106@@ -449,7 +533,15 @@ static int beagle_twl_gpio_setup(struct device *dev,
107 mmc[0].gpio_wp = beagle_config.mmc1_gpio_wp;
108 /* gpio + 0 is "mmc0_cd" (input/IRQ) */
109 mmc[0].gpio_cd = gpio + 0;
110+#if defined(CONFIG_WL12XX) || defined(CONFIG_WL12XX_MODULE)
111+ if(!strcmp(expansionboard_name, "bbtoys-wifi")) {
112+ omap2_hsmmc_init(mmcbbt);
113+ } else {
114+ omap2_hsmmc_init(mmc);
115+ }
116+#else
117 omap2_hsmmc_init(mmc);
118+#endif
119
120 /*
121 * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active
122@@ -849,6 +941,17 @@ static void __init omap3_beagle_init(void)
123 gpio_export(162, 1);
124 }
125
126+ if(!strcmp(expansionboard_name, "bbtoys-wifi"))
127+ {
128+ if (wl12xx_set_platform_data(&omap_beagle_wlan_data))
129+ pr_err("error setting wl12xx data\n");
130+ printk(KERN_INFO "Beagle expansionboard: registering wl12xx bt platform device\n");
131+ platform_device_register(&wl12xx_device);
132+ platform_device_register(&btwilink_device);
133+ printk(KERN_INFO "Beagle expansionboard: registering wl12xx wifi platform device\n");
134+ platform_device_register(&omap_vwlan_device);
135+ }
136+
137 if(!strcmp(expansionboard2_name, "bbtoys-ulcd"))
138 {
139 printk(KERN_INFO "Beagle second expansionboard: initializing touchscreen: tsc2007\n");
140--
1411.7.7.4
142