diff options
author | Rakesh Goyal <rgoyal@nvidia.com> | 2012-08-28 22:16:08 +0530 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-09-05 16:02:42 -0700 |
commit | 32b8cc820fc9f3709c23e6b383825d6cdb0a6085 (patch) | |
tree | 8fe5c888cb38b2971a49c6892d43dc694e0d7051 | |
parent | 6315861867aae8b64d04a46b05248c33b7d613db (diff) |
ARM: tegra: enterprise: enable wl18xx wireless module support
Bug 990784
Change-Id: I173df3f7244e7d0b40ae5aad98c72885ff42fdab
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: http://git-master/r/129103
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Rakesh Kumar <krakesh@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/board-enterprise-sdhci.c | 44 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-enterprise.c | 73 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-enterprise.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board.h | 4 |
4 files changed, 107 insertions, 16 deletions
diff --git a/arch/arm/mach-tegra/board-enterprise-sdhci.c b/arch/arm/mach-tegra/board-enterprise-sdhci.c index 8032f8105bed..a003ae9cbd8e 100644 --- a/arch/arm/mach-tegra/board-enterprise-sdhci.c +++ b/arch/arm/mach-tegra/board-enterprise-sdhci.c @@ -22,6 +22,7 @@ #include <linux/clk.h> #include <linux/err.h> #include <linux/mmc/host.h> +#include <linux/wl12xx.h> #include <asm/mach-types.h> #include <mach/irqs.h> @@ -52,6 +53,14 @@ static struct wifi_platform_data enterprise_wifi_control = { .set_carddetect = enterprise_wifi_set_carddetect, }; +static struct wl12xx_platform_data enterprise_wl12xx_wlan_data __initdata = { + .irq = TEGRA_GPIO_TO_IRQ(ENTERPRISE_WLAN_WOW), + .board_ref_clock = WL12XX_REFCLOCK_26, + .board_tcxo_clock = 1, + .set_power = enterprise_wifi_power, + .set_carddetect = enterprise_wifi_set_carddetect, +}; + static struct resource wifi_resource[] = { [0] = { .name = "bcm4329_wlan_irq", @@ -61,7 +70,7 @@ static struct resource wifi_resource[] = { }, }; -static struct platform_device enterprise_wifi_device = { +static struct platform_device enterprise_brcm_wifi_device = { .name = "bcm4329_wlan", .id = 1, .num_resources = 1, @@ -238,10 +247,22 @@ static int enterprise_wifi_power(int on) tegra_io_dpd_disable(sd_dpd); mutex_unlock(&sd_dpd->delay_lock); } - gpio_set_value(ENTERPRISE_WLAN_PWR, on); - mdelay(100); - gpio_set_value(ENTERPRISE_WLAN_RST, on); - mdelay(200); + + if (on) { + gpio_set_value(ENTERPRISE_WLAN_RST, 1); + mdelay(100); + gpio_set_value(ENTERPRISE_WLAN_RST, 0); + mdelay(100); + gpio_set_value(ENTERPRISE_WLAN_RST, 1); + mdelay(100); + gpio_set_value(ENTERPRISE_WLAN_PWR, 1); + mdelay(200); + } else { + gpio_set_value(ENTERPRISE_WLAN_RST, 0); + mdelay(100); + gpio_set_value(ENTERPRISE_WLAN_PWR, 0); + } + if (sd_dpd) { mutex_lock(&sd_dpd->delay_lock); tegra_io_dpd_enable(sd_dpd); @@ -295,7 +316,11 @@ static int __init enterprise_wifi_init(void) if (rc) pr_err("WLAN_WOW gpio direction configuration failed:%d\n", rc); - platform_device_register(&enterprise_wifi_device); + if (tegra_get_commchip_id() == COMMCHIP_TI_WL18XX) + wl12xx_set_platform_data(&enterprise_wl12xx_wlan_data); + else + platform_device_register(&enterprise_brcm_wifi_device); + return 0; } @@ -306,6 +331,13 @@ int __init enterprise_sdhci_init(void) tegra_sdhci_platform_data2.cd_gpio = ENTERPRISE_SD_CD; platform_device_register(&tegra_sdhci_device2); + /* TI wifi module does not use emdedded sdio */ + if (tegra_get_commchip_id() == COMMCHIP_TI_WL18XX) { +#ifdef CONFIG_MMC_EMBEDDED_SDIO + tegra_sdhci_platform_data0.mmc_data.embedded_sdio = NULL; +#endif + } + platform_device_register(&tegra_sdhci_device0); enterprise_wifi_init(); return 0; diff --git a/arch/arm/mach-tegra/board-enterprise.c b/arch/arm/mach-tegra/board-enterprise.c index 51db725d0223..25f737f75338 100644 --- a/arch/arm/mach-tegra/board-enterprise.c +++ b/arch/arm/mach-tegra/board-enterprise.c @@ -42,6 +42,8 @@ #include <linux/mfd/tlv320aic3262-core.h> #include <linux/nfc/pn544.h> +#include <linux/skbuff.h> +#include <linux/ti_wilink_st.h> #include <sound/max98088.h> #include <mach/clk.h> @@ -124,6 +126,32 @@ static struct tegra_thermal_data thermal_data = { #endif }; +/* wl128x BT, FM, GPS connectivity chip */ +struct ti_st_plat_data enterprise_wilink_pdata = { + .nshutdown_gpio = TEGRA_GPIO_PE6, + .dev_name = BLUETOOTH_UART_DEV_NAME, + .flow_cntrl = 1, + .baud_rate = 3000000, +}; + +static struct platform_device wl128x_device = { + .name = "kim", + .id = -1, + .dev.platform_data = &enterprise_wilink_pdata, +}; + +static struct platform_device btwilink_device = { + .name = "btwilink", + .id = -1, +}; + +static noinline void __init enterprise_bt_st(void) +{ + pr_info("enterprise_bt_st"); + + platform_device_register(&wl128x_device); + platform_device_register(&btwilink_device); +} static struct rfkill_gpio_platform_data enterprise_bt_rfkill_pdata[] = { { .name = "bt_rfkill", @@ -140,8 +168,21 @@ static struct platform_device enterprise_bt_rfkill_device = { .platform_data = &enterprise_bt_rfkill_pdata, }, }; - -static struct resource enterprise_bluesleep_resources[] = { +static struct resource enterprise_ti_bluesleep_resources[] = { + [0] = { + .name = "gpio_host_wake", + .start = TEGRA_GPIO_PS2, + .end = TEGRA_GPIO_PS2, + .flags = IORESOURCE_IO, + }, + [1] = { + .name = "host_wake", + .start = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PS2), + .end = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PS2), + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, + }, +}; +static struct resource enterprise_brcm_bluesleep_resources[] = { [0] = { .name = "gpio_host_wake", .start = TEGRA_GPIO_PS2, @@ -162,16 +203,30 @@ static struct resource enterprise_bluesleep_resources[] = { }, }; -static struct platform_device enterprise_bluesleep_device = { +static struct platform_device enterprise_ti_bluesleep_device = { .name = "bluesleep", .id = -1, - .num_resources = ARRAY_SIZE(enterprise_bluesleep_resources), - .resource = enterprise_bluesleep_resources, + .num_resources = ARRAY_SIZE(enterprise_ti_bluesleep_resources), + .resource = enterprise_ti_bluesleep_resources, }; +static struct platform_device enterprise_brcm_bluesleep_device = { + .name = "bluesleep", + .id = -1, + .num_resources = ARRAY_SIZE(enterprise_brcm_bluesleep_resources), + .resource = enterprise_brcm_bluesleep_resources, +}; +static void __init enterprise_bt_rfkill(void) +{ + platform_device_register(&enterprise_bt_rfkill_device); + return; +} static void __init enterprise_setup_bluesleep(void) { - platform_device_register(&enterprise_bluesleep_device); + if (tegra_get_commchip_id() == COMMCHIP_TI_WL18XX) + platform_device_register(&enterprise_ti_bluesleep_device); + else + platform_device_register(&enterprise_brcm_bluesleep_device); return; } @@ -634,7 +689,6 @@ static struct platform_device *enterprise_devices[] __initdata = { &tegra_avp_device, #endif &tegra_camera, - &enterprise_bt_rfkill_device, &tegra_spi_device4, &tegra_hda_device, #if defined(CONFIG_CRYPTO_DEV_TEGRA_SE) @@ -1078,7 +1132,6 @@ static void __init tegra_enterprise_init(void) enterprise_usb_init(); if (board_info.board_id == BOARD_E1239) enterprise_bt_rfkill_pdata[0].reset_gpio = TEGRA_GPIO_PF4; - platform_add_devices(enterprise_devices, ARRAY_SIZE(enterprise_devices)); tegra_ram_console_debug_init(); enterprise_regulator_init(); @@ -1093,6 +1146,10 @@ static void __init tegra_enterprise_init(void) enterprise_audio_init(); enterprise_baseband_init(); enterprise_panel_init(); + if (tegra_get_commchip_id() == COMMCHIP_TI_WL18XX) + enterprise_bt_st(); + else + enterprise_bt_rfkill(); enterprise_setup_bluesleep(); enterprise_emc_init(); enterprise_sensors_init(); diff --git a/arch/arm/mach-tegra/board-enterprise.h b/arch/arm/mach-tegra/board-enterprise.h index e9bda707fed2..ae488dfb4618 100644 --- a/arch/arm/mach-tegra/board-enterprise.h +++ b/arch/arm/mach-tegra/board-enterprise.h @@ -121,6 +121,8 @@ void enterprise_bpc_mgmt_init(void); #define TEGRA_GPIO_HP_DET TEGRA_GPIO_PW3 #define TEGRA_GPIO_CODEC_RST TEGRA_GPIO_PX0 +/* UART port which is used by bluetooth*/ +#define BLUETOOTH_UART_DEV_NAME "/dev/ttyHS2" /* Baseband GPIO addresses */ #define GPIO_BB_RESET TEGRA_GPIO_PE1 diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h index 7c081fad642a..85d02d501b63 100644 --- a/arch/arm/mach-tegra/board.h +++ b/arch/arm/mach-tegra/board.h @@ -72,9 +72,9 @@ #define COMMCHIP_UNKNOWN 0 #define COMMCHIP_NOCHIP 1 #define COMMCHIP_BROADCOM_BCM4329 2 -#define COMMCHIP BROADCOM_BCM4330 3 +#define COMMCHIP_BROADCOM_BCM4330 3 #define COMMCHIP_MARVELL_SD8797 4 - +#define COMMCHIP_TI_WL18XX 5 struct memory_accessor; |