From: Andi Shyti Date: Mon, 13 Jun 2016 02:44:09 +0000 (+0900) Subject: spi: s3c64xx: add the BROKEN_CS case when setting up the transfer X-Git-Tag: submit/tizen/20160810.050017~141 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ef44196ef9a50b01faa92d5e74b6a4c68dd0402;p=platform%2Fkernel%2Flinux-exynos.git spi: s3c64xx: add the BROKEN_CS case when setting up the transfer The CS line might be disconneced ("broken"), therefore unused. In this case, the device doesn't need to wait for the user to handle the CS line for selecting the slave. The data will then be automatically transferred without taking the CS line status into account. Change-Id: Ibddf87721b7d882efbdad9c978b79a3e19189b3e Signed-off-by: Andi Shyti Signed-off-by: Jaehoon Chung --- diff --git a/Documentation/devicetree/bindings/spi/spi-samsung.txt b/Documentation/devicetree/bindings/spi/spi-samsung.txt index 6dbdeb3c361a..62f19b6f8387 100644 --- a/Documentation/devicetree/bindings/spi/spi-samsung.txt +++ b/Documentation/devicetree/bindings/spi/spi-samsung.txt @@ -40,6 +40,9 @@ Optional Board Specific Properties: - cs-gpios: should specify GPIOs used for chipselects (see spi-bus.txt) +- broken-cs: the CS line is disconnected, therefore the device should not wait + for the CS protocol to be established + SPI Controller specific data in SPI slave nodes: - The spi slave nodes should provide the following information which is required diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 3c7ee578e1f0..629f187f9228 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -706,7 +706,8 @@ static int s3c64xx_spi_transfer_one(struct spi_master *master, enable_datapath(sdd, spi, xfer, use_dma); /* Start the signals */ - if (!(sdd->port_conf->quirks & S3C64XX_SPI_QUIRK_CS_AUTO)) + if (!(sdd->port_conf->quirks & S3C64XX_SPI_QUIRK_CS_AUTO) || + sdd->cntrlr_info->broken_cs) writel(0, sdd->regs + S3C64XX_SPI_SLAVE_SEL); else writel(readl(sdd->regs + S3C64XX_SPI_SLAVE_SEL) @@ -997,6 +998,8 @@ static struct s3c64xx_spi_info *s3c64xx_spi_parse_dt(struct device *dev) sci->num_cs = temp; } + sci->broken_cs = of_property_read_bool(dev->of_node, "broken-cs"); + return sci; } #else diff --git a/include/linux/platform_data/spi-s3c64xx.h b/include/linux/platform_data/spi-s3c64xx.h index d3889b98a1a1..ee1fb3a61b1f 100644 --- a/include/linux/platform_data/spi-s3c64xx.h +++ b/include/linux/platform_data/spi-s3c64xx.h @@ -38,6 +38,7 @@ struct s3c64xx_spi_csinfo { struct s3c64xx_spi_info { int src_clk_nr; int num_cs; + bool broken_cs; int (*cfg_gpio)(void); dma_filter_fn filter; };