aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi_bfin5xx.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-10-15 00:13:29 -0400
committerMike Frysinger <vapier@gentoo.org>2010-10-18 02:49:35 -0400
commit90008a641dd832cc2e2c4d21b7da94de91e9d0a4 (patch)
tree08ba56ed239b74075fa1dd0b48114f5f78ea3bb5 /drivers/spi/spi_bfin5xx.c
parent2a045131db69c207b9e3f9614b2c9b0f2e82bcb7 (diff)
spi/bfin_spi: use the SPI namespaced bit names
This lets us push the short SPI MMR bit names out of the global namespace. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'drivers/spi/spi_bfin5xx.c')
-rw-r--r--drivers/spi/spi_bfin5xx.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c
index ffff0998e55..07044d7db9a 100644
--- a/drivers/spi/spi_bfin5xx.c
+++ b/drivers/spi/spi_bfin5xx.c
@@ -504,8 +504,8 @@ static irqreturn_t bfin_spi_dma_irq_handler(int irq, void *dev_id)
504 * register until it goes low for 2 successive reads 504 * register until it goes low for 2 successive reads
505 */ 505 */
506 if (drv_data->tx != NULL) { 506 if (drv_data->tx != NULL) {
507 while ((read_STAT(drv_data) & TXS) || 507 while ((read_STAT(drv_data) & BIT_STAT_TXS) ||
508 (read_STAT(drv_data) & TXS)) 508 (read_STAT(drv_data) & BIT_STAT_TXS))
509 cpu_relax(); 509 cpu_relax();
510 } 510 }
511 511
@@ -514,14 +514,14 @@ static irqreturn_t bfin_spi_dma_irq_handler(int irq, void *dev_id)
514 dmastat, read_STAT(drv_data)); 514 dmastat, read_STAT(drv_data));
515 515
516 timeout = jiffies + HZ; 516 timeout = jiffies + HZ;
517 while (!(read_STAT(drv_data) & SPIF)) 517 while (!(read_STAT(drv_data) & BIT_STAT_SPIF))
518 if (!time_before(jiffies, timeout)) { 518 if (!time_before(jiffies, timeout)) {
519 dev_warn(&drv_data->pdev->dev, "timeout waiting for SPIF"); 519 dev_warn(&drv_data->pdev->dev, "timeout waiting for SPIF");
520 break; 520 break;
521 } else 521 } else
522 cpu_relax(); 522 cpu_relax();
523 523
524 if ((dmastat & DMA_ERR) && (spistat & RBSY)) { 524 if ((dmastat & DMA_ERR) && (spistat & BIT_STAT_RBSY)) {
525 msg->state = ERROR_STATE; 525 msg->state = ERROR_STATE;
526 dev_err(&drv_data->pdev->dev, "dma receive: fifo/buffer overflow\n"); 526 dev_err(&drv_data->pdev->dev, "dma receive: fifo/buffer overflow\n");
527 } else { 527 } else {
@@ -1000,11 +1000,12 @@ static int bfin_spi_setup(struct spi_device *spi)
1000 if (chip_info) { 1000 if (chip_info) {
1001 /* Make sure people stop trying to set fields via ctl_reg 1001 /* Make sure people stop trying to set fields via ctl_reg
1002 * when they should actually be using common SPI framework. 1002 * when they should actually be using common SPI framework.
1003 * Currently we let through: WOM EMISO PSSE GM SZ TIMOD. 1003 * Currently we let through: WOM EMISO PSSE GM SZ.
1004 * Not sure if a user actually needs/uses any of these, 1004 * Not sure if a user actually needs/uses any of these,
1005 * but let's assume (for now) they do. 1005 * but let's assume (for now) they do.
1006 */ 1006 */
1007 if (chip_info->ctl_reg & (SPE|MSTR|CPOL|CPHA|LSBF|SIZE)) { 1007 if (chip_info->ctl_reg & ~(BIT_CTL_OPENDRAIN | BIT_CTL_EMISO | \
1008 BIT_CTL_PSSE | BIT_CTL_GM | BIT_CTL_SZ)) {
1008 dev_err(&spi->dev, "do not set bits in ctl_reg " 1009 dev_err(&spi->dev, "do not set bits in ctl_reg "
1009 "that the SPI framework manages\n"); 1010 "that the SPI framework manages\n");
1010 goto error; 1011 goto error;
@@ -1022,13 +1023,13 @@ static int bfin_spi_setup(struct spi_device *spi)
1022 1023
1023 /* translate common spi framework into our register */ 1024 /* translate common spi framework into our register */
1024 if (spi->mode & SPI_CPOL) 1025 if (spi->mode & SPI_CPOL)
1025 chip->ctl_reg |= CPOL; 1026 chip->ctl_reg |= BIT_CTL_CPOL;
1026 if (spi->mode & SPI_CPHA) 1027 if (spi->mode & SPI_CPHA)
1027 chip->ctl_reg |= CPHA; 1028 chip->ctl_reg |= BIT_CTL_CPHA;
1028 if (spi->mode & SPI_LSB_FIRST) 1029 if (spi->mode & SPI_LSB_FIRST)
1029 chip->ctl_reg |= LSBF; 1030 chip->ctl_reg |= BIT_CTL_LSBF;
1030 /* we dont support running in slave mode (yet?) */ 1031 /* we dont support running in slave mode (yet?) */
1031 chip->ctl_reg |= MSTR; 1032 chip->ctl_reg |= BIT_CTL_MASTER;
1032 1033
1033 /* 1034 /*
1034 * Notice: for blackfin, the speed_hz is the value of register 1035 * Notice: for blackfin, the speed_hz is the value of register