summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2012-05-06 20:28:12 +0800
committerShawn Guo <shawn.guo@linaro.org>2012-05-12 09:43:11 +0800
commitdffa27e7a8626ed2d64f027b0f844fe6fe438c11 (patch)
treed528c04f789b2c83cfe174e88100fbca6bc71647 /drivers/spi
parent15afbc68780f8c06c5b5590adcbf7534ee1920b3 (diff)
downloadlinux-dffa27e7a8626ed2d64f027b0f844fe6fe438c11.tar.gz
linux-dffa27e7a8626ed2d64f027b0f844fe6fe438c11.tar.bz2
linux-dffa27e7a8626ed2d64f027b0f844fe6fe438c11.zip
spi/imx: adopt pinctrl support
Cc: spi-devel-general@lists.sourceforge.net Cc: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-imx.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 570f22053be8..69c9a6601f45 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -37,6 +37,7 @@
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_gpio.h>
+#include <linux/pinctrl/consumer.h>
#include <mach/spi.h>
@@ -758,6 +759,7 @@ static int __devinit spi_imx_probe(struct platform_device *pdev)
struct spi_master *master;
struct spi_imx_data *spi_imx;
struct resource *res;
+ struct pinctrl *pinctrl;
int i, ret, num_cs;
if (!np && !mxc_platform_info) {
@@ -845,6 +847,12 @@ static int __devinit spi_imx_probe(struct platform_device *pdev)
goto out_iounmap;
}
+ pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+ if (IS_ERR(pinctrl)) {
+ ret = PTR_ERR(pinctrl);
+ goto out_free_irq;
+ }
+
spi_imx->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(spi_imx->clk)) {
dev_err(&pdev->dev, "unable to get clock\n");