Skip to contentSkip to conversation

serial:ifx6x60:Keep word size accordance with SPI controller

PATCH In review chao bi 2 participants 3 messages Dec 12, 2012 – Jan 16, 2013 TTY layer and serial drivers

lore
Share & tools
lore

chao bi

author
#0 lore raw

PATCH 1/1 serial:ifx6x60:Keep word size accordance with SPI controller

As protocol driver, IFX SPI driver initiate to setup SPI master with default SPI word size as 16 bit/word, however, SPI master may not adopt this default value due to SPI controller's capability, it might choose an available value by itself and set it to spi_device.bits_per_word. In order to keep align with Controller, IFX driver should make use of this value during SPI transfer, but the default one.

---
 drivers/tty/serial/ifx6x60.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/tty/serial/ifx6x60.c +2 -1
index 675d94a..5919992 100644
@@ -810,7 +810,8 @@ static void ifx_spi_io(unsigned long data)
 		ifx_dev->spi_xfer.cs_change = 0;
 		ifx_dev->spi_xfer.speed_hz = ifx_dev->spi_dev->max_speed_hz;
 		/* ifx_dev->spi_xfer.speed_hz = 390625; */
-		ifx_dev->spi_xfer.bits_per_word = spi_bpw;
+		ifx_dev->spi_xfer.bits_per_word =
+		ifx_dev->spi_dev->bits_per_word;
 
 		ifx_dev->spi_xfer.tx_buf = ifx_dev->tx_buffer;
 		ifx_dev->spi_xfer.rx_buf = ifx_dev->rx_buffer;
Signature · 1 line
1.7.1
maintainer
#1 lore raw
Quoted 19 lines · chao bi

As protocol driver, IFX SPI driver initiate to setup SPI master with default SPI word size as 16 bit/word, however, SPI master may not adopt this default value due to SPI controller's capability, it might choose an available value by itself and set it to spi_device.bits_per_word. In order to keep align with Controller, IFX driver should make use of this value during SPI transfer, but the default one.

---
 drivers/tty/serial/ifx6x60.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/tty/serial/ifx6x60.c +0 -0
index 675d94a..5919992 100644

drivers/tty/serial/ifx6x60.c static void ifx_spi_io(unsigned long data) · line 814

Quoted 6 lines
drivers/tty/serial/ifx6x60.c +2 -1
@@ -810,7 +810,8 @@ static void ifx_spi_io(unsigned long data)
 		ifx_dev->spi_xfer.cs_change = 0;
 		ifx_dev->spi_xfer.speed_hz = ifx_dev->spi_dev->max_speed_hz;
 		/* ifx_dev->spi_xfer.speed_hz = 390625; */
-		ifx_dev->spi_xfer.bits_per_word = spi_bpw;
+		ifx_dev->spi_xfer.bits_per_word =
+		ifx_dev->spi_dev->bits_per_word;

Please follow the proper coding style (hint, this isn't it.)

thanks,

greg k-h

author
#2 lore raw

Sorry for that, please check my resubmitted patch right now.

Thanks,
Chao

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Wednesday, January 16, 2013 10:50 AM
To: Bi, Chao
Cc: Alan Cox; Gorby, Russ; Chen, Jun D; [email protected]; [email protected]
Subject: Re: [PATCH] serial:ifx6x60:Keep word size accordance with SPI controller

Quoted 19 lines · chao bi

As protocol driver, IFX SPI driver initiate to setup SPI master with default SPI word size as 16 bit/word, however, SPI master may not adopt this default value due to SPI controller's capability, it might choose an available value by itself and set it to spi_device.bits_per_word. In order to keep align with Controller, IFX driver should make use of this value during SPI transfer, but the default one.

---
 drivers/tty/serial/ifx6x60.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/drivers/tty/serial/ifx6x60.c index 675d94a..5919992 100644

drivers/tty/serial/ifx6x60.c static void ifx_spi_io(unsigned long data) · line 814

Quoted 6 lines
drivers/tty/serial/ifx6x60.c +2 -1
@@ -810,7 +810,8 @@ static void ifx_spi_io(unsigned long data)
 		ifx_dev->spi_xfer.cs_change = 0;
 		ifx_dev->spi_xfer.speed_hz = ifx_dev->spi_dev->max_speed_hz;
 		/* ifx_dev->spi_xfer.speed_hz = 390625; */
-		ifx_dev->spi_xfer.bits_per_word = spi_bpw;
+		ifx_dev->spi_xfer.bits_per_word =
+		ifx_dev->spi_dev->bits_per_word;

Please follow the proper coding style (hint, this isn't it.)

thanks,

greg k-h