OpenBIC
OpenSource Bridge-IC
plat_fan.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef PLAT_FAN_H
18#define PLAT_FAN_H
19
20#define MAX_FAN_DUTY_VALUE 100
21#define DEFAULT_FAN_DUTY_VALUE 70
22#define MAX_FAN_PWM_INDEX_COUNT 4
23
24#define INDEX_ALL_PWM 0xFF
25
26#define PWM_DEVICE_NAME "PWM"
27
32};
33
37};
38
39void init_fan_mode();
40void init_fan_duty();
41int pal_get_fan_ctrl_mode(uint8_t *ctrl_mode);
42void pal_set_fan_ctrl_mode(uint8_t ctrl_mode);
43int pal_get_fan_rpm(uint8_t fan_id, uint16_t *rpm);
44int pal_get_fan_duty(uint8_t pwm_id, uint8_t *duty, uint8_t slot_index);
45int pal_set_fan_duty(uint8_t pwm_id, uint8_t duty, uint8_t slot_index);
46
47#endif
int pal_get_fan_ctrl_mode(uint8_t *ctrl_mode)
Definition: plat_fan.c:68
fan_mode_ctrl_cmd
Definition: plat_fan.h:28
@ FAN_SET_AUTO_MODE
Definition: plat_fan.h:30
@ FAN_GET_MODE
Definition: plat_fan.h:31
@ FAN_SET_MANUAL_MODE
Definition: plat_fan.h:29
int pal_get_fan_rpm(uint8_t fan_id, uint16_t *rpm)
Definition: plat_fan.c:85
void pal_set_fan_ctrl_mode(uint8_t ctrl_mode)
Definition: plat_fan.c:79
int pal_get_fan_duty(uint8_t pwm_id, uint8_t *duty, uint8_t slot_index)
Definition: plat_fan.c:119
void init_fan_mode()
Definition: plat_fan.c:43
int pal_set_fan_duty(uint8_t pwm_id, uint8_t duty, uint8_t slot_index)
Definition: plat_fan.c:135
fan_mode
Definition: plat_fan.h:34
@ FAN_AUTO_MODE
Definition: plat_fan.h:36
@ FAN_MANUAL_MODE
Definition: plat_fan.h:35
void init_fan_duty()
Definition: plat_fan.c:49