Skip to contentSkip to conversation

spi: Get spi-3wire from dts

PATCH New Jagan Teki 2 participants 6 messages Dec 3, 2015 – Dec 4, 2015 SPI

lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

PATCH 1/2 spi: Get spi-3wire from dts

spi-3wire is used when SI/SO signals shared so get the same from dts node and assign to mode on slave plat->mode.

---
 drivers/spi/spi-uclass.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/spi/spi-uclass.c +2 -0
index 3c7d64a..e0f6b25 100644
@@ -378,6 +378,8 @@ int spi_slave_ofdata_to_platdata(const void *blob, int node,
 		mode |= SPI_CPHA;
 	if (fdtdec_get_bool(blob, node, "spi-cs-high"))
 		mode |= SPI_CS_HIGH;
+	if (fdtdec_get_bool(blob, node, "spi-3wire"))
+		mode |= SPI_3WIRE;
 	if (fdtdec_get_bool(blob, node, "spi-half-duplex"))
 		mode |= SPI_PREAMBLE;
 	plat->mode = mode;
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 2/2 spi: ti_qspi: Fix SPI_3WIRE checking using mode

SPI_3WIRE is spi mode not spi flags, so this patch fixed the spi-3wire checking throgh mode instead of flags.

Cc Mugunthan V N <[email protected]>
Cc Simon Glass <[email protected]>
---
 drivers/spi/ti_qspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/ti_qspi.c +1 -1
index 646dd89..5747ed1 100644
@@ -293,7 +293,7 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *dout,
 	qslave->cmd = 0;
 	qslave->cmd |= QSPI_WLEN(8);
 	qslave->cmd |= QSPI_EN_CS(slave->cs);
-	if (flags & SPI_3WIRE)
+	if (qslave->mode & SPI_3WIRE)
 		qslave->cmd |= QSPI_3_PIN;
 	qslave->cmd |= 0xfff;
 
Signature · 1 line
1.9.1
author
#3 lore raw

PATCH 2/2 spi: ti_qspi: Fix SPI_3WIRE checking using mode

Quoted 4 lines · Simon Glass
Quoted 3 lines · Jagan Teki

SPI_3WIRE is spi mode not spi flags, so this patch fixed the spi-3wire checking throgh mode instead of flags.

Quoted 8 lines
Quoted 6 lines
Cc Mugunthan V N <[email protected]>
Cc Simon Glass <[email protected]>
---
 drivers/spi/ti_qspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-spi/master

thanks!

Signature · 1 line
Jagan.
author
#5 lore raw

PATCH 1/2 spi: Get spi-3wire from dts

Quoted 5 lines · Simon Glass
Quoted 4 lines · Jagan Teki

spi-3wire is used when SI/SO signals shared so get the same from dts node and assign to mode on slave plat->mode.

Quoted 7 lines
Quoted 5 lines
---
 drivers/spi/spi-uclass.c | 2 ++
 1 file changed, 2 insertions(+)

Applied to u-boot-spi/master

thanks!

Signature · 1 line
Jagan.