diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-10-28 06:13:00 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-10-28 06:13:00 -0400 |
commit | 9ae21ca362679757786f5abe556c7943e9001426 (patch) | |
tree | db4ab371195fed9d327745eaf12c912f3f74f0e2 /arch/arm/mach-imx/mach-mx27_3ds.c | |
parent | 12ba8d1e9262ce81a695795410bd9ee5c9407ba1 (diff) | |
parent | a3484ffd2acc196ca934369395fe9aac63ed1a47 (diff) |
Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6 into devel-stable
Diffstat (limited to 'arch/arm/mach-imx/mach-mx27_3ds.c')
-rw-r--r-- | arch/arm/mach-imx/mach-mx27_3ds.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c index b8bbd31aa850..84a5ba03f1ba 100644 --- a/arch/arm/mach-imx/mach-mx27_3ds.c +++ b/arch/arm/mach-imx/mach-mx27_3ds.c | |||
@@ -23,16 +23,20 @@ | |||
23 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
24 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
25 | #include <linux/input/matrix_keypad.h> | 25 | #include <linux/input/matrix_keypad.h> |
26 | #include <linux/irq.h> | ||
26 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
27 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
28 | #include <asm/mach/time.h> | 29 | #include <asm/mach/time.h> |
29 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
30 | #include <mach/common.h> | 31 | #include <mach/common.h> |
31 | #include <mach/iomux-mx27.h> | 32 | #include <mach/iomux-mx27.h> |
33 | #include <mach/mmc.h> | ||
32 | 34 | ||
33 | #include "devices-imx27.h" | 35 | #include "devices-imx27.h" |
34 | #include "devices.h" | 36 | #include "devices.h" |
35 | 37 | ||
38 | #define SD1_EN_GPIO (GPIO_PORTB + 25) | ||
39 | |||
36 | static const int mx27pdk_pins[] __initconst = { | 40 | static const int mx27pdk_pins[] __initconst = { |
37 | /* UART1 */ | 41 | /* UART1 */ |
38 | PE12_PF_UART1_TXD, | 42 | PE12_PF_UART1_TXD, |
@@ -58,6 +62,14 @@ static const int mx27pdk_pins[] __initconst = { | |||
58 | PD15_AOUT_FEC_COL, | 62 | PD15_AOUT_FEC_COL, |
59 | PD16_AIN_FEC_TX_ER, | 63 | PD16_AIN_FEC_TX_ER, |
60 | PF23_AIN_FEC_TX_EN, | 64 | PF23_AIN_FEC_TX_EN, |
65 | /* SDHC1 */ | ||
66 | PE18_PF_SD1_D0, | ||
67 | PE19_PF_SD1_D1, | ||
68 | PE20_PF_SD1_D2, | ||
69 | PE21_PF_SD1_D3, | ||
70 | PE22_PF_SD1_CMD, | ||
71 | PE23_PF_SD1_CLK, | ||
72 | SD1_EN_GPIO | GPIO_GPIO | GPIO_OUT, | ||
61 | }; | 73 | }; |
62 | 74 | ||
63 | static const struct imxuart_platform_data uart_pdata __initconst = { | 75 | static const struct imxuart_platform_data uart_pdata __initconst = { |
@@ -85,13 +97,39 @@ static struct matrix_keymap_data mx27_3ds_keymap_data = { | |||
85 | .keymap_size = ARRAY_SIZE(mx27_3ds_keymap), | 97 | .keymap_size = ARRAY_SIZE(mx27_3ds_keymap), |
86 | }; | 98 | }; |
87 | 99 | ||
100 | static int mx27_3ds_sdhc1_init(struct device *dev, irq_handler_t detect_irq, | ||
101 | void *data) | ||
102 | { | ||
103 | return request_irq(IRQ_GPIOB(26), detect_irq, IRQF_TRIGGER_FALLING | | ||
104 | IRQF_TRIGGER_RISING, "sdhc1-card-detect", data); | ||
105 | } | ||
106 | |||
107 | static void mx27_3ds_sdhc1_exit(struct device *dev, void *data) | ||
108 | { | ||
109 | free_irq(IRQ_GPIOB(26), data); | ||
110 | } | ||
111 | |||
112 | static struct imxmmc_platform_data sdhc1_pdata = { | ||
113 | .init = mx27_3ds_sdhc1_init, | ||
114 | .exit = mx27_3ds_sdhc1_exit, | ||
115 | }; | ||
116 | |||
117 | static void mx27_3ds_sdhc1_enable_level_translator(void) | ||
118 | { | ||
119 | /* Turn on TXB0108 OE pin */ | ||
120 | gpio_request(SD1_EN_GPIO, "sd1_enable"); | ||
121 | gpio_direction_output(SD1_EN_GPIO, 1); | ||
122 | } | ||
123 | |||
88 | static void __init mx27pdk_init(void) | 124 | static void __init mx27pdk_init(void) |
89 | { | 125 | { |
90 | mxc_gpio_setup_multiple_pins(mx27pdk_pins, ARRAY_SIZE(mx27pdk_pins), | 126 | mxc_gpio_setup_multiple_pins(mx27pdk_pins, ARRAY_SIZE(mx27pdk_pins), |
91 | "mx27pdk"); | 127 | "mx27pdk"); |
128 | mx27_3ds_sdhc1_enable_level_translator(); | ||
92 | imx27_add_imx_uart0(&uart_pdata); | 129 | imx27_add_imx_uart0(&uart_pdata); |
93 | imx27_add_fec(NULL); | 130 | imx27_add_fec(NULL); |
94 | mxc_register_device(&imx_kpp_device, &mx27_3ds_keymap_data); | 131 | mxc_register_device(&imx_kpp_device, &mx27_3ds_keymap_data); |
132 | mxc_register_device(&mxc_sdhc_device0, &sdhc1_pdata); | ||
95 | } | 133 | } |
96 | 134 | ||
97 | static void __init mx27pdk_timer_init(void) | 135 | static void __init mx27pdk_timer_init(void) |