OpenBIC
OpenSource Bridge-IC
plat_fan.c File Reference
#include <stdio.h>
#include <drivers/sensor.h>
#include <drivers/pwm.h>
#include "plat_fan.h"
#include "ipmi.h"
#include <logging/log.h>
Include dependency graph for plat_fan.c:

Classes

struct  fan_handle
 

Macros

#define FAN_LABELS(node_id)   { .device_label = DT_LABEL(node_id) },
 
#define FAN_NODE_LABELS(n)   DT_FOREACH_CHILD(DT_DRV_INST(n), FAN_LABELS)
 
#define FAN_INIT_MACRO()   DT_INST_FOREACH_STATUS_OKAY(FAN_NODE_LABELS)
 

Functions

 LOG_MODULE_REGISTER (plat_fan)
 
void init_fan_mode ()
 
void init_fan_duty ()
 
int pal_get_fan_ctrl_mode (uint8_t *ctrl_mode)
 
void pal_set_fan_ctrl_mode (uint8_t ctrl_mode)
 
int pal_get_fan_rpm (uint8_t fan_id, uint16_t *rpm)
 
int pal_get_fan_duty (uint8_t pwm_id, uint8_t *duty, uint8_t slot_index)
 
int pal_set_fan_duty (uint8_t pwm_id, uint8_t duty, uint8_t slot_index)
 

Macro Definition Documentation

◆ FAN_INIT_MACRO

#define FAN_INIT_MACRO ( )    DT_INST_FOREACH_STATUS_OKAY(FAN_NODE_LABELS)

◆ FAN_LABELS

#define FAN_LABELS (   node_id)    { .device_label = DT_LABEL(node_id) },

◆ FAN_NODE_LABELS

#define FAN_NODE_LABELS (   n)    DT_FOREACH_CHILD(DT_DRV_INST(n), FAN_LABELS)

Function Documentation

◆ init_fan_duty()

void init_fan_duty ( )

◆ init_fan_mode()

void init_fan_mode ( )

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( plat_fan  )

◆ pal_get_fan_ctrl_mode()

int pal_get_fan_ctrl_mode ( uint8_t *  ctrl_mode)

◆ pal_get_fan_duty()

int pal_get_fan_duty ( uint8_t  pwm_id,
uint8_t *  duty,
uint8_t  slot_index 
)

◆ pal_get_fan_rpm()

int pal_get_fan_rpm ( uint8_t  fan_id,
uint16_t *  rpm 
)

◆ pal_set_fan_ctrl_mode()

void pal_set_fan_ctrl_mode ( uint8_t  ctrl_mode)

◆ pal_set_fan_duty()

int pal_set_fan_duty ( uint8_t  pwm_id,
uint8_t  duty,
uint8_t  slot_index 
)