Lines Matching refs:st

44 	struct adxl367_spi_state *st = context;  in adxl367_read_fifo()  local
46 st->fifo_xfer[1].rx_buf = fifo_buf; in adxl367_read_fifo()
47 st->fifo_xfer[1].len = fifo_entries * sizeof(*fifo_buf); in adxl367_read_fifo()
49 return spi_sync(st->spi, &st->fifo_msg); in adxl367_read_fifo()
55 struct adxl367_spi_state *st = context; in adxl367_read() local
58 st->reg_read_tx_buf[1] = reg; in adxl367_read()
59 st->reg_read_xfer[1].rx_buf = val_buf; in adxl367_read()
60 st->reg_read_xfer[1].len = val_size; in adxl367_read()
62 return spi_sync(st->spi, &st->reg_read_msg); in adxl367_read()
67 struct adxl367_spi_state *st = context; in adxl367_write() local
69 st->reg_write_xfer[1].tx_buf = val_buf; in adxl367_write()
70 st->reg_write_xfer[1].len = val_size; in adxl367_write()
72 return spi_sync(st->spi, &st->reg_write_msg); in adxl367_write()
91 struct adxl367_spi_state *st; in adxl367_spi_probe() local
94 st = devm_kzalloc(&spi->dev, sizeof(*st), GFP_KERNEL); in adxl367_spi_probe()
95 if (!st) in adxl367_spi_probe()
98 st->spi = spi; in adxl367_spi_probe()
105 st->reg_write_tx_buf[0] = ADXL367_SPI_WRITE_COMMAND; in adxl367_spi_probe()
106 st->reg_write_xfer[0].tx_buf = st->reg_write_tx_buf; in adxl367_spi_probe()
107 st->reg_write_xfer[0].len = sizeof(st->reg_write_tx_buf); in adxl367_spi_probe()
108 spi_message_init_with_transfers(&st->reg_write_msg, in adxl367_spi_probe()
109 st->reg_write_xfer, 2); in adxl367_spi_probe()
116 st->reg_read_tx_buf[0] = ADXL367_SPI_READ_COMMAND; in adxl367_spi_probe()
117 st->reg_read_xfer[0].tx_buf = st->reg_read_tx_buf; in adxl367_spi_probe()
118 st->reg_read_xfer[0].len = sizeof(st->reg_read_tx_buf); in adxl367_spi_probe()
119 spi_message_init_with_transfers(&st->reg_read_msg, in adxl367_spi_probe()
120 st->reg_read_xfer, 2); in adxl367_spi_probe()
127 st->fifo_tx_buf[0] = ADXL367_SPI_FIFO_COMMAND; in adxl367_spi_probe()
128 st->fifo_xfer[0].tx_buf = st->fifo_tx_buf; in adxl367_spi_probe()
129 st->fifo_xfer[0].len = sizeof(st->fifo_tx_buf); in adxl367_spi_probe()
130 spi_message_init_with_transfers(&st->fifo_msg, st->fifo_xfer, 2); in adxl367_spi_probe()
132 regmap = devm_regmap_init(&spi->dev, &adxl367_spi_regmap_bus, st, in adxl367_spi_probe()
137 return adxl367_probe(&spi->dev, &adxl367_spi_ops, st, regmap, spi->irq); in adxl367_spi_probe()