This patch rework the irq_pol register setting for RISING and FALLING interrupt settings only. The at86rf2xx datasheets doens't describe any case for level irq interrupts and it didn't work on a beaglebone with a at86rf231 chip.
Also use IRQ_TYPE_* defines instead of IRQF_* defines. There is no functionality change but irq_get_trigger_type returns IRQ_TYPE_* defines. Signed-off-by: Alexander Aring <alex.ar...@gmail.com> --- drivers/net/ieee802154/at86rf2xx.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/ieee802154/at86rf2xx.c b/drivers/net/ieee802154/at86rf2xx.c index 28d2455..f891f3c 100644 --- a/drivers/net/ieee802154/at86rf2xx.c +++ b/drivers/net/ieee802154/at86rf2xx.c @@ -1091,11 +1091,17 @@ static int at86rf2xx_hw_init(struct at86rf2xx_local *lp) return rc; irq_type = irq_get_trigger_type(lp->spi->irq); - /* configure irq polarity, defaults to high active */ - if (irq_type & (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW)) - irq_pol = IRQ_ACTIVE_LOW; - else + switch (irq_type) { + case IRQ_TYPE_EDGE_RISING: irq_pol = IRQ_ACTIVE_HIGH; + break; + case IRQ_TYPE_EDGE_FALLING: + irq_pol = IRQ_ACTIVE_LOW; + break; + default: + dev_err(&lp->spi->dev, "wrong irq trigger type %d", irq_type); + return -EINVAL; + } rc = at86rf2xx_write_subreg(lp, SR_IRQ_POLARITY, irq_pol); if (rc) -- 2.0.0 ------------------------------------------------------------------------------ HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration http://p.sf.net/sfu/hpccsystems _______________________________________________ Linux-zigbee-devel mailing list Linux-zigbee-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel