Commit ebce10e5b2542e71e1201c85dbe3b6432569a497
Committed by
Tom Rini
1 parent
345ef20465
Exists in
master
and in
53 other branches
twl6030: move twl6030 register access functions to common header file
twl6030_i2c_[read|write]_u8 can be used else where to access multi-function device such as twl6030, so move the register access functions to the common twl6030.h header file. Signed-off-by: Nishanth Menon <nm@ti.com>
Showing 2 changed files with 11 additions and 11 deletions Side-by-side Diff
drivers/power/twl6030.c
... | ... | @@ -25,17 +25,6 @@ |
25 | 25 | |
26 | 26 | #include <twl6030.h> |
27 | 27 | |
28 | -/* Functions to read and write from TWL6030 */ | |
29 | -static inline int twl6030_i2c_write_u8(u8 chip_no, u8 reg, u8 val) | |
30 | -{ | |
31 | - return i2c_write(chip_no, reg, 1, &val, 1); | |
32 | -} | |
33 | - | |
34 | -static inline int twl6030_i2c_read_u8(u8 chip_no, u8 reg, u8 *val) | |
35 | -{ | |
36 | - return i2c_read(chip_no, reg, 1, val, 1); | |
37 | -} | |
38 | - | |
39 | 28 | static int twl6030_gpadc_read_channel(u8 channel_no) |
40 | 29 | { |
41 | 30 | u8 lsb = 0; |
include/twl6030.h
... | ... | @@ -126,6 +126,17 @@ |
126 | 126 | #define GPCH0_LSB 0x57 |
127 | 127 | #define GPCH0_MSB 0x58 |
128 | 128 | |
129 | +/* Functions to read and write from TWL6030 */ | |
130 | +static inline int twl6030_i2c_write_u8(u8 chip_no, u8 reg, u8 val) | |
131 | +{ | |
132 | + return i2c_write(chip_no, reg, 1, &val, 1); | |
133 | +} | |
134 | + | |
135 | +static inline int twl6030_i2c_read_u8(u8 chip_no, u8 reg, u8 *val) | |
136 | +{ | |
137 | + return i2c_read(chip_no, reg, 1, val, 1); | |
138 | +} | |
139 | + | |
129 | 140 | void twl6030_init_battery_charging(void); |
130 | 141 | void twl6030_usb_device_settings(void); |
131 | 142 | void twl6030_start_usb_charging(void); |