aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/blackfin/mach-bf609/clock.c7
-rw-r--r--drivers/spi/spi-adi-v3.c13
2 files changed, 14 insertions, 6 deletions
diff --git a/arch/blackfin/mach-bf609/clock.c b/arch/blackfin/mach-bf609/clock.c
index 56200f37cfc8..244fa4ab4c56 100644
--- a/arch/blackfin/mach-bf609/clock.c
+++ b/arch/blackfin/mach-bf609/clock.c
@@ -363,6 +363,12 @@ static struct clk ethclk = {
363 .ops = &dummy_clk_ops, 363 .ops = &dummy_clk_ops,
364}; 364};
365 365
366static struct clk spiclk = {
367 .name = "spi",
368 .parent = &sclk1,
369 .ops = &dummy_clk_ops,
370};
371
366static struct clk_lookup bf609_clks[] = { 372static struct clk_lookup bf609_clks[] = {
367 CLK(sys_clkin, NULL, "SYS_CLKIN"), 373 CLK(sys_clkin, NULL, "SYS_CLKIN"),
368 CLK(pll_clk, NULL, "PLLCLK"), 374 CLK(pll_clk, NULL, "PLLCLK"),
@@ -375,6 +381,7 @@ static struct clk_lookup bf609_clks[] = {
375 CLK(dclk, NULL, "DCLK"), 381 CLK(dclk, NULL, "DCLK"),
376 CLK(oclk, NULL, "OCLK"), 382 CLK(oclk, NULL, "OCLK"),
377 CLK(ethclk, NULL, "stmmaceth"), 383 CLK(ethclk, NULL, "stmmaceth"),
384 CLK(spiclk, NULL, "spi"),
378}; 385};
379 386
380int __init clk_init(void) 387int __init clk_init(void)
diff --git a/drivers/spi/spi-adi-v3.c b/drivers/spi/spi-adi-v3.c
index 0c2914cfcdb5..dcb2287c7f8a 100644
--- a/drivers/spi/spi-adi-v3.c
+++ b/drivers/spi/spi-adi-v3.c
@@ -13,6 +13,7 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 */ 14 */
15 15
16#include <linux/clk.h>
16#include <linux/delay.h> 17#include <linux/delay.h>
17#include <linux/device.h> 18#include <linux/device.h>
18#include <linux/dma-mapping.h> 19#include <linux/dma-mapping.h>
@@ -800,7 +801,7 @@ static int adi_spi_probe(struct platform_device *pdev)
800 struct adi_spi_master *drv_data; 801 struct adi_spi_master *drv_data;
801 struct resource *mem, *res; 802 struct resource *mem, *res;
802 unsigned int tx_dma, rx_dma; 803 unsigned int tx_dma, rx_dma;
803 unsigned long sclk; 804 struct clk *sclk;
804 int ret; 805 int ret;
805 806
806 if (!info) { 807 if (!info) {
@@ -808,10 +809,10 @@ static int adi_spi_probe(struct platform_device *pdev)
808 return -ENODEV; 809 return -ENODEV;
809 } 810 }
810 811
811 sclk = get_sclk1(); 812 sclk = devm_clk_get(dev, "spi");
812 if (!sclk) { 813 if (IS_ERR(sclk)) {
813 dev_err(dev, "can not get sclk1\n"); 814 dev_err(dev, "can not get spi clock\n");
814 return -ENXIO; 815 return PTR_ERR(sclk);
815 } 816 }
816 817
817 res = platform_get_resource(pdev, IORESOURCE_DMA, 0); 818 res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
@@ -852,7 +853,7 @@ static int adi_spi_probe(struct platform_device *pdev)
852 drv_data->tx_dma = tx_dma; 853 drv_data->tx_dma = tx_dma;
853 drv_data->rx_dma = rx_dma; 854 drv_data->rx_dma = rx_dma;
854 drv_data->pin_req = info->pin_req; 855 drv_data->pin_req = info->pin_req;
855 drv_data->sclk = sclk; 856 drv_data->sclk = clk_get_rate(sclk);
856 857
857 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 858 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
858 drv_data->regs = devm_ioremap_resource(dev, mem); 859 drv_data->regs = devm_ioremap_resource(dev, mem);