DS1WM: decouple host IRQ and INTR active state settings

The DS1WM driver incorrectly infers the IAS bit (1-wire interrupt active
high) from IRQ settings.  There are devices that have IAS=0 but still need
the IRQ to trigger on a rising edge.  With this patch, machines with DS1WM
that need IAS=1 have to set .active_high=1 in the ds1wm_platform_data.

Signed-off-by: Philipp Zabel <[email protected]>
Acked-by: Evgeniy Polyakov <[email protected]>
Acked-by: Matt Reimer <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Philipp Zabel 2008-02-07 00:13:22 -08:00 • committed by Linus Torvalds
commit 4aa323bd83
2 changed files with 6 additions and 4 deletions

View file

@ -361,11 +361,12 @@ static int ds1wm_probe(struct platform_device *pdev)
goto err1;
}
ds1wm_data->irq = res->start;
ds1wm_data->active_high = (res->flags & IORESOURCE_IRQ_HIGHEDGE) ?
1 : 0;
ds1wm_data->active_high = plat->active_high;
set_irq_type(ds1wm_data->irq, ds1wm_data->active_high ?
IRQ_TYPE_EDGE_RISING : IRQ_TYPE_EDGE_FALLING);
if (res->flags & IORESOURCE_IRQ_HIGHEDGE)
set_irq_type(ds1wm_data->irq, IRQ_TYPE_EDGE_RISING);
if (res->flags & IORESOURCE_IRQ_LOWEDGE)
set_irq_type(ds1wm_data->irq, IRQ_TYPE_EDGE_FALLING);
ret = request_irq(ds1wm_data->irq, ds1wm_isr, IRQF_DISABLED,
"ds1wm", ds1wm_data);