Lines Matching refs:spi

96 static void txx9spi_cs_func(struct spi_device *spi, struct txx9spi *c,  in txx9spi_cs_func()  argument
99 int val = (spi->mode & SPI_CS_HIGH) ? on : !on; in txx9spi_cs_func()
106 c->last_chipselect = spi->chip_select; in txx9spi_cs_func()
112 gpio_set_value(spi->chip_select, val); in txx9spi_cs_func()
116 static int txx9spi_setup(struct spi_device *spi) in txx9spi_setup() argument
118 struct txx9spi *c = spi_master_get_devdata(spi->master); in txx9spi_setup()
120 if (!spi->max_speed_hz) in txx9spi_setup()
123 if (gpio_direction_output(spi->chip_select, in txx9spi_setup()
124 !(spi->mode & SPI_CS_HIGH))) { in txx9spi_setup()
125 dev_err(&spi->dev, "Cannot setup GPIO for chipselect.\n"); in txx9spi_setup()
131 txx9spi_cs_func(spi, c, 0, (NSEC_PER_SEC / 2) / spi->max_speed_hz); in txx9spi_setup()
150 struct spi_device *spi = m->spi; in txx9spi_work_one() local
160 cs_delay = 100 + (NSEC_PER_SEC / 2) / spi->max_speed_hz; in txx9spi_work_one()
164 dev_err(&spi->dev, "Bad mode.\n"); in txx9spi_work_one()
173 | ((spi->mode & SPI_CPOL) ? TXx9_SPCR0_SPOL : 0) in txx9spi_work_one()
174 | ((spi->mode & SPI_CPHA) ? TXx9_SPCR0_SPHA : 0) in txx9spi_work_one()
184 u32 speed_hz = t->speed_hz ? : spi->max_speed_hz; in txx9spi_work_one()
206 txx9spi_cs_func(spi, c, 1, cs_delay); in txx9spi_work_one()
262 txx9spi_cs_func(spi, c, 0, cs_delay); in txx9spi_work_one()
275 txx9spi_cs_func(spi, c, 0, cs_delay); in txx9spi_work_one()
301 static int txx9spi_transfer(struct spi_device *spi, struct spi_message *m) in txx9spi_transfer() argument
303 struct spi_master *master = spi->master; in txx9spi_transfer()