diff options
author | Pali Rohár <pali@kernel.org> | 2020-10-26 22:36:15 +0100 |
---|---|---|
committer | Lokesh Vutla <lokeshvutla@ti.com> | 2020-11-15 15:25:55 +0530 |
commit | 4fcc084eeb8cd7db77263672c6a43da629a4ed48 (patch) | |
tree | 8d6b9028f4ddf7a9ae4cc5daea6c03d8ac38bb47 /include/twl4030.h | |
parent | a1337e3581b74b62397767b5a8d8ff148ccb97c1 (diff) | |
download | u-boot-4fcc084eeb8cd7db77263672c6a43da629a4ed48.tar.gz |
power: twl4030: Add twl4030_i2c_read() function
Function twl4030_i2c_read() is like twl4030_i2c_read_u8() but instead of
single value it rather returns array of values.
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Diffstat (limited to 'include/twl4030.h')
-rw-r--r-- | include/twl4030.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/twl4030.h b/include/twl4030.h index c27ad615eeb..ef05193996a 100644 --- a/include/twl4030.h +++ b/include/twl4030.h @@ -654,14 +654,20 @@ static inline int twl4030_i2c_write_u8(u8 chip_no, u8 reg, u8 val) return i2c_write(chip_no, reg, 1, &val, 1); } -static inline int twl4030_i2c_read_u8(u8 chip_no, u8 reg, u8 *val) +static inline int twl4030_i2c_read(u8 chip_no, u8 reg, u8 *val, int len) { - return i2c_read(chip_no, reg, 1, val, 1); + return i2c_read(chip_no, reg, 1, val, len); } #else int twl4030_i2c_write_u8(u8 chip_no, u8 reg, u8 val); -int twl4030_i2c_read_u8(u8 chip_no, u8 reg, u8 *val); +int twl4030_i2c_read(u8 chip_no, u8 reg, u8 *val, int len); #endif + +static inline int twl4030_i2c_read_u8(u8 chip_no, u8 reg, u8 *val) +{ + return twl4030_i2c_read(chip_no, reg, val, 1); +} + /* * Power */ |