diff options
author | Nishanth Menon | 2013-03-26 05:20:57 +0000 |
---|---|---|
committer | Tom Rini | 2013-05-10 08:25:55 -0400 |
commit | ff2d57ea5e9b56e22c84647b9532292e5ea862f9 (patch) | |
tree | 18d368d8389c487dbf17f3e4ea70cc0e1c1f44ae /include/palmas.h | |
parent | 384bcae013c78e020e9a04df4c7cc3b451a68811 (diff) |
palmas: use palmas_i2c_[read|write]_u8
commit 21144298 (power: twl6035: add palmas PMIC support)
introduced twl6035_i2c_[read|write]_u8
Then, commit dd23e59d (omap5: pbias ldo9 turn on)
introduced palmas_[read|write]_u8 for precisely the same access
function. TWL6035 belongs to the palmas family, so instead of having
an twl6035 API, we could use an generic palmas API instead.
To stay consistent with the function naming of twl4030,6030 accessors,
we use palmas_i2c_[read|write]_u8
Cc: Balaji T K <balajitk@ti.com>
Cc: Sricharan R <r.sricharan@ti.com>
Reported-by: Ruchika Kharwar <ruchika@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Diffstat (limited to 'include/palmas.h')
-rw-r--r-- | include/palmas.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/palmas.h b/include/palmas.h index 305092e1cee..e629fbf9988 100644 --- a/include/palmas.h +++ b/include/palmas.h @@ -36,7 +36,19 @@ #define LDO_MODE_SLEEP (1 << 2) #define LDO_MODE_ACTIVE (1 << 0) -int twl6035_i2c_write_u8(u8 chip_no, u8 val, u8 reg); -int twl6035_i2c_read_u8(u8 chip_no, u8 *val, u8 reg); +/* + * Functions to read and write from TPS659038/TWL6035/TWL6037 + * or other Palmas family of TI PMICs + */ +static inline int palmas_i2c_write_u8(u8 chip_no, u8 reg, u8 val) +{ + return i2c_write(chip_no, reg, 1, &val, 1); +} + +static inline int palmas_i2c_read_u8(u8 chip_no, u8 reg, u8 *val) +{ + return i2c_read(chip_no, reg, 1, val, 1); +} + void palmas_init_settings(void); int palmas_mmc1_poweron_ldo(void); |