#include <asm/hardware/sa1111.h>
+#ifdef CONFIG_ARCH_PXA
+#include <asm/arch/pxa-regs.h>
+#endif
+
extern void __init sa1110_mb_enable(void);
/*
* %-EBUSY physical address already marked in-use.
* %0 successful.
*/
-static int __init
+static int
__sa1111_probe(struct device *me, struct resource *mem, int irq)
{
struct sa1111 *sachip;
*/
int dma_needs_bounce(struct device *dev, dma_addr_t addr, size_t size)
{
- unsigned int physaddr = SA1111_DMA_ADDR((unsigned int)addr);
- u32 dma_mask = *dev->dma_mask;
-
/*
* Section 4.6 of the "Intel StrongARM SA-1111 Development Module
* User's Guide" mentions that jumpers R51 and R52 control the
* SDRAM bank 1 on Neponset). The default configuration selects
* Assabet, so any address in bank 1 is necessarily invalid.
*/
- if ((machine_is_assabet() || machine_is_pfs168()) &&
- (addr >= 0xc8000000 || (addr + size) >= 0xc8000000))
- return 1;
-
- /*
- * Check to see if either the start or end are illegal.
- */
- return ((addr & ~dma_mask)) || ((addr + size - 1) & ~dma_mask);
+ return ((machine_is_assabet() || machine_is_pfs168()) &&
+ (addr >= 0xc8000000 || (addr + size) >= 0xc8000000));
}
struct sa1111_save_data {
static int sa1111_probe(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
- struct resource *mem = NULL, *irq = NULL;
- int i;
+ struct resource *mem;
+ int irq;
- for (i = 0; i < pdev->num_resources; i++) {
- if (pdev->resource[i].flags & IORESOURCE_MEM)
- mem = &pdev->resource[i];
- if (pdev->resource[i].flags & IORESOURCE_IRQ)
- irq = &pdev->resource[i];
- }
- return __sa1111_probe(dev, mem, irq ? irq->start : NO_IRQ);
+ mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!mem)
+ return -EINVAL;
+ irq = platform_get_irq(pdev, 0);
+
+ return __sa1111_probe(dev, mem, irq);
}
static int sa1111_remove(struct device *dev)