OpenBIC
OpenSource Bridge-IC
plat_hook.c File Reference
#include <stdio.h>
#include <string.h>
#include <logging/log.h>
#include "plat_hook.h"
#include "plat_class.h"
#include "nct7363.h"
#include "ina238.h"
#include "plat_i2c.h"
#include "sensor.h"
#include "nct214.h"
#include "libutil.h"
#include "plat_sensor_table.h"
Include dependency graph for plat_hook.c:

Macros

#define FB_PRSNT_NUM_PER_IOEXP   7
 
#define FB_PWR_PRSNT_ADDR_EVEN   0x4A
 
#define FB_PWR_PRSNT_ADDR_ODD   0x4E
 
#define FB_SIG_PRSNT_ADDR_EVEN   0x4A
 
#define FB_SIG_PRSNT_ADDR_ODD   0x4E
 

Functions

 LOG_MODULE_REGISTER (plat_hook)
 
 K_MUTEX_DEFINE (i2c_1_PCA9546a_mutex)
 
 K_MUTEX_DEFINE (i2c_2_PCA9546a_mutex)
 
 K_MUTEX_DEFINE (i2c_6_PCA9546a_mutex)
 
 K_MUTEX_DEFINE (i2c_7_PCA9546a_mutex)
 
 K_MUTEX_DEFINE (i2c_8_PCA9546a_mutex)
 
 K_MUTEX_DEFINE (i2c_9_PCA9546a_mutex)
 
struct k_mutex * get_i2c_mux_mutex (uint8_t i2c_bus)
 
bool pre_PCA9546A_read (sensor_cfg *cfg, void *args)
 
bool post_PCA9546A_read (sensor_cfg *cfg, void *args, int *reading)
 
bool post_adm1272_read (sensor_cfg *cfg, void *args, int *reading)
 
bool post_ads112c_read (sensor_cfg *cfg, void *args, int *reading)
 
bool get_fb_present_status (uint16_t *fb_present_status)
 

Variables

adm1272_init_arg adm1272_init_args []
 
nct7363_init_arg nct7363_init_args []
 
ads112c_init_arg ads112c_init_args []
 
ads112c_post_arg ads112c_post_args []
 
adc_asd_init_arg adc_asd_init_args []
 
ina238_init_arg ina238_init_args []
 
nct214_init_arg nct214_init_args []
 
xdp710_init_arg xdp710_init_args []
 
hdc1080_init_arg hdc1080_init_args []
 
ast_tach_init_arg ast_tach_init_args []
 
e50sn12051_init_arg e50sn12051_init_args []
 
bmr4922302_803_init_arg bmr4922302_803_init_args []
 
mux_config bus_1_PCA9546A_configs []
 
mux_config bus_2_PCA9546A_configs []
 
mux_config bus_6_PCA9546A_configs []
 
mux_config bus_7_PCA9546A_configs []
 
mux_config bus_8_PCA9546A_configs []
 
mux_config bus_9_PCA9546A_configs []
 

Macro Definition Documentation

◆ FB_PRSNT_NUM_PER_IOEXP

#define FB_PRSNT_NUM_PER_IOEXP   7

◆ FB_PWR_PRSNT_ADDR_EVEN

#define FB_PWR_PRSNT_ADDR_EVEN   0x4A

◆ FB_PWR_PRSNT_ADDR_ODD

#define FB_PWR_PRSNT_ADDR_ODD   0x4E

◆ FB_SIG_PRSNT_ADDR_EVEN

#define FB_SIG_PRSNT_ADDR_EVEN   0x4A

◆ FB_SIG_PRSNT_ADDR_ODD

#define FB_SIG_PRSNT_ADDR_ODD   0x4E

Function Documentation

◆ get_fb_present_status()

bool get_fb_present_status ( uint16_t *  fb_present_status)

◆ get_i2c_mux_mutex()

struct k_mutex * get_i2c_mux_mutex ( uint8_t  i2c_bus)

◆ K_MUTEX_DEFINE() [1/6]

K_MUTEX_DEFINE ( i2c_1_PCA9546a_mutex  )

◆ K_MUTEX_DEFINE() [2/6]

K_MUTEX_DEFINE ( i2c_2_PCA9546a_mutex  )

◆ K_MUTEX_DEFINE() [3/6]

K_MUTEX_DEFINE ( i2c_6_PCA9546a_mutex  )

◆ K_MUTEX_DEFINE() [4/6]

K_MUTEX_DEFINE ( i2c_7_PCA9546a_mutex  )

◆ K_MUTEX_DEFINE() [5/6]

K_MUTEX_DEFINE ( i2c_8_PCA9546a_mutex  )

◆ K_MUTEX_DEFINE() [6/6]

K_MUTEX_DEFINE ( i2c_9_PCA9546a_mutex  )

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_hook  )

◆ post_adm1272_read()

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

◆ post_ads112c_read()

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

◆ post_PCA9546A_read()

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

◆ pre_PCA9546A_read()

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

Variable Documentation

◆ adc_asd_init_args

adc_asd_init_arg adc_asd_init_args[]
Initial value:
= {
[0] = { .is_init = false,},
}

◆ adm1272_init_args

adm1272_init_arg adm1272_init_args[]

◆ ads112c_init_args

ads112c_init_arg ads112c_init_args[]

◆ ads112c_post_args

ads112c_post_arg ads112c_post_args[]
Initial value:
= {
[0] = { .plat_sensor_type = PLATFORM_ADS112C_FLOW,},
[1] = { .plat_sensor_type = PLATFORM_ADS112C_PRESS,},
[2] = { .plat_sensor_type = PLATFORM_ADS112C_TEMP_RPU,},
[3] = { .plat_sensor_type = PLATFORM_ADS112C_OTHER,},
[4] = { .plat_sensor_type = PLATFORM_ADS112C_LEAKAGE,},
[5] = { .plat_sensor_type = PLATFORM_ADS112C_TEMP_RACK,},
}
@ PLATFORM_ADS112C_OTHER
Definition: plat_hook.h:51
@ PLATFORM_ADS112C_TEMP_RPU
Definition: plat_hook.h:49
@ PLATFORM_ADS112C_PRESS
Definition: plat_hook.h:48
@ PLATFORM_ADS112C_TEMP_RACK
Definition: plat_hook.h:50
@ PLATFORM_ADS112C_FLOW
Definition: plat_hook.h:47
@ PLATFORM_ADS112C_LEAKAGE
Definition: plat_hook.h:52

◆ ast_tach_init_args

ast_tach_init_arg ast_tach_init_args[]
Initial value:
= {
[0] = { .is_init = false,},
[1] = { .is_init = false,},
}

◆ bmr4922302_803_init_args

bmr4922302_803_init_arg bmr4922302_803_init_args[]
Initial value:
= {
[0] = { .is_init = false,},
}

◆ bus_1_PCA9546A_configs

mux_config bus_1_PCA9546A_configs[]
Initial value:
= {
[0] = { .target_addr = BUS_1_MUX_ADDR, .channel = PCA9546A_CHANNEL_0 },
[1] = { .target_addr = BUS_1_MUX_ADDR, .channel = PCA9546A_CHANNEL_1 },
[2] = { .target_addr = BUS_1_MUX_ADDR, .channel = PCA9546A_CHANNEL_2 },
[3] = { .target_addr = BUS_1_MUX_ADDR, .channel = PCA9546A_CHANNEL_3 },
}
#define BUS_1_MUX_ADDR
Definition: plat_hook.h:35
@ PCA9546A_CHANNEL_0
Definition: i2c-mux-pca954x.h:34
@ PCA9546A_CHANNEL_3
Definition: i2c-mux-pca954x.h:37
@ PCA9546A_CHANNEL_2
Definition: i2c-mux-pca954x.h:36
@ PCA9546A_CHANNEL_1
Definition: i2c-mux-pca954x.h:35

◆ bus_2_PCA9546A_configs

mux_config bus_2_PCA9546A_configs[]
Initial value:
= {
[0] = { .target_addr = BUS_2_MUX_ADDR, .channel = PCA9546A_CHANNEL_0 },
[1] = { .target_addr = BUS_2_MUX_ADDR, .channel = PCA9546A_CHANNEL_1 },
[2] = { .target_addr = BUS_2_MUX_ADDR, .channel = PCA9546A_CHANNEL_2 },
[3] = { .target_addr = BUS_2_MUX_ADDR, .channel = PCA9546A_CHANNEL_3 },
}
#define BUS_2_MUX_ADDR
Definition: plat_hook.h:36

◆ bus_6_PCA9546A_configs

mux_config bus_6_PCA9546A_configs[]
Initial value:
= {
[0] = { .target_addr = BUS_6_MUX_ADDR, .channel = PCA9546A_CHANNEL_0 },
[1] = { .target_addr = BUS_6_MUX_ADDR, .channel = PCA9546A_CHANNEL_1 },
[2] = { .target_addr = BUS_6_MUX_ADDR, .channel = PCA9546A_CHANNEL_2 },
[3] = { .target_addr = BUS_6_MUX_ADDR, .channel = PCA9546A_CHANNEL_3 },
}
#define BUS_6_MUX_ADDR
Definition: plat_hook.h:37

◆ bus_7_PCA9546A_configs

mux_config bus_7_PCA9546A_configs[]
Initial value:
= {
[0] = { .target_addr = BUS_7_MUX_ADDR, .channel = PCA9546A_CHANNEL_0 },
[1] = { .target_addr = BUS_7_MUX_ADDR, .channel = PCA9546A_CHANNEL_1 },
[2] = { .target_addr = BUS_7_MUX_ADDR, .channel = PCA9546A_CHANNEL_2 },
[3] = { .target_addr = BUS_7_MUX_ADDR, .channel = PCA9546A_CHANNEL_3 },
}
#define BUS_7_MUX_ADDR
Definition: plat_hook.h:38

◆ bus_8_PCA9546A_configs

mux_config bus_8_PCA9546A_configs[]
Initial value:
= {
[0] = { .target_addr = BUS_8_MUX_ADDR, .channel = PCA9546A_CHANNEL_0 },
[1] = { .target_addr = BUS_8_MUX_ADDR, .channel = PCA9546A_CHANNEL_1 },
[2] = { .target_addr = BUS_8_MUX_ADDR, .channel = PCA9546A_CHANNEL_2 },
}
#define BUS_8_MUX_ADDR
Definition: plat_hook.h:39

◆ bus_9_PCA9546A_configs

mux_config bus_9_PCA9546A_configs[]
Initial value:
= {
[0] = { .target_addr = BUS_9_MUX_ADDR, .channel = PCA9546A_CHANNEL_1 },
[1] = { .target_addr = BUS_9_MUX_ADDR, .channel = PCA9546A_CHANNEL_2 },
}
#define BUS_9_MUX_ADDR
Definition: plat_hook.h:40

◆ e50sn12051_init_args

e50sn12051_init_arg e50sn12051_init_args[]
Initial value:
= {
[0] = { .is_init = false,},
}

◆ hdc1080_init_args

hdc1080_init_arg hdc1080_init_args[]

◆ ina238_init_args

ina238_init_arg ina238_init_args[]
Initial value:
= {
[0] = {
.is_init = false,
.r_shunt = 0.0005,
.adc_range = INA238_ADC_RANGE_PN_163,
.alert_latch = INA238_ALERT_LATCH_ENABLE,
.i_max = 175,
},
[1] = {
.is_init = false,
.r_shunt = 0.0005,
.adc_range = INA238_ADC_RANGE_PN_163,
.alert_latch = INA238_ALERT_LATCH_ENABLE,
.i_max = 175,
},
}
@ INA238_ALERT_LATCH_ENABLE
Definition: ina238.h:62
@ INA238_ADC_RANGE_PN_163
Definition: ina238.h:56

◆ nct214_init_args

nct214_init_arg nct214_init_args[]
Initial value:
= {
[0] = {
.is_init = false,
.temperature_range = NCT_214_TEMPERATURE_RANGE_EXTENDED,
},
[1] = {
.is_init = false,
.temperature_range = NCT_214_TEMPERATURE_RANGE_EXTENDED,
},
[2] = {
.is_init = false,
.temperature_range = NCT_214_TEMPERATURE_RANGE_EXTENDED,
},
[3] = {
.is_init = false,
.temperature_range = NCT_214_TEMPERATURE_RANGE_EXTENDED,
},
}
@ NCT_214_TEMPERATURE_RANGE_EXTENDED
Definition: nct214.h:38

◆ nct7363_init_args

nct7363_init_arg nct7363_init_args[]

◆ xdp710_init_args

xdp710_init_arg xdp710_init_args[]
Initial value:
= {
[0] = {
.r_sense = 1,
},
[1] = {
.r_sense = 1,
},
[2] = {
.r_sense = 1,
},
[3] = {
.r_sense = 1,
},
}