diff options
Diffstat (limited to 'drivers/spi/spi-sh.c')
-rw-r--r-- | drivers/spi/spi-sh.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/spi/spi-sh.c b/drivers/spi/spi-sh.c index c120a70094f2..f6f2c7010177 100644 --- a/drivers/spi/spi-sh.c +++ b/drivers/spi/spi-sh.c | |||
@@ -171,7 +171,6 @@ static int spi_sh_send(struct spi_sh_data *ss, struct spi_message *mesg, | |||
171 | int remain = t->len; | 171 | int remain = t->len; |
172 | int cur_len; | 172 | int cur_len; |
173 | unsigned char *data; | 173 | unsigned char *data; |
174 | unsigned long tmp; | ||
175 | long ret; | 174 | long ret; |
176 | 175 | ||
177 | if (t->len) | 176 | if (t->len) |
@@ -213,9 +212,7 @@ static int spi_sh_send(struct spi_sh_data *ss, struct spi_message *mesg, | |||
213 | } | 212 | } |
214 | 213 | ||
215 | if (list_is_last(&t->transfer_list, &mesg->transfers)) { | 214 | if (list_is_last(&t->transfer_list, &mesg->transfers)) { |
216 | tmp = spi_sh_read(ss, SPI_SH_CR1); | 215 | spi_sh_clear_bit(ss, SPI_SH_SSD | SPI_SH_SSDB, SPI_SH_CR1); |
217 | tmp = tmp & ~(SPI_SH_SSD | SPI_SH_SSDB); | ||
218 | spi_sh_write(ss, tmp, SPI_SH_CR1); | ||
219 | spi_sh_set_bit(ss, SPI_SH_SSA, SPI_SH_CR1); | 216 | spi_sh_set_bit(ss, SPI_SH_SSA, SPI_SH_CR1); |
220 | 217 | ||
221 | ss->cr1 &= ~SPI_SH_TBE; | 218 | ss->cr1 &= ~SPI_SH_TBE; |
@@ -239,7 +236,6 @@ static int spi_sh_receive(struct spi_sh_data *ss, struct spi_message *mesg, | |||
239 | int remain = t->len; | 236 | int remain = t->len; |
240 | int cur_len; | 237 | int cur_len; |
241 | unsigned char *data; | 238 | unsigned char *data; |
242 | unsigned long tmp; | ||
243 | long ret; | 239 | long ret; |
244 | 240 | ||
245 | if (t->len > SPI_SH_MAX_BYTE) | 241 | if (t->len > SPI_SH_MAX_BYTE) |
@@ -247,9 +243,7 @@ static int spi_sh_receive(struct spi_sh_data *ss, struct spi_message *mesg, | |||
247 | else | 243 | else |
248 | spi_sh_write(ss, t->len, SPI_SH_CR3); | 244 | spi_sh_write(ss, t->len, SPI_SH_CR3); |
249 | 245 | ||
250 | tmp = spi_sh_read(ss, SPI_SH_CR1); | 246 | spi_sh_clear_bit(ss, SPI_SH_SSD | SPI_SH_SSDB, SPI_SH_CR1); |
251 | tmp = tmp & ~(SPI_SH_SSD | SPI_SH_SSDB); | ||
252 | spi_sh_write(ss, tmp, SPI_SH_CR1); | ||
253 | spi_sh_set_bit(ss, SPI_SH_SSA, SPI_SH_CR1); | 247 | spi_sh_set_bit(ss, SPI_SH_SSA, SPI_SH_CR1); |
254 | 248 | ||
255 | spi_sh_wait_write_buffer_empty(ss); | 249 | spi_sh_wait_write_buffer_empty(ss); |
@@ -358,9 +352,6 @@ static int spi_sh_setup(struct spi_device *spi) | |||
358 | { | 352 | { |
359 | struct spi_sh_data *ss = spi_master_get_devdata(spi->master); | 353 | struct spi_sh_data *ss = spi_master_get_devdata(spi->master); |
360 | 354 | ||
361 | if (!spi->bits_per_word) | ||
362 | spi->bits_per_word = 8; | ||
363 | |||
364 | pr_debug("%s: enter\n", __func__); | 355 | pr_debug("%s: enter\n", __func__); |
365 | 356 | ||
366 | spi_sh_write(ss, 0xfe, SPI_SH_CR1); /* SPI sycle stop */ | 357 | spi_sh_write(ss, 0xfe, SPI_SH_CR1); /* SPI sycle stop */ |