aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-07-02 18:20:50 -0400
committerDavid S. Miller <davem@davemloft.net>2014-07-08 00:29:25 -0400
commit1db0558e87ddf0e4892963602b35ac079b507dd9 (patch)
treee3399ddc2d07bd41bb32a1555def0a0a17920669
parent6bd2b132bfbaea46abbcc65f1be57709b2fb601a (diff)
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: Alexander Aring <alex.aring@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ieee802154/at86rf230.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 492fb7e7675d..46db6f8fb58f 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -1276,7 +1276,7 @@ static struct at86rf2xx_chip_data at86rf212_data = {
1276 1276
1277static int at86rf230_hw_init(struct at86rf230_local *lp) 1277static int at86rf230_hw_init(struct at86rf230_local *lp)
1278{ 1278{
1279 int rc, irq_pol, irq_type; 1279 int rc, irq_type, irq_pol = IRQ_ACTIVE_HIGH;
1280 unsigned int dvdd; 1280 unsigned int dvdd;
1281 u8 csma_seed[2]; 1281 u8 csma_seed[2];
1282 1282
@@ -1285,11 +1285,8 @@ static int at86rf230_hw_init(struct at86rf230_local *lp)
1285 return rc; 1285 return rc;
1286 1286
1287 irq_type = irq_get_trigger_type(lp->spi->irq); 1287 irq_type = irq_get_trigger_type(lp->spi->irq);
1288 /* configure irq polarity, defaults to high active */ 1288 if (irq_type == IRQ_TYPE_EDGE_FALLING)
1289 if (irq_type & (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW))
1290 irq_pol = IRQ_ACTIVE_LOW; 1289 irq_pol = IRQ_ACTIVE_LOW;
1291 else
1292 irq_pol = IRQ_ACTIVE_HIGH;
1293 1290
1294 rc = at86rf230_write_subreg(lp, SR_IRQ_POLARITY, irq_pol); 1291 rc = at86rf230_write_subreg(lp, SR_IRQ_POLARITY, irq_pol);
1295 if (rc) 1292 if (rc)