diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /drivers/spi/spi-ath79.c | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'drivers/spi/spi-ath79.c')
-rw-r--r-- | drivers/spi/spi-ath79.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/spi/spi-ath79.c b/drivers/spi/spi-ath79.c index 9a5d7791c5f..03019bf5a5e 100644 --- a/drivers/spi/spi-ath79.c +++ b/drivers/spi/spi-ath79.c | |||
@@ -13,7 +13,6 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/module.h> | ||
17 | #include <linux/init.h> | 16 | #include <linux/init.h> |
18 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
19 | #include <linux/spinlock.h> | 18 | #include <linux/spinlock.h> |
@@ -192,7 +191,7 @@ static u32 ath79_spi_txrx_mode0(struct spi_device *spi, unsigned nsecs, | |||
192 | return ath79_spi_rr(sp, AR71XX_SPI_REG_RDS); | 191 | return ath79_spi_rr(sp, AR71XX_SPI_REG_RDS); |
193 | } | 192 | } |
194 | 193 | ||
195 | static int ath79_spi_probe(struct platform_device *pdev) | 194 | static __devinit int ath79_spi_probe(struct platform_device *pdev) |
196 | { | 195 | { |
197 | struct spi_master *master; | 196 | struct spi_master *master; |
198 | struct ath79_spi *sp; | 197 | struct ath79_spi *sp; |
@@ -216,6 +215,9 @@ static int ath79_spi_probe(struct platform_device *pdev) | |||
216 | if (pdata) { | 215 | if (pdata) { |
217 | master->bus_num = pdata->bus_num; | 216 | master->bus_num = pdata->bus_num; |
218 | master->num_chipselect = pdata->num_chipselect; | 217 | master->num_chipselect = pdata->num_chipselect; |
218 | } else { | ||
219 | master->bus_num = -1; | ||
220 | master->num_chipselect = 1; | ||
219 | } | 221 | } |
220 | 222 | ||
221 | sp->bitbang.master = spi_master_get(master); | 223 | sp->bitbang.master = spi_master_get(master); |
@@ -251,7 +253,7 @@ err_put_master: | |||
251 | return ret; | 253 | return ret; |
252 | } | 254 | } |
253 | 255 | ||
254 | static int ath79_spi_remove(struct platform_device *pdev) | 256 | static __devexit int ath79_spi_remove(struct platform_device *pdev) |
255 | { | 257 | { |
256 | struct ath79_spi *sp = platform_get_drvdata(pdev); | 258 | struct ath79_spi *sp = platform_get_drvdata(pdev); |
257 | 259 | ||
@@ -265,13 +267,24 @@ static int ath79_spi_remove(struct platform_device *pdev) | |||
265 | 267 | ||
266 | static struct platform_driver ath79_spi_driver = { | 268 | static struct platform_driver ath79_spi_driver = { |
267 | .probe = ath79_spi_probe, | 269 | .probe = ath79_spi_probe, |
268 | .remove = ath79_spi_remove, | 270 | .remove = __devexit_p(ath79_spi_remove), |
269 | .driver = { | 271 | .driver = { |
270 | .name = DRV_NAME, | 272 | .name = DRV_NAME, |
271 | .owner = THIS_MODULE, | 273 | .owner = THIS_MODULE, |
272 | }, | 274 | }, |
273 | }; | 275 | }; |
274 | module_platform_driver(ath79_spi_driver); | 276 | |
277 | static __init int ath79_spi_init(void) | ||
278 | { | ||
279 | return platform_driver_register(&ath79_spi_driver); | ||
280 | } | ||
281 | module_init(ath79_spi_init); | ||
282 | |||
283 | static __exit void ath79_spi_exit(void) | ||
284 | { | ||
285 | platform_driver_unregister(&ath79_spi_driver); | ||
286 | } | ||
287 | module_exit(ath79_spi_exit); | ||
275 | 288 | ||
276 | MODULE_DESCRIPTION("SPI controller driver for Atheros AR71XX/AR724X/AR913X"); | 289 | MODULE_DESCRIPTION("SPI controller driver for Atheros AR71XX/AR724X/AR913X"); |
277 | MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>"); | 290 | MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>"); |