Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86217
b: refs/heads/master
c: f6febcc
h: refs/heads/master
i:
  86215: 1ac3a4f
v: v3
  • Loading branch information
Atsushi Nemoto authored and Linus Torvalds committed Feb 24, 2008
1 parent c2076ee commit 3bd4506
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4f9d5f4a353440f2265781bfa641587964901861
refs/heads/master: f6febccd7f86fbe94858a4a32d9384cc014c9f40
10 changes: 10 additions & 0 deletions trunk/drivers/spi/atmel_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ static void cs_activate(struct atmel_spi *as, struct spi_device *spi)
unsigned gpio = (unsigned) spi->controller_data;
unsigned active = spi->mode & SPI_CS_HIGH;
u32 mr;
int i;
u32 csr;
u32 cpol = (spi->mode & SPI_CPOL) ? SPI_BIT(CPOL) : 0;

/* Make sure clock polarity is correct */
for (i = 0; i < spi->master->num_chipselect; i++) {
csr = spi_readl(as, CSR0 + 4 * i);
if ((csr ^ cpol) & SPI_BIT(CPOL))
spi_writel(as, CSR0 + 4 * i, csr ^ SPI_BIT(CPOL));
}

mr = spi_readl(as, MR);
mr = SPI_BFINS(PCS, ~(1 << spi->chip_select), mr);
Expand Down

0 comments on commit 3bd4506

Please sign in to comment.