aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Ott <alan@signal11.us>2013-03-18 08:06:40 -0400
committerDavid S. Miller <davem@davemloft.net>2013-03-19 10:07:49 -0400
commit50861c7effcad107826e49e6077e64b666c2dc3f (patch)
tree2eb63432917291a7c5b9d6a40eba861662d93845
parentc9bbb75f1dffef0e6ac47abf32cdb668d5e1a867 (diff)
mrf24j40: pinctrl support
Activate pinctrl settings when used with a DT system. Signed-off-by: Alan Ott <alan@signal11.us> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ieee802154/mrf24j40.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
index 3f2c7aaf28c4..3106895e8b91 100644
--- a/drivers/net/ieee802154/mrf24j40.c
+++ b/drivers/net/ieee802154/mrf24j40.c
@@ -22,6 +22,7 @@
22#include <linux/spi/spi.h> 22#include <linux/spi/spi.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/pinctrl/consumer.h>
25#include <net/wpan-phy.h> 26#include <net/wpan-phy.h>
26#include <net/mac802154.h> 27#include <net/mac802154.h>
27 28
@@ -623,6 +624,7 @@ static int mrf24j40_probe(struct spi_device *spi)
623 int ret = -ENOMEM; 624 int ret = -ENOMEM;
624 u8 val; 625 u8 val;
625 struct mrf24j40 *devrec; 626 struct mrf24j40 *devrec;
627 struct pinctrl *pinctrl;
626 628
627 printk(KERN_INFO "mrf24j40: probe(). IRQ: %d\n", spi->irq); 629 printk(KERN_INFO "mrf24j40: probe(). IRQ: %d\n", spi->irq);
628 630
@@ -633,6 +635,11 @@ static int mrf24j40_probe(struct spi_device *spi)
633 if (!devrec->buf) 635 if (!devrec->buf)
634 goto err_buf; 636 goto err_buf;
635 637
638 pinctrl = devm_pinctrl_get_select_default(&spi->dev);
639 if (IS_ERR(pinctrl))
640 dev_warn(&spi->dev,
641 "pinctrl pins are not configured from the driver");
642
636 spi->mode = SPI_MODE_0; /* TODO: Is this appropriate for right here? */ 643 spi->mode = SPI_MODE_0; /* TODO: Is this appropriate for right here? */
637 if (spi->max_speed_hz > MAX_SPI_SPEED_HZ) 644 if (spi->max_speed_hz > MAX_SPI_SPEED_HZ)
638 spi->max_speed_hz = MAX_SPI_SPEED_HZ; 645 spi->max_speed_hz = MAX_SPI_SPEED_HZ;