]> git.karo-electronics.de Git - karo-tx-linux.git/commit
hwmon: (ina2xx) Use structure array to distinguish chip types
authorGuenter Roeck <linux@roeck-us.net>
Sat, 12 May 2012 18:21:01 +0000 (11:21 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 9 Sep 2012 16:33:33 +0000 (09:33 -0700)
commitdec4389c09739bf93c4fa56fe43471d8ec53a7a1
tree888ac5c52df7353e5bcba0714e06b59616853b14
parent195ce7fb06a96c8eb32503ef02082637342ea6bb
hwmon: (ina2xx) Use structure array to distinguish chip types

Replace per-device initialization and per-device calculation code with
per-device configuration data, which is then used to configure the chip and
perform calculations based on that data.

Also use i2c_smbus_write_read_swapped i2c_smbus_write_word_swapped to read and
write word swapped I2C data.

This patch reduces code size by more than 400 bytes on x86_64.

Cc: Lothar Felten <l-felten@ti.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/ina2xx.c