diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-05-06 08:28:12 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-05-11 21:43:11 -0400 |
commit | dffa27e7a8626ed2d64f027b0f844fe6fe438c11 (patch) | |
tree | d528c04f789b2c83cfe174e88100fbca6bc71647 /drivers/spi/spi-imx.c | |
parent | 15afbc68780f8c06c5b5590adcbf7534ee1920b3 (diff) |
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/spi-imx.c')
-rw-r--r-- | drivers/spi/spi-imx.c | 8 |
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 @@ | |||
37 | #include <linux/of.h> | 37 | #include <linux/of.h> |
38 | #include <linux/of_device.h> | 38 | #include <linux/of_device.h> |
39 | #include <linux/of_gpio.h> | 39 | #include <linux/of_gpio.h> |
40 | #include <linux/pinctrl/consumer.h> | ||
40 | 41 | ||
41 | #include <mach/spi.h> | 42 | #include <mach/spi.h> |
42 | 43 | ||
@@ -758,6 +759,7 @@ static int __devinit spi_imx_probe(struct platform_device *pdev) | |||
758 | struct spi_master *master; | 759 | struct spi_master *master; |
759 | struct spi_imx_data *spi_imx; | 760 | struct spi_imx_data *spi_imx; |
760 | struct resource *res; | 761 | struct resource *res; |
762 | struct pinctrl *pinctrl; | ||
761 | int i, ret, num_cs; | 763 | int i, ret, num_cs; |
762 | 764 | ||
763 | if (!np && !mxc_platform_info) { | 765 | if (!np && !mxc_platform_info) { |
@@ -845,6 +847,12 @@ static int __devinit spi_imx_probe(struct platform_device *pdev) | |||
845 | goto out_iounmap; | 847 | goto out_iounmap; |
846 | } | 848 | } |
847 | 849 | ||
850 | pinctrl = devm_pinctrl_get_select_default(&pdev->dev); | ||
851 | if (IS_ERR(pinctrl)) { | ||
852 | ret = PTR_ERR(pinctrl); | ||
853 | goto out_free_irq; | ||
854 | } | ||
855 | |||
848 | spi_imx->clk = clk_get(&pdev->dev, NULL); | 856 | spi_imx->clk = clk_get(&pdev->dev, NULL); |
849 | if (IS_ERR(spi_imx->clk)) { | 857 | if (IS_ERR(spi_imx->clk)) { |
850 | dev_err(&pdev->dev, "unable to get clock\n"); | 858 | dev_err(&pdev->dev, "unable to get clock\n"); |