Commit 1db0558e authored by Alexander Aring's avatar Alexander Aring Committed by David S. Miller

at86rf230: rework irq_pol setting

This patch rework the irq_pol register setting for rising and falling
interrupt settings only. The default behaviour should be rising flag.

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: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6bd2b132
...@@ -1276,7 +1276,7 @@ static struct at86rf2xx_chip_data at86rf212_data = { ...@@ -1276,7 +1276,7 @@ static struct at86rf2xx_chip_data at86rf212_data = {
static int at86rf230_hw_init(struct at86rf230_local *lp) static int at86rf230_hw_init(struct at86rf230_local *lp)
{ {
int rc, irq_pol, irq_type; int rc, irq_type, irq_pol = IRQ_ACTIVE_HIGH;
unsigned int dvdd; unsigned int dvdd;
u8 csma_seed[2]; u8 csma_seed[2];
...@@ -1285,11 +1285,8 @@ static int at86rf230_hw_init(struct at86rf230_local *lp) ...@@ -1285,11 +1285,8 @@ static int at86rf230_hw_init(struct at86rf230_local *lp)
return rc; return rc;
irq_type = irq_get_trigger_type(lp->spi->irq); irq_type = irq_get_trigger_type(lp->spi->irq);
/* configure irq polarity, defaults to high active */ if (irq_type == IRQ_TYPE_EDGE_FALLING)
if (irq_type & (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW))
irq_pol = IRQ_ACTIVE_LOW; irq_pol = IRQ_ACTIVE_LOW;
else
irq_pol = IRQ_ACTIVE_HIGH;
rc = at86rf230_write_subreg(lp, SR_IRQ_POLARITY, irq_pol); rc = at86rf230_write_subreg(lp, SR_IRQ_POLARITY, irq_pol);
if (rc) if (rc)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment