diff options
author | Sangwook Lee <sangwook.lee@linaro.org> | 2011-10-14 12:03:06 +0100 |
---|---|---|
committer | Angus Ainslie <angus.ainslie@linaro.org> | 2011-10-19 19:23:53 -0600 |
commit | cd1e1c318916bc38996b295a3d64d8698bb57d73 (patch) | |
tree | c9976e544d96302680c4d11bf3937b0c3ad771f8 | |
parent | 0fb020d99625b0b11a5d4cd5fd8696c69e97cc8a (diff) |
ARM:EXYNOS4:ORIGEN Add platform device for bt3.0.0-2011.10
-Add Platform device for Bluetooth
-Clean up WLAN code
Signed-off-by: Sangwook Lee <sangwook.lee@linaro.org>
Signed-off-by: Angus Ainslie <angus.ainslie@linaro.org>
-rw-r--r-- | arch/arm/mach-exynos4/Kconfig | 8 | ||||
-rw-r--r-- | arch/arm/mach-exynos4/mach-origen.c | 54 |
2 files changed, 45 insertions, 17 deletions
diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig index ad1c6c08406e..fc8dc59f9dd4 100644 --- a/arch/arm/mach-exynos4/Kconfig +++ b/arch/arm/mach-exynos4/Kconfig @@ -268,6 +268,14 @@ config MACH_ORIGEN help Machine support for ORIGEN based on Samsung EXYNOS4210 +config ORIGEN_BT + bool "Bluetooth(CSR) of Origen" + depends on MACH_ORIGEN + select RFKILL + help + This driver is able to control + the state of CSR8819 in Origen + endmenu comment "Configuration for HSMMC bus width" diff --git a/arch/arm/mach-exynos4/mach-origen.c b/arch/arm/mach-exynos4/mach-origen.c index 528c58eb1762..fe186d0c0102 100644 --- a/arch/arm/mach-exynos4/mach-origen.c +++ b/arch/arm/mach-exynos4/mach-origen.c @@ -170,8 +170,10 @@ static int origen_wifi_status_register(void (*notify_func) return 0; } -static struct gpio origen_wlan_bt_gpios[] __initdata = { - { EXYNOS4_GPX2(2), GPIOF_OUT_INIT_HIGH, "GPIO_BT_RESET"}, +/* + * WLAN & BT GPIO Configurations + */ +static struct gpio origen_w_b[] __initdata = { { EXYNOS4_GPX2(3), GPIOF_OUT_INIT_HIGH, "GPIO_WIFI_BT_WOW"}, { EXYNOS4_GPX2(4), GPIOF_OUT_INIT_LOW, "GPIO_WIFI_RESET"}, }; @@ -180,28 +182,25 @@ static void origen_wlan_setup_power(bool val) { int err; - origen_wlan_bt_gpios[0].gpio = EXYNOS4_GPX2(2); - origen_wlan_bt_gpios[1].gpio = EXYNOS4_GPX2(3); - origen_wlan_bt_gpios[2].gpio = EXYNOS4_GPX2(4); + origen_w_b[0].gpio = EXYNOS4_GPX2(3); + origen_w_b[1].gpio = EXYNOS4_GPX2(4); if (val) { - err = gpio_request_array(origen_wlan_bt_gpios, - ARRAY_SIZE(origen_wlan_bt_gpios)); + err = gpio_request_one(origen_w_b[1].gpio, + origen_w_b[1].flags, origen_w_b[1].label); if (err) { - pr_warning("ORIGEN: Not obtain WIFI/BT gpios\n"); + pr_warning("ORIGEN: Not obtain WIFI gpios\n"); return; } - s3c_gpio_cfgpin(origen_wlan_bt_gpios[2].gpio, S3C_GPIO_OUTPUT); - s3c_gpio_setpull(origen_wlan_bt_gpios[2].gpio, - S3C_GPIO_PULL_NONE); + s3c_gpio_cfgpin(origen_w_b[1].gpio, S3C_GPIO_OUTPUT); + s3c_gpio_setpull(origen_w_b[1].gpio, S3C_GPIO_PULL_NONE); /* VDD33,I/O Supply must be done */ - gpio_set_value(origen_wlan_bt_gpios[2].gpio, 0); + gpio_set_value(origen_w_b[1].gpio, 0); udelay(30); /*Tb */ - gpio_direction_output(origen_wlan_bt_gpios[2].gpio, 1); + gpio_direction_output(origen_w_b[1].gpio, 1); } else { - gpio_direction_output(origen_wlan_bt_gpios[2].gpio, 0); - gpio_free_array(origen_wlan_bt_gpios, - ARRAY_SIZE(origen_wlan_bt_gpios)); + gpio_direction_output(origen_w_b[1].gpio, 0); + gpio_free(origen_w_b[1].gpio); } return; @@ -340,6 +339,24 @@ static void __init origen_ehci_init(void) s5p_ehci_set_platdata(pdata); } +/* + * UART configuration for Bluetooth + */ +static struct gpio origen_bt_pins[] = { + { EXYNOS4_GPA0(0), 0, "UART_0_RXD"}, + { EXYNOS4_GPA0(1), 0, "UART_0_TXD"}, + { EXYNOS4_GPA0(2), 0, "UART_0_CTSn"}, + { EXYNOS4_GPA0(3), 0, "UART_0_RTSn"}, + { EXYNOS4_GPX2(2), 0, "GPIO_BT_RESET"}, +}; + +/* Bluetooth Platform device */ +static struct platform_device origen_device_bluetooth = { + .name = "origen-bt", + .id = -1, + .dev.platform_data = &origen_bt_pins, +}; + static struct platform_device *origen_devices[] __initdata = { &exynos4_device_pd[PD_MFC], &exynos4_device_pd[PD_G3D], @@ -379,6 +396,9 @@ static struct platform_device *origen_devices[] __initdata = { #ifdef CONFIG_USB_GADGET_S3C_OTGD &s3c_device_usbgadget, #endif +#ifdef CONFIG_ORIGEN_BT + &origen_device_bluetooth, +#endif &origen_device_gpiokeys, }; @@ -447,8 +467,8 @@ static void __init origen_machine_init(void) origen_ehci_init(); samsung_bl_set(&origen_bl_gpio_info, &origen_bl_data); - } + #if defined(CONFIG_S5P_MEM_CMA) static void __init exynos4_reserve_cma(void) { |