diff options
author | Ian Molton <spyro@f2s.com> | 2008-09-26 08:38:59 -0400 |
---|---|---|
committer | Ian Molton <spyro@f2s.com> | 2008-12-14 22:29:34 -0500 |
commit | b1ae1b7b274f67c149bee4731e38a7516c723de4 (patch) | |
tree | 9f31ef6e8fb28359f6dbc8bb7ecac2c75bce2fa1 /arch/arm/mach-pxa/eseries.c | |
parent | f4ad9a9624fafec4647e7e45469e0446586f81fb (diff) |
[ARM] pxa: Add multi-io support for e-series
This patchset provides support for the TMIO based IO controller used in the
Toshiba e-series PDAs.
Signed-off-by: Ian Molton <spyro@f2s.com>
Acked-by: Samuel Ortiz <sameo@openedhand.com>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/eseries.c')
-rw-r--r-- | arch/arm/mach-pxa/eseries.c | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c index ee79e33b1748..dfce7d5b659e 100644 --- a/arch/arm/mach-pxa/eseries.c +++ b/arch/arm/mach-pxa/eseries.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/gpio.h> | 15 | #include <linux/gpio.h> |
16 | #include <linux/delay.h> | ||
16 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
17 | 18 | ||
18 | #include <asm/setup.h> | 19 | #include <asm/setup.h> |
@@ -26,6 +27,7 @@ | |||
26 | #include <mach/irda.h> | 27 | #include <mach/irda.h> |
27 | 28 | ||
28 | #include "generic.h" | 29 | #include "generic.h" |
30 | #include "clock.h" | ||
29 | 31 | ||
30 | /* Only e800 has 128MB RAM */ | 32 | /* Only e800 has 128MB RAM */ |
31 | void __init eseries_fixup(struct machine_desc *desc, | 33 | void __init eseries_fixup(struct machine_desc *desc, |
@@ -86,3 +88,82 @@ struct pxaficp_platform_data e7xx_ficp_platform_data = { | |||
86 | .shutdown = e7xx_irda_shutdown, | 88 | .shutdown = e7xx_irda_shutdown, |
87 | }; | 89 | }; |
88 | 90 | ||
91 | int eseries_tmio_enable(struct platform_device *dev) | ||
92 | { | ||
93 | /* Reset - bring SUSPEND high before PCLR */ | ||
94 | gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0); | ||
95 | gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0); | ||
96 | msleep(1); | ||
97 | gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1); | ||
98 | msleep(1); | ||
99 | gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 1); | ||
100 | msleep(1); | ||
101 | return 0; | ||
102 | } | ||
103 | |||
104 | int eseries_tmio_disable(struct platform_device *dev) | ||
105 | { | ||
106 | gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0); | ||
107 | gpio_set_value(GPIO_ESERIES_TMIO_PCLR, 0); | ||
108 | return 0; | ||
109 | } | ||
110 | |||
111 | int eseries_tmio_suspend(struct platform_device *dev) | ||
112 | { | ||
113 | gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 0); | ||
114 | return 0; | ||
115 | } | ||
116 | |||
117 | int eseries_tmio_resume(struct platform_device *dev) | ||
118 | { | ||
119 | gpio_set_value(GPIO_ESERIES_TMIO_SUSPEND, 1); | ||
120 | msleep(1); | ||
121 | return 0; | ||
122 | } | ||
123 | |||
124 | void eseries_get_tmio_gpios(void) | ||
125 | { | ||
126 | gpio_request(GPIO_ESERIES_TMIO_SUSPEND, NULL); | ||
127 | gpio_request(GPIO_ESERIES_TMIO_PCLR, NULL); | ||
128 | gpio_direction_output(GPIO_ESERIES_TMIO_SUSPEND, 0); | ||
129 | gpio_direction_output(GPIO_ESERIES_TMIO_PCLR, 0); | ||
130 | } | ||
131 | |||
132 | /* TMIO controller uses the same resources on all e-series machines. */ | ||
133 | struct resource eseries_tmio_resources[] = { | ||
134 | [0] = { | ||
135 | .start = PXA_CS4_PHYS, | ||
136 | .end = PXA_CS4_PHYS + 0x1fffff, | ||
137 | .flags = IORESOURCE_MEM, | ||
138 | }, | ||
139 | [1] = { | ||
140 | .start = IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ), | ||
141 | .end = IRQ_GPIO(GPIO_ESERIES_TMIO_IRQ), | ||
142 | .flags = IORESOURCE_IRQ, | ||
143 | }, | ||
144 | }; | ||
145 | |||
146 | /* Some e-series hardware cannot control the 32K clock */ | ||
147 | static void clk_32k_dummy(struct clk *clk) | ||
148 | { | ||
149 | } | ||
150 | |||
151 | static const struct clkops clk_32k_dummy_ops = { | ||
152 | .enable = clk_32k_dummy, | ||
153 | .disable = clk_32k_dummy, | ||
154 | }; | ||
155 | |||
156 | static struct clk tmio_dummy_clk = { | ||
157 | .ops = &clk_32k_dummy_ops, | ||
158 | .rate = 32768, | ||
159 | }; | ||
160 | |||
161 | static struct clk_lookup eseries_clkregs[] = { | ||
162 | INIT_CLKREG(&tmio_dummy_clk, NULL, "CLK_CK32K"), | ||
163 | }; | ||
164 | |||
165 | void eseries_register_clks(void) | ||
166 | { | ||
167 | clks_register(eseries_clkregs, ARRAY_SIZE(eseries_clkregs)); | ||
168 | } | ||
169 | |||