diff mbox

[v2] ARM: EXYNOS: Add WLAN init on ORIGEN

Message ID 1330351866-6446-1-git-send-email-sangwook.lee@linaro.org
State New
Headers show

Commit Message

Sangwook Feb. 27, 2012, 2:11 p.m. UTC
Add WLAN init code on Origen for both hw2.1.1 and hw2.0 in AR6003

Signed-off-by: Sangwook Lee <sangwook.lee@linaro.org>
---
 arch/arm/mach-exynos/mach-origen.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c
index 02c242e..821b57a 100644
--- a/arch/arm/mach-exynos/mach-origen.c
+++ b/arch/arm/mach-exynos/mach-origen.c
@@ -21,6 +21,7 @@ 
 #include <linux/mfd/max8997.h>
 #include <linux/lcd.h>
 #include <linux/rfkill-gpio.h>
+#include <linux/delay.h>
 
 #include <asm/mach/arch.h>
 #include <asm/hardware/gic.h>
@@ -668,6 +669,22 @@  static void __init origen_bt_setup(void)
 	s3c_gpio_setpull(EXYNOS4_GPX2(2), S3C_GPIO_PULL_NONE);
 }
 
+static void __init origen_wlan_setup(void)
+{
+	int err;
+
+	/* EXYNOS4_GPX2(4) is reset pin to the external chip */
+	err = gpio_request_one(EXYNOS4_GPX2(4), GPIOF_OUT_INIT_LOW, "GPX2_4");
+	if (err) {
+		pr_warning("ORIGEN: Failed to obtain WIFI GPIOs\n");
+		return;
+	}
+	s3c_gpio_setpull(EXYNOS4_GPX2(4), S3C_GPIO_PULL_NONE);
+	gpio_set_value(EXYNOS4_GPX2(4), 0);
+	udelay(30);     /*AR6003 specific value Tb */
+	gpio_set_value(EXYNOS4_GPX2(4), 1);
+}
+
 static void s5p_tv_setup(void)
 {
 	/* Direct HPD to HDMI chip */
@@ -723,6 +740,7 @@  static void __init origen_machine_init(void)
 	samsung_bl_set(&origen_bl_gpio_info, &origen_bl_data);
 
 	origen_bt_setup();
+	origen_wlan_setup();
 }
 
 MACHINE_START(ORIGEN, "ORIGEN")