Re: [PATCH] USB/ISP1760: Add support for the generic platfrom device centralized driver model (v2)

From: Enrico Scholz
Date: Mon Nov 24 2008 - 11:10:23 EST


Bryan Wu <cooloney@xxxxxxxxxx>
writes:

> - isp1760 interrupt is default setup TRIGGER_LOW
> ...
> + irq = platform_get_irq(pdev, 0);
> ...
> + hcd = isp1760_register(addr->start, resource_size(addr), irq,
> + IRQF_DISABLED | IRQF_SHARED | IRQF_TRIGGER_LOW,
> + &pdev->dev, dev_name(&pdev->dev),
> + devflags);

TRIGGER_LOW default is bad on e.g. XScale platforms which have
edge triggered interrupts. It would be better to use the resource
flags for interrupt configuration. E.g.

----
struct resource *irq_res;
unsigned long flags;

irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);

flags = ((irq_res->flags & IRQF_TRIGGER_MASK) |
((irq_res->flags & IORESOURCE_IRQ_SHAREABLE) ?
IRQF_SHARED : 0));

if ((irq_res->flags & (IORESOURCE_IRQ_HIGHEDGE|IORESOURCE_IRQ_LOWEDGE)))
dev_flags |= ISP1760_FLAG_INTR_EDGE_TRIG;

hcd = isp1760_register(addr->start, resource_size(addr), irq,
IRQF_DISABLED | flags,
&pdev->dev, dev_name(&pdev->dev),
devflags);
----



Enrico

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/