Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: tegra20-slink: Add OPP support

The SPI on Tegra belongs to the core power domain and we're going to
enable GENPD support for the core domain. Now SPI driver must use OPP
API for driving the controller's clock rate because OPP API takes care
of reconfiguring the domain's performance state in accordance to the
rate. Add OPP support to the driver.

Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Dmitry Osipenko and committed by
Thierry Reding
07f83755 6902dc2f

+8 -1
+8 -1
drivers/spi/spi-tegra20-slink.c
··· 18 18 #include <linux/kthread.h> 19 19 #include <linux/module.h> 20 20 #include <linux/platform_device.h> 21 + #include <linux/pm_opp.h> 21 22 #include <linux/pm_runtime.h> 22 23 #include <linux/of.h> 23 24 #include <linux/of_device.h> 24 25 #include <linux/reset.h> 25 26 #include <linux/spi/spi.h> 27 + 28 + #include <soc/tegra/common.h> 26 29 27 30 #define SLINK_COMMAND 0x000 28 31 #define SLINK_BIT_LENGTH(x) (((x) & 0x1f) << 0) ··· 683 680 bits_per_word = t->bits_per_word; 684 681 speed = t->speed_hz; 685 682 if (speed != tspi->cur_speed) { 686 - clk_set_rate(tspi->clk, speed * 4); 683 + dev_pm_opp_set_rate(tspi->dev, speed * 4); 687 684 tspi->cur_speed = speed; 688 685 } 689 686 ··· 1068 1065 ret = PTR_ERR(tspi->rst); 1069 1066 goto exit_free_master; 1070 1067 } 1068 + 1069 + ret = devm_tegra_core_dev_init_opp_table_common(&pdev->dev); 1070 + if (ret) 1071 + goto exit_free_master; 1071 1072 1072 1073 tspi->max_buf_size = SLINK_FIFO_DEPTH << 2; 1073 1074 tspi->dma_buf_size = DEFAULT_SPI_DMA_BUF_LEN;