diff options
author | Andi Shyti <andi.shyti@samsung.com> | 2016-06-27 22:41:13 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-06-29 17:45:23 -0400 |
commit | 11f66f0927bd044c17b2c2884d5103f8eb6cab38 (patch) | |
tree | e6cf926210785464cfff851eb95415a5f1ab7e4c | |
parent | a92e7c3d82a1313ab1954e5cdfd8f04efdb4ca78 (diff) |
spi: s3c64xx: do not configure the device twice
At the start of the transfer, the spi_config function is called
twice, the first time when the 3c64xx_spi_prepare_message is
called and the second time with the s3c64xx_spi_transfer_one,
both called from the spi framework.
Remove the first call at the prepare message because in that
point we don't have the imformation about "bit per word" and
frequency.
Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/spi/spi-s3c64xx.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 14269b07804c..c65a9e6baefd 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c | |||
@@ -676,16 +676,6 @@ static int s3c64xx_spi_prepare_message(struct spi_master *master, | |||
676 | struct spi_device *spi = msg->spi; | 676 | struct spi_device *spi = msg->spi; |
677 | struct s3c64xx_spi_csinfo *cs = spi->controller_data; | 677 | struct s3c64xx_spi_csinfo *cs = spi->controller_data; |
678 | 678 | ||
679 | /* If Master's(controller) state differs from that needed by Slave */ | ||
680 | if (sdd->cur_speed != spi->max_speed_hz | ||
681 | || sdd->cur_mode != spi->mode | ||
682 | || sdd->cur_bpw != spi->bits_per_word) { | ||
683 | sdd->cur_bpw = spi->bits_per_word; | ||
684 | sdd->cur_speed = spi->max_speed_hz; | ||
685 | sdd->cur_mode = spi->mode; | ||
686 | s3c64xx_spi_config(sdd); | ||
687 | } | ||
688 | |||
689 | /* Configure feedback delay */ | 679 | /* Configure feedback delay */ |
690 | writel(cs->fb_delay & 0x3, sdd->regs + S3C64XX_SPI_FB_CLK); | 680 | writel(cs->fb_delay & 0x3, sdd->regs + S3C64XX_SPI_FB_CLK); |
691 | 681 | ||
@@ -712,6 +702,7 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master, | |||
712 | if (bpw != sdd->cur_bpw || speed != sdd->cur_speed) { | 702 | if (bpw != sdd->cur_bpw || speed != sdd->cur_speed) { |
713 | sdd->cur_bpw = bpw; | 703 | sdd->cur_bpw = bpw; |
714 | sdd->cur_speed = speed; | 704 | sdd->cur_speed = speed; |
705 | sdd->cur_mode = spi->mode; | ||
715 | s3c64xx_spi_config(sdd); | 706 | s3c64xx_spi_config(sdd); |
716 | } | 707 | } |
717 | 708 | ||