diff options
Diffstat (limited to 'drivers/spi/spi-tegra20-slink.c')
-rw-r--r-- | drivers/spi/spi-tegra20-slink.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c index be3a069879c3..eb5b771e1575 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; |
@@ -761,10 +760,6 @@ static int tegra_slink_setup(struct spi_device *spi) | |||
761 | spi->mode & SPI_CPHA ? "" : "~", | 760 | spi->mode & SPI_CPHA ? "" : "~", |
762 | spi->max_speed_hz); | 761 | spi->max_speed_hz); |
763 | 762 | ||
764 | BUG_ON(spi->chip_select >= MAX_CHIP_SELECT); | ||
765 | |||
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); | 763 | ret = pm_runtime_get_sync(tspi->dev); |
769 | if (ret < 0) { | 764 | if (ret < 0) { |
770 | dev_err(tspi->dev, "pm runtime failed, e = %d\n", ret); | 765 | dev_err(tspi->dev, "pm runtime failed, e = %d\n", ret); |
@@ -999,15 +994,6 @@ static irqreturn_t tegra_slink_isr(int irq, void *context_data) | |||
999 | return IRQ_WAKE_THREAD; | 994 | return IRQ_WAKE_THREAD; |
1000 | } | 995 | } |
1001 | 996 | ||
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 = { | 997 | static const struct tegra_slink_chip_data tegra30_spi_cdata = { |
1012 | .cs_hold_time = true, | 998 | .cs_hold_time = true, |
1013 | }; | 999 | }; |
@@ -1053,7 +1039,6 @@ static int tegra_slink_probe(struct platform_device *pdev) | |||
1053 | master->unprepare_message = tegra_slink_unprepare_message; | 1039 | master->unprepare_message = tegra_slink_unprepare_message; |
1054 | master->auto_runtime_pm = true; | 1040 | master->auto_runtime_pm = true; |
1055 | master->num_chipselect = MAX_CHIP_SELECT; | 1041 | master->num_chipselect = MAX_CHIP_SELECT; |
1056 | master->bus_num = -1; | ||
1057 | 1042 | ||
1058 | platform_set_drvdata(pdev, master); | 1043 | platform_set_drvdata(pdev, master); |
1059 | tspi = spi_master_get_devdata(master); | 1044 | tspi = spi_master_get_devdata(master); |
@@ -1062,7 +1047,9 @@ static int tegra_slink_probe(struct platform_device *pdev) | |||
1062 | tspi->chip_data = cdata; | 1047 | tspi->chip_data = cdata; |
1063 | spin_lock_init(&tspi->lock); | 1048 | spin_lock_init(&tspi->lock); |
1064 | 1049 | ||
1065 | tegra_slink_parse_dt(tspi); | 1050 | if (of_property_read_u32(tspi->dev->of_node, "spi-max-frequency", |
1051 | &master->max_speed_hz)) | ||
1052 | master->max_speed_hz = 25000000; /* 25MHz */ | ||
1066 | 1053 | ||
1067 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1054 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1068 | if (!r) { | 1055 | if (!r) { |