android_kernel_xiaomi_sm7250/include/linux/cpu_cooling.h
Srinivasarao P d6bbbe0157 Reverting below patches from android-4.19-stable.125
15207c29 ANDROID: add ion_stat tracepoint to common kernel
82d4e59 Revert "UPSTREAM: mm, page_alloc: spread allocations across zones before introducing fragmentation"
5e86f20 Revert "UPSTREAM: mm: use alloc_flags to record if kswapd can wake"
fbc355c Revert "BACKPORT: mm: move zone watermark accesses behind an accessor"
35be952 Revert "BACKPORT: mm: reclaim small amounts of memory when an external fragmentation event occurs"
776eba0 Revert "BACKPORT: mm, compaction: be selective about what pageblocks to clear skip hints
ca46612 ANDROID: GKI: USB: add Android ABI padding to some structures
a10905b ANDROID: GKI: usb: core: Add support to parse config summary capability descriptors
77379e5 ANDROID: GKI: USB: pd: Extcon fix for C current
27ac613 ANDROID: GKI: usb: Add support to handle USB SMMU S1 address
52b86b2 ANDROID: GKI: usb: Add helper APIs to return xhci phys addresses
bf3e2f7 ANDROID: GKI: usb: phy: Fix ABI diff for usb_otg_state
a34e269 ANDROID: GKI: usb: phy: Fix ABI diff due to usb_phy.drive_dp_pulse
7edd303 ANDROID: GKI: usb: phy: Fix ABI diff for usb_phy_type and usb_phy.reset
639d56b ANDROID: GKI: usb: hcd: Add USB atomic notifier callback for HC died error
5b6a535 ANDROID: GKI: USB: Fix ABI diff for struct usb_bus
a9c813f ANDROID: usb: gadget: Add missing inline qualifier to stub functions
632093e ANDROID: GKI: USB: Resolve ABI diff for usb_gadget and usb_gadget_ops
f7fbc94 ANDROID: GKI: usb: Add helper API to issue stop endpoint command
5dfdaa1 ANDROID: GKI: usb: xhci: Add support for secondary interrupters
a6c834c ANDROID: GKI: usb: host: xhci: Add support for usb core indexing
c89d039 ANDROID: GKI: sched: add Android ABI padding to some structures
b14ffb0 ANDROID: GKI: sched.h: add Android ABI padding to some structures
c830822 ANDROID: GKI: sched: struct fields for Per-Sched-domain over utilization
eead514 ANDROID: GKI: sched: stub sched_isolate symbols
36e1278 ANDROID: GKI: sched: add task boost vendor fields to task_struct
3bc16e4 ANDROID: GKI: power_supply: Add FG_TYPE power-supply property
4211b82 ANDROID: GKI: power_supply: Add PROP_MOISTURE_DETECTION_ENABLED
0134f3d ANDROID: GKI: power: supply: format regression
66e2580 ANDROID: Incremental fs: wake up log pollers less often
c92446c ANDROID: Incremental fs: Fix scheduling while atomic error
adb33b8 ANDROID: Incremental fs: Avoid continually recalculating hashes
a8629be ANDROID: Incremental fs: Fix issues with very large files
c7c8c61 ANDROID: Incremental fs: Add setattr call
9d7386a ANDROID: Incremental fs: Use simple compression in log buffer
298fe8e ANDROID: Incremental fs: Fix create_file performance
580b23c ANDROID: Incremental fs: Fix compound page usercopy crash
06a024d ANDROID: Incremental fs: Clean up incfs_test build process
5e6feac ANDROID: Incremental fs: make remount log buffer change atomic
5128381 ANDROID: Incremental fs: Optimize get_filled_block
23f5b7c ANDROID: Incremental fs: Fix mislabeled __user ptrs
114b043 ANDROID: Incremental fs: Use 64-bit int for file_size when writing hash blocks
ae41ea9 ANDROID: Incremental fs: Fix remount
e251cfe ANDROID: Incremental fs: Protect get_fill_block, and add a field
759d52e ANDROID: Incremental fs: Fix crash polling 0 size read_log
21b6d8c ANDROID: Incremental fs: get_filled_blocks: better index_out
0389387 net: qualcomm: rmnet: Allow configuration updates to existing devices
95b8a4b ANDROID: GKI: regulator: core: Add support for regulator providers with sync state
653a867 ANDROID: GKI: regulator: Add proxy consumer driver
6efb91e ANDROID: power_supply: Add RTX power-supply property
e90672c ANDROID: GKI: power: supply: Add POWER_SUPPLY_PROP_CHARGE_DISABLE
d1e3253 usb: dwc3: gadget: Properly set maxpacket limit
074e6e4 usb: dwc3: gadget: Do link recovery for SS and SSP
dbee0a8 usb: dwc3: gadget: Fix request completion check
c521b70 usb: dwc3: gadget: Don't clear flags before transfer ended
d1eded7 usb: dwc3: gadget: don't enable interrupt when disabling endpoint
831494c usb: dwc3: core: add support for disabling SS instances in park mode
b0434aa usb: dwc3: don't set gadget->is_otg flag
fe60e0d usb: dwc3: gadget: Wrap around when skip TRBs
b71b0c1 ANDROID: GKI: drivers: thermal: cpu_cooling: Use CPU ID as cooling device ID
eaa42a5 ANDROID: GKI: drivers: of-thermal: Relate thermal zones using same sensor
10d3954 ANDROID: GKI: drivers: thermal: Add support for getting trip temperature
5a7902f ANDROID: GKI: Add functions of_thermal_handle_trip/of_thermal_handle_trip_temp
b078dd6 ANDROID: GKI: drivers: thermal: Add post suspend evaluate flag to thermal zone devicetree
e92e403 ANDROID: GKI: drivers: cpu_cooling: allow platform freq mitigation

Change-Id: Id2a4fb08f24ad83c880fa8e4c199ea90837649b5
Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
2020-07-29 13:12:56 +05:30

122 lines
3.6 KiB
C

/*
* linux/include/linux/cpu_cooling.h
*
* Copyright (C) 2012 Samsung Electronics Co., Ltd(http://www.samsung.com)
* Copyright (C) 2012 Amit Daniel <amit.kachhap@linaro.org>
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* 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.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#ifndef __CPU_COOLING_H__
#define __CPU_COOLING_H__
#include <linux/of.h>
#include <linux/thermal.h>
#include <linux/cpumask.h>
struct cpufreq_policy;
typedef int (*plat_mitig_t)(int cpu, u32 clip_freq);
struct cpu_cooling_ops {
plat_mitig_t ceil_limit, floor_limit;
};
#ifdef CONFIG_CPU_THERMAL
/**
* cpufreq_cooling_register - function to create cpufreq cooling device.
* @policy: cpufreq policy.
*/
struct thermal_cooling_device *
cpufreq_cooling_register(struct cpufreq_policy *policy);
/**
* cpufreq_platform_cooling_register - create cpufreq cooling device with
* additional platform specific mitigation function.
*
* @policy: cpufreq policy
* @plat_ops: the platform mitigation functions that will be called insted of
* cpufreq, if provided.
*/
struct thermal_cooling_device *
cpufreq_platform_cooling_register(struct cpufreq_policy *policy,
struct cpu_cooling_ops *ops);
/**
* cpufreq_cooling_unregister - function to remove cpufreq cooling device.
* @cdev: thermal cooling device pointer.
*/
void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev);
#else /* !CONFIG_CPU_THERMAL */
static inline struct thermal_cooling_device *
cpufreq_cooling_register(struct cpufreq_policy *policy)
{
return ERR_PTR(-ENOSYS);
}
static inline
void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
{
return;
}
#endif /* CONFIG_CPU_THERMAL */
#if defined(CONFIG_THERMAL_OF) && defined(CONFIG_CPU_THERMAL)
/**
* of_cpufreq_cooling_register - create cpufreq cooling device based on DT.
* @policy: cpufreq policy.
*/
struct thermal_cooling_device *
of_cpufreq_cooling_register(struct cpufreq_policy *policy);
#else
static inline struct thermal_cooling_device *
of_cpufreq_cooling_register(struct cpufreq_policy *policy)
{
return NULL;
}
static inline struct thermal_cooling_device *
cpufreq_platform_cooling_register(struct cpufreq_policy *policy,
struct cpu_cooling_ops *ops)
{
return NULL;
}
#endif /* defined(CONFIG_THERMAL_OF) && defined(CONFIG_CPU_THERMAL) */
#ifdef CONFIG_QTI_CPU_ISOLATE_COOLING_DEVICE
extern void cpu_cooling_max_level_notifier_register(struct notifier_block *n);
extern void cpu_cooling_max_level_notifier_unregister(struct notifier_block *n);
extern const struct cpumask *cpu_cooling_get_max_level_cpumask(void);
#else
static inline
void cpu_cooling_max_level_notifier_register(struct notifier_block *n)
{
}
static inline
void cpu_cooling_max_level_notifier_unregister(struct notifier_block *n)
{
}
static inline const struct cpumask *cpu_cooling_get_max_level_cpumask(void)
{
return cpu_none_mask;
}
#endif /* CONFIG_QTI_CPU_ISOLATE_COOLING_DEVICE */
#endif /* __CPU_COOLING_H__ */