Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83500
b: refs/heads/master
c: 13f3e64
h: refs/heads/master
v: v3
  • Loading branch information
Sonic Zhang authored and Linus Torvalds committed Feb 6, 2008
1 parent d9c80f4 commit 07bbd40
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4fd432d9c7ac9a14e750d2ab0c91bc151e9af32e
refs/heads/master: 13f3e642b24632d206fe2f6a5ee8b275ea062790
22 changes: 10 additions & 12 deletions trunk/drivers/spi/spi_bfin5xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,16 @@ static void u8_writer(struct driver_data *drv_data)
dev_dbg(&drv_data->pdev->dev,
"cr8-s is 0x%x\n", read_STAT(drv_data));

/* poll for SPI completion before start */
while (!(read_STAT(drv_data) & BIT_STAT_SPIF))
cpu_relax();

while (drv_data->tx < drv_data->tx_end) {
write_TDBR(drv_data, (*(u8 *) (drv_data->tx)));
while (read_STAT(drv_data) & BIT_STAT_TXS)
cpu_relax();
++drv_data->tx;
}

/* poll for SPI completion before return */
while (!(read_STAT(drv_data) & BIT_STAT_SPIF))
cpu_relax();
}

static void u8_cs_chg_writer(struct driver_data *drv_data)
Expand Down Expand Up @@ -398,32 +398,30 @@ static void u16_writer(struct driver_data *drv_data)
dev_dbg(&drv_data->pdev->dev,
"cr16 is 0x%x\n", read_STAT(drv_data));

/* poll for SPI completion before start */
while (!(read_STAT(drv_data) & BIT_STAT_SPIF))
cpu_relax();

while (drv_data->tx < drv_data->tx_end) {
write_TDBR(drv_data, (*(u16 *) (drv_data->tx)));
while ((read_STAT(drv_data) & BIT_STAT_TXS))
cpu_relax();
drv_data->tx += 2;
}

/* poll for SPI completion before return */
while (!(read_STAT(drv_data) & BIT_STAT_SPIF))
cpu_relax();
}

static void u16_cs_chg_writer(struct driver_data *drv_data)
{
struct chip_data *chip = drv_data->cur_chip;

/* poll for SPI completion before start */
while (!(read_STAT(drv_data) & BIT_STAT_SPIF))
cpu_relax();

while (drv_data->tx < drv_data->tx_end) {
cs_active(drv_data, chip);

write_TDBR(drv_data, (*(u16 *) (drv_data->tx)));
while ((read_STAT(drv_data) & BIT_STAT_TXS))
cpu_relax();
while (!(read_STAT(drv_data) & BIT_STAT_SPIF))
cpu_relax();

cs_deactive(drv_data, chip);

Expand Down

0 comments on commit 07bbd40

Please sign in to comment.