Lines Matching refs:spi
98 struct spi_sedi_data *spi = dev->data; in transceive() local
99 struct spi_context *ctx = &spi->ctx; in transceive()
107 spi_context_lock(&spi->ctx, asynchronous, cb, userdata, config); in transceive()
119 spi->tx_data_updated = false; in transceive()
120 spi->rx_data_updated = false; in transceive()
122 spi_context_buffers_setup(&spi->ctx, tx_bufs, rx_bufs, 1); in transceive()
129 spi->tx_dummy_len = 0; in transceive()
134 spi->rx_dummy_len = dummy_len; in transceive()
136 spi->rx_dummy_len = 0; in transceive()
141 spi->tx_dummy_len = dummy_len; in transceive()
143 spi->tx_dummy_len = 0; in transceive()
144 spi->rx_dummy_len = 0; in transceive()
148 spi_context_cs_control(&spi->ctx, true); in transceive()
149 spi_context_complete(&spi->ctx, dev, 0); in transceive()
163 spi->tx_dummy_len -= transfer_bytes; in transceive()
169 spi->rx_dummy_len -= transfer_bytes; in transceive()
193 spi_context_cs_control(&spi->ctx, false); in transceive()
202 ret = spi_context_wait_for_completion(&spi->ctx); in transceive()
211 spi_context_cs_control(&spi->ctx, true); in transceive()
214 spi_context_release(&spi->ctx, ret); in transceive()
243 struct spi_sedi_data *spi = dev->data; in spi_sedi_release() local
245 if (!spi_context_configured(&spi->ctx, config)) { in spi_sedi_release()
249 spi_context_unlock_unconditionally(&spi->ctx); in spi_sedi_release()
260 struct spi_sedi_data *spi = dev->data; in spi_sedi_callback() local
261 struct spi_context *ctx = &spi->ctx; in spi_sedi_callback()
272 spi_context_cs_control(&spi->ctx, true); in spi_sedi_callback()
273 spi_context_complete(&spi->ctx, dev, error); in spi_sedi_callback()
280 (spi->rx_data_updated == false)) { in spi_sedi_callback()
283 spi->rx_dummy_len); in spi_sedi_callback()
284 spi->rx_data_updated = true; in spi_sedi_callback()
286 } else if (spi->tx_data_updated == false) { in spi_sedi_callback()
288 spi->tx_dummy_len); in spi_sedi_callback()
289 spi->tx_data_updated = true; in spi_sedi_callback()
300 static DEVICE_API(spi, sedi_spi_api) = {
314 struct spi_sedi_data *spi = dev->data; in spi_sedi_init() local
328 spi_context_unlock_unconditionally(&spi->ctx); in spi_sedi_init()