summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 345ef20)
raw | patch | inline | side by side (parent: 345ef20)
author | Nishanth Menon <nm@ti.com> | |
Tue, 26 Mar 2013 05:20:52 +0000 (05:20 +0000) | ||
committer | Tom Rini <trini@ti.com> | |
Fri, 10 May 2013 12:25:54 +0000 (08:25 -0400) |
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>
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>
drivers/power/twl6030.c | patch | blob | history | |
include/twl6030.h | patch | blob | history |
index 58ad4ad3664b474650c05312b9f5a05da695160d..d421e6005bae177ee27b8a30cb32f98e3afdda43 100644 (file)
--- a/drivers/power/twl6030.c
+++ b/drivers/power/twl6030.c
#include <twl6030.h>
-/* Functions to read and write from TWL6030 */
-static inline int twl6030_i2c_write_u8(u8 chip_no, u8 reg, u8 val)
-{
- return i2c_write(chip_no, reg, 1, &val, 1);
-}
-
-static inline int twl6030_i2c_read_u8(u8 chip_no, u8 reg, u8 *val)
-{
- return i2c_read(chip_no, reg, 1, val, 1);
-}
-
static int twl6030_gpadc_read_channel(u8 channel_no)
{
u8 lsb = 0;
diff --git a/include/twl6030.h b/include/twl6030.h
index a9fcadbfef7e348e64eb33907e17a758d994c3a4..f7ba3c7b1ff031563eb7071eff566b5a68d31b19 100644 (file)
--- a/include/twl6030.h
+++ b/include/twl6030.h
#define GPCH0_LSB 0x57
#define GPCH0_MSB 0x58
+/* Functions to read and write from TWL6030 */
+static inline int twl6030_i2c_write_u8(u8 chip_no, u8 reg, u8 val)
+{
+ return i2c_write(chip_no, reg, 1, &val, 1);
+}
+
+static inline int twl6030_i2c_read_u8(u8 chip_no, u8 reg, u8 *val)
+{
+ return i2c_read(chip_no, reg, 1, val, 1);
+}
+
void twl6030_init_battery_charging(void);
void twl6030_usb_device_settings(void);
void twl6030_start_usb_charging(void);