aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2014-08-12 10:45:25 +0100
committerAndrey Konovalov <andrey.konovalov@linaro.org>2014-09-11 22:38:23 +0400
commitd99bf0e243af137be53fd8c5e07fe7054b4c3be6 (patch)
tree1b670295fc8d982705b36662215ef7e350ddf93d
parent184588164618ec2e6e182395efba6a639e6d93aa (diff)
ARM:qcom: Add WLAN reset support
This patch adds wlan reset functionality to board specific data as sdio device does not support platform speific data from DT yet. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
-rw-r--r--arch/arm/mach-qcom/board.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/arch/arm/mach-qcom/board.c b/arch/arm/mach-qcom/board.c
index c437a9941726..a0e9b477fabf 100644
--- a/arch/arm/mach-qcom/board.c
+++ b/arch/arm/mach-qcom/board.c
@@ -11,6 +11,10 @@
*/
#include <linux/init.h>
+#include <linux/of.h>
+#include <linux/of_gpio.h>
+#include <linux/of_platform.h>
+#include <linux/delay.h>
#include <asm/mach/arch.h>
@@ -23,6 +27,31 @@ static const char * const qcom_dt_match[] __initconst = {
NULL
};
+static void __init qcom_late_init(void)
+{
+ struct device_node *node;
+ int reset_gpio, ret;
+
+ for_each_compatible_node(node, NULL, "atheros,ath6kl") {
+ of_node_put(node);
+
+ reset_gpio = of_get_named_gpio(node, "reset-gpio", 0);
+ if (reset_gpio < 0)
+ return;
+
+ ret = gpio_request_one(reset_gpio,
+ GPIOF_DIR_OUT | GPIOF_INIT_HIGH, "reset");
+ if (ret)
+ return;
+
+ udelay(100);
+ gpio_set_value(reset_gpio, 0);
+ udelay(100);
+ gpio_set_value(reset_gpio, 1);
+ }
+}
+
DT_MACHINE_START(QCOM_DT, "Qualcomm (Flattened Device Tree)")
- .dt_compat = qcom_dt_match,
+ .init_late = qcom_late_init,
+ .dt_compat = qcom_dt_match,
MACHINE_END