From patchwork Thu Feb 24 07:26:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Reizer, Eyal" X-Patchwork-Id: 586521 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1O7R9Su009522 for ; Thu, 24 Feb 2011 07:27:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751735Ab1BXH1I (ORCPT ); Thu, 24 Feb 2011 02:27:08 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:60587 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750975Ab1BXH1H convert rfc822-to-8bit (ORCPT ); Thu, 24 Feb 2011 02:27:07 -0500 Received: from dlep33.itg.ti.com ([157.170.170.112]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id p1O7R5In026160 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Feb 2011 01:27:05 -0600 Received: from dlep26.itg.ti.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id p1O7R5Vo015016; Thu, 24 Feb 2011 01:27:05 -0600 (CST) Received: from dnce72.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id p1O7R4TH029344; Thu, 24 Feb 2011 01:27:04 -0600 (CST) Received: from dnce02.ent.ti.com ([137.167.131.106]) by dnce72.ent.ti.com ([137.167.131.87]) with mapi; Thu, 24 Feb 2011 08:27:04 +0100 From: "Reizer, Eyal" To: Tony Lindgren CC: "linux-omap@vger.kernel.org" Date: Thu, 24 Feb 2011 08:26:33 +0100 Subject: RE: Re: Ping-> Subject: [PATCH] omap: omap3evm: add support for the WL12xx WLAN module to the omap3evm Thread-Topic: Re: Ping-> Subject: [PATCH] omap: omap3evm: add support for the WL12xx WLAN module to the omap3evm Thread-Index: AcvTo4DsmcjasEHbRfmJ497DqObVUgAUIHrw Message-ID: References: <20110217222027.GD20795@atomide.com> <20110223214903.GB30316@atomide.com> In-Reply-To: <20110223214903.GB30316@atomide.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-cr-puzzleid: {96EC2381-E1F4-47ED-BBDE-623C02FF271C} x-cr-hashedpuzzle: BDot B9i4 DDLM F7QJ GRPE HWHN IfGt JYnQ LCbJ LQMJ Olbc PEbF Qjl7 Tat6 Vfum Wj7l; 2; bABpAG4AdQB4AC0AbwBtAGEAcABAAHYAZwBlAHIALgBrAGUAcgBuAGUAbAAuAG8AcgBnADsAdABvAG4AeQBAAGEAdABvAG0AaQBkAGUALgBjAG8AbQA=; Sosha1_v1; 7; {96EC2381-E1F4-47ED-BBDE-623C02FF271C}; ZQB5AGEAbAByAEAAdABpAC4AYwBvAG0A; Thu, 24 Feb 2011 07:26:33 GMT; UgBFADoAIABSAGUAOgAgAFAAaQBuAGcALQA+ACAAUwB1AGIAagBlAGMAdAA6ACAAIAAgACAAWwBQAEEAVABDAEgAXQAgAG8AbQBhAHAAOgAgAG8AbQBhAHAAMwBlAHYAbQA6ACAAYQBkAGQAIABzAHUAcABwAG8AcgB0ACAAZgBvAHIAIAB0AGgAZQAgAFcATAAxADIAeAB4ACAAVwBMAEEATgAgAG0AbwBkAHUAbABlACAAdABvACAAdABoAGUAIABvAG0AYQBwADMAZQB2AG0A acceptlanguage: en-US MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 24 Feb 2011 07:27:10 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 323c380..349aac9 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -30,6 +30,8 @@ #include #include +#include +#include #include #include @@ -381,6 +383,16 @@ static struct omap2_hsmmc_info mmc[] = { .gpio_cd = -EINVAL, .gpio_wp = 63, }, +#ifdef CONFIG_WL12XX_PLATFORM_DATA + { + .name = "wl1271", + .mmc = 2, + .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD, + .gpio_wp = -EINVAL, + .gpio_cd = -EINVAL, + .nonremovable = true, + }, +#endif {} /* Terminator */ }; @@ -538,6 +550,47 @@ static struct regulator_init_data omap3_evm_vpll2 = { .consumer_supplies = &omap3_evm_vpll2_supply, }; +#ifdef CONFIG_WL12XX_PLATFORM_DATA + +#define OMAP3EVM_WLAN_PMENA_GPIO (150) +#define OMAP3EVM_WLAN_IRQ_GPIO (149) + +static struct regulator_consumer_supply omap3evm_vmmc2_supply = + REGULATOR_SUPPLY("vmmc", "mmci-omap-hs.1"); + +/* VMMC2 for driving the WL12xx module */ +static struct regulator_init_data omap3evm_vmmc2 = { + .constraints = { + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 1, + .consumer_supplies = &omap3evm_vmmc2_supply, +}; + +static struct fixed_voltage_config omap3evm_vwlan = { + .supply_name = "vwl1271", + .microvolts = 1800000, /* 1.80V */ + .gpio = OMAP3EVM_WLAN_PMENA_GPIO, + .startup_delay = 70000, /* 70ms */ + .enable_high = 1, + .enabled_at_boot = 0, + .init_data = &omap3evm_vmmc2, +}; + +static struct platform_device omap3evm_wlan_regulator = { + .name = "reg-fixed-voltage", + .id = 1, + .dev = { + .platform_data = &omap3evm_vwlan, + }, +}; + +struct wl12xx_platform_data omap3evm_wlan_data __initdata = { + .irq = OMAP_GPIO_IRQ(OMAP3EVM_WLAN_IRQ_GPIO), + .board_ref_clock = 2, /* ref clock is 38.4 MHz */ +}; +#endif + static struct twl4030_platform_data omap3evm_twldata = { .irq_base = TWL4030_IRQ_BASE, .irq_end = TWL4030_IRQ_END, @@ -658,6 +711,21 @@ static struct omap_board_mux board_mux[] __initdata = { OMAP_PIN_OFF_WAKEUPENABLE), OMAP3_MUX(MCSPI1_CS1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW), +#ifdef CONFIG_WL12XX_PLATFORM_DATA + /* WLAN IRQ - GPIO 149 */ + OMAP3_MUX(UART1_RTS, OMAP_MUX_MODE4 | OMAP_PIN_INPUT), + + /* WLAN POWER ENABLE - GPIO 150 */ + OMAP3_MUX(UART1_CTS, OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT), + + /* MMC2 SDIO pin muxes for WL12xx */ + OMAP3_MUX(SDMMC2_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), + OMAP3_MUX(SDMMC2_CMD, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), + OMAP3_MUX(SDMMC2_DAT0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), + OMAP3_MUX(SDMMC2_DAT1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), + OMAP3_MUX(SDMMC2_DAT2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), + OMAP3_MUX(SDMMC2_DAT3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT_PULLUP), +#endif { .reg_offset = OMAP_MUX_TERMINATOR }, }; #endif @@ -715,6 +783,12 @@ static void __init omap3_evm_init(void) ads7846_dev_init(); omap3evm_init_smsc911x(); omap3_evm_display_init(); +#ifdef CONFIG_WL12XX_PLATFORM_DATA + /* WL12xx WLAN Init */ + if (wl12xx_set_platform_data(&omap3evm_wlan_data)) + pr_err("error setting wl12xx data\n"); + platform_device_register(&omap3evm_wlan_regulator); +#endif } MACHINE_START(OMAP3EVM, "OMAP3 EVM")