diff options
Diffstat (limited to 'drivers/spi')
| -rw-r--r-- | drivers/spi/mpc512x_psc_spi.c | 2 | ||||
| -rw-r--r-- | drivers/spi/mpc52xx_psc_spi.c | 11 | ||||
| -rw-r--r-- | drivers/spi/mpc52xx_spi.c | 3 | ||||
| -rw-r--r-- | drivers/spi/spi.c | 4 | ||||
| -rw-r--r-- | drivers/spi/spi_mpc8xxx.c | 4 | ||||
| -rw-r--r-- | drivers/spi/spi_ppc4xx.c | 2 | ||||
| -rw-r--r-- | drivers/spi/xilinx_spi.c | 3 | ||||
| -rw-r--r-- | drivers/spi/xilinx_spi_of.c | 4 |
8 files changed, 16 insertions, 17 deletions
diff --git a/drivers/spi/mpc512x_psc_spi.c b/drivers/spi/mpc512x_psc_spi.c index 2534b1ec3edd..10baac3f8ea5 100644 --- a/drivers/spi/mpc512x_psc_spi.c +++ b/drivers/spi/mpc512x_psc_spi.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
| 20 | #include <linux/errno.h> | 20 | #include <linux/errno.h> |
| 21 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
| 22 | #include <linux/of_address.h> | ||
| 22 | #include <linux/of_platform.h> | 23 | #include <linux/of_platform.h> |
| 23 | #include <linux/workqueue.h> | 24 | #include <linux/workqueue.h> |
| 24 | #include <linux/completion.h> | 25 | #include <linux/completion.h> |
| @@ -440,6 +441,7 @@ static int __init mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr, | |||
| 440 | master->setup = mpc512x_psc_spi_setup; | 441 | master->setup = mpc512x_psc_spi_setup; |
| 441 | master->transfer = mpc512x_psc_spi_transfer; | 442 | master->transfer = mpc512x_psc_spi_transfer; |
| 442 | master->cleanup = mpc512x_psc_spi_cleanup; | 443 | master->cleanup = mpc512x_psc_spi_cleanup; |
| 444 | master->dev.of_node = dev->of_node; | ||
| 443 | 445 | ||
| 444 | tempp = ioremap(regaddr, size); | 446 | tempp = ioremap(regaddr, size); |
| 445 | if (!tempp) { | 447 | if (!tempp) { |
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c index 7104cb739da7..66d170147dcc 100644 --- a/drivers/spi/mpc52xx_psc_spi.c +++ b/drivers/spi/mpc52xx_psc_spi.c | |||
| @@ -16,8 +16,8 @@ | |||
| 16 | #include <linux/types.h> | 16 | #include <linux/types.h> |
| 17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
| 18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
| 19 | #include <linux/of_address.h> | ||
| 19 | #include <linux/of_platform.h> | 20 | #include <linux/of_platform.h> |
| 20 | #include <linux/of_spi.h> | ||
| 21 | #include <linux/workqueue.h> | 21 | #include <linux/workqueue.h> |
| 22 | #include <linux/completion.h> | 22 | #include <linux/completion.h> |
| 23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
| @@ -398,6 +398,7 @@ static int __init mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr, | |||
| 398 | master->setup = mpc52xx_psc_spi_setup; | 398 | master->setup = mpc52xx_psc_spi_setup; |
| 399 | master->transfer = mpc52xx_psc_spi_transfer; | 399 | master->transfer = mpc52xx_psc_spi_transfer; |
| 400 | master->cleanup = mpc52xx_psc_spi_cleanup; | 400 | master->cleanup = mpc52xx_psc_spi_cleanup; |
| 401 | master->dev.of_node = dev->of_node; | ||
| 401 | 402 | ||
| 402 | mps->psc = ioremap(regaddr, size); | 403 | mps->psc = ioremap(regaddr, size); |
| 403 | if (!mps->psc) { | 404 | if (!mps->psc) { |
| @@ -470,7 +471,6 @@ static int __init mpc52xx_psc_spi_of_probe(struct of_device *op, | |||
| 470 | const u32 *regaddr_p; | 471 | const u32 *regaddr_p; |
| 471 | u64 regaddr64, size64; | 472 | u64 regaddr64, size64; |
| 472 | s16 id = -1; | 473 | s16 id = -1; |
| 473 | int rc; | ||
| 474 | 474 | ||
| 475 | regaddr_p = of_get_address(op->dev.of_node, 0, &size64, NULL); | 475 | regaddr_p = of_get_address(op->dev.of_node, 0, &size64, NULL); |
| 476 | if (!regaddr_p) { | 476 | if (!regaddr_p) { |
| @@ -491,13 +491,8 @@ static int __init mpc52xx_psc_spi_of_probe(struct of_device *op, | |||
| 491 | id = *psc_nump + 1; | 491 | id = *psc_nump + 1; |
| 492 | } | 492 | } |
| 493 | 493 | ||
| 494 | rc = mpc52xx_psc_spi_do_probe(&op->dev, (u32)regaddr64, (u32)size64, | 494 | return mpc52xx_psc_spi_do_probe(&op->dev, (u32)regaddr64, (u32)size64, |
| 495 | irq_of_parse_and_map(op->dev.of_node, 0), id); | 495 | irq_of_parse_and_map(op->dev.of_node, 0), id); |
| 496 | if (rc == 0) | ||
| 497 | of_register_spi_devices(dev_get_drvdata(&op->dev), | ||
| 498 | op->dev.of_node); | ||
| 499 | |||
| 500 | return rc; | ||
| 501 | } | 496 | } |
| 502 | 497 | ||
| 503 | static int __exit mpc52xx_psc_spi_of_remove(struct of_device *op) | 498 | static int __exit mpc52xx_psc_spi_of_remove(struct of_device *op) |
diff --git a/drivers/spi/mpc52xx_spi.c b/drivers/spi/mpc52xx_spi.c index b1a76bff775f..56136ff00e01 100644 --- a/drivers/spi/mpc52xx_spi.c +++ b/drivers/spi/mpc52xx_spi.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
| 19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
| 20 | #include <linux/spi/spi.h> | 20 | #include <linux/spi/spi.h> |
| 21 | #include <linux/of_spi.h> | ||
| 22 | #include <linux/io.h> | 21 | #include <linux/io.h> |
| 23 | #include <linux/of_gpio.h> | 22 | #include <linux/of_gpio.h> |
| 24 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
| @@ -439,6 +438,7 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op, | |||
| 439 | master->setup = mpc52xx_spi_setup; | 438 | master->setup = mpc52xx_spi_setup; |
| 440 | master->transfer = mpc52xx_spi_transfer; | 439 | master->transfer = mpc52xx_spi_transfer; |
| 441 | master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_LSB_FIRST; | 440 | master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_LSB_FIRST; |
| 441 | master->dev.of_node = op->dev.of_node; | ||
| 442 | 442 | ||
| 443 | dev_set_drvdata(&op->dev, master); | 443 | dev_set_drvdata(&op->dev, master); |
| 444 | 444 | ||
| @@ -512,7 +512,6 @@ static int __devinit mpc52xx_spi_probe(struct of_device *op, | |||
| 512 | if (rc) | 512 | if (rc) |
| 513 | goto err_register; | 513 | goto err_register; |
| 514 | 514 | ||
| 515 | of_register_spi_devices(master, op->dev.of_node); | ||
| 516 | dev_info(&ms->master->dev, "registered MPC5200 SPI bus\n"); | 515 | dev_info(&ms->master->dev, "registered MPC5200 SPI bus\n"); |
| 517 | 516 | ||
| 518 | return rc; | 517 | return rc; |
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index b3a1f9259b62..1bb1b88780ce 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/slab.h> | 26 | #include <linux/slab.h> |
| 27 | #include <linux/mod_devicetable.h> | 27 | #include <linux/mod_devicetable.h> |
| 28 | #include <linux/spi/spi.h> | 28 | #include <linux/spi/spi.h> |
| 29 | #include <linux/of_spi.h> | ||
| 29 | 30 | ||
| 30 | 31 | ||
| 31 | /* SPI bustype and spi_master class are registered after board init code | 32 | /* SPI bustype and spi_master class are registered after board init code |
| @@ -540,6 +541,9 @@ int spi_register_master(struct spi_master *master) | |||
| 540 | /* populate children from any spi device tables */ | 541 | /* populate children from any spi device tables */ |
| 541 | scan_boardinfo(master); | 542 | scan_boardinfo(master); |
| 542 | status = 0; | 543 | status = 0; |
| 544 | |||
| 545 | /* Register devices from the device tree */ | ||
| 546 | of_register_spi_devices(master); | ||
| 543 | done: | 547 | done: |
| 544 | return status; | 548 | return status; |
| 545 | } | 549 | } |
diff --git a/drivers/spi/spi_mpc8xxx.c b/drivers/spi/spi_mpc8xxx.c index 97ab0a81338a..aad9ae1b9c69 100644 --- a/drivers/spi/spi_mpc8xxx.c +++ b/drivers/spi/spi_mpc8xxx.c | |||
| @@ -38,7 +38,6 @@ | |||
| 38 | #include <linux/of_platform.h> | 38 | #include <linux/of_platform.h> |
| 39 | #include <linux/gpio.h> | 39 | #include <linux/gpio.h> |
| 40 | #include <linux/of_gpio.h> | 40 | #include <linux/of_gpio.h> |
| 41 | #include <linux/of_spi.h> | ||
| 42 | #include <linux/slab.h> | 41 | #include <linux/slab.h> |
| 43 | 42 | ||
| 44 | #include <sysdev/fsl_soc.h> | 43 | #include <sysdev/fsl_soc.h> |
| @@ -1009,6 +1008,7 @@ mpc8xxx_spi_probe(struct device *dev, struct resource *mem, unsigned int irq) | |||
| 1009 | master->setup = mpc8xxx_spi_setup; | 1008 | master->setup = mpc8xxx_spi_setup; |
| 1010 | master->transfer = mpc8xxx_spi_transfer; | 1009 | master->transfer = mpc8xxx_spi_transfer; |
| 1011 | master->cleanup = mpc8xxx_spi_cleanup; | 1010 | master->cleanup = mpc8xxx_spi_cleanup; |
| 1011 | master->dev.of_node = dev->of_node; | ||
| 1012 | 1012 | ||
| 1013 | mpc8xxx_spi = spi_master_get_devdata(master); | 1013 | mpc8xxx_spi = spi_master_get_devdata(master); |
| 1014 | mpc8xxx_spi->dev = dev; | 1014 | mpc8xxx_spi->dev = dev; |
| @@ -1299,8 +1299,6 @@ static int __devinit of_mpc8xxx_spi_probe(struct of_device *ofdev, | |||
| 1299 | goto err; | 1299 | goto err; |
| 1300 | } | 1300 | } |
| 1301 | 1301 | ||
| 1302 | of_register_spi_devices(master, np); | ||
| 1303 | |||
| 1304 | return 0; | 1302 | return 0; |
| 1305 | 1303 | ||
| 1306 | err: | 1304 | err: |
diff --git a/drivers/spi/spi_ppc4xx.c b/drivers/spi/spi_ppc4xx.c index d53466a249d9..0f5fa7e2a550 100644 --- a/drivers/spi/spi_ppc4xx.c +++ b/drivers/spi/spi_ppc4xx.c | |||
| @@ -407,6 +407,7 @@ static int __init spi_ppc4xx_of_probe(struct of_device *op, | |||
| 407 | master = spi_alloc_master(dev, sizeof *hw); | 407 | master = spi_alloc_master(dev, sizeof *hw); |
| 408 | if (master == NULL) | 408 | if (master == NULL) |
| 409 | return -ENOMEM; | 409 | return -ENOMEM; |
| 410 | master->dev.of_node = np; | ||
| 410 | dev_set_drvdata(dev, master); | 411 | dev_set_drvdata(dev, master); |
| 411 | hw = spi_master_get_devdata(master); | 412 | hw = spi_master_get_devdata(master); |
| 412 | hw->master = spi_master_get(master); | 413 | hw->master = spi_master_get(master); |
| @@ -545,7 +546,6 @@ static int __init spi_ppc4xx_of_probe(struct of_device *op, | |||
| 545 | } | 546 | } |
| 546 | 547 | ||
| 547 | dev_info(dev, "driver initialized\n"); | 548 | dev_info(dev, "driver initialized\n"); |
| 548 | of_register_spi_devices(master, np); | ||
| 549 | 549 | ||
| 550 | return 0; | 550 | return 0; |
| 551 | 551 | ||
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c index 1b47363cb73f..80f2db5bcfd6 100644 --- a/drivers/spi/xilinx_spi.c +++ b/drivers/spi/xilinx_spi.c | |||
| @@ -390,6 +390,9 @@ struct spi_master *xilinx_spi_init(struct device *dev, struct resource *mem, | |||
| 390 | 390 | ||
| 391 | master->bus_num = bus_num; | 391 | master->bus_num = bus_num; |
| 392 | master->num_chipselect = pdata->num_chipselect; | 392 | master->num_chipselect = pdata->num_chipselect; |
| 393 | #ifdef CONFIG_OF | ||
| 394 | master->dev.of_node = dev->of_node; | ||
| 395 | #endif | ||
| 393 | 396 | ||
| 394 | xspi->mem = *mem; | 397 | xspi->mem = *mem; |
| 395 | xspi->irq = irq; | 398 | xspi->irq = irq; |
diff --git a/drivers/spi/xilinx_spi_of.c b/drivers/spi/xilinx_spi_of.c index 4654805b08d8..f53d3f6b9f61 100644 --- a/drivers/spi/xilinx_spi_of.c +++ b/drivers/spi/xilinx_spi_of.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/io.h> | 29 | #include <linux/io.h> |
| 30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
| 31 | 31 | ||
| 32 | #include <linux/of_address.h> | ||
| 32 | #include <linux/of_platform.h> | 33 | #include <linux/of_platform.h> |
| 33 | #include <linux/of_device.h> | 34 | #include <linux/of_device.h> |
| 34 | #include <linux/of_spi.h> | 35 | #include <linux/of_spi.h> |
| @@ -80,9 +81,6 @@ static int __devinit xilinx_spi_of_probe(struct of_device *ofdev, | |||
| 80 | 81 | ||
| 81 | dev_set_drvdata(&ofdev->dev, master); | 82 | dev_set_drvdata(&ofdev->dev, master); |
| 82 | 83 | ||
| 83 | /* Add any subnodes on the SPI bus */ | ||
| 84 | of_register_spi_devices(master, ofdev->dev.of_node); | ||
| 85 | |||
| 86 | return 0; | 84 | return 0; |
| 87 | } | 85 | } |
| 88 | 86 | ||
