mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
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>
This commit is contained in:
parent
15afbc6878
commit
dffa27e7a8
1 changed files with 8 additions and 0 deletions
|
@ -37,6 +37,7 @@
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <linux/of_device.h>
|
#include <linux/of_device.h>
|
||||||
#include <linux/of_gpio.h>
|
#include <linux/of_gpio.h>
|
||||||
|
#include <linux/pinctrl/consumer.h>
|
||||||
|
|
||||||
#include <mach/spi.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_master *master;
|
||||||
struct spi_imx_data *spi_imx;
|
struct spi_imx_data *spi_imx;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
struct pinctrl *pinctrl;
|
||||||
int i, ret, num_cs;
|
int i, ret, num_cs;
|
||||||
|
|
||||||
if (!np && !mxc_platform_info) {
|
if (!np && !mxc_platform_info) {
|
||||||
|
@ -845,6 +847,12 @@ static int __devinit spi_imx_probe(struct platform_device *pdev)
|
||||||
goto out_iounmap;
|
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);
|
spi_imx->clk = clk_get(&pdev->dev, NULL);
|
||||||
if (IS_ERR(spi_imx->clk)) {
|
if (IS_ERR(spi_imx->clk)) {
|
||||||
dev_err(&pdev->dev, "unable to get clock\n");
|
dev_err(&pdev->dev, "unable to get clock\n");
|
||||||
|
|
Loading…
Reference in a new issue