Lines Matching refs:spi_xcomm

32 struct spi_xcomm {
43 static int spi_xcomm_sync_config(struct spi_xcomm *spi_xcomm, unsigned int len)
46 uint8_t *buf = spi_xcomm->buf;
48 settings = spi_xcomm->settings;
53 put_unaligned_be16(spi_xcomm->chipselect, &buf[3]);
55 return i2c_master_send(spi_xcomm->i2c, buf, 5);
58 static void spi_xcomm_chipselect(struct spi_xcomm *spi_xcomm,
62 uint16_t chipselect = spi_xcomm->chipselect;
69 spi_xcomm->chipselect = chipselect;
72 static int spi_xcomm_setup_transfer(struct spi_xcomm *spi_xcomm,
78 if (t->speed_hz != spi_xcomm->current_speed) {
89 spi_xcomm->current_speed = t->speed_hz;
110 static int spi_xcomm_txrx_bufs(struct spi_xcomm *spi_xcomm,
116 spi_xcomm->buf[0] = SPI_XCOMM_CMD_WRITE;
117 memcpy(spi_xcomm->buf + 1, t->tx_buf, t->len);
119 ret = i2c_master_send(spi_xcomm->i2c, spi_xcomm->buf, t->len + 1);
125 ret = i2c_master_recv(spi_xcomm->i2c, t->rx_buf, t->len);
138 struct spi_xcomm *spi_xcomm = spi_controller_get_devdata(host);
139 unsigned int settings = spi_xcomm->settings;
147 spi_xcomm_chipselect(spi_xcomm, spi, true);
156 status = spi_xcomm_setup_transfer(spi_xcomm, spi, t, &settings);
169 spi_xcomm->settings = settings;
170 status = spi_xcomm_sync_config(spi_xcomm, t->len);
173 } else if (settings != spi_xcomm->settings || is_first) {
174 spi_xcomm->settings = settings;
175 status = spi_xcomm_sync_config(spi_xcomm, 0);
181 status = spi_xcomm_txrx_bufs(spi_xcomm, spi, t);
197 spi_xcomm_chipselect(spi_xcomm, spi, false);
207 struct spi_xcomm *spi_xcomm;
211 host = spi_alloc_host(&i2c->dev, sizeof(*spi_xcomm));
215 spi_xcomm = spi_controller_get_devdata(host);
216 spi_xcomm->i2c = i2c;