cregit-Linux how code gets into the kernel

Release 4.18 drivers/thermal/thermal_core.h

Directory: drivers/thermal
/* SPDX-License-Identifier: GPL-2.0 */
/*
 *  thermal_core.h
 *
 *  Copyright (C) 2012  Intel Corp
 *  Author: Durgadoss R <durgadoss.r@intel.com>
 */

#ifndef __THERMAL_CORE_H__

#define __THERMAL_CORE_H__

#include <linux/device.h>
#include <linux/thermal.h>

/* Initial state of a cooling device during binding */

#define THERMAL_NO_TARGET -1UL

/*
 * This structure is used to describe the behavior of
 * a certain cooling device on a certain trip point
 * in a certain thermal zone
 */

struct thermal_instance {
	
int id;
	
char name[THERMAL_NAME_LENGTH];
	
struct thermal_zone_device *tz;
	
struct thermal_cooling_device *cdev;
	
int trip;
	
bool initialized;
	
unsigned long upper;	/* Highest cooling state for this trip point */
	
unsigned long lower;	/* Lowest cooling state for this trip point */
	
unsigned long target;	/* expected cooling state */
	
char attr_name[THERMAL_NAME_LENGTH];
	
struct device_attribute attr;
	
char weight_attr_name[THERMAL_NAME_LENGTH];
	
struct device_attribute weight_attr;
	
struct list_head tz_node; /* node in tz->thermal_instances */
	
struct list_head cdev_node; /* node in cdev->thermal_instances */
	
unsigned int weight; /* The weight of the cooling device */
};


#define to_thermal_zone(_dev) \
	container_of(_dev, struct thermal_zone_device, device)


#define to_cooling_device(_dev)	\
	container_of(_dev, struct thermal_cooling_device, device)

int thermal_register_governor(struct thermal_governor *);
void thermal_unregister_governor(struct thermal_governor *);
void thermal_zone_device_rebind_exception(struct thermal_zone_device *,
					  const char *, size_t);
void thermal_zone_device_unbind_exception(struct thermal_zone_device *,
					  const char *, size_t);
int thermal_zone_device_set_policy(struct thermal_zone_device *, char *);
int thermal_build_list_of_policies(char *buf);

/* sysfs I/F */
int thermal_zone_create_device_groups(struct thermal_zone_device *, int);
void thermal_zone_destroy_device_groups(struct thermal_zone_device *);
void thermal_cooling_device_setup_sysfs(struct thermal_cooling_device *);
void thermal_cooling_device_destroy_sysfs(struct thermal_cooling_device *cdev);
/* used only at binding time */
ssize_t trip_point_show(struct device *, struct device_attribute *, char *);
ssize_t weight_show(struct device *, struct device_attribute *, char *);
ssize_t weight_store(struct device *, struct device_attribute *, const char *,
		     size_t);

#ifdef CONFIG_THERMAL_STATISTICS
void thermal_cooling_device_stats_update(struct thermal_cooling_device *cdev,
					 unsigned long new_state);
#else

static inline void thermal_cooling_device_stats_update(struct thermal_cooling_device *cdev, unsigned long new_state) {}

Contributors

PersonTokensPropCommitsCommitProp
Viresh Kumar15100.00%1100.00%
Total15100.00%1100.00%

#endif /* CONFIG_THERMAL_STATISTICS */ #ifdef CONFIG_THERMAL_GOV_STEP_WISE int thermal_gov_step_wise_register(void); void thermal_gov_step_wise_unregister(void); #else
static inline int thermal_gov_step_wise_register(void) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Rui Zhang12100.00%1100.00%
Total12100.00%1100.00%


static inline void thermal_gov_step_wise_unregister(void) {}

Contributors

PersonTokensPropCommitsCommitProp
Rui Zhang8100.00%1100.00%
Total8100.00%1100.00%

#endif /* CONFIG_THERMAL_GOV_STEP_WISE */ #ifdef CONFIG_THERMAL_GOV_FAIR_SHARE int thermal_gov_fair_share_register(void); void thermal_gov_fair_share_unregister(void); #else
static inline int thermal_gov_fair_share_register(void) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Rui Zhang12100.00%1100.00%
Total12100.00%1100.00%


static inline void thermal_gov_fair_share_unregister(void) {}

Contributors

PersonTokensPropCommitsCommitProp
Rui Zhang8100.00%1100.00%
Total8100.00%1100.00%

#endif /* CONFIG_THERMAL_GOV_FAIR_SHARE */ #ifdef CONFIG_THERMAL_GOV_BANG_BANG int thermal_gov_bang_bang_register(void); void thermal_gov_bang_bang_unregister(void); #else
static inline int thermal_gov_bang_bang_register(void) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Peter Feuerer12100.00%1100.00%
Total12100.00%1100.00%


static inline void thermal_gov_bang_bang_unregister(void) {}

Contributors

PersonTokensPropCommitsCommitProp
Peter Feuerer8100.00%1100.00%
Total8100.00%1100.00%

#endif /* CONFIG_THERMAL_GOV_BANG_BANG */ #ifdef CONFIG_THERMAL_GOV_USER_SPACE int thermal_gov_user_space_register(void); void thermal_gov_user_space_unregister(void); #else
static inline int thermal_gov_user_space_register(void) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Rui Zhang12100.00%1100.00%
Total12100.00%1100.00%


static inline void thermal_gov_user_space_unregister(void) {}

Contributors

PersonTokensPropCommitsCommitProp
Rui Zhang8100.00%1100.00%
Total8100.00%1100.00%

#endif /* CONFIG_THERMAL_GOV_USER_SPACE */ #ifdef CONFIG_THERMAL_GOV_POWER_ALLOCATOR int thermal_gov_power_allocator_register(void); void thermal_gov_power_allocator_unregister(void); #else
static inline int thermal_gov_power_allocator_register(void) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Javi Merino12100.00%1100.00%
Total12100.00%1100.00%


static inline void thermal_gov_power_allocator_unregister(void) {}

Contributors

PersonTokensPropCommitsCommitProp
Javi Merino8100.00%1100.00%
Total8100.00%1100.00%

#endif /* CONFIG_THERMAL_GOV_POWER_ALLOCATOR */ /* device tree support */ #ifdef CONFIG_THERMAL_OF int of_parse_thermal_zones(void); void of_thermal_destroy_zones(void); int of_thermal_get_ntrips(struct thermal_zone_device *); bool of_thermal_is_trip_valid(struct thermal_zone_device *, int); const struct thermal_trip * of_thermal_get_trip_points(struct thermal_zone_device *); #else
static inline int of_parse_thermal_zones(void) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Eduardo Valentin12100.00%1100.00%
Total12100.00%1100.00%


static inline void of_thermal_destroy_zones(void) { }

Contributors

PersonTokensPropCommitsCommitProp
Eduardo Valentin8100.00%1100.00%
Total8100.00%1100.00%


static inline int of_thermal_get_ntrips(struct thermal_zone_device *tz) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Lukasz Majewski15100.00%1100.00%
Total15100.00%1100.00%


static inline bool of_thermal_is_trip_valid(struct thermal_zone_device *tz, int trip) { return false; }

Contributors

PersonTokensPropCommitsCommitProp
Lukasz Majewski1794.44%150.00%
Joe Perches15.56%150.00%
Total18100.00%2100.00%


static inline const struct thermal_trip * of_thermal_get_trip_points(struct thermal_zone_device *tz) { return NULL; }

Contributors

PersonTokensPropCommitsCommitProp
Lukasz Majewski18100.00%1100.00%
Total18100.00%1100.00%

#endif #endif /* __THERMAL_CORE_H__ */

Overall Contributors

PersonTokensPropCommitsCommitProp
Eduardo Valentin16826.97%834.78%
Rui Zhang13922.31%28.70%
Durgadoss R8313.32%14.35%
Lukasz Majewski7912.68%313.04%
Javi Merino508.03%28.70%
Viresh Kumar487.70%28.70%
Peter Feuerer406.42%14.35%
Christophe Jaillet81.28%14.35%
Kapileshwar Singh50.80%14.35%
Lina Iyer20.32%14.35%
Joe Perches10.16%14.35%
Total623100.00%23100.00%
Directory: drivers/thermal
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.