22 #include <linux/device.h>
24 #include <linux/slab.h>
78 #define SPI_MODE_0 (0|0)
79 #define SPI_MODE_1 (0|SPI_CPHA)
80 #define SPI_MODE_2 (SPI_CPOL|0)
81 #define SPI_MODE_3 (SPI_CPOL|SPI_CPHA)
82 #define SPI_CS_HIGH 0x04
83 #define SPI_LSB_FIRST 0x08
84 #define SPI_3WIRE 0x10
86 #define SPI_NO_CS 0x40
87 #define SPI_READY 0x80
116 static inline void spi_dev_put(
struct spi_device *spi)
123 static inline void *spi_get_ctldata(
struct spi_device *spi)
128 static inline void spi_set_ctldata(
struct spi_device *spi,
void *
state)
135 static inline void spi_set_drvdata(
struct spi_device *spi,
void *
data)
140 static inline void *spi_get_drvdata(
struct spi_device *spi)
198 static inline void spi_unregister_driver(
struct spi_driver *sdrv)
212 #define module_spi_driver(__spi_driver) \
213 module_driver(__spi_driver, spi_register_driver, \
214 spi_unregister_driver)
300 #define SPI_MASTER_HALF_DUPLEX BIT(0)
301 #define SPI_MASTER_NO_RX BIT(1)
302 #define SPI_MASTER_NO_TX BIT(2)
367 static inline void *spi_master_get_devdata(
struct spi_master *master)
372 static inline void spi_master_set_devdata(
struct spi_master *master,
void *
data)
384 static inline void spi_master_put(
struct spi_master *master)
573 static inline void spi_message_init(
struct spi_message *
m)
607 for (i = 0; i < ntrans; i++, t++)
608 spi_message_add_tail(t, m);
613 static inline void spi_message_free(
struct spi_message *m)
654 spi_message_init(&m);
655 spi_message_add_tail(&t, &m);
678 spi_message_init(&m);
679 spi_message_add_tail(&t, &m);
685 const void *txbuf,
unsigned n_tx,
686 void *rxbuf,
unsigned n_rx);
706 return (status < 0) ? status :
result;
730 return (status < 0) ? status :
result;