Patchwork [U-Boot,V2,3/6] spi: define SPI_XFER_ONCE

login
register
mail settings
Submitter Nikita Kiryanov
Date Oct. 16, 2013, 2:23 p.m.
Message ID <1381933409-8127-4-git-send-email-nikita@compulab.co.il>
Download mbox | patch
Permalink /patch/283955/
State Accepted
Delegated to: Anatolij Gustschin
Headers show

Comments

Nikita Kiryanov - Oct. 16, 2013, 2:23 p.m.
The flag combination "SPI_XFER_BEGIN | SPI_XFER_END" is a common use
case of spi_xfer, and it can easily cause an already long line (spi_xfer
takes 5 parameters) to go over the 80 character limit.

define SPI_XFER_ONCE to be a shorter version of the above flag combination.

Cc: Tom Rini <trini@ti.com>
Cc: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
---
NOTE:	This is a new patch. Its contents were originally part of "lcd: add
	DataImage SCF0403x LCD panel support". Split because it is unrelated to
	the patch it was originally in. (Igor Grinberg)

 include/spi.h | 1 +
 1 file changed, 1 insertion(+)
Anatolij Gustschin - Nov. 12, 2013, 9:19 a.m.
On Wed, 16 Oct 2013 17:23:26 +0300
Nikita Kiryanov <nikita@compulab.co.il> wrote:

> The flag combination "SPI_XFER_BEGIN | SPI_XFER_END" is a common use
> case of spi_xfer, and it can easily cause an already long line (spi_xfer
> takes 5 parameters) to go over the 80 character limit.
> 
> define SPI_XFER_ONCE to be a shorter version of the above flag combination.
> 
> Cc: Tom Rini <trini@ti.com>
> Cc: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
> ---
> NOTE:	This is a new patch. Its contents were originally part of "lcd: add
> 	DataImage SCF0403x LCD panel support". Split because it is unrelated to
> 	the patch it was originally in. (Igor Grinberg)
> 
>  include/spi.h | 1 +
>  1 file changed, 1 insertion(+)

applied to u-boot-video/master, thanks!

Anatolij

Patch

diff --git a/include/spi.h b/include/spi.h
index 67da75c..e2563c9 100644
--- a/include/spi.h
+++ b/include/spi.h
@@ -29,6 +29,7 @@ 
 #define SPI_XFER_END		0x02	/* Deassert CS after transfer */
 #define SPI_XFER_MMAP		0x08	/* Memory Mapped start */
 #define SPI_XFER_MMAP_END	0x10	/* Memory Mapped End */
+#define SPI_XFER_ONCE		(SPI_XFER_BEGIN | SPI_XFER_END)
 
 /* Header byte that marks the start of the message */
 #define SPI_PREAMBLE_END_BYTE	0xec