sa1111.c (a8a93c6f9922c0d70459668c1300b226cb3918ab) sa1111.c (4ed89f2228061422ce5f62545fd0b6f6648bd2cc)
1/*
2 * linux/arch/arm/common/sa1111.c
3 *
4 * SA1111 support
5 *
6 * Original code by John Dorsey
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 268 unchanged lines hidden (view full) ---

277 for (i = 0; i < 8; i++) {
278 sa1111_writel(ip0 ^ mask, mapbase + SA1111_INTPOL0);
279 sa1111_writel(ip0, mapbase + SA1111_INTPOL0);
280 if (sa1111_readl(mapbase + SA1111_INTSTATCLR0) & mask)
281 break;
282 }
283
284 if (i == 8)
1/*
2 * linux/arch/arm/common/sa1111.c
3 *
4 * SA1111 support
5 *
6 * Original code by John Dorsey
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 268 unchanged lines hidden (view full) ---

277 for (i = 0; i < 8; i++) {
278 sa1111_writel(ip0 ^ mask, mapbase + SA1111_INTPOL0);
279 sa1111_writel(ip0, mapbase + SA1111_INTPOL0);
280 if (sa1111_readl(mapbase + SA1111_INTSTATCLR0) & mask)
281 break;
282 }
283
284 if (i == 8)
285 printk(KERN_ERR "Danger Will Robinson: failed to "
286 "re-trigger IRQ%d\n", d->irq);
285 pr_err("Danger Will Robinson: failed to re-trigger IRQ%d\n",
286 d->irq);
287 return i == 8 ? -1 : 0;
288}
289
290static int sa1111_type_lowirq(struct irq_data *d, unsigned int flags)
291{
292 struct sa1111 *sachip = irq_data_get_irq_chip_data(d);
293 void __iomem *mapbase = sachip->base + SA1111_INTC;
294 unsigned int mask = SA1111_IRQMASK_LO(d->irq);

--- 84 unchanged lines hidden (view full) ---

379 for (i = 0; i < 8; i++) {
380 sa1111_writel(ip1 ^ mask, mapbase + SA1111_INTPOL1);
381 sa1111_writel(ip1, mapbase + SA1111_INTPOL1);
382 if (sa1111_readl(mapbase + SA1111_INTSTATCLR1) & mask)
383 break;
384 }
385
386 if (i == 8)
287 return i == 8 ? -1 : 0;
288}
289
290static int sa1111_type_lowirq(struct irq_data *d, unsigned int flags)
291{
292 struct sa1111 *sachip = irq_data_get_irq_chip_data(d);
293 void __iomem *mapbase = sachip->base + SA1111_INTC;
294 unsigned int mask = SA1111_IRQMASK_LO(d->irq);

--- 84 unchanged lines hidden (view full) ---

379 for (i = 0; i < 8; i++) {
380 sa1111_writel(ip1 ^ mask, mapbase + SA1111_INTPOL1);
381 sa1111_writel(ip1, mapbase + SA1111_INTPOL1);
382 if (sa1111_readl(mapbase + SA1111_INTSTATCLR1) & mask)
383 break;
384 }
385
386 if (i == 8)
387 printk(KERN_ERR "Danger Will Robinson: failed to "
388 "re-trigger IRQ%d\n", d->irq);
387 pr_err("Danger Will Robinson: failed to re-trigger IRQ%d\n",
388 d->irq);
389 return i == 8 ? -1 : 0;
390}
391
392static int sa1111_type_highirq(struct irq_data *d, unsigned int flags)
393{
394 struct sa1111 *sachip = irq_data_get_irq_chip_data(d);
395 void __iomem *mapbase = sachip->base + SA1111_INTC;
396 unsigned int mask = SA1111_IRQMASK_HI(d->irq);

--- 338 unchanged lines hidden (view full) ---

735 */
736 id = sa1111_readl(sachip->base + SA1111_SKID);
737 if ((id & SKID_ID_MASK) != SKID_SA1111_ID) {
738 printk(KERN_DEBUG "SA1111 not detected: ID = %08lx\n", id);
739 ret = -ENODEV;
740 goto err_unmap;
741 }
742
389 return i == 8 ? -1 : 0;
390}
391
392static int sa1111_type_highirq(struct irq_data *d, unsigned int flags)
393{
394 struct sa1111 *sachip = irq_data_get_irq_chip_data(d);
395 void __iomem *mapbase = sachip->base + SA1111_INTC;
396 unsigned int mask = SA1111_IRQMASK_HI(d->irq);

--- 338 unchanged lines hidden (view full) ---

735 */
736 id = sa1111_readl(sachip->base + SA1111_SKID);
737 if ((id & SKID_ID_MASK) != SKID_SA1111_ID) {
738 printk(KERN_DEBUG "SA1111 not detected: ID = %08lx\n", id);
739 ret = -ENODEV;
740 goto err_unmap;
741 }
742
743 printk(KERN_INFO "SA1111 Microprocessor Companion Chip: "
744 "silicon revision %lx, metal revision %lx\n",
745 (id & SKID_SIREV_MASK)>>4, (id & SKID_MTREV_MASK));
743 pr_info("SA1111 Microprocessor Companion Chip: silicon revision %lx, metal revision %lx\n",
744 (id & SKID_SIREV_MASK) >> 4, id & SKID_MTREV_MASK);
746
747 /*
748 * We found it. Wake the chip up, and initialise.
749 */
750 sa1111_wake(sachip);
751
752 /*
753 * The interrupt controller must be initialised before any

--- 298 unchanged lines hidden (view full) ---

1052 */
1053static struct platform_driver sa1111_device_driver = {
1054 .probe = sa1111_probe,
1055 .remove = sa1111_remove,
1056 .suspend = sa1111_suspend,
1057 .resume = sa1111_resume,
1058 .driver = {
1059 .name = "sa1111",
745
746 /*
747 * We found it. Wake the chip up, and initialise.
748 */
749 sa1111_wake(sachip);
750
751 /*
752 * The interrupt controller must be initialised before any

--- 298 unchanged lines hidden (view full) ---

1051 */
1052static struct platform_driver sa1111_device_driver = {
1053 .probe = sa1111_probe,
1054 .remove = sa1111_remove,
1055 .suspend = sa1111_suspend,
1056 .resume = sa1111_resume,
1057 .driver = {
1058 .name = "sa1111",
1059 .owner = THIS_MODULE,
1060 },
1061};
1062
1063/*
1064 * Get the parent device driver (us) structure
1065 * from a child function device
1066 */
1067static inline struct sa1111 *sa1111_chip_driver(struct sa1111_dev *sadev)

--- 390 unchanged lines hidden ---
1060 },
1061};
1062
1063/*
1064 * Get the parent device driver (us) structure
1065 * from a child function device
1066 */
1067static inline struct sa1111 *sa1111_chip_driver(struct sa1111_dev *sadev)

--- 390 unchanged lines hidden ---