Lines Matching refs:spi
14 static int cxd2880_spi_device_write(struct cxd2880_spi *spi, in cxd2880_spi_device_write() argument
22 if (!spi || !spi->user || !data || size == 0) in cxd2880_spi_device_write()
25 spi_device = spi->user; in cxd2880_spi_device_write()
33 result = spi_sync(spi_device->spi, &msg); in cxd2880_spi_device_write()
41 static int cxd2880_spi_device_write_read(struct cxd2880_spi *spi, in cxd2880_spi_device_write_read() argument
50 if (!spi || !spi->user || !tx_data || in cxd2880_spi_device_write_read()
54 spi_device = spi->user; in cxd2880_spi_device_write_read()
56 result = spi_write_then_read(spi_device->spi, tx_data, in cxd2880_spi_device_write_read()
70 struct spi_device *spi = spi_device->spi; in cxd2880_spi_device_initialize() local
74 spi->mode = SPI_MODE_0; in cxd2880_spi_device_initialize()
77 spi->mode = SPI_MODE_1; in cxd2880_spi_device_initialize()
80 spi->mode = SPI_MODE_2; in cxd2880_spi_device_initialize()
83 spi->mode = SPI_MODE_3; in cxd2880_spi_device_initialize()
89 spi->max_speed_hz = speed_hz; in cxd2880_spi_device_initialize()
90 spi->bits_per_word = 8; in cxd2880_spi_device_initialize()
91 result = spi_setup(spi); in cxd2880_spi_device_initialize()
100 int cxd2880_spi_device_create_spi(struct cxd2880_spi *spi, in cxd2880_spi_device_create_spi() argument
103 if (!spi || !spi_device) in cxd2880_spi_device_create_spi()
106 spi->read = NULL; in cxd2880_spi_device_create_spi()
107 spi->write = cxd2880_spi_device_write; in cxd2880_spi_device_create_spi()
108 spi->write_read = cxd2880_spi_device_write_read; in cxd2880_spi_device_create_spi()
109 spi->flags = 0; in cxd2880_spi_device_create_spi()
110 spi->user = spi_device; in cxd2880_spi_device_create_spi()