coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
tps65090.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TPS65090_I2C_ADDR   0x48
 

Enumerations

enum  fet_id {
  FET1_CTRL = 0x0f , FET2_CTRL , FET3_CTRL , FET4_CTRL ,
  FET5_CTRL , FET6_CTRL , FET7_CTRL
}
 
enum  { TPS65090_ST1_OTC = 1 << 0 , TPS65090_ST1_OCC = 1 << 1 , TPS65090_ST1_STATE_SHIFT = 4 , TPS65090_ST1_STATE_MASK = 0xf << TPS65090_ST1_STATE_SHIFT }
 
enum  { FET_ERR_COMMS = -1 , FET_ERR_NOT_READY = -2 }
 

Functions

int tps65090_fet_enable (unsigned int bus, enum fet_id fet_id)
 Enable FET. More...
 
int tps65090_fet_disable (unsigned int bus, enum fet_id fet_id)
 Disable FET. More...
 
int tps65090_fet_is_enabled (unsigned int bus, enum fet_id fet_id)
 Is FET enabled? More...
 
int tps65090_set_charge_enable (unsigned int bus, int enable)
 Enable / disable the battery charger. More...
 
int tps65090_is_charging (unsigned int bus)
 Check whether we have enabled battery charging. More...
 
int tps65090_get_status (unsigned int bus)
 Return the value of the status register. More...
 

Macro Definition Documentation

◆ TPS65090_I2C_ADDR

#define TPS65090_I2C_ADDR   0x48

Definition at line 7 of file tps65090.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TPS65090_ST1_OTC 
TPS65090_ST1_OCC 
TPS65090_ST1_STATE_SHIFT 
TPS65090_ST1_STATE_MASK 

Definition at line 20 of file tps65090.h.

◆ anonymous enum

anonymous enum
Enumerator
FET_ERR_COMMS 
FET_ERR_NOT_READY 

Definition at line 29 of file tps65090.h.

◆ fet_id

enum fet_id
Enumerator
FET1_CTRL 
FET2_CTRL 
FET3_CTRL 
FET4_CTRL 
FET5_CTRL 
FET6_CTRL 
FET7_CTRL 

Definition at line 10 of file tps65090.h.

Function Documentation

◆ tps65090_fet_disable()

int tps65090_fet_disable ( unsigned int  bus,
enum fet_id  fet_id 
)

Disable FET.

Parameters
busI2C bus number the TPS65090 is on
fet_idFET ID, value between 1 and 7
Returns
0 on success, non-0 on failure

Definition at line 129 of file tps65090.c.

References tps65090_fet_set().

Here is the call graph for this function:

◆ tps65090_fet_enable()

int tps65090_fet_enable ( unsigned int  bus,
enum fet_id  fet_id 
)

Enable FET.

Parameters
busI2C bus number the TPS65090 is on
fet_idFET ID, value between 1 and 7 return 0 on success, non-0 on failure

Definition at line 95 of file tps65090.c.

References BIOS_DEBUG, FET_ERR_NOT_READY, printk, tps65090_fet_set(), and udelay().

Referenced by backlight_vdd(), lcd_vdd(), and sdmmc_vdd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tps65090_fet_is_enabled()

int tps65090_fet_is_enabled ( unsigned int  bus,
enum fet_id  fet_id 
)

Is FET enabled?

Parameters
busI2C bus number the TPS65090 is on
fet_idFET ID, value between 1 and 7
Returns
1 enabled, 0 disabled, negative value on failure

Definition at line 134 of file tps65090.c.

References BIOS_DEBUG, FET_CTRL_ENFET, printk, and tps65090_i2c_read().

Here is the call graph for this function:

◆ tps65090_get_status()

int tps65090_get_status ( unsigned int  bus)

Return the value of the status register.

Parameters
busI2C bus number the TPS65090 is on
Returns
status register value, or -1 on error

Definition at line 179 of file tps65090.c.

References REG_CG_STATUS1, tps65090_i2c_read(), and val.

Here is the call graph for this function:

◆ tps65090_is_charging()

int tps65090_is_charging ( unsigned int  bus)

Check whether we have enabled battery charging.

Parameters
busI2C bus number the TPS65090 is on
Returns
1 if enabled, 0 if disabled

Definition at line 148 of file tps65090.c.

References CG_CTRL0_ENC_MASK, REG_CG_CTRL0, tps65090_i2c_read(), and val.

Here is the call graph for this function:

◆ tps65090_set_charge_enable()

int tps65090_set_charge_enable ( unsigned int  bus,
int  enable 
)

Enable / disable the battery charger.

Parameters
busI2C bus number the TPS65090 is on
enable0 to disable charging, non-zero to enable

Definition at line 159 of file tps65090.c.

References BIOS_DEBUG, CG_CTRL0_ENC_MASK, printk, REG_CG_CTRL0, tps65090_i2c_read(), tps65090_i2c_write(), and val.

Here is the call graph for this function: