diff options
author | Igor Grinberg <grinberg@compulab.co.il> | 2009-10-14 03:20:21 -0400 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2009-11-30 20:03:08 -0500 |
commit | b3d01da66d45504f8bdc6fbc9c0c1f1705ebc251 (patch) | |
tree | 61fcf3e49280202a9b639036d7ae0fe17a6ce8f8 /arch/arm/mach-pxa/cm-x300.c | |
parent | 74e74defd6c471fc7ec108e64cb953164940a122 (diff) |
[ARM] pxa/cm-x300: add Wi2Wi chip (Bluetooth and WiFi) initialization
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/cm-x300.c')
-rw-r--r-- | arch/arm/mach-pxa/cm-x300.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c index 8726dc7c73a6..9a21bc567ca2 100644 --- a/arch/arm/mach-pxa/cm-x300.c +++ b/arch/arm/mach-pxa/cm-x300.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/delay.h> | ||
19 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
20 | 21 | ||
21 | #include <linux/gpio.h> | 22 | #include <linux/gpio.h> |
@@ -513,6 +514,42 @@ static void __init cm_x300_init_rtc(void) | |||
513 | static inline void cm_x300_init_rtc(void) {} | 514 | static inline void cm_x300_init_rtc(void) {} |
514 | #endif | 515 | #endif |
515 | 516 | ||
517 | static void __init cm_x300_init_wi2wi(void) | ||
518 | { | ||
519 | int bt_reset, wlan_en; | ||
520 | int err; | ||
521 | |||
522 | if (system_rev < 130) { | ||
523 | wlan_en = 77; | ||
524 | bt_reset = 78; | ||
525 | } else { | ||
526 | wlan_en = 71; | ||
527 | bt_reset = 70; | ||
528 | } | ||
529 | |||
530 | /* Libertas and CSR reset */ | ||
531 | err = gpio_request(wlan_en, "wlan en"); | ||
532 | if (err) { | ||
533 | pr_err("CM-X300: failed to request wlan en gpio: %d\n", err); | ||
534 | } else { | ||
535 | gpio_direction_output(wlan_en, 1); | ||
536 | gpio_free(wlan_en); | ||
537 | } | ||
538 | |||
539 | err = gpio_request(bt_reset, "bt reset"); | ||
540 | if (err) { | ||
541 | pr_err("CM-X300: failed to request bt reset gpio: %d\n", err); | ||
542 | } else { | ||
543 | gpio_direction_output(bt_reset, 1); | ||
544 | udelay(10); | ||
545 | gpio_set_value(bt_reset, 0); | ||
546 | udelay(10); | ||
547 | gpio_set_value(bt_reset, 1); | ||
548 | gpio_free(bt_reset); | ||
549 | } | ||
550 | } | ||
551 | |||
552 | /* MFP */ | ||
516 | static void __init cm_x300_init_mfp(void) | 553 | static void __init cm_x300_init_mfp(void) |
517 | { | 554 | { |
518 | /* board-processor specific GPIO initialization */ | 555 | /* board-processor specific GPIO initialization */ |
@@ -542,6 +579,7 @@ static void __init cm_x300_init(void) | |||
542 | cm_x300_init_spi(); | 579 | cm_x300_init_spi(); |
543 | cm_x300_init_rtc(); | 580 | cm_x300_init_rtc(); |
544 | cm_x300_init_ac97(); | 581 | cm_x300_init_ac97(); |
582 | cm_x300_init_wi2wi(); | ||
545 | } | 583 | } |
546 | 584 | ||
547 | static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags, | 585 | static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags, |