OpenBIC
OpenSource Bridge-IC
plat_power_status.c File Reference
#include <stdlib.h>
#include "hal_i2c.h"
#include "plat_i2c.h"
#include "plat_gpio.h"
#include "plat_class.h"
#include "pmbus.h"
#include "plat_mctp.h"
#include "plat_sensor_table.h"
#include "power_status.h"
#include "plat_power_status.h"
#include "util_worker.h"
#include "logging/log.h"
Include dependency graph for plat_power_status.c:

Classes

struct  rt8848c_cfg_tune
 

Macros

#define CPLD_REG_E1S_PRSNT_STATE   0x12
 
#define CPLD_REG_RETIMER_PRSNT_STATE   0x13
 
#define PWR_STAT_MON_THREAD_STACK_SIZE   1024
 

Functions

 LOG_MODULE_REGISTER (plat_power_status)
 
 K_MUTEX_DEFINE (post_status_mutex)
 
void reset_post_end_work_status ()
 
 K_TIMER_DEFINE (send_cmd_timer, send_cmd_to_dev, NULL)
 
void handle_post_work (struct k_work *work)
 
 K_WORK_DEFINE (handle_post_end_work, handle_post_work)
 
void handle_post_action ()
 
void handle_post_status (bool status, bool need_change)
 
void handle_tda38741_work_around ()
 
 K_KERNEL_STACK_MEMBER (power_status_monitor_stack, PWR_STAT_MON_THREAD_STACK_SIZE)
 
void power_status_monitor_handler (void *arug0, void *arug1, void *arug2)
 
void power_status_monitor ()
 
bool satmc_access (uint8_t sensor_num)
 
bool get_satmc_status ()
 
void set_satmc_status (bool status)
 
void retimer_addr_loss ()
 
uint8_t scan_retimer_addr ()
 
bool retimer_access (uint8_t sensor_num)
 
bool get_retimer_status ()
 
bool e1s_access (uint8_t sensor_num)
 

Variables

struct rt8848c_cfg_tune rt8848c_cfg_tune []
 
struct k_thread power_status_monitor_thread
 
bool retimer_addr_get = false
 

Macro Definition Documentation

◆ CPLD_REG_E1S_PRSNT_STATE

#define CPLD_REG_E1S_PRSNT_STATE   0x12

◆ CPLD_REG_RETIMER_PRSNT_STATE

#define CPLD_REG_RETIMER_PRSNT_STATE   0x13

◆ PWR_STAT_MON_THREAD_STACK_SIZE

#define PWR_STAT_MON_THREAD_STACK_SIZE   1024

Function Documentation

◆ e1s_access()

bool e1s_access ( uint8_t  sensor_num)
Here is the call graph for this function:

◆ get_retimer_status()

bool get_retimer_status ( )
Here is the call graph for this function:

◆ get_satmc_status()

bool get_satmc_status ( )
Here is the call graph for this function:

◆ handle_post_action()

void handle_post_action ( )

◆ handle_post_status()

void handle_post_status ( bool  status,
bool  need_change 
)
Here is the call graph for this function:

◆ handle_post_work()

void handle_post_work ( struct k_work *  work)
Here is the call graph for this function:

◆ handle_tda38741_work_around()

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

◆ K_KERNEL_STACK_MEMBER()

K_KERNEL_STACK_MEMBER ( power_status_monitor_stack  ,
PWR_STAT_MON_THREAD_STACK_SIZE   
)

◆ K_MUTEX_DEFINE()

K_MUTEX_DEFINE ( post_status_mutex  )

◆ K_TIMER_DEFINE()

K_TIMER_DEFINE ( send_cmd_timer  ,
send_cmd_to_dev  ,
NULL   
)

◆ K_WORK_DEFINE()

K_WORK_DEFINE ( handle_post_end_work  ,
handle_post_work   
)

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_power_status  )

◆ power_status_monitor()

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

◆ power_status_monitor_handler()

void power_status_monitor_handler ( void *  arug0,
void *  arug1,
void *  arug2 
)
Here is the call graph for this function:

◆ reset_post_end_work_status()

void reset_post_end_work_status ( )

◆ retimer_access()

bool retimer_access ( uint8_t  sensor_num)
Here is the call graph for this function:

◆ retimer_addr_loss()

void retimer_addr_loss ( )

◆ satmc_access()

bool satmc_access ( uint8_t  sensor_num)
Here is the call graph for this function:

◆ scan_retimer_addr()

uint8_t scan_retimer_addr ( )

◆ set_satmc_status()

void set_satmc_status ( bool  status)
Here is the call graph for this function:

Variable Documentation

◆ power_status_monitor_thread

struct k_thread power_status_monitor_thread

◆ retimer_addr_get

bool retimer_addr_get = false

◆ rt8848c_cfg_tune

Initial value:
= {
{ 0x00, 0x00 },
{ 0x54, 0x6B },
{ 0x4F, 0x19 },
{ 0x4D, 0x03 },
{ 0x11, 0x1F },
{ 0x13, 0x00 },
{ 0x15, 0x1F },
{ 0x17, 0x00 },
{ 0x19, 0x1F },
{ 0x1B, 0x00 },
{ 0x1D, 0x1F },
{ 0x1F, 0x00 },
{ 0x12, 0x12 },
{ 0x14, 0x00 },
{ 0x16, 0x01 },
{ 0x18, 0x00 },
{ 0x1A, 0x12 },
{ 0x1C, 0x01 },
{ 0x1E, 0x00 },
{ 0x20, 0x01 },
{ 0x00, 0xA6 },
}