diff options
author | Barry Song <Baohua.Song@csr.com> | 2012-05-14 22:21:00 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2012-05-20 01:17:31 -0400 |
commit | 71422f9e68d43f3fbc6c8939ca8d1b80aa2e4d1a (patch) | |
tree | df8ba1f5bebf272ea14cdbb01924aaeb65c93525 /drivers/spi/spi-sirf.c | |
parent | 067aa4815a9bc12a569d8a06afef50ba5773afbf (diff) |
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: Barry Song <Baohua.Song@csr.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi/spi-sirf.c')
-rw-r--r-- | drivers/spi/spi-sirf.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c index 52fe495bb32a..ecc3d9763d10 100644 --- a/drivers/spi/spi-sirf.c +++ b/drivers/spi/spi-sirf.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/of_gpio.h> | 19 | #include <linux/of_gpio.h> |
20 | #include <linux/spi/spi.h> | 20 | #include <linux/spi/spi.h> |
21 | #include <linux/spi/spi_bitbang.h> | 21 | #include <linux/spi/spi_bitbang.h> |
22 | #include <linux/pinctrl/pinmux.h> | 22 | #include <linux/pinctrl/consumer.h> |
23 | 23 | ||
24 | #define DRIVER_NAME "sirfsoc_spi" | 24 | #define DRIVER_NAME "sirfsoc_spi" |
25 | 25 | ||
@@ -127,7 +127,7 @@ struct sirfsoc_spi { | |||
127 | void __iomem *base; | 127 | void __iomem *base; |
128 | u32 ctrl_freq; /* SPI controller clock speed */ | 128 | u32 ctrl_freq; /* SPI controller clock speed */ |
129 | struct clk *clk; | 129 | struct clk *clk; |
130 | struct pinmux *pmx; | 130 | struct pinctrl *p; |
131 | 131 | ||
132 | /* rx & tx bufs from the spi_transfer */ | 132 | /* rx & tx bufs from the spi_transfer */ |
133 | const void *tx; | 133 | const void *tx; |
@@ -560,17 +560,15 @@ static int __devinit spi_sirfsoc_probe(struct platform_device *pdev) | |||
560 | master->bus_num = pdev->id; | 560 | master->bus_num = pdev->id; |
561 | sspi->bitbang.master->dev.of_node = pdev->dev.of_node; | 561 | sspi->bitbang.master->dev.of_node = pdev->dev.of_node; |
562 | 562 | ||
563 | sspi->pmx = pinmux_get(&pdev->dev, NULL); | 563 | sspi->p = pinctrl_get_select_default(&pdev->dev); |
564 | ret = IS_ERR(sspi->pmx); | 564 | ret = IS_ERR(sspi->p); |
565 | if (ret) | 565 | if (ret) |
566 | goto free_master; | 566 | goto free_master; |
567 | 567 | ||
568 | pinmux_enable(sspi->pmx); | ||
569 | |||
570 | sspi->clk = clk_get(&pdev->dev, NULL); | 568 | sspi->clk = clk_get(&pdev->dev, NULL); |
571 | if (IS_ERR(sspi->clk)) { | 569 | if (IS_ERR(sspi->clk)) { |
572 | ret = -EINVAL; | 570 | ret = -EINVAL; |
573 | goto free_pmx; | 571 | goto free_pin; |
574 | } | 572 | } |
575 | clk_enable(sspi->clk); | 573 | clk_enable(sspi->clk); |
576 | sspi->ctrl_freq = clk_get_rate(sspi->clk); | 574 | sspi->ctrl_freq = clk_get_rate(sspi->clk); |
@@ -598,9 +596,8 @@ static int __devinit spi_sirfsoc_probe(struct platform_device *pdev) | |||
598 | free_clk: | 596 | free_clk: |
599 | clk_disable(sspi->clk); | 597 | clk_disable(sspi->clk); |
600 | clk_put(sspi->clk); | 598 | clk_put(sspi->clk); |
601 | free_pmx: | 599 | free_pin: |
602 | pinmux_disable(sspi->pmx); | 600 | pinctrl_put(sspi->p); |
603 | pinmux_put(sspi->pmx); | ||
604 | free_master: | 601 | free_master: |
605 | spi_master_put(master); | 602 | spi_master_put(master); |
606 | err_cs: | 603 | err_cs: |
@@ -623,8 +620,7 @@ static int __devexit spi_sirfsoc_remove(struct platform_device *pdev) | |||
623 | } | 620 | } |
624 | clk_disable(sspi->clk); | 621 | clk_disable(sspi->clk); |
625 | clk_put(sspi->clk); | 622 | clk_put(sspi->clk); |
626 | pinmux_disable(sspi->pmx); | 623 | pinctrl_put(sspi->p); |
627 | pinmux_put(sspi->pmx); | ||
628 | spi_master_put(master); | 624 | spi_master_put(master); |
629 | return 0; | 625 | return 0; |
630 | } | 626 | } |