diff mbox

[U-Boot,v3,2/5] spi: make mode visible to both dm and non-dm

Message ID 1450086667-19522-2-git-send-email-jteki@openedev.com
State Accepted
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Commit Message

Jagan Teki Dec. 14, 2015, 9:51 a.m. UTC
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 <bmeng.cn@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Jagan Teki <jteki@openedev.com>
---
Changes for v3:
- none
Changes for v2:
- Used uint instead u8 in mode

 include/spi.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Bin Meng Dec. 15, 2015, 5:06 a.m. UTC | #1
On Mon, Dec 14, 2015 at 5:51 PM, Jagan Teki <jteki@openedev.com> wrote:
> 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 <bmeng.cn@gmail.com>
> Cc: Simon Glass <sjg@chromium.org>
> Signed-off-by: Jagan Teki <jteki@openedev.com>
> ---
> Changes for v3:
> - none
> Changes for v2:
> - Used uint instead u8 in mode
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Jagan Teki Dec. 15, 2015, 6:29 a.m. UTC | #2
On 15 December 2015 at 10:36, Bin Meng <bmeng.cn@gmail.com> wrote:
> On Mon, Dec 14, 2015 at 5:51 PM, Jagan Teki <jteki@openedev.com> wrote:
>> 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 <bmeng.cn@gmail.com>
>> Cc: Simon Glass <sjg@chromium.org>
>> Signed-off-by: Jagan Teki <jteki@openedev.com>
>> ---
>> Changes for v3:
>> - none
>> Changes for v2:
>> - Used uint instead u8 in mode
>>
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> Tested-by: Bin Meng <bmeng.cn@gmail.com>

Tested-by: Jagan Teki <jteki@openedev.com>

Applied to u-boot-spi/master

thanks!
diff mbox

Patch

diff --git a/include/spi.h b/include/spi.h
index b4d2723..05202d0 100644
--- a/include/spi.h
+++ b/include/spi.h
@@ -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;