aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-s3c64xx.c
diff options
context:
space:
mode:
authorAndi Shyti <andi.shyti@samsung.com>2016-06-27 22:41:12 -0400
committerMark Brown <broonie@kernel.org>2016-06-29 17:45:23 -0400
commita92e7c3d82a1313ab1954e5cdfd8f04efdb4ca78 (patch)
treeef099f7f2fdb25db02300b670414a5d94a29e91b /drivers/spi/spi-s3c64xx.c
parentaa4964c4eb3ed38666023bcb805403cb7cf2af63 (diff)
spi: s3c64xx: consider the case when the CS line is not connected
When the CS line is not connected, it is not needed to enable or disable the chip selection functionality from the s3c64xx devices in order to perform a transfer. Set the CS controller logically always enabled already during initialization (by writing '0' in the S3C64XX_SPI_SLAVE_SEL register) and never disable it. Signed-off-by: Andi Shyti <andi.shyti@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-s3c64xx.c')
-rw-r--r--drivers/spi/spi-s3c64xx.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 972367d5c7f2..14269b07804c 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -315,6 +315,9 @@ static void s3c64xx_spi_set_cs(struct spi_device *spi, bool enable)
315 struct s3c64xx_spi_driver_data *sdd = 315 struct s3c64xx_spi_driver_data *sdd =
316 spi_master_get_devdata(spi->master); 316 spi_master_get_devdata(spi->master);
317 317
318 if (sdd->cntrlr_info->no_cs)
319 return;
320
318 if (enable) { 321 if (enable) {
319 if (!(sdd->port_conf->quirks & S3C64XX_SPI_QUIRK_CS_AUTO)) { 322 if (!(sdd->port_conf->quirks & S3C64XX_SPI_QUIRK_CS_AUTO)) {
320 writel(0, sdd->regs + S3C64XX_SPI_SLAVE_SEL); 323 writel(0, sdd->regs + S3C64XX_SPI_SLAVE_SEL);
@@ -960,7 +963,9 @@ static void s3c64xx_spi_hwinit(struct s3c64xx_spi_driver_data *sdd, int channel)
960 963
961 sdd->cur_speed = 0; 964 sdd->cur_speed = 0;
962 965
963 if (!(sdd->port_conf->quirks & S3C64XX_SPI_QUIRK_CS_AUTO)) 966 if (sci->no_cs)
967 writel(0, sdd->regs + S3C64XX_SPI_SLAVE_SEL);
968 else if (!(sdd->port_conf->quirks & S3C64XX_SPI_QUIRK_CS_AUTO))
964 writel(S3C64XX_SPI_SLAVE_SIG_INACT, sdd->regs + S3C64XX_SPI_SLAVE_SEL); 969 writel(S3C64XX_SPI_SLAVE_SIG_INACT, sdd->regs + S3C64XX_SPI_SLAVE_SEL);
965 970
966 /* Disable Interrupts - we use Polling if not DMA mode */ 971 /* Disable Interrupts - we use Polling if not DMA mode */
@@ -1015,6 +1020,8 @@ static struct s3c64xx_spi_info *s3c64xx_spi_parse_dt(struct device *dev)
1015 sci->num_cs = temp; 1020 sci->num_cs = temp;
1016 } 1021 }
1017 1022
1023 sci->no_cs = of_property_read_bool(dev->of_node, "broken-cs");
1024
1018 return sci; 1025 return sci;
1019} 1026}
1020#else 1027#else