Squashed backup commit (no shallow-clone history issues) of xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream commit 9eece662e) plus all fixes applied to get everpal_defconfig building clean against a modern (GCC 15.2.0) toolchain -- see the previous commit message on the lineage-23.2 branch (also in this repo history is not available here since this is a squashed snapshot; full incremental history lives in the local DL380 checkout and the upstream GitHub remote). Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
72 lines
2.0 KiB
C
72 lines
2.0 KiB
C
/*
|
|
* Copyright (C) 2018 MediaTek Inc.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
* See http://www.gnu.org/licenses/gpl-2.0.html for more details.
|
|
*/
|
|
|
|
#ifndef __MTK_THERMAL_IPI_H__
|
|
#define __MTK_THERMAL_IPI_H__
|
|
|
|
#ifdef CONFIG_MTK_TINYSYS_SSPM_SUPPORT
|
|
#define THERMAL_ENABLE_TINYSYS_SSPM (0)
|
|
#define THERMAL_ENABLE_ONLY_TZ_SSPM (1)
|
|
#else
|
|
#define THERMAL_ENABLE_TINYSYS_SSPM (0)
|
|
#endif
|
|
|
|
#if THERMAL_ENABLE_TINYSYS_SSPM || THERMAL_ENABLE_ONLY_TZ_SSPM
|
|
#include "sspm_ipi.h"
|
|
#include <sspm_reservedmem_define.h>
|
|
|
|
#define THERMAL_SLOT_NUM (4)
|
|
#define BIG_CORE_THRESHOLD_ARRAY_SIZE (3)
|
|
/* IPI Msg type */
|
|
enum {
|
|
THERMAL_IPI_INIT_GRP1,
|
|
THERMAL_IPI_INIT_GRP2,
|
|
THERMAL_IPI_INIT_GRP3,
|
|
THERMAL_IPI_INIT_GRP4,
|
|
THERMAL_IPI_INIT_GRP5,
|
|
THERMAL_IPI_INIT_GRP6,
|
|
THERMAL_IPI_LVTS_INIT_GRP1,
|
|
THERMAL_IPI_GET_TEMP,
|
|
THERMAL_IPI_SET_ATM_CFG_GRP1,
|
|
THERMAL_IPI_SET_ATM_CFG_GRP2,
|
|
THERMAL_IPI_SET_ATM_CFG_GRP3,
|
|
THERMAL_IPI_SET_ATM_CFG_GRP4,
|
|
THERMAL_IPI_SET_ATM_CFG_GRP5,
|
|
THERMAL_IPI_SET_ATM_CFG_GRP6,
|
|
THERMAL_IPI_SET_ATM_CFG_GRP7,
|
|
THERMAL_IPI_SET_ATM_CFG_GRP8,
|
|
THERMAL_IPI_SET_ATM_TTJ,
|
|
THERMAL_IPI_SET_ATM_EN,
|
|
THERMAL_IPI_GET_ATM_CPU_LIMIT,
|
|
THERMAL_IPI_GET_ATM_GPU_LIMIT,
|
|
THERMAL_IPI_SET_BIG_FREQ_THRESHOLD,
|
|
THERMAL_IPI_GET_BIG_FREQ_THRESHOLD,
|
|
NR_THERMAL_IPI
|
|
};
|
|
|
|
/* IPI Msg data structure */
|
|
struct thermal_ipi_data {
|
|
unsigned int cmd;
|
|
union {
|
|
struct {
|
|
int arg[THERMAL_SLOT_NUM - 1];
|
|
} data;
|
|
} u;
|
|
};
|
|
extern unsigned int thermal_to_sspm(unsigned int cmd,
|
|
struct thermal_ipi_data *thermal_data);
|
|
extern int atm_to_sspm(unsigned int cmd, int data_len,
|
|
struct thermal_ipi_data *thermal_data, int *ackData);
|
|
#endif /* THERMAL_ENABLE_TINYSYS_SSPM */
|
|
#endif
|