aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2015-02-03 10:01:19 -0800
committerMark Brown <broonie@kernel.org>2015-02-04 20:48:13 +0000
commit5892ded23c8e9e015b01347222ba4de8a80e7ce2 (patch)
tree24a8457b9c79c08289add18d09c07ed6cb22c9ae /sound
parentregmap: Export regmap_get_val_endian (diff)
downloadlinux-dev-5892ded23c8e9e015b01347222ba4de8a80e7ce2.tar.xz
linux-dev-5892ded23c8e9e015b01347222ba4de8a80e7ce2.zip
regmap: Fix i2c word access when using SMBus access functions
SMBus access functions assume that 16-bit values are formatted as little endian numbers. The direct i2c access functions in regmap, however, assume that 16-bit values are formatted as big endian numbers. As a result, the current code returns different values if an i2c chip's 16-bit registers are accessed through i2c access functions vs. SMBus access functions. Use regmap_smbus_read_word_swapped and regmap_smbus_write_word_swapped for 16-bit SMBus accesses if a chip is configured as REGMAP_ENDIAN_BIG. If the chip is configured as REGMAP_ENDIAN_LITTLE, keep using regmap_smbus_write_word_data and regmap_smbus_read_word_data. Otherwise reject registration if the controller does not support direct i2c accesses. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
0 files changed, 0 insertions, 0 deletions