/* returns the used measurement range of the X/Y/Z-axis  */
static int tmag5273_attr_get_xyz_meas_range(const struct device *dev, struct sensor_value *val)
/* returns the used measurement range of the X/Y/Z-axis  */
static int tmag5273_attr_get_xyz_meas_range(const struct device *dev, struct sensor_value *val)
{
	const struct tmag5273_config *drv_cfg = dev->config;
	struct tmag5273_data *drv_data = dev->data;
	uint8_t regdata;
	int retval;
	retval = i2c_reg_read_byte_dt(&drv_cfg->i2c, TMAG5273_REG_SENSOR_CONFIG_2, &regdata);
	if (retval < 0) {
		return retval;
	}
	if ((regdata & TMAG5273_MEAS_RANGE_XYZ_MSK) == TMAG5273_XYZ_MEAS_RANGE_HIGH) {
		val->val1 = tmag5273_range_high(drv_data->version);
	} else {
		val->val1 = tmag5273_range_low(drv_data->version);
	}
	val->val2 = 0;
	return 0;
}