aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/pxa2xx_spi.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-05-25 02:38:26 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-05-25 02:38:26 -0400
commitb1e50ebcf24668e57f058deb48b0704b5391ed0f (patch)
tree17e1b69b249d0738317b732186340c9dd053f1a1 /drivers/spi/pxa2xx_spi.c
parent0c2a2ae32793e3500a15a449612485f5d17dd431 (diff)
parent7e125f7b9cbfce4101191b8076d606c517a73066 (diff)
Merge remote branch 'origin' into secretlab/next-spi
Diffstat (limited to 'drivers/spi/pxa2xx_spi.c')
-rw-r--r--drivers/spi/pxa2xx_spi.c25
1 files changed, 12 insertions, 13 deletions
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);