lkml.org 
[lkml]   [2015]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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 &regmap_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 &regmap_smbus_word;
> + else
> + return &regmap_smbus_word_swapped;
> else if (config->val_bits == 8 && config->reg_bits == 8 &&
> i2c_check_functionality(i2c->adapter,
> I2C_FUNC_SMBUS_BYTE_DATA))
>



\
 
 \ /
  Last update: 2015-02-02 11:41    [W:0.223 / U:2.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site