1 From f7d71be36165002251727019b1a03a19938bfa64 Mon Sep 17 00:00:00 2001
2 From: Koen Kooi <koen@beagleboard.org>
3 Date: Mon, 20 Dec 2010 11:57:56 +0100
4 Subject: [PATCH 13/28] omap3: beagleboard: add WIP support for beagleboardtoys WL12xx board
6 Based on a patch by Luciano Coelho <luciano.coelho@nokia.com>
8 Signed-off-by: Koen Kooi <koen@beagleboard.org>
10 arch/arm/mach-omap2/board-omap3beagle.c | 84 ++++++++++++++++++++++++++++++-
11 1 files changed, 83 insertions(+), 1 deletions(-)
13 diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
14 index 64a181e..59b26da 100644
15 --- a/arch/arm/mach-omap2/board-omap3beagle.c
16 +++ b/arch/arm/mach-omap2/board-omap3beagle.c
17 @@ -146,6 +146,67 @@ fail0:
19 char expansionboard_name[16];
21 +#if defined(CONFIG_WL1271) || defined(CONFIG_WL1271_MODULE)
22 +#include <linux/regulator/fixed.h>
23 +#include <linux/wl12xx.h>
25 +#define OMAP_BEAGLE_WLAN_EN_GPIO (139)
26 +#define OMAP_BEAGLE_WLAN_IRQ_GPIO (137)
28 +struct wl12xx_platform_data omap_beagle_wlan_data __initdata = {
29 + .irq = OMAP_GPIO_IRQ(OMAP_BEAGLE_WLAN_IRQ_GPIO),
30 + .board_ref_clock = 2, /* 38.4 MHz */
33 + static struct omap2_hsmmc_info mmcbbt[] = {
36 + .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
42 + .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
45 + .nonremovable = true,
50 +static struct regulator_consumer_supply beagle_vmmc2_supply = {
52 + .dev_name = "mmci-omap-hs.1",
55 +static struct regulator_init_data beagle_vmmc2 = {
57 + .valid_ops_mask = REGULATOR_CHANGE_STATUS,
59 + .num_consumer_supplies = 1,
60 + .consumer_supplies = &beagle_vmmc2_supply,
63 +static struct fixed_voltage_config beagle_vwlan = {
64 + .supply_name = "vwl1271",
65 + .microvolts = 1800000, /* 1.8V */
66 + .gpio = OMAP_BEAGLE_WLAN_EN_GPIO,
67 + .startup_delay = 70000, /* 70ms */
69 + .enabled_at_boot = 0,
70 + .init_data = &beagle_vmmc2,
73 +static struct platform_device omap_vwlan_device = {
74 + .name = "reg-fixed-voltage",
77 + .platform_data = &beagle_vwlan,
82 #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
84 #include <plat/mcspi.h>
85 @@ -384,11 +445,24 @@ static int beagle_twl_gpio_setup(struct device *dev,
87 /* gpio + 0 is "mmc0_cd" (input/IRQ) */
88 mmc[0].gpio_cd = gpio + 0;
89 +#if defined(CONFIG_WL1271) || defined(CONFIG_WL1271_MODULE)
90 + if(!strcmp(expansionboard_name, "fixme-beagletoy")) {
91 + omap2_hsmmc_init(mmcbbt);
92 + /* link regulators to MMC adapters */
93 + beagle_vmmc1_supply.dev = mmcbbt[0].dev;
94 + beagle_vsim_supply.dev = mmcbbt[0].dev;
96 + omap2_hsmmc_init(mmc);
97 + /* link regulators to MMC adapters */
98 + beagle_vmmc1_supply.dev = mmc[0].dev;
99 + beagle_vsim_supply.dev = mmc[0].dev;
102 omap2_hsmmc_init(mmc);
104 /* link regulators to MMC adapters */
105 beagle_vmmc1_supply.dev = mmc[0].dev;
106 beagle_vsim_supply.dev = mmc[0].dev;
109 /* REVISIT: need ehci-omap hooks for external VBUS
110 * power switch and overcurrent detect
111 @@ -788,6 +862,14 @@ static void __init omap3_beagle_init(void)
115 + if(!strcmp(expansionboard_name, "fixme-beagletoy"))
117 + if (wl12xx_set_platform_data(&omap_beagle_wlan_data))
118 + pr_err("error setting wl12xx data\n");
119 + printk(KERN_INFO "Beagle expansionboard: registering wl12xx platform device\n");
120 + platform_device_register(&omap_vwlan_device);
123 usb_musb_init(&musb_board_data);
124 usb_ehci_init(&ehci_pdata);
125 omap3beagle_flash_init();