aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/pxa27x.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-12 17:17:12 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-12 17:17:12 -0400
commit4aabab2181f20560948c2045ce1faaa9ac1507a8 (patch)
tree6556e126687c9cbb4b4a35a8ad8c327df30ac256 /arch/arm/mach-pxa/pxa27x.c
parentbb50cbbd4beacd5ceda76c32fcb116c67fe8c66c (diff)
parentca9ced7f6798868f9d2c81a59b49f8c2136685d8 (diff)
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (50 commits) [ARM] sa1100: remove boot time RTC initialisation [ARM] sa1100: stop doing our own rtc management over suspend [ARM] 4474/1: Do not check the PSR_F_BIT in valid_user_regs [ARM] 4473/2: Take the HWCAP definitions out of the elf.h file [ARM] pxa: move platform devices to separate header file [ARM] pxa: move device registration into CPU-specific file [ARM] pxa: remove boot time RTC initialisation [ARM] pxa: stop doing our own rtc management over suspend [ARM] 4451/1: pxa: make dma.c generic and remove cpu specific dma code [ARM] 4450/1: pxa: add pxa25x_init_irq() and pxa27x_init_irq() [ARM] 4440/1: PXA: enable the checking of ICIP2 for IRQs [ARM] 4438/1: PXA: remove #ifdef .. #endif from pxa_gpio_demux_handler() [ARM] 4437/1: PXA: move the GPIO IRQ initialization code to pxa_init_irq_gpio() [ARM] 4436/1: PXA: move low IRQ initialization code to pxa_init_irq_low() [ARM] 4435/1: PXA: remove PXA_INTERNAL_IRQS [ARM] 4434/1: PXA: remove PXA_IRQ_SKIP [ARM] pxa: Fix PXA27x suspend type validation, remove pxa_pm_prepare() [ARM] pxa: move pm_ops structure into CPU specific files [ARM] pxa: introduce cpu_is_pxaXXX macros [ARM] pxa: remove MMC register defines from pxa-regs.h ...
Diffstat (limited to 'arch/arm/mach-pxa/pxa27x.c')
-rw-r--r--arch/arm/mach-pxa/pxa27x.c78
1 files changed, 63 insertions, 15 deletions
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 1939acc3f9f7..aa5bb02c897b 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -19,10 +19,14 @@
19 19
20#include <asm/hardware.h> 20#include <asm/hardware.h>
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <asm/arch/irqs.h>
22#include <asm/arch/pxa-regs.h> 23#include <asm/arch/pxa-regs.h>
23#include <asm/arch/ohci.h> 24#include <asm/arch/ohci.h>
25#include <asm/arch/pm.h>
26#include <asm/arch/dma.h>
24 27
25#include "generic.h" 28#include "generic.h"
29#include "devices.h"
26 30
27/* Crystal clock: 13MHz */ 31/* Crystal clock: 13MHz */
28#define BASE_CLK 13000000 32#define BASE_CLK 13000000
@@ -122,17 +126,6 @@ EXPORT_SYMBOL(get_lcdclk_frequency_10khz);
122 126
123#ifdef CONFIG_PM 127#ifdef CONFIG_PM
124 128
125int pxa_cpu_pm_prepare(suspend_state_t state)
126{
127 switch (state) {
128 case PM_SUSPEND_MEM:
129 case PM_SUSPEND_STANDBY:
130 return 0;
131 default:
132 return -EINVAL;
133 }
134}
135
136void pxa_cpu_pm_enter(suspend_state_t state) 129void pxa_cpu_pm_enter(suspend_state_t state)
137{ 130{
138 extern void pxa_cpu_standby(void); 131 extern void pxa_cpu_standby(void);
@@ -162,6 +155,15 @@ void pxa_cpu_pm_enter(suspend_state_t state)
162 } 155 }
163} 156}
164 157
158static int pxa27x_pm_valid(suspend_state_t state)
159{
160 return state == PM_SUSPEND_MEM || state == PM_SUSPEND_STANDBY;
161}
162
163static struct pm_ops pxa27x_pm_ops = {
164 .enter = pxa_pm_enter,
165 .valid = pxa27x_pm_valid,
166};
165#endif 167#endif
166 168
167/* 169/*
@@ -183,7 +185,7 @@ static struct resource pxa27x_ohci_resources[] = {
183 }, 185 },
184}; 186};
185 187
186static struct platform_device ohci_device = { 188static struct platform_device pxaohci_device = {
187 .name = "pxa27x-ohci", 189 .name = "pxa27x-ohci",
188 .id = -1, 190 .id = -1,
189 .dev = { 191 .dev = {
@@ -196,16 +198,62 @@ static struct platform_device ohci_device = {
196 198
197void __init pxa_set_ohci_info(struct pxaohci_platform_data *info) 199void __init pxa_set_ohci_info(struct pxaohci_platform_data *info)
198{ 200{
199 ohci_device.dev.platform_data = info; 201 pxaohci_device.dev.platform_data = info;
200} 202}
201 203
204static struct resource i2c_power_resources[] = {
205 {
206 .start = 0x40f00180,
207 .end = 0x40f001a3,
208 .flags = IORESOURCE_MEM,
209 }, {
210 .start = IRQ_PWRI2C,
211 .end = IRQ_PWRI2C,
212 .flags = IORESOURCE_IRQ,
213 },
214};
215
216static struct platform_device pxai2c_power_device = {
217 .name = "pxa2xx-i2c",
218 .id = 1,
219 .resource = i2c_power_resources,
220 .num_resources = ARRAY_SIZE(i2c_power_resources),
221};
222
202static struct platform_device *devices[] __initdata = { 223static struct platform_device *devices[] __initdata = {
203 &ohci_device, 224 &pxamci_device,
225 &pxaudc_device,
226 &pxafb_device,
227 &ffuart_device,
228 &btuart_device,
229 &stuart_device,
230 &pxai2c_device,
231 &pxai2c_power_device,
232 &pxai2s_device,
233 &pxaficp_device,
234 &pxartc_device,
235 &pxaohci_device,
204}; 236};
205 237
238void __init pxa27x_init_irq(void)
239{
240 pxa_init_irq_low();
241 pxa_init_irq_high();
242 pxa_init_irq_gpio(128);
243}
244
206static int __init pxa27x_init(void) 245static int __init pxa27x_init(void)
207{ 246{
208 return platform_add_devices(devices, ARRAY_SIZE(devices)); 247 int ret = 0;
248 if (cpu_is_pxa27x()) {
249 if ((ret = pxa_init_dma(32)))
250 return ret;
251#ifdef CONFIG_PM
252 pm_set_ops(&pxa27x_pm_ops);
253#endif
254 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
255 }
256 return ret;
209} 257}
210 258
211subsys_initcall(pxa27x_init); 259subsys_initcall(pxa27x_init);