Lines Matching defs:spi
24 #include <linux/spi/spi.h>
96 static void txx9spi_cs_func(struct spi_device *spi, struct txx9spi *c,
108 c->last_chipselect = spi->cs_gpiod;
114 gpiod_set_value(spi->cs_gpiod, on);
118 static int txx9spi_setup(struct spi_device *spi)
120 struct txx9spi *c = spi_master_get_devdata(spi->master);
122 if (!spi->max_speed_hz)
127 txx9spi_cs_func(spi, c, 0, (NSEC_PER_SEC / 2) / spi->max_speed_hz);
146 struct spi_device *spi = m->spi;
156 cs_delay = 100 + (NSEC_PER_SEC / 2) / spi->max_speed_hz;
160 dev_err(&spi->dev, "Bad mode.\n");
169 | ((spi->mode & SPI_CPOL) ? TXx9_SPCR0_SPOL : 0)
170 | ((spi->mode & SPI_CPHA) ? TXx9_SPCR0_SPHA : 0)
202 txx9spi_cs_func(spi, c, 1, cs_delay);
257 txx9spi_cs_func(spi, c, 0, cs_delay);
270 txx9spi_cs_func(spi, c, 0, cs_delay);
296 static int txx9spi_transfer(struct spi_device *spi, struct spi_message *m)
298 struct spi_master *master = spi->master;
380 c->clk = devm_clk_get(&dev->dev, "spi-baseclk");
421 /* the spi->mode bits understood by this driver: */