Lines Matching refs:bitbang
183 struct spi_bitbang *bitbang; in spi_bitbang_setup() local
187 bitbang = spi_master_get_devdata(spi->master); in spi_bitbang_setup()
198 cs->txrx_word = bitbang->txrx_word[spi->mode & (SPI_CPOL|SPI_CPHA)]; in spi_bitbang_setup()
204 if (bitbang->setup_transfer) { in spi_bitbang_setup()
205 retval = bitbang->setup_transfer(spi, NULL); in spi_bitbang_setup()
234 struct spi_bitbang *bitbang; in spi_bitbang_bufs() local
236 bitbang = spi_master_get_devdata(spi->master); in spi_bitbang_bufs()
237 if (bitbang->set_line_direction) { in spi_bitbang_bufs()
240 err = bitbang->set_line_direction(spi, !!(t->tx_buf)); in spi_bitbang_bufs()
270 struct spi_bitbang *bitbang; in spi_bitbang_prepare_hardware() local
272 bitbang = spi_master_get_devdata(spi); in spi_bitbang_prepare_hardware()
274 mutex_lock(&bitbang->lock); in spi_bitbang_prepare_hardware()
275 bitbang->busy = 1; in spi_bitbang_prepare_hardware()
276 mutex_unlock(&bitbang->lock); in spi_bitbang_prepare_hardware()
285 struct spi_bitbang *bitbang = spi_master_get_devdata(master); in spi_bitbang_transfer_one() local
288 if (bitbang->setup_transfer) { in spi_bitbang_transfer_one()
289 status = bitbang->setup_transfer(spi, transfer); in spi_bitbang_transfer_one()
295 status = bitbang->txrx_bufs(spi, transfer); in spi_bitbang_transfer_one()
310 struct spi_bitbang *bitbang; in spi_bitbang_unprepare_hardware() local
312 bitbang = spi_master_get_devdata(spi); in spi_bitbang_unprepare_hardware()
314 mutex_lock(&bitbang->lock); in spi_bitbang_unprepare_hardware()
315 bitbang->busy = 0; in spi_bitbang_unprepare_hardware()
316 mutex_unlock(&bitbang->lock); in spi_bitbang_unprepare_hardware()
323 struct spi_bitbang *bitbang = spi_master_get_devdata(spi->master); in spi_bitbang_set_cs() local
332 bitbang->chipselect(spi, enable ? BITBANG_CS_ACTIVE : in spi_bitbang_set_cs()
339 int spi_bitbang_init(struct spi_bitbang *bitbang) in spi_bitbang_init() argument
341 struct spi_master *master = bitbang->master; in spi_bitbang_init()
355 if (custom_cs && !bitbang->chipselect) in spi_bitbang_init()
358 mutex_init(&bitbang->lock); in spi_bitbang_init()
361 master->mode_bits = SPI_CPOL | SPI_CPHA | bitbang->flags; in spi_bitbang_init()
376 if (!bitbang->txrx_bufs) { in spi_bitbang_init()
377 bitbang->use_dma = 0; in spi_bitbang_init()
378 bitbang->txrx_bufs = spi_bitbang_bufs; in spi_bitbang_init()
380 if (!bitbang->setup_transfer) in spi_bitbang_init()
381 bitbang->setup_transfer = in spi_bitbang_init()
420 int spi_bitbang_start(struct spi_bitbang *bitbang) in spi_bitbang_start() argument
422 struct spi_master *master = bitbang->master; in spi_bitbang_start()
425 ret = spi_bitbang_init(bitbang); in spi_bitbang_start()
443 void spi_bitbang_stop(struct spi_bitbang *bitbang) in spi_bitbang_stop() argument
445 spi_unregister_master(bitbang->master); in spi_bitbang_stop()