aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/spi/spi-sirf.c20
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)
598free_clk: 596free_clk:
599 clk_disable(sspi->clk); 597 clk_disable(sspi->clk);
600 clk_put(sspi->clk); 598 clk_put(sspi->clk);
601free_pmx: 599free_pin:
602 pinmux_disable(sspi->pmx); 600 pinctrl_put(sspi->p);
603 pinmux_put(sspi->pmx);
604free_master: 601free_master:
605 spi_master_put(master); 602 spi_master_put(master);
606err_cs: 603err_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}