mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-18 06:38:15 +01:00
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>
This commit is contained in:
parent
345ef20465
commit
ebce10e5b2
@ -25,17 +25,6 @@
|
|||||||
|
|
||||||
#include <twl6030.h>
|
#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)
|
static int twl6030_gpadc_read_channel(u8 channel_no)
|
||||||
{
|
{
|
||||||
u8 lsb = 0;
|
u8 lsb = 0;
|
||||||
|
@ -126,6 +126,17 @@
|
|||||||
#define GPCH0_LSB 0x57
|
#define GPCH0_LSB 0x57
|
||||||
#define GPCH0_MSB 0x58
|
#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_init_battery_charging(void);
|
||||||
void twl6030_usb_device_settings(void);
|
void twl6030_usb_device_settings(void);
|
||||||
void twl6030_start_usb_charging(void);
|
void twl6030_start_usb_charging(void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user