brintos

brintos / linux-shallow public Read only

0
0
Text · 3.7 KiB · e01221e Raw
145 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2/*3 *  Copyright (C) Linaro Ltd 20204 *  Author: Daniel Lezcano <daniel.lezcano@linaro.org>5 */6 7struct thermal_genl_cpu_caps {8	int cpu;9	int performance;10	int efficiency;11};12 13enum thermal_genl_multicast_groups {14	THERMAL_GENL_SAMPLING_GROUP = 0,15	THERMAL_GENL_EVENT_GROUP = 1,16	THERMAL_GENL_MAX_GROUP = THERMAL_GENL_EVENT_GROUP,17};18 19#define THERMAL_NOTIFY_BIND	020#define THERMAL_NOTIFY_UNBIND	121 22struct thermal_genl_notify {23	int mcgrp;24};25 26struct thermal_zone_device;27struct thermal_trip;28struct thermal_cooling_device;29 30/* Netlink notification function */31#ifdef CONFIG_THERMAL_NETLINK32int __init thermal_netlink_init(void);33void __init thermal_netlink_exit(void);34int thermal_genl_register_notifier(struct notifier_block *nb);35int thermal_genl_unregister_notifier(struct notifier_block *nb);36 37int thermal_notify_tz_create(const struct thermal_zone_device *tz);38int thermal_notify_tz_delete(const struct thermal_zone_device *tz);39int thermal_notify_tz_enable(const struct thermal_zone_device *tz);40int thermal_notify_tz_disable(const struct thermal_zone_device *tz);41int thermal_notify_tz_trip_down(const struct thermal_zone_device *tz,42				const struct thermal_trip *trip);43int thermal_notify_tz_trip_up(const struct thermal_zone_device *tz,44			      const struct thermal_trip *trip);45int thermal_notify_tz_trip_change(const struct thermal_zone_device *tz,46				  const struct thermal_trip *trip);47int thermal_notify_cdev_state_update(const struct thermal_cooling_device *cdev,48				     int state);49int thermal_notify_cdev_add(const struct thermal_cooling_device *cdev);50int thermal_notify_cdev_delete(const struct thermal_cooling_device *cdev);51int thermal_notify_tz_gov_change(const struct thermal_zone_device *tz,52				 const char *name);53int thermal_genl_sampling_temp(int id, int temp);54int thermal_genl_cpu_capability_event(int count,55				      struct thermal_genl_cpu_caps *caps);56#else57static inline int thermal_netlink_init(void)58{59	return 0;60}61 62static inline int thermal_notify_tz_create(const struct thermal_zone_device *tz)63{64	return 0;65}66 67static inline int thermal_genl_register_notifier(struct notifier_block *nb)68{69	return 0;70}71 72static inline int thermal_genl_unregister_notifier(struct notifier_block *nb)73{74	return 0;75}76 77static inline int thermal_notify_tz_delete(const struct thermal_zone_device *tz)78{79	return 0;80}81 82static inline int thermal_notify_tz_enable(const struct thermal_zone_device *tz)83{84	return 0;85}86 87static inline int thermal_notify_tz_disable(const struct thermal_zone_device *tz)88{89	return 0;90}91 92static inline int thermal_notify_tz_trip_down(const struct thermal_zone_device *tz,93					      const struct thermal_trip *trip)94{95	return 0;96}97 98static inline int thermal_notify_tz_trip_up(const struct thermal_zone_device *tz,99					    const struct thermal_trip *trip)100{101	return 0;102}103 104static inline int thermal_notify_tz_trip_change(const struct thermal_zone_device *tz,105						const struct thermal_trip *trip)106{107	return 0;108}109 110static inline int thermal_notify_cdev_state_update(const struct thermal_cooling_device *cdev,111						   int state)112{113	return 0;114}115 116static inline int thermal_notify_cdev_add(const struct thermal_cooling_device *cdev)117{118	return 0;119}120 121static inline int thermal_notify_cdev_delete(const struct thermal_cooling_device *cdev)122{123	return 0;124}125 126static inline int thermal_notify_tz_gov_change(const struct thermal_zone_device *tz,127					       const char *name)128{129	return 0;130}131 132static inline int thermal_genl_sampling_temp(int id, int temp)133{134	return 0;135}136 137static inline int thermal_genl_cpu_capability_event(int count, struct thermal_genl_cpu_caps *caps)138{139	return 0;140}141 142static inline void __init thermal_netlink_exit(void) {}143 144#endif /* CONFIG_THERMAL_NETLINK */145