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>
struct completion done;
};
struct completion done;
};
-static int spi_st_clk_enable(struct spi_st *spi_st)
-{
- /*
- * Current platforms use one of the core clocks for SPI and I2C.
- * If we attempt to disable the clock, the system will hang.
- *
- * TODO: Remove this when platform supports power domains.
- */
- return 0;
-
- return clk_prepare_enable(spi_st->clk);
-}
-
-static void spi_st_clk_disable(struct spi_st *spi_st)
-{
- /*
- * Current platforms use one of the core clocks for SPI and I2C.
- * If we attempt to disable the clock, the system will hang.
- *
- * TODO: Remove this when platform supports power domains.
- */
- return;
-
- clk_disable_unprepare(spi_st->clk);
-}
-
/* Load the TX FIFO */
static void ssc_write_tx_fifo(struct spi_st *spi_st)
{
/* Load the TX FIFO */
static void ssc_write_tx_fifo(struct spi_st *spi_st)
{
- ret = spi_st_clk_enable(spi_st);
+ ret = clk_prepare_enable(spi_st->clk);
if (ret)
goto put_master;
if (ret)
goto put_master;
- spi_st_clk_disable(spi_st);
+ clk_disable_unprepare(spi_st->clk);
put_master:
spi_master_put(master);
return ret;
put_master:
spi_master_put(master);
return ret;
struct spi_master *master = platform_get_drvdata(pdev);
struct spi_st *spi_st = spi_master_get_devdata(master);
struct spi_master *master = platform_get_drvdata(pdev);
struct spi_st *spi_st = spi_master_get_devdata(master);
- spi_st_clk_disable(spi_st);
+ clk_disable_unprepare(spi_st->clk);
pinctrl_pm_select_sleep_state(&pdev->dev);
pinctrl_pm_select_sleep_state(&pdev->dev);
writel_relaxed(0, spi_st->base + SSC_IEN);
pinctrl_pm_select_sleep_state(dev);
writel_relaxed(0, spi_st->base + SSC_IEN);
pinctrl_pm_select_sleep_state(dev);
- spi_st_clk_disable(spi_st);
+ clk_disable_unprepare(spi_st->clk);
struct spi_st *spi_st = spi_master_get_devdata(master);
int ret;
struct spi_st *spi_st = spi_master_get_devdata(master);
int ret;
- ret = spi_st_clk_enable(spi_st);
+ ret = clk_prepare_enable(spi_st->clk);
pinctrl_pm_select_default_state(dev);
return ret;
pinctrl_pm_select_default_state(dev);
return ret;