OpenBIC
OpenSource Bridge-IC
plat_hook.c File Reference
#include <stdio.h>
#include <string.h>
#include <logging/log.h>
#include "ast_adc.h"
#include "sensor.h"
#include "libutil.h"
#include "m88rt51632.h"
#include "rg3mxxb12.h"
#include "p3h284x.h"
#include "plat_class.h"
#include "plat_i2c.h"
#include "plat_hook.h"
#include "plat_sensor_table.h"
#include "plat_gpio.h"
Include dependency graph for plat_hook.c:

Macros

#define RETIMER_INIT_RETRY_COUNT   3
 

Functions

 LOG_MODULE_DECLARE (sensor)
 
 K_MUTEX_DEFINE (i2c_hub_mutex)
 
bool pre_i2c_bus_read (sensor_cfg *cfg, void *args)
 
bool post_i2c_bus_read (sensor_cfg *cfg, void *args, int *reading)
 
bool pre_retimer_read (sensor_cfg *cfg, void *args)
 
void pre_retimer_eeprom_recover ()
 
void post_retimer_eeprom_recover ()
 

Variables

adc_asd_init_arg adc_expa_asd_init_args []
 
adc_asd_init_arg adc_expb_asd_init_args []
 
ina233_init_arg ina233_init_args []
 
sq52205_init_arg sq52205_init_args []
 
i2c_proc_arg i2c_proc_args []
 
pt5161l_init_arg pt5161l_init_args []
 

Macro Definition Documentation

◆ RETIMER_INIT_RETRY_COUNT

#define RETIMER_INIT_RETRY_COUNT   3

Function Documentation

◆ K_MUTEX_DEFINE()

K_MUTEX_DEFINE ( i2c_hub_mutex  )

◆ LOG_MODULE_DECLARE()

LOG_MODULE_DECLARE ( sensor  )

◆ post_i2c_bus_read()

bool post_i2c_bus_read ( sensor_cfg cfg,
void *  args,
int *  reading 
)

close all channels after the sensor read to avoid conflict with other devices reading.

◆ post_retimer_eeprom_recover()

void post_retimer_eeprom_recover ( )
Here is the call graph for this function:

◆ pre_i2c_bus_read()

bool pre_i2c_bus_read ( sensor_cfg cfg,
void *  args 
)

◆ pre_retimer_eeprom_recover()

void pre_retimer_eeprom_recover ( )
Here is the call graph for this function:

◆ pre_retimer_read()

bool pre_retimer_read ( sensor_cfg cfg,
void *  args 
)

Variable Documentation

◆ adc_expa_asd_init_args

adc_asd_init_arg adc_expa_asd_init_args[]
Initial value:
= {
[0] = {
.is_init = false,
.deglitch[0] = { .deglitch_en = true, .upper_bound = 0x2DB },
.deglitch[1] = { .deglitch_en = true, .upper_bound = 0x2DB },
.deglitch[2] = { .deglitch_en = true, .upper_bound = 0x2DB },
.deglitch[5] = { .deglitch_en = true, .upper_bound = 0x2DB },
.deglitch[6] = { .deglitch_en = true, .upper_bound = 0x31A },
.deglitch[7] = { .deglitch_en = true, .upper_bound = 0X18D },
},
[1] = {
.is_init = false,
.deglitch[0] = { .deglitch_en = true, .upper_bound = 0x214 },
}
}

◆ adc_expb_asd_init_args

adc_asd_init_arg adc_expb_asd_init_args[]
Initial value:
= {
[0] = {
.is_init = false,
.deglitch[0] = { .deglitch_en = true, .upper_bound = 0x2DB },
.deglitch[1] = { .deglitch_en = true, .upper_bound = 0x2DB },
.deglitch[2] = { .deglitch_en = true, .upper_bound = 0x2DB },
.deglitch[3] = { .deglitch_en = true, .upper_bound = 0x2DB },
.deglitch[4] = { .deglitch_en = true, .upper_bound = 0x2DB },
.deglitch[5] = { .deglitch_en = true, .upper_bound = 0x2DB },
},
[1] = {
.is_init = false,
.deglitch[3] = { .deglitch_en = true, .upper_bound = 0x31A },
.deglitch[6] = { .deglitch_en = true, .upper_bound = 0x214 },
}
}

◆ i2c_proc_args

i2c_proc_arg i2c_proc_args[]
Initial value:
= {
[0] = { .bus = I2C_BUS2, .channel = I2C_HUB_CHANNEL_0 },
[1] = { .bus = I2C_BUS2, .channel = I2C_HUB_CHANNEL_1 },
[2] = { .bus = I2C_BUS2, .channel = I2C_HUB_CHANNEL_2 },
[3] = { .bus = I2C_BUS2, .channel = I2C_HUB_CHANNEL_3 },
[4] = { .bus = I2C_BUS2, .channel = I2C_HUB_CHANNEL_4 },
[5] = { .bus = I2C_BUS2, .channel = I2C_HUB_CHANNEL_5 },
}
#define I2C_BUS2
Definition: plat_i2c.h:25
#define I2C_HUB_CHANNEL_4
Definition: plat_hook.h:41
#define I2C_HUB_CHANNEL_1
Definition: plat_hook.h:38
#define I2C_HUB_CHANNEL_2
Definition: plat_hook.h:39
#define I2C_HUB_CHANNEL_3
Definition: plat_hook.h:40
#define I2C_HUB_CHANNEL_5
Definition: plat_hook.h:42
#define I2C_HUB_CHANNEL_0
Definition: plat_hook.h:37

◆ ina233_init_args

ina233_init_arg ina233_init_args[]

◆ pt5161l_init_args

pt5161l_init_arg pt5161l_init_args[]
Initial value:
= { [0] = { .is_init = false,
.temp_cal_code_pma_a = { 0, 0, 0, 0 },
.temp_cal_code_pma_b = { 0, 0, 0, 0 },
.temp_cal_code_avg = 0 } }

◆ sq52205_init_args

sq52205_init_arg sq52205_init_args[]