/* Writes the value of the specified register only when the device is ready to accept user requests. If the device ready flag is deactivated the write operation will be executed without checking the device state.  */
int32_t ad7124_write_register(struct ad7124_dev *dev, struct ad7124_st_reg p_reg)
/* Writes the value of the specified register only when the device is ready to accept user requests. If the device ready flag is deactivated the write operation will be executed without checking the device state.  */
int32_t ad7124_write_register(struct ad7124_dev *dev, struct ad7124_st_reg p_reg)
{
	int32_t ret;
	if (dev->check_ready) {
		ret = ad7124_wait_for_spi_ready(dev,
						dev->spi_rdy_poll_cnt);
		if (ret < 0)
			return ret;
	}
	ret = ad7124_no_check_write_register(dev,
					     p_reg);
	return ret;
}