aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-05-22 02:36:56 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-05-22 02:36:56 -0400
commitcf9b59e9d3e008591d1f54830f570982bb307a0d (patch)
tree113478ce8fd8c832ba726ffdf59b82cb46356476 /drivers/spi
parent44504b2bebf8b5823c59484e73096a7d6574471d (diff)
parentf4b87dee923342505e1ddba8d34ce9de33e75050 (diff)
Merge remote branch 'origin' into secretlab/next-devicetree
Merging in current state of Linus' tree to deal with merge conflicts and build failures in vio.c after merge. Conflicts: drivers/i2c/busses/i2c-cpm.c drivers/i2c/busses/i2c-mpc.c drivers/net/gianfar.c Also fixed up one line in arch/powerpc/kernel/vio.c to use the correct node pointer. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/Kconfig6
-rw-r--r--drivers/spi/omap2_mcspi.c5
-rw-r--r--drivers/spi/pxa2xx_spi.c25
-rw-r--r--drivers/spi/spi.c8
-rw-r--r--drivers/spi/spi_mpc8xxx.c2
5 files changed, 24 insertions, 22 deletions
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index a191fa2be7c5..f950b6316949 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -180,10 +180,10 @@ config SPI_OMAP_UWIRE
180 This hooks up to the MicroWire controller on OMAP1 chips. 180 This hooks up to the MicroWire controller on OMAP1 chips.
181 181
182config SPI_OMAP24XX 182config SPI_OMAP24XX
183 tristate "McSPI driver for OMAP24xx/OMAP34xx" 183 tristate "McSPI driver for OMAP"
184 depends on ARCH_OMAP2 || ARCH_OMAP3 184 depends on ARCH_OMAP2PLUS
185 help 185 help
186 SPI master controller for OMAP24xx/OMAP34xx Multichannel SPI 186 SPI master controller for OMAP24XX and later Multichannel SPI
187 (McSPI) modules. 187 (McSPI) modules.
188 188
189config SPI_OMAP_100K 189config SPI_OMAP_100K
diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index d8356af118a8..e0de0d0eedea 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -204,6 +204,7 @@ static inline void mcspi_write_chconf0(const struct spi_device *spi, u32 val)
204 204
205 cs->chconf0 = val; 205 cs->chconf0 = val;
206 mcspi_write_cs_reg(spi, OMAP2_MCSPI_CHCONF0, val); 206 mcspi_write_cs_reg(spi, OMAP2_MCSPI_CHCONF0, val);
207 mcspi_read_cs_reg(spi, OMAP2_MCSPI_CHCONF0);
207} 208}
208 209
209static void omap2_mcspi_set_dma_req(const struct spi_device *spi, 210static void omap2_mcspi_set_dma_req(const struct spi_device *spi,
@@ -532,7 +533,7 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
532 goto out; 533 goto out;
533 } 534 }
534#ifdef VERBOSE 535#ifdef VERBOSE
535 dev_dbg(&spi->dev, "write-%d %04x\n", 536 dev_dbg(&spi->dev, "write-%d %08x\n",
536 word_len, *tx); 537 word_len, *tx);
537#endif 538#endif
538 __raw_writel(*tx++, tx_reg); 539 __raw_writel(*tx++, tx_reg);
@@ -550,7 +551,7 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
550 mcspi_write_chconf0(spi, l); 551 mcspi_write_chconf0(spi, l);
551 *rx++ = __raw_readl(rx_reg); 552 *rx++ = __raw_readl(rx_reg);
552#ifdef VERBOSE 553#ifdef VERBOSE
553 dev_dbg(&spi->dev, "read-%d %04x\n", 554 dev_dbg(&spi->dev, "read-%d %08x\n",
554 word_len, *(rx - 1)); 555 word_len, *(rx - 1));
555#endif 556#endif
556 } 557 }
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c
index 36828358a4d8..e76b1afafe07 100644
--- a/drivers/spi/pxa2xx_spi.c
+++ b/drivers/spi/pxa2xx_spi.c
@@ -36,8 +36,7 @@
36#include <asm/delay.h> 36#include <asm/delay.h>
37 37
38#include <mach/dma.h> 38#include <mach/dma.h>
39#include <mach/regs-ssp.h> 39#include <plat/ssp.h>
40#include <mach/ssp.h>
41#include <mach/pxa2xx_spi.h> 40#include <mach/pxa2xx_spi.h>
42 41
43MODULE_AUTHOR("Stephen Street"); 42MODULE_AUTHOR("Stephen Street");
@@ -1318,14 +1317,14 @@ static int setup(struct spi_device *spi)
1318 /* NOTE: PXA25x_SSP _could_ use external clocking ... */ 1317 /* NOTE: PXA25x_SSP _could_ use external clocking ... */
1319 if (drv_data->ssp_type != PXA25x_SSP) 1318 if (drv_data->ssp_type != PXA25x_SSP)
1320 dev_dbg(&spi->dev, "%ld Hz actual, %s\n", 1319 dev_dbg(&spi->dev, "%ld Hz actual, %s\n",
1321 clk_get_rate(ssp->clk) 1320 clk_get_rate(ssp->clk)
1322 / (1 + ((chip->cr0 & SSCR0_SCR) >> 8)), 1321 / (1 + ((chip->cr0 & SSCR0_SCR(0xfff)) >> 8)),
1323 chip->enable_dma ? "DMA" : "PIO"); 1322 chip->enable_dma ? "DMA" : "PIO");
1324 else 1323 else
1325 dev_dbg(&spi->dev, "%ld Hz actual, %s\n", 1324 dev_dbg(&spi->dev, "%ld Hz actual, %s\n",
1326 clk_get_rate(ssp->clk) / 2 1325 clk_get_rate(ssp->clk) / 2
1327 / (1 + ((chip->cr0 & SSCR0_SCR) >> 8)), 1326 / (1 + ((chip->cr0 & SSCR0_SCR(0x0ff)) >> 8)),
1328 chip->enable_dma ? "DMA" : "PIO"); 1327 chip->enable_dma ? "DMA" : "PIO");
1329 1328
1330 if (spi->bits_per_word <= 8) { 1329 if (spi->bits_per_word <= 8) {
1331 chip->n_bytes = 1; 1330 chip->n_bytes = 1;
@@ -1466,7 +1465,7 @@ static int __init pxa2xx_spi_probe(struct platform_device *pdev)
1466 1465
1467 platform_info = dev->platform_data; 1466 platform_info = dev->platform_data;
1468 1467
1469 ssp = ssp_request(pdev->id, pdev->name); 1468 ssp = pxa_ssp_request(pdev->id, pdev->name);
1470 if (ssp == NULL) { 1469 if (ssp == NULL) {
1471 dev_err(&pdev->dev, "failed to request SSP%d\n", pdev->id); 1470 dev_err(&pdev->dev, "failed to request SSP%d\n", pdev->id);
1472 return -ENODEV; 1471 return -ENODEV;
@@ -1476,7 +1475,7 @@ static int __init pxa2xx_spi_probe(struct platform_device *pdev)
1476 master = spi_alloc_master(dev, sizeof(struct driver_data) + 16); 1475 master = spi_alloc_master(dev, sizeof(struct driver_data) + 16);
1477 if (!master) { 1476 if (!master) {
1478 dev_err(&pdev->dev, "cannot alloc spi_master\n"); 1477 dev_err(&pdev->dev, "cannot alloc spi_master\n");
1479 ssp_free(ssp); 1478 pxa_ssp_free(ssp);
1480 return -ENOMEM; 1479 return -ENOMEM;
1481 } 1480 }
1482 drv_data = spi_master_get_devdata(master); 1481 drv_data = spi_master_get_devdata(master);
@@ -1558,7 +1557,7 @@ static int __init pxa2xx_spi_probe(struct platform_device *pdev)
1558 write_SSCR1(SSCR1_RxTresh(RX_THRESH_DFLT) | 1557 write_SSCR1(SSCR1_RxTresh(RX_THRESH_DFLT) |
1559 SSCR1_TxTresh(TX_THRESH_DFLT), 1558 SSCR1_TxTresh(TX_THRESH_DFLT),
1560 drv_data->ioaddr); 1559 drv_data->ioaddr);
1561 write_SSCR0(SSCR0_SerClkDiv(2) 1560 write_SSCR0(SSCR0_SCR(2)
1562 | SSCR0_Motorola 1561 | SSCR0_Motorola
1563 | SSCR0_DataSize(8), 1562 | SSCR0_DataSize(8),
1564 drv_data->ioaddr); 1563 drv_data->ioaddr);
@@ -1605,7 +1604,7 @@ out_error_irq_alloc:
1605 1604
1606out_error_master_alloc: 1605out_error_master_alloc:
1607 spi_master_put(master); 1606 spi_master_put(master);
1608 ssp_free(ssp); 1607 pxa_ssp_free(ssp);
1609 return status; 1608 return status;
1610} 1609}
1611 1610
@@ -1649,7 +1648,7 @@ static int pxa2xx_spi_remove(struct platform_device *pdev)
1649 free_irq(ssp->irq, drv_data); 1648 free_irq(ssp->irq, drv_data);
1650 1649
1651 /* Release SSP */ 1650 /* Release SSP */
1652 ssp_free(ssp); 1651 pxa_ssp_free(ssp);
1653 1652
1654 /* Disconnect from the SPI framework */ 1653 /* Disconnect from the SPI framework */
1655 spi_unregister_master(drv_data->master); 1654 spi_unregister_master(drv_data->master);
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 9ffb0fdbd6fe..b3a1f9259b62 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -41,7 +41,7 @@ static void spidev_release(struct device *dev)
41 spi->master->cleanup(spi); 41 spi->master->cleanup(spi);
42 42
43 spi_master_put(spi->master); 43 spi_master_put(spi->master);
44 kfree(dev); 44 kfree(spi);
45} 45}
46 46
47static ssize_t 47static ssize_t
@@ -257,6 +257,7 @@ int spi_add_device(struct spi_device *spi)
257{ 257{
258 static DEFINE_MUTEX(spi_add_lock); 258 static DEFINE_MUTEX(spi_add_lock);
259 struct device *dev = spi->master->dev.parent; 259 struct device *dev = spi->master->dev.parent;
260 struct device *d;
260 int status; 261 int status;
261 262
262 /* Chipselects are numbered 0..max; validate. */ 263 /* Chipselects are numbered 0..max; validate. */
@@ -278,10 +279,11 @@ int spi_add_device(struct spi_device *spi)
278 */ 279 */
279 mutex_lock(&spi_add_lock); 280 mutex_lock(&spi_add_lock);
280 281
281 if (bus_find_device_by_name(&spi_bus_type, NULL, dev_name(&spi->dev)) 282 d = bus_find_device_by_name(&spi_bus_type, NULL, dev_name(&spi->dev));
282 != NULL) { 283 if (d != NULL) {
283 dev_err(dev, "chipselect %d already in use\n", 284 dev_err(dev, "chipselect %d already in use\n",
284 spi->chip_select); 285 spi->chip_select);
286 put_device(d);
285 status = -EBUSY; 287 status = -EBUSY;
286 goto done; 288 goto done;
287 } 289 }
diff --git a/drivers/spi/spi_mpc8xxx.c b/drivers/spi/spi_mpc8xxx.c
index 77ab15e330d0..75b7f8c0babc 100644
--- a/drivers/spi/spi_mpc8xxx.c
+++ b/drivers/spi/spi_mpc8xxx.c
@@ -640,7 +640,7 @@ static int mpc8xxx_spi_setup(struct spi_device *spi)
640 } 640 }
641 mpc8xxx_spi = spi_master_get_devdata(spi->master); 641 mpc8xxx_spi = spi_master_get_devdata(spi->master);
642 642
643 hw_mode = cs->hw_mode; /* Save orginal settings */ 643 hw_mode = cs->hw_mode; /* Save original settings */
644 cs->hw_mode = mpc8xxx_spi_read_reg(&mpc8xxx_spi->base->mode); 644 cs->hw_mode = mpc8xxx_spi_read_reg(&mpc8xxx_spi->base->mode);
645 /* mask out bits we are going to set */ 645 /* mask out bits we are going to set */
646 cs->hw_mode &= ~(SPMODE_CP_BEGIN_EDGECLK | SPMODE_CI_INACTIVEHIGH 646 cs->hw_mode &= ~(SPMODE_CP_BEGIN_EDGECLK | SPMODE_CI_INACTIVEHIGH