linux/drivers/base/regmap
Guenter Roeck 5892ded23c 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>
2015-02-04 20:48:13 +00:00
..
internal.h regmap: Export regmap_get_val_endian 2015-02-04 20:48:11 +00:00
Kconfig regmap: ac97: Add generic AC'97 callbacks 2014-11-19 10:28:14 +00:00
Makefile regmap: ac97: Add generic AC'97 callbacks 2014-11-19 10:28:14 +00:00
regcache-flat.c regmap: cache: Sort include headers alphabetically 2014-10-20 12:25:06 +01:00
regcache-lzo.c regmap: cache: Sort include headers alphabetically 2014-10-20 12:25:06 +01:00
regcache-rbtree.c regmap: cache: Sort include headers alphabetically 2014-10-20 12:25:06 +01:00
regcache.c Merge remote-tracking branches 'regmap/topic/ac97' and 'regmap/topic/headers' into regmap-next 2014-11-21 11:32:36 +00:00
regmap-ac97.c regmap: ac97: Add generic AC'97 callbacks 2014-11-19 10:28:14 +00:00
regmap-debugfs.c Merge remote-tracking branch 'regmap/fix/debugfs' into regmap-linus 2014-09-29 20:49:40 +01:00
regmap-i2c.c regmap: Fix i2c word access when using SMBus access functions 2015-02-04 20:48:13 +00:00
regmap-irq.c regmap: irq: Fix possible ZERO_SIZE_PTR pointer dereferencing error. 2014-05-26 16:37:04 +01:00
regmap-mmio.c Merge remote-tracking branches 'regmap/topic/irq', 'regmap/topic/le', 'regmap/topic/mmio' and 'regmap/topic/rbtree' into regmap-next 2014-06-02 17:07:39 +01:00
regmap-spi.c regmap: add DT endianness binding support. 2014-08-16 16:56:23 -05:00
regmap-spmi.c regmap: spmi: support base and extended register spaces 2014-02-15 11:55:28 -08:00
regmap.c regmap: Export regmap_get_val_endian 2015-02-04 20:48:11 +00:00