Lines Matching defs:spi
4 * using the spi in LCD controler for commands send
15 #include <linux/spi/spi.h>
20 * @spi: the SPI device.
30 static inline int lcd_spi_write(struct spi_device *spi, u32 data)
35 *(void **) spi_controller_get_devdata(spi->controller);
40 switch (spi->bits_per_word) {
51 dev_err(&spi->dev, "Wrong spi bit length\n");
66 dev_err(&spi->dev, "spi cmd send time out\n");
81 static int lcd_spi_setup(struct spi_device *spi)
84 *(void **) spi_controller_get_devdata(spi->controller);
88 CFG_TXBITS(spi->bits_per_word) |
94 * After set mode it needs some time to pull up the spi signals,
95 * or it would cause the wrong waveform when send spi command,
107 static int lcd_spi_one_transfer(struct spi_device *spi, struct spi_message *m)
113 switch (spi->bits_per_word) {
116 lcd_spi_write(spi, ((u8 *)t->tx_buf)[i]);
120 lcd_spi_write(spi, ((u16 *)t->tx_buf)[i]);
124 lcd_spi_write(spi, ((u32 *)t->tx_buf)[i]);
127 dev_err(&spi->dev, "Wrong spi bit length\n");
151 /* set bus num to 5 to avoid conflict with other spi hosts */