aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/em-x270.c
diff options
context:
space:
mode:
authorMike Rapoport <mike@compulab.co.il>2009-05-12 09:31:14 -0400
committerEric Miao <eric.y.miao@gmail.com>2009-06-04 22:50:24 -0400
commit2f15cb594e0c17177bd79ead9234cc6806954e6f (patch)
treedf46f25a7d6eda7b3121ae1371b2295973c3de47 /arch/arm/mach-pxa/em-x270.c
parent76e3fc36eb3d78997e7f4dcdc01cc38dc3178201 (diff)
[ARM] pxa/em-x270: update libertas device setup
Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'arch/arm/mach-pxa/em-x270.c')
-rw-r--r--arch/arm/mach-pxa/em-x270.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index e2f9834e2daa..65e8dbad06b3 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -684,26 +684,52 @@ static int em_x270_libertas_setup(struct spi_device *spi)
684 if (err) 684 if (err)
685 return err; 685 return err;
686 686
687 err = gpio_request(GPIO19_WLAN_STRAP, "WLAN STRAP");
688 if (err)
689 goto err_free_pwen;
690
691 if (machine_is_exeda()) {
692 err = gpio_request(GPIO37_WLAN_RST, "WLAN RST");
693 if (err)
694 goto err_free_strap;
695
696 gpio_direction_output(GPIO37_WLAN_RST, 1);
697 msleep(100);
698 }
699
687 gpio_direction_output(GPIO19_WLAN_STRAP, 1); 700 gpio_direction_output(GPIO19_WLAN_STRAP, 1);
688 mdelay(100); 701 msleep(100);
689 702
690 pxa2xx_mfp_config(ARRAY_AND_SIZE(em_x270_libertas_pin_config)); 703 pxa2xx_mfp_config(ARRAY_AND_SIZE(em_x270_libertas_pin_config));
691 704
692 gpio_direction_output(GPIO115_WLAN_PWEN, 0); 705 gpio_direction_output(GPIO115_WLAN_PWEN, 0);
693 mdelay(100); 706 msleep(100);
694 gpio_set_value(GPIO115_WLAN_PWEN, 1); 707 gpio_set_value(GPIO115_WLAN_PWEN, 1);
695 mdelay(100); 708 msleep(100);
696 709
697 spi->bits_per_word = 16; 710 spi->bits_per_word = 16;
698 spi_setup(spi); 711 spi_setup(spi);
699 712
700 return 0; 713 return 0;
714
715err_free_strap:
716 gpio_free(GPIO19_WLAN_STRAP);
717err_free_pwen:
718 gpio_free(GPIO115_WLAN_PWEN);
719
720 return err;
701} 721}
702 722
703static int em_x270_libertas_teardown(struct spi_device *spi) 723static int em_x270_libertas_teardown(struct spi_device *spi)
704{ 724{
705 gpio_set_value(GPIO115_WLAN_PWEN, 0); 725 gpio_set_value(GPIO115_WLAN_PWEN, 0);
706 gpio_free(GPIO115_WLAN_PWEN); 726 gpio_free(GPIO115_WLAN_PWEN);
727 gpio_free(GPIO19_WLAN_STRAP);
728
729 if (machine_is_exeda()) {
730 gpio_set_value(GPIO37_WLAN_RST, 0);
731 gpio_free(GPIO37_WLAN_RST);
732 }
707 733
708 return 0; 734 return 0;
709} 735}