^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (c) 2018 Fuzhou Rockchip Electronics Co., Ltd
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #ifndef __SOC_ROCKCHIP_IPA_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #define __SOC_ROCKCHIP_IPA_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) struct ipa_power_model_data {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) u32 static_coefficient;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) u32 dynamic_coefficient;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) s32 ts[4]; /* temperature scaling factor */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) struct thermal_zone_device *tz;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) u32 leakage;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) u32 ref_leakage;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) u32 lkg_range[2]; /* min leakage and max leakage */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) s32 ls[3]; /* leakage scaling factor */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #if IS_ENABLED(CONFIG_ROCKCHIP_IPA)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct ipa_power_model_data *rockchip_ipa_power_model_init(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) char *lkg_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) unsigned long
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) rockchip_ipa_get_static_power(struct ipa_power_model_data *model_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) unsigned long voltage_mv);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) static inline struct ipa_power_model_data *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) rockchip_ipa_power_model_init(struct device *dev, char *lkg_name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) return ERR_PTR(-ENOTSUPP);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) static inline unsigned long
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) rockchip_ipa_get_static_power(struct ipa_power_model_data *data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) unsigned long voltage_mv)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) #endif /* CONFIG_ROCKCHIP_IPA */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #endif