Commit 71422f9e authored by Barry Song's avatar Barry Song Committed by Grant Likely

SPI: PRIMA2: use the newest APIs of PINCTRL to fix compiling errors

Fix the compiling errors:
drivers/spi/spi-sirf.c: In function 'spi_sirfsoc_probe':
drivers/spi/spi-sirf.c:563: error: implicit declaration of function 'pinmux_get'
drivers/spi/spi-sirf.c:563: warning: assignment makes pointer from integer without a cast
drivers/spi/spi-sirf.c:568: error: implicit declaration of function 'pinmux_enable'
drivers/spi/spi-sirf.c:602: error: implicit declaration of function 'pinmux_disable'
drivers/spi/spi-sirf.c:603: error: implicit declaration of function 'pinmux_put'
make[3]: *** [drivers/spi/spi-sirf.o] Error 1
Signed-off-by: default avatarBarry Song <Baohua.Song@csr.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 067aa481
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
#include <linux/spi/spi.h> #include <linux/spi/spi.h>
#include <linux/spi/spi_bitbang.h> #include <linux/spi/spi_bitbang.h>
#include <linux/pinctrl/pinmux.h> #include <linux/pinctrl/consumer.h>
#define DRIVER_NAME "sirfsoc_spi" #define DRIVER_NAME "sirfsoc_spi"
...@@ -127,7 +127,7 @@ struct sirfsoc_spi { ...@@ -127,7 +127,7 @@ struct sirfsoc_spi {
void __iomem *base; void __iomem *base;
u32 ctrl_freq; /* SPI controller clock speed */ u32 ctrl_freq; /* SPI controller clock speed */
struct clk *clk; struct clk *clk;
struct pinmux *pmx; struct pinctrl *p;
/* rx & tx bufs from the spi_transfer */ /* rx & tx bufs from the spi_transfer */
const void *tx; const void *tx;
...@@ -560,17 +560,15 @@ static int __devinit spi_sirfsoc_probe(struct platform_device *pdev) ...@@ -560,17 +560,15 @@ static int __devinit spi_sirfsoc_probe(struct platform_device *pdev)
master->bus_num = pdev->id; master->bus_num = pdev->id;
sspi->bitbang.master->dev.of_node = pdev->dev.of_node; sspi->bitbang.master->dev.of_node = pdev->dev.of_node;
sspi->pmx = pinmux_get(&pdev->dev, NULL); sspi->p = pinctrl_get_select_default(&pdev->dev);
ret = IS_ERR(sspi->pmx); ret = IS_ERR(sspi->p);
if (ret) if (ret)
goto free_master; goto free_master;
pinmux_enable(sspi->pmx);
sspi->clk = clk_get(&pdev->dev, NULL); sspi->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(sspi->clk)) { if (IS_ERR(sspi->clk)) {
ret = -EINVAL; ret = -EINVAL;
goto free_pmx; goto free_pin;
} }
clk_enable(sspi->clk); clk_enable(sspi->clk);
sspi->ctrl_freq = clk_get_rate(sspi->clk); sspi->ctrl_freq = clk_get_rate(sspi->clk);
...@@ -598,9 +596,8 @@ static int __devinit spi_sirfsoc_probe(struct platform_device *pdev) ...@@ -598,9 +596,8 @@ static int __devinit spi_sirfsoc_probe(struct platform_device *pdev)
free_clk: free_clk:
clk_disable(sspi->clk); clk_disable(sspi->clk);
clk_put(sspi->clk); clk_put(sspi->clk);
free_pmx: free_pin:
pinmux_disable(sspi->pmx); pinctrl_put(sspi->p);
pinmux_put(sspi->pmx);
free_master: free_master:
spi_master_put(master); spi_master_put(master);
err_cs: err_cs:
...@@ -623,8 +620,7 @@ static int __devexit spi_sirfsoc_remove(struct platform_device *pdev) ...@@ -623,8 +620,7 @@ static int __devexit spi_sirfsoc_remove(struct platform_device *pdev)
} }
clk_disable(sspi->clk); clk_disable(sspi->clk);
clk_put(sspi->clk); clk_put(sspi->clk);
pinmux_disable(sspi->pmx); pinctrl_put(sspi->p);
pinmux_put(sspi->pmx);
spi_master_put(master); spi_master_put(master);
return 0; return 0;
} }
......
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