diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-02-02 23:30:22 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-02-08 09:21:16 +0100 |
commit | a046ff2df85bbab113ed3f78d94d5f957a16df7c (patch) | |
tree | d5f17b66723a729119abb53b895676cce87c82bf /include/spi | |
parent | 4f0a92ecb0358c428cc268a22e7925e8e828840a (diff) | |
download | barebox-a046ff2df85bbab113ed3f78d94d5f957a16df7c.tar.gz |
video: add MIPI DBI Type C Option 3 support
Import the Linux v5.15 state of the driver to allow easy porting of
MIPI-DBI displays like the Ilitek 9431 added in a follow-up commit.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220202223023.341817-4-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/spi')
-rw-r--r-- | include/spi/spi.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/spi/spi.h b/include/spi/spi.h index c5ad6bd39f..d133e0e212 100644 --- a/include/spi/spi.h +++ b/include/spi/spi.h @@ -409,6 +409,26 @@ spi_message_add_tail(struct spi_transfer *t, struct spi_message *m) list_add_tail(&t->transfer_list, &m->transfers); } +/** + * spi_message_init_with_transfers - Initialize spi_message and append transfers + * @m: spi_message to be initialized + * @xfers: An array of spi transfers + * @num_xfers: Number of items in the xfer array + * + * This function initializes the given spi_message and adds each spi_transfer in + * the given array to the message. + */ +static inline void +spi_message_init_with_transfers(struct spi_message *m, +struct spi_transfer *xfers, unsigned int num_xfers) +{ + unsigned int i; + + spi_message_init(m); + for (i = 0; i < num_xfers; ++i) + spi_message_add_tail(&xfers[i], m); +} + static inline void spi_transfer_del(struct spi_transfer *t) { |