/* lis3l02dq_spi_write_reg_8() - write single byte to a register @dev: device associated with child of actual device (iio_dev or iio_trig) @reg_address: the address of the register to be writen @val: the value to write  */
int lis3l02dq_spi_write_reg_8(struct device *dev, u8 reg_address, u8 *val)
/* lis3l02dq_spi_write_reg_8() - write single byte to a register @dev: device associated with child of actual device (iio_dev or iio_trig) @reg_address: the address of the register to be writen @val: the value to write  */
int lis3l02dq_spi_write_reg_8(struct device *dev, u8 reg_address, u8 *val)
{
	int ret;
	struct spi_message msg;
	struct iio_dev *indio_dev = dev_get_drvdata(dev);
	struct lis3l02dq_state *st = iio_dev_get_devdata(indio_dev);
	struct spi_transfer xfer = {
		.tx_buf = st->tx,
		.bits_per_word = 8,
		.len = 2,
		.cs_change = 1,
	};
	mutex_lock(&st->buf_lock);
	st->tx[0] = LIS3L02DQ_WRITE_REG(reg_address);
	st->tx[1] = *val;
	spi_message_init(&msg);
	spi_message_add_tail(&xfer, &msg);
	ret =  spi_sync(st->us, &msg);
	mutex_unlock(&st->buf_lock);
	return ret;
}