diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2024-05-17 22:40:20 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-05-27 01:33:22 +0100 |
commit | f261172d39f358dcecce13c310690d3937e0cca6 (patch) | |
tree | b994b49c9992cba69b3d1d538da42b651fce434f /include/linux/spi/spi_bitbang.h | |
parent | f44b3730b038363475a3f84bee2038d8b6448ed8 (diff) | |
download | linux-f261172d39f358dcecce13c310690d3937e0cca6.tar.gz linux-f261172d39f358dcecce13c310690d3937e0cca6.tar.bz2 linux-f261172d39f358dcecce13c310690d3937e0cca6.zip |
spi: bitbang: Use typedef for txrx_*() callbacks
With a typedef for the txrx_*() callbacks the code looks neater.
Note that typedef for a function is okay to have.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://msgid.link/r/20240517194104.747328-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/spi/spi_bitbang.h')
-rw-r--r-- | include/linux/spi/spi_bitbang.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h index b930eca2ef7b..7ca08b430ed5 100644 --- a/include/linux/spi/spi_bitbang.h +++ b/include/linux/spi/spi_bitbang.h @@ -4,6 +4,8 @@ #include <linux/workqueue.h> +typedef u32 (*spi_bb_txrx_word_fn)(struct spi_device *, unsigned int, u32, u8, unsigned int); + struct spi_bitbang { struct mutex lock; u8 busy; @@ -28,9 +30,8 @@ struct spi_bitbang { int (*txrx_bufs)(struct spi_device *spi, struct spi_transfer *t); /* txrx_word[SPI_MODE_*]() just looks like a shift register */ - u32 (*txrx_word[4])(struct spi_device *spi, - unsigned nsecs, - u32 word, u8 bits, unsigned flags); + spi_bb_txrx_word_fn txrx_word[4]; + int (*set_line_direction)(struct spi_device *spi, bool output); }; |