// SPDX-License-Identifier: GPL-2.0/* * thermal.c - Generic Thermal Management Sysfs support. * * Copyright (C) 2008 Intel Corp * Copyright (C) 2008 Zhang Rui <rui.zhang@intel.com> * Copyright (C) 2008 Sujith Thomas <sujith.thomas@intel.com> */#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt#include<linux/device.h>#include<linux/err.h>#include<linux/export.h>#include<linux/slab.h>#include<linux/kdev_t.h>#include<linux/idr.h>#include<linux/thermal.h>#include<linux/reboot.h>#include<linux/string.h>#include<linux/of.h>#include<linux/suspend.h>#define CREATE_TRACE_POINTS#include<trace/events/thermal.h>#include"thermal_core.h"#include"thermal_hwmon.h"staticDEFINE_IDA(thermal_tz_ida);staticDEFINE_IDA(thermal_cdev_ida);staticLIST_HEAD(thermal_tz_list);staticLIST_HEAD(thermal_cdev_list);staticLIST_HEAD(thermal_governor_list);staticDEFINE_MUTEX(thermal_list_lock);staticDEFINE_MUTEX(thermal_governor_lock);staticatomic_tin_suspend;staticstructthermal_governor*def_governor;/* * Governor section: set of functions to handle thermal governors * * Functions to help in the life cycle of thermal governors within * the thermal core and by the thermal governor code. */staticstructthermal_governor*__find_governor(constchar*name){structthermal_governor*