diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-02-10 08:51:13 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-11 07:07:53 -0500 |
commit | 3c604de496d7568b3fddb9f2531630aa89908186 (patch) | |
tree | 144628bca4f44ff1f7b429a2195e703f16a9c63f /drivers | |
parent | 44830b4c2f978a1bc667d1557d26277a7e593cf5 (diff) |
spi: tegra20-slink: Convert to use master->max_speed_hz
Use master->max_speed_hz instead of tspi->spi_max_frequency, so spi core will
handle checking transfer speed.
In additional, since commit 052eb2d49006 'spi: core: Set max_speed_hz of
spi_device default to max_speed_hz of controller',
spi core will also set default spi->max_speed_hz if it is not set.
So remove the duplicate code in tegra_slink_setup.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/spi/spi-tegra20-slink.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c index be3a069879c3..9da14f2e2818 100644 --- a/drivers/spi/spi-tegra20-slink.c +++ b/drivers/spi/spi-tegra20-slink.c | |||
@@ -171,7 +171,6 @@ struct tegra_slink_data { | |||
171 | void __iomem *base; | 171 | void __iomem *base; |
172 | phys_addr_t phys; | 172 | phys_addr_t phys; |
173 | unsigned irq; | 173 | unsigned irq; |
174 | u32 spi_max_frequency; | ||
175 | u32 cur_speed; | 174 | u32 cur_speed; |
176 | 175 | ||
177 | struct spi_device *cur_spi; | 176 | struct spi_device *cur_spi; |
@@ -763,8 +762,6 @@ static int tegra_slink_setup(struct spi_device *spi) | |||
763 | 762 | ||
764 | BUG_ON(spi->chip_select >= MAX_CHIP_SELECT); | 763 | BUG_ON(spi->chip_select >= MAX_CHIP_SELECT); |
765 | 764 | ||
766 | /* Set speed to the spi max fequency if spi device has not set */ | ||
767 | spi->max_speed_hz = spi->max_speed_hz ? : tspi->spi_max_frequency; | ||
768 | ret = pm_runtime_get_sync(tspi->dev); | 765 | ret = pm_runtime_get_sync(tspi->dev); |
769 | if (ret < 0) { | 766 | if (ret < 0) { |
770 | dev_err(tspi->dev, "pm runtime failed, e = %d\n", ret); | 767 | dev_err(tspi->dev, "pm runtime failed, e = %d\n", ret); |
@@ -999,15 +996,6 @@ static irqreturn_t tegra_slink_isr(int irq, void *context_data) | |||
999 | return IRQ_WAKE_THREAD; | 996 | return IRQ_WAKE_THREAD; |
1000 | } | 997 | } |
1001 | 998 | ||
1002 | static void tegra_slink_parse_dt(struct tegra_slink_data *tspi) | ||
1003 | { | ||
1004 | struct device_node *np = tspi->dev->of_node; | ||
1005 | |||
1006 | if (of_property_read_u32(np, "spi-max-frequency", | ||
1007 | &tspi->spi_max_frequency)) | ||
1008 | tspi->spi_max_frequency = 25000000; /* 25MHz */ | ||
1009 | } | ||
1010 | |||
1011 | static const struct tegra_slink_chip_data tegra30_spi_cdata = { | 999 | static const struct tegra_slink_chip_data tegra30_spi_cdata = { |
1012 | .cs_hold_time = true, | 1000 | .cs_hold_time = true, |
1013 | }; | 1001 | }; |
@@ -1062,7 +1050,9 @@ static int tegra_slink_probe(struct platform_device *pdev) | |||
1062 | tspi->chip_data = cdata; | 1050 | tspi->chip_data = cdata; |
1063 | spin_lock_init(&tspi->lock); | 1051 | spin_lock_init(&tspi->lock); |
1064 | 1052 | ||
1065 | tegra_slink_parse_dt(tspi); | 1053 | if (of_property_read_u32(tspi->dev->of_node, "spi-max-frequency", |
1054 | &master->max_speed_hz)) | ||
1055 | master->max_speed_hz = 25000000; /* 25MHz */ | ||
1066 | 1056 | ||
1067 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1057 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1068 | if (!r) { | 1058 | if (!r) { |