diff options
Diffstat (limited to 'drivers/spi/spi-tegra20-slink.c')
-rw-r--r-- | drivers/spi/spi-tegra20-slink.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c index be3a069879c3..e3c1b93e45d1 100644 --- a/drivers/spi/spi-tegra20-slink.c +++ b/drivers/spi/spi-tegra20-slink.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/dma-mapping.h> | 23 | #include <linux/dma-mapping.h> |
24 | #include <linux/dmapool.h> | 24 | #include <linux/dmapool.h> |
25 | #include <linux/err.h> | 25 | #include <linux/err.h> |
26 | #include <linux/init.h> | ||
27 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
28 | #include <linux/io.h> | 27 | #include <linux/io.h> |
29 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
@@ -171,7 +170,6 @@ struct tegra_slink_data { | |||
171 | void __iomem *base; | 170 | void __iomem *base; |
172 | phys_addr_t phys; | 171 | phys_addr_t phys; |
173 | unsigned irq; | 172 | unsigned irq; |
174 | u32 spi_max_frequency; | ||
175 | u32 cur_speed; | 173 | u32 cur_speed; |
176 | 174 | ||
177 | struct spi_device *cur_spi; | 175 | struct spi_device *cur_spi; |
@@ -761,10 +759,6 @@ static int tegra_slink_setup(struct spi_device *spi) | |||
761 | spi->mode & SPI_CPHA ? "" : "~", | 759 | spi->mode & SPI_CPHA ? "" : "~", |
762 | spi->max_speed_hz); | 760 | spi->max_speed_hz); |
763 | 761 | ||
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); | 762 | ret = pm_runtime_get_sync(tspi->dev); |
769 | if (ret < 0) { | 763 | if (ret < 0) { |
770 | dev_err(tspi->dev, "pm runtime failed, e = %d\n", ret); | 764 | dev_err(tspi->dev, "pm runtime failed, e = %d\n", ret); |
@@ -999,15 +993,6 @@ static irqreturn_t tegra_slink_isr(int irq, void *context_data) | |||
999 | return IRQ_WAKE_THREAD; | 993 | return IRQ_WAKE_THREAD; |
1000 | } | 994 | } |
1001 | 995 | ||
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 = { | 996 | static const struct tegra_slink_chip_data tegra30_spi_cdata = { |
1012 | .cs_hold_time = true, | 997 | .cs_hold_time = true, |
1013 | }; | 998 | }; |
@@ -1053,7 +1038,6 @@ static int tegra_slink_probe(struct platform_device *pdev) | |||
1053 | master->unprepare_message = tegra_slink_unprepare_message; | 1038 | master->unprepare_message = tegra_slink_unprepare_message; |
1054 | master->auto_runtime_pm = true; | 1039 | master->auto_runtime_pm = true; |
1055 | master->num_chipselect = MAX_CHIP_SELECT; | 1040 | master->num_chipselect = MAX_CHIP_SELECT; |
1056 | master->bus_num = -1; | ||
1057 | 1041 | ||
1058 | platform_set_drvdata(pdev, master); | 1042 | platform_set_drvdata(pdev, master); |
1059 | tspi = spi_master_get_devdata(master); | 1043 | tspi = spi_master_get_devdata(master); |
@@ -1062,7 +1046,9 @@ static int tegra_slink_probe(struct platform_device *pdev) | |||
1062 | tspi->chip_data = cdata; | 1046 | tspi->chip_data = cdata; |
1063 | spin_lock_init(&tspi->lock); | 1047 | spin_lock_init(&tspi->lock); |
1064 | 1048 | ||
1065 | tegra_slink_parse_dt(tspi); | 1049 | if (of_property_read_u32(tspi->dev->of_node, "spi-max-frequency", |
1050 | &master->max_speed_hz)) | ||
1051 | master->max_speed_hz = 25000000; /* 25MHz */ | ||
1066 | 1052 | ||
1067 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1053 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1068 | if (!r) { | 1054 | if (!r) { |