>From 99d7838e8cb78fd954812332efbc790cd88abd13 Mon Sep 17 00:00:00 2001 From: Gregory Alagnou <[email protected]>
Date: Thu, 4 Nov 2010 12:17:22 +0100 Subject: [PATCH] Meego TI integration: SFI parsing for wl12xx board_ref_clock Signed-off-by: Gregory Alagnou <[email protected]> --- arch/x86/kernel/mrst.c | 169 ++++++++++++++++++++++++------------------------ 1 files changed, 85 insertions(+), 84 deletions(-) diff --git a/arch/x86/kernel/mrst.c b/arch/x86/kernel/mrst.c index 76fd4c1..4e77186 100644 --- a/arch/x86/kernel/mrst.c +++ b/arch/x86/kernel/mrst.c @@ -1036,6 +1036,90 @@ void *tc35894xbg_n_platform_data(void *info) &tc35894xbg_ncdk_data); } +static struct regulator_consumer_supply zoom_vmmc3_supply = { + .supply = "vmmc", + .dev_name = "0000:00:04.1", +}; + +static struct regulator_init_data zoom_vmmc3 = { + .constraints = { + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 1, + .consumer_supplies = &zoom_vmmc3_supply, +}; + +static struct fixed_voltage_config zoom_vwlan = { + .supply_name = "vwl1271", + .microvolts = 1800000, + .gpio = 75, + .startup_delay = 70000, + .enable_high = 1, + .enabled_at_boot = 0, + .init_data = &zoom_vmmc3, +}; + +static struct platform_device omap_vwlan_device = { + .name = "reg-fixed-voltage", + .id = 1, + .dev = { + .platform_data = &zoom_vwlan, + }, +}; + +#define WL12XX_SFI_GPIO_IRQ_NAME "WLAN-interrupt" +#define WL12XX_SFI_GPIO_ENABLE_NAME "WLAN-enable" +#define ICDK_BOARD_REF_CLK 26000000 +#define NCDK_BOARD_REF_CLK 38400000 +void *wl12xx_platform_data_init(void *info) +{ + int retval = 0; + struct sd_board_info *sd_info = info; + static struct wl12xx_platform_data mid_wifi_control; + unsigned int wifi_irq_gpio; + unsigned int wifi_enable_gpio; + + /*Get GPIO numbers from the SFI table*/ + wifi_irq_gpio = get_gpio_by_name(WL12XX_SFI_GPIO_IRQ_NAME); + if (wifi_irq_gpio == -1) { + pr_err("%s: Unable to find WLAN-interrupt GPIO in the SFI table\n", __func__); + return NULL; + } + + wifi_enable_gpio = get_gpio_by_name(WL12XX_SFI_GPIO_ENABLE_NAME); + if (wifi_enable_gpio == -1) { + pr_err("%s: Unable to find WLAN-enable GPIO in the SFI table\n", __func__); + return NULL; + } + + /* Set our board_ref_clock from SFI SD board info */ + if (sd_info->board_ref_clock == ICDK_BOARD_REF_CLK) + /*iCDK board*/ + /*26Mhz TCXO clock ref*/ + mid_wifi_control.board_ref_clock = 1; + else if (sd_info->board_ref_clock == NCDK_BOARD_REF_CLK) + /*nCDK board*/ + /*38,4Mhz TCXO clock ref*/ + mid_wifi_control.board_ref_clock = 2; + + /* Set wlan irq */ + mid_wifi_control.irq = wifi_irq_gpio; + retval = wl12xx_set_platform_data(&mid_wifi_control); + if (retval < 0) { + pr_err("error setting wl12xx data\n"); + return NULL; + } + + zoom_vwlan.gpio = wifi_enable_gpio; + retval = platform_device_register(&omap_vwlan_device); + if (retval < 0) { + pr_err("error platform_device_register\n"); + return NULL; + } + + return &mid_wifi_control; +} + static const struct devs_id device_ids[] = { {"pmic_gpio", SFI_DEV_TYPE_SPI, 1, &pmic_gpio_platform_data}, {"pmic_gpio", SFI_DEV_TYPE_IPC, 1, &pmic_gpio_platform_data}, @@ -1061,6 +1145,7 @@ static const struct devs_id device_ids[] = { {"i2c_TC35894-i", SFI_DEV_TYPE_I2C, 0, &tc35894xbg_i_platform_data}, {"bh1770glc", SFI_DEV_TYPE_I2C, 0, &bh1770glc_platform_data_init}, {"lp5523", SFI_DEV_TYPE_I2C, 0, &lp5523_platform_data_init}, + {"wlan_tcxo_clk", SFI_DEV_TYPE_SD, 0, &wl12xx_platform_data_init}, {}, }; @@ -1676,87 +1761,3 @@ static int __init setup_hsu_dma_enable_flag(char *p) return 0; } early_param("hsu_dma", setup_hsu_dma_enable_flag); - - -#if defined(CONFIG_WL1271) || defined(CONFIG_WL1271_MODULE) -#include <linux/etherdevice.h> -/***************************************************************************** - * Function called by wl1273 driver - */ -unsigned int wifi_irq_gpio; -unsigned int wifi_enable_gpio; -struct wl12xx_platform_data mid_wifi_control __initdata = { - .board_ref_clock = 2, - .irq = 2, -}; - -static struct regulator_consumer_supply zoom_vmmc3_supply = { - .supply = "vmmc", - .dev_name = "0000:00:04.1", -}; - -static struct regulator_init_data zoom_vmmc3 = { - .constraints = { - .valid_ops_mask = REGULATOR_CHANGE_STATUS, - }, - .num_consumer_supplies = 1, - .consumer_supplies = &zoom_vmmc3_supply, -}; - -static struct fixed_voltage_config zoom_vwlan = { - .supply_name = "vwl1271", - .microvolts = 1800000, - .gpio = 75, - .startup_delay = 70000, - .enable_high = 1, - .enabled_at_boot = 0, - .init_data = &zoom_vmmc3, -}; - -static struct platform_device omap_vwlan_device = { - .name = "reg-fixed-voltage", - .id = 1, - .dev = { - .platform_data = &zoom_vwlan, - }, -}; - - -static int __init mid_wifi_init(void) -{ - int retval = 0; - - /*Get GPIO numbers from the SFI table*/ - wifi_irq_gpio = get_gpio_by_name("WLAN-interrupt"); - if (wifi_irq_gpio == -1) { - pr_err("%s: Unable to find WLAN-interrupt GPIO in the SFI table\n", __func__); - retval = -EIO; - goto out; - } - - wifi_enable_gpio = get_gpio_by_name("WLAN-enable"); - if (wifi_enable_gpio == -1) { - pr_err("%s: Unable to find WLAN-enable GPIO in the SFI table\n", __func__); - retval = -EIO; - goto out; - } - - mid_wifi_control.irq = wifi_irq_gpio; - retval = wl12xx_set_platform_data(&mid_wifi_control); - if (retval < 0) { - pr_err("error setting wl12xx data\n"); - goto out; - } - - zoom_vwlan.gpio = wifi_enable_gpio; - retval = platform_device_register(&omap_vwlan_device); - if (retval < 0) { - pr_err("error platform_device_register\n"); - goto out; - } - -out: - return retval; -} -device_initcall(mid_wifi_init); -#endif -- 1.7.2.3 --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
0002-Meego-TI-integration-SFI-parsing-for-wl12xx-board_re.patch
Description: 0002-Meego-TI-integration-SFI-parsing-for-wl12xx-board_re.patch
_______________________________________________ MeeGo-kernel mailing list [email protected] http://lists.meego.com/listinfo/meego-kernel
