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)
88 lines
2.1 KiB
C
88 lines
2.1 KiB
C
/*
|
|
* Copyright (C) 2019 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 the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#ifndef _APU_LOG_H_
|
|
#define _APU_LOG_H_
|
|
|
|
#ifdef BUILD_POLICY_TEST
|
|
#include "test.h"
|
|
#else
|
|
#include <aee.h>
|
|
#include "debug_driver.h"
|
|
|
|
extern int g_pwr_log_level;
|
|
extern int g_pm_procedure;
|
|
|
|
enum {
|
|
APUSYS_PWR_LOG_ERR,
|
|
APUSYS_PWR_LOG_WARN,
|
|
APUSYS_PWR_LOG_INFO,
|
|
APUSYS_PWR_LOG_DEBUG,
|
|
APUSYS_PWR_LOG_VERBOSE,
|
|
};
|
|
|
|
#define DVFS_TAG "[DVFS]"
|
|
#define PWR_LOG_INF(format, args...) \
|
|
do { \
|
|
if (g_pwr_log_level >= APUSYS_PWR_LOG_INFO) \
|
|
pr_debug(DVFS_TAG " " format, ##args); \
|
|
} while (0)
|
|
|
|
#define PWR_LOG_PM(format, args...) \
|
|
do { \
|
|
if (g_pwr_log_level >= APUSYS_PWR_LOG_WARN) \
|
|
pr_debug(DVFS_TAG "[pm] " format, ##args); \
|
|
} while (0)
|
|
|
|
#define PWR_LOG_ERR(format, args...) \
|
|
pr_err(DVFS_TAG "[error] " format, ##args)
|
|
|
|
|
|
#define PWR_TAG "[apu_power_2.0]"
|
|
#define LOG_PM(format, args...) \
|
|
do { \
|
|
if (g_pwr_log_level >= APUSYS_PWR_LOG_WARN) \
|
|
pr_debug(PWR_TAG "[pm] " format, ##args); \
|
|
} while (0)
|
|
|
|
#define LOG_INF(format, args...) \
|
|
do { \
|
|
if (g_pwr_log_level >= APUSYS_PWR_LOG_INFO) \
|
|
pr_debug(PWR_TAG " " format, ##args); \
|
|
} while (0)
|
|
|
|
#define LOG_WRN(format, args...) \
|
|
do { \
|
|
if (!g_pm_procedure) \
|
|
if (g_pwr_log_level >= APUSYS_PWR_LOG_WARN) \
|
|
pr_warn(PWR_TAG "[warn] " format, ##args); \
|
|
} while (0)
|
|
|
|
#define LOG_ERR(format, args...) pr_err(PWR_TAG "[error] " format, ##args)
|
|
#define LOG_DBG(format, args...) \
|
|
do { \
|
|
if (g_pwr_log_level >= APUSYS_PWR_LOG_DEBUG) \
|
|
pr_debug(PWR_TAG " " format, ##args); \
|
|
} while (0)
|
|
|
|
#define apu_aee_warn(key, format, args...) \
|
|
do { \
|
|
pr_debug(format, ##args); \
|
|
} while (0)
|
|
|
|
#define LOG_DUMP(format, args...) \
|
|
apu_dbg_print(format, ##args)
|
|
|
|
#endif /* BUILD_POLICY_TEST */
|
|
#endif /* _APU_LOG_H_ */
|