Commit 50861c7e authored by Alan Ott's avatar Alan Ott Committed by David S. Miller

mrf24j40: pinctrl support

Activate pinctrl settings when used with a DT system.
Signed-off-by: default avatarAlan Ott <alan@signal11.us>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c9bbb75f
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pinctrl/consumer.h>
#include <net/wpan-phy.h> #include <net/wpan-phy.h>
#include <net/mac802154.h> #include <net/mac802154.h>
...@@ -623,6 +624,7 @@ static int mrf24j40_probe(struct spi_device *spi) ...@@ -623,6 +624,7 @@ static int mrf24j40_probe(struct spi_device *spi)
int ret = -ENOMEM; int ret = -ENOMEM;
u8 val; u8 val;
struct mrf24j40 *devrec; struct mrf24j40 *devrec;
struct pinctrl *pinctrl;
printk(KERN_INFO "mrf24j40: probe(). IRQ: %d\n", spi->irq); printk(KERN_INFO "mrf24j40: probe(). IRQ: %d\n", spi->irq);
...@@ -633,6 +635,11 @@ static int mrf24j40_probe(struct spi_device *spi) ...@@ -633,6 +635,11 @@ static int mrf24j40_probe(struct spi_device *spi)
if (!devrec->buf) if (!devrec->buf)
goto err_buf; goto err_buf;
pinctrl = devm_pinctrl_get_select_default(&spi->dev);
if (IS_ERR(pinctrl))
dev_warn(&spi->dev,
"pinctrl pins are not configured from the driver");
spi->mode = SPI_MODE_0; /* TODO: Is this appropriate for right here? */ spi->mode = SPI_MODE_0; /* TODO: Is this appropriate for right here? */
if (spi->max_speed_hz > MAX_SPI_SPEED_HZ) if (spi->max_speed_hz > MAX_SPI_SPEED_HZ)
spi->max_speed_hz = MAX_SPI_SPEED_HZ; spi->max_speed_hz = MAX_SPI_SPEED_HZ;
......
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