/* A negative return value indicates an error occurred while reading the register.  */
static s32 ad525x_write(struct i2c_client *client, u8 reg, u8 value)
/* A negative return value indicates an error occurred while reading the register.  */
static s32 ad525x_write(struct i2c_client *client, u8 reg, u8 value)
{
	struct dpot_data *data = i2c_get_clientdata(client);
	if (reg & AD525X_I2C_CMD)
		return i2c_smbus_write_byte(client, reg);
	if (data->max_pos > 256)
		return i2c_smbus_write_word_data(client, (reg & 0xF8) |
						((reg & 0x7) << 1), value);
	else
		return i2c_smbus_write_byte_data(client, reg, value);
}