Skip to contentSkip to conversation

spi: make mode visible to both dm and non-dm

PATCH New Jagan Teki 2 participants 2 messages Dec 14, 2015

lore
Share & tools
lore

Jagan Teki

author
#0 lore raw

PATCH v3 2/5 spi: make mode visible to both dm and non-dm

Couldn't find the exact reason to define 'mode' for dm, probably it is not using in non-dm drivers but it need to visible both dm and non-dm as mode data is getting dereferred in spi flash core ie common to both.

Cc Bin Meng <[email protected]>
Cc Simon Glass <[email protected]>

---
Changes for v3: make mode as uint
Changes for v2: none

 include/spi.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/spi.h +2 -2
index b4d2723..05202d0 100644
@@ -99,13 +99,13 @@ struct dm_spi_slave_platdata {
  *
  * @dev:		SPI slave device
  * @max_hz:		Maximum speed for this slave
- * @mode:		SPI mode to use for this slave (see SPI mode flags)
  * @speed:		Current bus speed. This is 0 until the bus is first
  *			claimed.
  * @bus:		ID of the bus that the slave is attached to. For
  *			driver model this is the sequence number of the SPI
  *			bus (bus->seq) so does not need to be stored
  * @cs:			ID of the chip select connected to the slave.
+ * @mode:		SPI mode to use for this slave (see SPI mode flags)
  * @op_mode_rx:		SPI RX operation mode.
  * @op_mode_tx:		SPI TX operation mode.
  * @wordlen:		Size of SPI word in number of bits
@@ -120,11 +120,11 @@ struct spi_slave {
 	struct udevice *dev;	/* struct spi_slave is dev->parentdata */
 	uint max_hz;
 	uint speed;
-	uint mode;
 #else
 	unsigned int bus;
 	unsigned int cs;
 #endif
+	uint mode;
 	u8 op_mode_rx;
 	u8 op_mode_tx;
 	unsigned int wordlen;
Signature · 1 line
1.9.1
#1 lore raw

PATCH v3 2/5 spi: make mode visible to both dm and non-dm

Hi Jagan,

Quoted 38 lines · Jagan Teki

Couldn't find the exact reason to define 'mode' for dm, probably it is not using in non-dm drivers but it need to visible both dm and non-dm as mode data is getting dereferred in spi flash core ie common to both.

Cc Bin Meng <[email protected]>
Cc Simon Glass <[email protected]>

---
Changes for v3: make mode as uint
Changes for v2: none

 include/spi.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/spi.h +1 -1
index b4d2723..05202d0 100644
@@ -99,13 +99,13 @@ struct dm_spi_slave_platdata {
  *
  * @dev:               SPI slave device
  * @max_hz:            Maximum speed for this slave
- * @mode:              SPI mode to use for this slave (see SPI mode flags)
  * @speed:             Current bus speed. This is 0 until the bus is first
  *                     claimed.
  * @bus:               ID of the bus that the slave is attached to. For
  *                     driver model this is the sequence number of the SPI
  *                     bus (bus->seq) so does not need to be stored
  * @cs:                        ID of the chip select connected to the slave.
+ * @mode:              SPI mode to use for this slave (see SPI mode flags)
  * @op_mode_rx:                SPI RX operation mode.
  * @op_mode_tx:                SPI TX operation mode.
  * @wordlen:           Size of SPI word in number of bits
@@ -120,11 +120,11 @@ struct spi_slave {
        struct udevice *dev;    /* struct spi_slave is dev->parentdata */
        uint max_hz;
        uint speed;

include/spi.h struct spi_slave {

Quoted 10 lines
include/spi.h +1 -2
-       uint mode;
 #else
        unsigned int bus;
        unsigned int cs;
 #endif
+       uint mode;
        u8 op_mode_rx;
        u8 op_mode_tx;
        unsigned int wordlen;
--

Can you please send all v3? I see you used to send just partial patch series to the mailing list, but I don't think that's good for people to test the whole series, especially for those who have not been tracking the series from the beginning.

For this case, after I applied the v3 2/5 patch, then applied the v2 3/5 patch, I got:

Applying: spi: Use mode instead of op_mode_tx
error: patch failed: include/spi.h:126
error: include/spi.h: patch does not apply
Patch failed at 0001 spi: Use mode instead of op_mode_tx
The copy of the patch that failed is found in:
~/work/git/u-boot/.git/rebase-apply/patch
When you have resolved this problem, run "git am --resolved". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".

Regards,
Bin