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-07 14:57:33 +0000
commit3c16e7c41bea7099292fec33185873c5d9b7e27a (patch)
tree4ded6aa049c37e8454680c2f60a63f7473c7cc38
parent863c9170406aa56e95612840d8ef1fac0cb56c78 (diff)
downloadlinux-sh-3c16e7c41bea7099292fec33185873c5d9b7e27a.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;