Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210630
b: refs/heads/master
c: e3e55ff
h: refs/heads/master
v: v3
  • Loading branch information
Feng Tang authored and Grant Likely committed Sep 8, 2010
1 parent 00796d1 commit 370506c
Show file tree
Hide file tree
Showing 3 changed files with 8 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: cbcc062abb16d39839b3d8d4e3d20360fc21eb58
refs/heads/master: e3e55ff5854655d8723ad8b307f02515aecc3df5
17 changes: 5 additions & 12 deletions trunk/drivers/spi/dw_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,6 @@ static void flush(struct dw_spi *dws)
wait_till_not_busy(dws);
}

static void null_cs_control(u32 command)
{
}

static int null_writer(struct dw_spi *dws)
{
u8 n_bytes = dws->n_bytes;
Expand Down Expand Up @@ -322,7 +318,7 @@ static void giveback(struct dw_spi *dws)
struct spi_transfer,
transfer_list);

if (!last_transfer->cs_change)
if (!last_transfer->cs_change && dws->cs_control)
dws->cs_control(MRST_SPI_DEASSERT);

msg->state = NULL;
Expand Down Expand Up @@ -549,13 +545,13 @@ static void pump_transfers(unsigned long data)
*/
if (dws->cs_control) {
if (dws->rx && dws->tx)
chip->tmode = 0x00;
chip->tmode = SPI_TMOD_TR;
else if (dws->rx)
chip->tmode = 0x02;
chip->tmode = SPI_TMOD_RO;
else
chip->tmode = 0x01;
chip->tmode = SPI_TMOD_TO;

cr0 &= ~(0x3 << SPI_MODE_OFFSET);
cr0 &= ~SPI_TMOD_MASK;
cr0 |= (chip->tmode << SPI_TMOD_OFFSET);
}

Expand Down Expand Up @@ -704,9 +700,6 @@ static int dw_spi_setup(struct spi_device *spi)
chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL);
if (!chip)
return -ENOMEM;

chip->cs_control = null_cs_control;
chip->enable_dma = 0;
}

/*
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/spi/dw_spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
#define SPI_MODE_OFFSET 6
#define SPI_SCPH_OFFSET 6
#define SPI_SCOL_OFFSET 7

#define SPI_TMOD_OFFSET 8
#define SPI_TMOD_MASK (0x3 << SPI_TMOD_OFFSET)
#define SPI_TMOD_TR 0x0 /* xmit & recv */
#define SPI_TMOD_TO 0x1 /* xmit only */
#define SPI_TMOD_RO 0x2 /* recv only */
Expand Down

0 comments on commit 370506c

Please sign in to comment.