[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 02 Feb 2015 11:26:23 +0100
From: Lars-Peter Clausen <lars@...afoo.de>
To: Guenter Roeck <linux@...ck-us.net>, Mark Brown <broonie@...nel.org>
CC: Robert Rosengren <robert.rosengren@...s.com>,
linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jean Delvare <jdelvare@...e.de>
Subject: Re: [PATCH] regmap: Fix i2c word access when using SMBus access functions
On 02/02/2015 12:48 AM, Guenter Roeck wrote:
[...]
> static int regmap_i2c_write(void *context, const void *data, size_t count)
> {
> struct device *dev = context;
> @@ -180,7 +216,10 @@ static const struct regmap_bus *regmap_get_i2c_bus(struct i2c_client *i2c,
> else if (config->val_bits == 16 && config->reg_bits == 8 &&
> i2c_check_functionality(i2c->adapter,
> I2C_FUNC_SMBUS_WORD_DATA))
> - return ®map_smbus_word;
> + if (config->val_format_endian == REGMAP_ENDIAN_LITTLE)
This should probably use regmap_get_val_endian() and maybe also handle
REGMAP_ENDIAN_NATIVE.
> + return ®map_smbus_word;
> + else
> + return ®map_smbus_word_swapped;
> else if (config->val_bits == 8 && config->reg_bits == 8 &&
> i2c_check_functionality(i2c->adapter,
> I2C_FUNC_SMBUS_BYTE_DATA))
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists