/* If the tolerance register is specified, 2 bytes are returned. Otherwise, 1 byte is returned. A negative value indicates an error occurred while reading the register.  */
static s32 ad525x_read(struct i2c_client *client, u8 reg)
/* If the tolerance register is specified, 2 bytes are returned. Otherwise, 1 byte is returned. A negative value indicates an error occurred while reading the register.  */
static s32 ad525x_read(struct i2c_client *client, u8 reg)
{
	struct dpot_data *data = i2c_get_clientdata(client);
	if ((reg & AD525X_REG_TOL) || (data->max_pos > 256))
		return i2c_smbus_read_word_data(client, (reg & 0xF8) |
						((reg & 0x7) << 1));
	else
		return i2c_smbus_read_byte_data(client, reg);
}