aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2016-06-07 07:19:00 -0400
committerPatrice Chotard <patrice.chotard@st.com>2016-07-12 07:22:55 -0400
commitcf4b5ceb95b1e8842bc4f061a8ba8c395b5dbc6d (patch)
tree5ffb1c9cfa52613cea57d30b77991dbbbc147cae
parentf221d8100e366e8373096ba7ffc36cf42d504e82 (diff)
spi: st-ssc4: Remove 'no clocking' hack
Due to the newly upstreamed 'critical clocks' API we can now safely handle clocking in the SPI and I2C drivers without fear of catastrophically crippling the running platform. Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r--drivers/spi/spi-st-ssc4.c36
1 files changed, 5 insertions, 31 deletions
diff --git a/drivers/spi/spi-st-ssc4.c b/drivers/spi/spi-st-ssc4.c
index d5adf9f31602..a56eca0e95a6 100644
--- a/drivers/spi/spi-st-ssc4.c
+++ b/drivers/spi/spi-st-ssc4.c
@@ -68,32 +68,6 @@ struct spi_st {
68 struct completion done; 68 struct completion done;
69}; 69};
70 70
71static int spi_st_clk_enable(struct spi_st *spi_st)
72{
73 /*
74 * Current platforms use one of the core clocks for SPI and I2C.
75 * If we attempt to disable the clock, the system will hang.
76 *
77 * TODO: Remove this when platform supports power domains.
78 */
79 return 0;
80
81 return clk_prepare_enable(spi_st->clk);
82}
83
84static void spi_st_clk_disable(struct spi_st *spi_st)
85{
86 /*
87 * Current platforms use one of the core clocks for SPI and I2C.
88 * If we attempt to disable the clock, the system will hang.
89 *
90 * TODO: Remove this when platform supports power domains.
91 */
92 return;
93
94 clk_disable_unprepare(spi_st->clk);
95}
96
97/* Load the TX FIFO */ 71/* Load the TX FIFO */
98static void ssc_write_tx_fifo(struct spi_st *spi_st) 72static void ssc_write_tx_fifo(struct spi_st *spi_st)
99{ 73{
@@ -349,7 +323,7 @@ static int spi_st_probe(struct platform_device *pdev)
349 goto put_master; 323 goto put_master;
350 } 324 }
351 325
352 ret = spi_st_clk_enable(spi_st); 326 ret = clk_prepare_enable(spi_st->clk);
353 if (ret) 327 if (ret)
354 goto put_master; 328 goto put_master;
355 329
@@ -408,7 +382,7 @@ static int spi_st_probe(struct platform_device *pdev)
408 return 0; 382 return 0;
409 383
410clk_disable: 384clk_disable:
411 spi_st_clk_disable(spi_st); 385 clk_disable_unprepare(spi_st->clk);
412put_master: 386put_master:
413 spi_master_put(master); 387 spi_master_put(master);
414 return ret; 388 return ret;
@@ -419,7 +393,7 @@ static int spi_st_remove(struct platform_device *pdev)
419 struct spi_master *master = platform_get_drvdata(pdev); 393 struct spi_master *master = platform_get_drvdata(pdev);
420 struct spi_st *spi_st = spi_master_get_devdata(master); 394 struct spi_st *spi_st = spi_master_get_devdata(master);
421 395
422 spi_st_clk_disable(spi_st); 396 clk_disable_unprepare(spi_st->clk);
423 397
424 pinctrl_pm_select_sleep_state(&pdev->dev); 398 pinctrl_pm_select_sleep_state(&pdev->dev);
425 399
@@ -435,7 +409,7 @@ static int spi_st_runtime_suspend(struct device *dev)
435 writel_relaxed(0, spi_st->base + SSC_IEN); 409 writel_relaxed(0, spi_st->base + SSC_IEN);
436 pinctrl_pm_select_sleep_state(dev); 410 pinctrl_pm_select_sleep_state(dev);
437 411
438 spi_st_clk_disable(spi_st); 412 clk_disable_unprepare(spi_st->clk);
439 413
440 return 0; 414 return 0;
441} 415}
@@ -446,7 +420,7 @@ static int spi_st_runtime_resume(struct device *dev)
446 struct spi_st *spi_st = spi_master_get_devdata(master); 420 struct spi_st *spi_st = spi_master_get_devdata(master);
447 int ret; 421 int ret;
448 422
449 ret = spi_st_clk_enable(spi_st); 423 ret = clk_prepare_enable(spi_st->clk);
450 pinctrl_pm_select_default_state(dev); 424 pinctrl_pm_select_default_state(dev);
451 425
452 return ret; 426 return ret;