mirror of
https://github.com/hardkernel/kernel_common_drivers.git
synced 2026-06-25 12:03:48 +09:00
195a41ef95
PD#SWPL-141014 Problem: txhd2 need to add media related thermal control Solution: 1. add media cooling device. media module should call media_cooling_register to register the cooling device. and usually configure maxstate of the cooling device. 2. reconstruct cpucore cooling device. Verify: txhd2 Change-Id: I0576e0d91a3062b60f877a4e8577e4fe84e5f53b Signed-off-by: Xingxing Wang <xingxing.wang@amlogic.com>
52 lines
1.3 KiB
C
52 lines
1.3 KiB
C
/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
|
|
/*
|
|
* Copyright (c) 2019 Amlogic, Inc. All rights reserved.
|
|
*/
|
|
|
|
#ifndef __MEDIA_COOLING_H__
|
|
#define __MEDIA_COOLING_H__
|
|
|
|
#include <linux/thermal.h>
|
|
|
|
/*hotstep: 0-->trip~trip+hyst,
|
|
*1-->trip+hyst~trip+2*hyst,2-->trip+2*hyst~trip+3*hyst.....
|
|
*setstep: step last set
|
|
*/
|
|
struct media_cooling_device {
|
|
struct thermal_cooling_device *cool_dev;
|
|
int (*set_media_cooling_state)(int state);
|
|
u32 hotstep; /*0:no limit;1:low level limit;2:high level limit*/
|
|
u32 setstep;
|
|
int maxstep; /*the max hotstep which can be setted by the cooling device*/
|
|
int bindtrip; /*trip id of the cooling device*/
|
|
};
|
|
|
|
struct media_cooling_para {
|
|
struct device_node *np;
|
|
int maxstep;
|
|
int bindtrip;
|
|
};
|
|
|
|
#ifdef CONFIG_AMLOGIC_MEDIA_THERMAL
|
|
struct thermal_cooling_device *media_cooling_register(struct media_cooling_device *mcdev);
|
|
void media_cooling_unregister(struct thermal_cooling_device *cdev);
|
|
int setup_media_para(const char *node_name);
|
|
#else
|
|
static inline struct thermal_cooling_device *
|
|
media_cooling_register(struct media_cooling_device *mcdev)
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
static inline
|
|
void media_cooling_unregister(struct thermal_cooling_device *cdev)
|
|
{
|
|
}
|
|
|
|
static inline int setup_media_para(const char *node_name)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif
|
|
#endif /* __MEDIA_COOLING_H__ */
|