diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-05-11 08:44:27 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-11 08:44:31 -0400 |
commit | 41fb454ebe6024f5c1e3b3cbc0abc0da762e7b51 (patch) | |
tree | 51c50bcb67a5039448ddfa1869d7948cab1217e9 /arch/arm/mach-pxa/em-x270.c | |
parent | 19c1a6f5764d787113fa323ffb18be7991208f82 (diff) | |
parent | 091bf7624d1c90cec9e578a18529f615213ff847 (diff) |
Merge commit 'v2.6.30-rc5' into core/iommu
Merge reason: core/iommu was on an .30-rc1 base,
update it to .30-rc5 to refresh.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/arm/mach-pxa/em-x270.c')
-rw-r--r-- | arch/arm/mach-pxa/em-x270.c | 90 |
1 files changed, 80 insertions, 10 deletions
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c index 920dfb8d36da..bc0f73fbd4ca 100644 --- a/arch/arm/mach-pxa/em-x270.c +++ b/arch/arm/mach-pxa/em-x270.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/regulator/machine.h> | 25 | #include <linux/regulator/machine.h> |
26 | #include <linux/spi/spi.h> | 26 | #include <linux/spi/spi.h> |
27 | #include <linux/spi/tdo24m.h> | 27 | #include <linux/spi/tdo24m.h> |
28 | #include <linux/spi/libertas_spi.h> | ||
28 | #include <linux/power_supply.h> | 29 | #include <linux/power_supply.h> |
29 | #include <linux/apm-emulation.h> | 30 | #include <linux/apm-emulation.h> |
30 | 31 | ||
@@ -62,6 +63,8 @@ | |||
62 | #define GPIO93_CAM_RESET (93) | 63 | #define GPIO93_CAM_RESET (93) |
63 | #define GPIO41_ETHIRQ (41) | 64 | #define GPIO41_ETHIRQ (41) |
64 | #define EM_X270_ETHIRQ IRQ_GPIO(GPIO41_ETHIRQ) | 65 | #define EM_X270_ETHIRQ IRQ_GPIO(GPIO41_ETHIRQ) |
66 | #define GPIO115_WLAN_PWEN (115) | ||
67 | #define GPIO19_WLAN_STRAP (19) | ||
65 | 68 | ||
66 | static int mmc_cd; | 69 | static int mmc_cd; |
67 | static int nand_rb; | 70 | static int nand_rb; |
@@ -159,8 +162,8 @@ static unsigned long common_pin_config[] = { | |||
159 | GPIO57_SSP1_TXD, | 162 | GPIO57_SSP1_TXD, |
160 | 163 | ||
161 | /* SSP2 */ | 164 | /* SSP2 */ |
162 | GPIO19_SSP2_SCLK, | 165 | GPIO19_GPIO, /* SSP2 clock is used as GPIO for Libertas pin-strap */ |
163 | GPIO14_SSP2_SFRM, | 166 | GPIO14_GPIO, |
164 | GPIO89_SSP2_TXD, | 167 | GPIO89_SSP2_TXD, |
165 | GPIO88_SSP2_RXD, | 168 | GPIO88_SSP2_RXD, |
166 | 169 | ||
@@ -640,28 +643,95 @@ static struct pxa2xx_spi_master em_x270_spi_info = { | |||
640 | }; | 643 | }; |
641 | 644 | ||
642 | static struct pxa2xx_spi_chip em_x270_tdo24m_chip = { | 645 | static struct pxa2xx_spi_chip em_x270_tdo24m_chip = { |
643 | .rx_threshold = 1, | 646 | .rx_threshold = 1, |
644 | .tx_threshold = 1, | 647 | .tx_threshold = 1, |
648 | .gpio_cs = -1, | ||
645 | }; | 649 | }; |
646 | 650 | ||
647 | static struct tdo24m_platform_data em_x270_tdo24m_pdata = { | 651 | static struct tdo24m_platform_data em_x270_tdo24m_pdata = { |
648 | .model = TDO35S, | 652 | .model = TDO35S, |
649 | }; | 653 | }; |
650 | 654 | ||
655 | static struct pxa2xx_spi_master em_x270_spi_2_info = { | ||
656 | .num_chipselect = 1, | ||
657 | .enable_dma = 1, | ||
658 | }; | ||
659 | |||
660 | static struct pxa2xx_spi_chip em_x270_libertas_chip = { | ||
661 | .rx_threshold = 1, | ||
662 | .tx_threshold = 1, | ||
663 | .timeout = 1000, | ||
664 | }; | ||
665 | |||
666 | static unsigned long em_x270_libertas_pin_config[] = { | ||
667 | /* SSP2 */ | ||
668 | GPIO19_SSP2_SCLK, | ||
669 | GPIO14_GPIO, | ||
670 | GPIO89_SSP2_TXD, | ||
671 | GPIO88_SSP2_RXD, | ||
672 | }; | ||
673 | |||
674 | static int em_x270_libertas_setup(struct spi_device *spi) | ||
675 | { | ||
676 | int err = gpio_request(GPIO115_WLAN_PWEN, "WLAN PWEN"); | ||
677 | if (err) | ||
678 | return err; | ||
679 | |||
680 | gpio_direction_output(GPIO19_WLAN_STRAP, 1); | ||
681 | mdelay(100); | ||
682 | |||
683 | pxa2xx_mfp_config(ARRAY_AND_SIZE(em_x270_libertas_pin_config)); | ||
684 | |||
685 | gpio_direction_output(GPIO115_WLAN_PWEN, 0); | ||
686 | mdelay(100); | ||
687 | gpio_set_value(GPIO115_WLAN_PWEN, 1); | ||
688 | mdelay(100); | ||
689 | |||
690 | spi->bits_per_word = 16; | ||
691 | spi_setup(spi); | ||
692 | |||
693 | return 0; | ||
694 | } | ||
695 | |||
696 | static int em_x270_libertas_teardown(struct spi_device *spi) | ||
697 | { | ||
698 | gpio_set_value(GPIO115_WLAN_PWEN, 0); | ||
699 | gpio_free(GPIO115_WLAN_PWEN); | ||
700 | |||
701 | return 0; | ||
702 | } | ||
703 | |||
704 | struct libertas_spi_platform_data em_x270_libertas_pdata = { | ||
705 | .use_dummy_writes = 1, | ||
706 | .gpio_cs = 14, | ||
707 | .setup = em_x270_libertas_setup, | ||
708 | .teardown = em_x270_libertas_teardown, | ||
709 | }; | ||
710 | |||
651 | static struct spi_board_info em_x270_spi_devices[] __initdata = { | 711 | static struct spi_board_info em_x270_spi_devices[] __initdata = { |
652 | { | 712 | { |
653 | .modalias = "tdo24m", | 713 | .modalias = "tdo24m", |
654 | .max_speed_hz = 1000000, | 714 | .max_speed_hz = 1000000, |
655 | .bus_num = 1, | 715 | .bus_num = 1, |
656 | .chip_select = 0, | 716 | .chip_select = 0, |
657 | .controller_data = &em_x270_tdo24m_chip, | 717 | .controller_data = &em_x270_tdo24m_chip, |
658 | .platform_data = &em_x270_tdo24m_pdata, | 718 | .platform_data = &em_x270_tdo24m_pdata, |
719 | }, | ||
720 | { | ||
721 | .modalias = "libertas_spi", | ||
722 | .max_speed_hz = 13000000, | ||
723 | .bus_num = 2, | ||
724 | .irq = IRQ_GPIO(116), | ||
725 | .chip_select = 0, | ||
726 | .controller_data = &em_x270_libertas_chip, | ||
727 | .platform_data = &em_x270_libertas_pdata, | ||
659 | }, | 728 | }, |
660 | }; | 729 | }; |
661 | 730 | ||
662 | static void __init em_x270_init_spi(void) | 731 | static void __init em_x270_init_spi(void) |
663 | { | 732 | { |
664 | pxa2xx_set_spi_info(1, &em_x270_spi_info); | 733 | pxa2xx_set_spi_info(1, &em_x270_spi_info); |
734 | pxa2xx_set_spi_info(2, &em_x270_spi_2_info); | ||
665 | spi_register_board_info(ARRAY_AND_SIZE(em_x270_spi_devices)); | 735 | spi_register_board_info(ARRAY_AND_SIZE(em_x270_spi_devices)); |
666 | } | 736 | } |
667 | #else | 737 | #else |