summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-dw.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2015-10-14 22:12:18 +0200
committerMark Brown <broonie@kernel.org>2015-10-19 21:31:57 +0200
commit4adb1f8f880081ee9921ebd399786387e0cd6f52 (patch)
tree6f0cdfed5b8a0713cf9e1cb6e1da4a804bbd309c /drivers/spi/spi-dw.c
parentspi: dw: use plain struct device * at earlier ->probe() (diff)
downloadlinux-4adb1f8f880081ee9921ebd399786387e0cd6f52.tar.xz
linux-4adb1f8f880081ee9921ebd399786387e0cd6f52.zip
spi: dw: remove unneeded cr0 member of struct chip_data
Since we recalculate cr0 each time we start a transfer the chip_data->cr0 becomes redundant. Remove it and related pieces. This is a follow up to commit 0ed36990a93b (spi: dw: Remove needless if statements). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-dw.c')
-rw-r--r--drivers/spi/spi-dw.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
index 749a831f26ce..c769c2a5da16 100644
--- a/drivers/spi/spi-dw.c
+++ b/drivers/spi/spi-dw.c
@@ -30,7 +30,6 @@
/* Slave spi_dev related */
struct chip_data {
- u16 cr0;
u8 cs; /* chip select pin */
u8 n_bytes; /* current is a 1/2/4 byte op */
u8 tmode; /* TR/TO/RO/EEPROM */
@@ -291,7 +290,7 @@ static int dw_spi_transfer_one(struct spi_master *master,
u16 txlevel = 0;
u16 clk_div = 0;
u32 speed = 0;
- u32 cr0 = 0;
+ u32 cr0;
int ret;
dws->dma_mapped = 0;
@@ -306,8 +305,6 @@ static int dw_spi_transfer_one(struct spi_master *master,
spi_enable_chip(dws, 0);
- cr0 = chip->cr0;
-
/* Handle per transfer options for bpw and speed */
speed = chip->speed_hz;
if ((transfer->speed_hz != speed) || !chip->clk_div) {
@@ -328,6 +325,7 @@ static int dw_spi_transfer_one(struct spi_master *master,
dws->n_bytes = 2;
dws->dma_width = 2;
}
+ /* Default SPI mode is SCPOL = 0, SCPH = 0 */
cr0 = (transfer->bits_per_word - 1)
| (chip->type << SPI_FRF_OFFSET)
| (spi->mode << SPI_MODE_OFFSET)
@@ -449,14 +447,6 @@ static int dw_spi_setup(struct spi_device *spi)
chip->bits_per_word = spi->bits_per_word;
chip->tmode = 0; /* Tx & Rx */
- /* Default SPI mode is SCPOL = 0, SCPH = 0 */
- chip->cr0 = (chip->bits_per_word - 1)
- | (chip->type << SPI_FRF_OFFSET)
- | (spi->mode << SPI_MODE_OFFSET)
- | (chip->tmode << SPI_TMOD_OFFSET);
-
- if (spi->mode & SPI_LOOP)
- chip->cr0 |= 1 << SPI_SRL_OFFSET;
if (gpio_is_valid(spi->cs_gpio)) {
ret = gpio_direction_output(spi->cs_gpio,