1223013Sdim/*
2223013Sdim * Copyright 2016 Advanced Micro Devices, Inc.
3223013Sdim *
4223013Sdim * Permission is hereby granted, free of charge, to any person obtaining a
5223013Sdim * copy of this software and associated documentation files (the "Software"),
6223013Sdim * to deal in the Software without restriction, including without limitation
7223013Sdim * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8223013Sdim * and/or sell copies of the Software, and to permit persons to whom the
9223013Sdim * Software is furnished to do so, subject to the following conditions:
10223013Sdim *
11249423Sdim * The above copyright notice and this permission notice shall be included in
12223013Sdim * all copies or substantial portions of the Software.
13249423Sdim *
14226633Sdim * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15249423Sdim * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16249423Sdim * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17223013Sdim * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18276479Sdim * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19223013Sdim * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20223013Sdim * OTHER DEALINGS IN THE SOFTWARE.
21223013Sdim *
22223013Sdim */
23223013Sdim
24276479Sdim#ifndef _SMU7_THERMAL_H_
25276479Sdim#define _SMU7_THERMAL_H_
26276479Sdim
27276479Sdim#include "hwmgr.h"
28223013Sdim
29223013Sdim#define SMU7_THERMAL_HIGH_ALERT_MASK         0x1
30223013Sdim#define SMU7_THERMAL_LOW_ALERT_MASK          0x2
31223013Sdim
32276479Sdim#define SMU7_THERMAL_MINIMUM_TEMP_READING    -256
33223013Sdim#define SMU7_THERMAL_MAXIMUM_TEMP_READING    255
34223013Sdim
35223013Sdim#define SMU7_THERMAL_MINIMUM_ALERT_TEMP      0
36276479Sdim#define SMU7_THERMAL_MAXIMUM_ALERT_TEMP      255
37223013Sdim
38223013Sdim#define FDO_PWM_MODE_STATIC  1
39223013Sdim#define FDO_PWM_MODE_STATIC_RPM 5
40276479Sdim
41223013Sdimextern int smu7_thermal_get_temperature(struct pp_hwmgr *hwmgr);
42223013Sdimextern int smu7_thermal_stop_thermal_controller(struct pp_hwmgr *hwmgr);
43276479Sdimextern int smu7_fan_ctrl_get_fan_speed_info(struct pp_hwmgr *hwmgr, struct phm_fan_speed_info *fan_speed_info);
44223013Sdimextern int smu7_fan_ctrl_get_fan_speed_pwm(struct pp_hwmgr *hwmgr, uint32_t *speed);
45223013Sdimextern int smu7_fan_ctrl_set_default_mode(struct pp_hwmgr *hwmgr);
46223013Sdimextern int smu7_fan_ctrl_set_static_mode(struct pp_hwmgr *hwmgr, uint32_t mode);
47276479Sdimextern int smu7_fan_ctrl_set_fan_speed_pwm(struct pp_hwmgr *hwmgr, uint32_t speed);
48223013Sdimextern int smu7_fan_ctrl_reset_fan_speed_to_default(struct pp_hwmgr *hwmgr);
49223013Sdimextern int smu7_thermal_ctrl_uninitialize_thermal_controller(struct pp_hwmgr *hwmgr);
50276479Sdimextern int smu7_fan_ctrl_set_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t speed);
51276479Sdimextern int smu7_fan_ctrl_get_fan_speed_rpm(struct pp_hwmgr *hwmgr, uint32_t *speed);
52276479Sdimextern int smu7_fan_ctrl_stop_smc_fan_control(struct pp_hwmgr *hwmgr);
53276479Sdimextern int smu7_thermal_disable_alert(struct pp_hwmgr *hwmgr);
54288943Sdimextern int smu7_fan_ctrl_start_smc_fan_control(struct pp_hwmgr *hwmgr);
55288943Sdimextern int smu7_start_thermal_controller(struct pp_hwmgr *hwmgr,
56280031Sdim				struct PP_TemperatureRange *temperature_range);
57223013Sdim#endif
58223013Sdim
59280031Sdim