aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/em-x270.c
diff options
context:
space:
mode:
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}