summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@libc.org>2016-04-04 07:13:46 +0000
committerRich Felker <dalias@libc.org>2016-04-11 22:57:04 +0000
commitf510366f67b73cfd9f3d03c2ba8a0fdc9b128bbe (patch)
tree54df5eb36fef58c591304c24f08b8c430aa6be02
parentac7e1057564b15a29a16d876bb729ac3eb4b93d0 (diff)
downloadlinux-sh-f510366f67b73cfd9f3d03c2ba8a0fdc9b128bbe.tar.gz
spi: fix J-Core bitbang chipselect code
Merge as fixup when rebasing.
-rw-r--r--drivers/spi/spi-jcore-bitbang.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/spi/spi-jcore-bitbang.c b/drivers/spi/spi-jcore-bitbang.c
index 28936a9329bd..9f86d6acb3c6 100644
--- a/drivers/spi/spi-jcore-bitbang.c
+++ b/drivers/spi/spi-jcore-bitbang.c
@@ -94,21 +94,8 @@ static void sei_spi_chipsel(struct spi_device *spi, int value)
sei_spi_wait_till_ready(hw, SEI_SPI_WAIT_RDY_MAX_LOOP);
- switch (value) {
- default:
- case SPI_NOCHIP_CS:
- hw->csReg = SEI_SPI_CTRL_ACS;
- break;
- case SPI_FLASH_CS:
- hw->csReg = 0;
- break;
- case SPI_SD_CS:
- hw->csReg = SEI_SPI_CTRL_ACS | SEI_SPI_CTRL_CCS;
- break;
- case SPI_CODEC_CS:
- hw->csReg = SEI_SPI_CTRL_ACS | SEI_SPI_CTRL_DCS;
- break;
- }
+ hw->csReg = ( SEI_SPI_CTRL_ACS | SEI_SPI_CTRL_CCS | SEI_SPI_CTRL_DCS )
+ ^ (value << 2*spi->chip_select);
writel(hw->csReg | hw->speedReg, hw->base + CTRL_REG);
}
@@ -168,7 +155,7 @@ static int sei_spi_probe(struct platform_device *pdev)
/* setup the master state. */
master->bus_num = -1; //pdev->id;
- master->num_chipselect = 2;
+ master->num_chipselect = 3;
master->mode_bits = SPI_MODE_3;
master->setup = sei_spi_setup;
master->transfer = NULL;