OpenBIC
OpenSource Bridge-IC
plat_hook.c File Reference
#include <stdio.h>
#include <string.h>
#include "sensor.h"
#include "plat_i2c.h"
#include "plat_gpio.h"
#include "plat_hook.h"
#include "plat_sensor_table.h"
#include "i2c-mux-tca9548.h"
#include "logging/log.h"
#include "libipmi.h"
#include "ipmi.h"
#include "power_status.h"
Include dependency graph for plat_hook.c:

Macros

#define ADJUST_ADM1278_CURRENT(x)   (x)
 
#define ADJUST_ADM1278_POWER(x)   (x)
 
#define ADJUST_LTC4282_CURRENT(x)   (x)
 
#define ADJUST_LTC4282_POWER(x)   (x)
 
#define ADJUST_MP5990_CURRENT(x)   (x)
 
#define ADJUST_MP5990_POWER(x)   (x)
 

Functions

 LOG_MODULE_REGISTER (plat_hook)
 
bool pre_nvme_read (sensor_cfg *cfg, void *args)
 
bool pre_vol_bat3v_read (sensor_cfg *cfg, void *args)
 
bool post_vol_bat3v_read (sensor_cfg *cfg, void *args, int *reading)
 
bool post_adm1278_cur_read (sensor_cfg *cfg, void *args, int *reading)
 
bool post_adm1278_pwr_read (sensor_cfg *cfg, void *args, int *reading)
 
bool post_ltc4282_cur_read (sensor_cfg *cfg, void *args, int *reading)
 
bool post_ltc4282_pwr_read (sensor_cfg *cfg, void *args, int *reading)
 
bool post_mp5990_cur_read (sensor_cfg *cfg, void *args, int *reading)
 
bool post_mp5990_pwr_read (sensor_cfg *cfg, void *args, int *reading)
 

Variables

adc_asd_init_arg ast_adc_init_args [] = { [0] = { .is_init = false } }
 
adm1278_init_arg adm1278_init_args []
 
ltc4282_init_arg ltc4282_init_args [] = { [0] = { .r_sense_mohm = 0.5 } }
 
mp5990_init_arg mp5990_init_args []
 
struct tca9548 mux_conf_addr_0xe2 []
 

Macro Definition Documentation

◆ ADJUST_ADM1278_CURRENT

#define ADJUST_ADM1278_CURRENT (   x)    (x)

◆ ADJUST_ADM1278_POWER

#define ADJUST_ADM1278_POWER (   x)    (x)

◆ ADJUST_LTC4282_CURRENT

#define ADJUST_LTC4282_CURRENT (   x)    (x)

◆ ADJUST_LTC4282_POWER

#define ADJUST_LTC4282_POWER (   x)    (x)

◆ ADJUST_MP5990_CURRENT

#define ADJUST_MP5990_CURRENT (   x)    (x)

◆ ADJUST_MP5990_POWER

#define ADJUST_MP5990_POWER (   x)    (x)

Function Documentation

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_hook  )

◆ post_adm1278_cur_read()

bool post_adm1278_cur_read ( sensor_cfg cfg,
void *  args,
int *  reading 
)
Here is the call graph for this function:

◆ post_adm1278_pwr_read()

bool post_adm1278_pwr_read ( sensor_cfg cfg,
void *  args,
int *  reading 
)
Here is the call graph for this function:

◆ post_ltc4282_cur_read()

bool post_ltc4282_cur_read ( sensor_cfg cfg,
void *  args,
int *  reading 
)
Here is the call graph for this function:

◆ post_ltc4282_pwr_read()

bool post_ltc4282_pwr_read ( sensor_cfg cfg,
void *  args,
int *  reading 
)
Here is the call graph for this function:

◆ post_mp5990_cur_read()

bool post_mp5990_cur_read ( sensor_cfg cfg,
void *  args,
int *  reading 
)
Here is the call graph for this function:

◆ post_mp5990_pwr_read()

bool post_mp5990_pwr_read ( sensor_cfg cfg,
void *  args,
int *  reading 
)
Here is the call graph for this function:

◆ post_vol_bat3v_read()

bool post_vol_bat3v_read ( sensor_cfg cfg,
void *  args,
int *  reading 
)
Here is the call graph for this function:

◆ pre_nvme_read()

bool pre_nvme_read ( sensor_cfg cfg,
void *  args 
)
Here is the call graph for this function:

◆ pre_vol_bat3v_read()

bool pre_vol_bat3v_read ( sensor_cfg cfg,
void *  args 
)
Here is the call graph for this function:

Variable Documentation

◆ adm1278_init_args

adm1278_init_arg adm1278_init_args[]
Initial value:
= {
[0] = { .is_init = false, .config = { 0x3F1C }, .r_sense = 0.3 }
}

◆ ast_adc_init_args

adc_asd_init_arg ast_adc_init_args[] = { [0] = { .is_init = false } }

◆ ltc4282_init_args

ltc4282_init_arg ltc4282_init_args[] = { [0] = { .r_sense_mohm = 0.5 } }

◆ mp5990_init_args

mp5990_init_arg mp5990_init_args[]
Initial value:
= {
[0] = { .is_init = false,
.iout_cal_gain = 0xFFFF,
.iout_oc_fault_limit = 0xFFFF,
.ocw_sc_ref = 0xFFFF },
}

◆ mux_conf_addr_0xe2

struct tca9548 mux_conf_addr_0xe2[]
Initial value:
= {
[0] = { .addr = 0xe2, .chan = 0 }, [1] = { .addr = 0xe2, .chan = 1 },
[2] = { .addr = 0xe2, .chan = 2 }, [3] = { .addr = 0xe2, .chan = 3 },
[4] = { .addr = 0xe2, .chan = 4 }, [5] = { .addr = 0xe2, .chan = 5 },
[6] = { .addr = 0xe2, .chan = 6 }, [7] = { .addr = 0xe2, .chan = 7 },
}