Linux Audio

Check our new training course

Loading...
v5.9
  1/* SPDX-License-Identifier: GPL-2.0 */
  2/*
  3 *  Copyright (C) Linaro Ltd 2020
  4 *  Author: Daniel Lezcano <daniel.lezcano@linaro.org>
  5 */
  6
 
 
 
 
 
 
 
 
 
 
  7/* Netlink notification function */
  8#ifdef CONFIG_THERMAL_NETLINK
  9int __init thermal_netlink_init(void);
 10int thermal_notify_tz_create(int tz_id, const char *name);
 11int thermal_notify_tz_delete(int tz_id);
 12int thermal_notify_tz_enable(int tz_id);
 13int thermal_notify_tz_disable(int tz_id);
 14int thermal_notify_tz_trip_down(int tz_id, int id);
 15int thermal_notify_tz_trip_up(int tz_id, int id);
 16int thermal_notify_tz_trip_delete(int tz_id, int id);
 17int thermal_notify_tz_trip_add(int tz_id, int id, int type,
 18			       int temp, int hyst);
 19int thermal_notify_tz_trip_change(int tz_id, int id, int type,
 20				  int temp, int hyst);
 21int thermal_notify_cdev_state_update(int cdev_id, int state);
 22int thermal_notify_cdev_add(int cdev_id, const char *name, int max_state);
 23int thermal_notify_cdev_delete(int cdev_id);
 24int thermal_notify_tz_gov_change(int tz_id, const char *name);
 
 
 25int thermal_genl_sampling_temp(int id, int temp);
 
 
 26#else
 27static inline int thermal_netlink_init(void)
 28{
 29	return 0;
 30}
 31
 32static inline int thermal_notify_tz_create(int tz_id, const char *name)
 33{
 34	return 0;
 35}
 36
 37static inline int thermal_notify_tz_delete(int tz_id)
 38{
 39	return 0;
 40}
 41
 42static inline int thermal_notify_tz_enable(int tz_id)
 43{
 44	return 0;
 45}
 46
 47static inline int thermal_notify_tz_disable(int tz_id)
 48{
 49	return 0;
 50}
 51
 52static inline int thermal_notify_tz_trip_down(int tz_id, int id)
 
 53{
 54	return 0;
 55}
 56
 57static inline int thermal_notify_tz_trip_up(int tz_id, int id)
 
 58{
 59	return 0;
 60}
 61
 62static inline int thermal_notify_tz_trip_delete(int tz_id, int id)
 
 63{
 64	return 0;
 65}
 66
 67static inline int thermal_notify_tz_trip_add(int tz_id, int id, int type,
 68					     int temp, int hyst)
 69{
 70	return 0;
 71}
 72
 73static inline int thermal_notify_tz_trip_change(int tz_id, int id, int type,
 74						int temp, int hyst)
 75{
 76	return 0;
 77}
 78
 79static inline int thermal_notify_cdev_state_update(int cdev_id, int state)
 80{
 81	return 0;
 82}
 83
 84static inline int thermal_notify_cdev_add(int cdev_id, const char *name,
 85					  int max_state)
 86{
 87	return 0;
 88}
 89
 90static inline int thermal_notify_cdev_delete(int cdev_id)
 91{
 92	return 0;
 93}
 94
 95static inline int thermal_notify_tz_gov_change(int tz_id, const char *name)
 96{
 97	return 0;
 98}
 99
100static inline int thermal_genl_sampling_temp(int id, int temp)
101{
102	return 0;
103}
104#endif /* CONFIG_THERMAL_NETLINK */
v6.8
  1/* SPDX-License-Identifier: GPL-2.0 */
  2/*
  3 *  Copyright (C) Linaro Ltd 2020
  4 *  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
 13struct thermal_zone_device;
 14struct thermal_trip;
 15struct thermal_cooling_device;
 16
 17/* Netlink notification function */
 18#ifdef CONFIG_THERMAL_NETLINK
 19int __init thermal_netlink_init(void);
 20void __init thermal_netlink_exit(void);
 21int thermal_notify_tz_create(const struct thermal_zone_device *tz);
 22int thermal_notify_tz_delete(const struct thermal_zone_device *tz);
 23int thermal_notify_tz_enable(const struct thermal_zone_device *tz);
 24int thermal_notify_tz_disable(const struct thermal_zone_device *tz);
 25int thermal_notify_tz_trip_down(const struct thermal_zone_device *tz,
 26				const struct thermal_trip *trip);
 27int thermal_notify_tz_trip_up(const struct thermal_zone_device *tz,
 28			      const struct thermal_trip *trip);
 29int thermal_notify_tz_trip_change(const struct thermal_zone_device *tz,
 30				  const struct thermal_trip *trip);
 31int thermal_notify_cdev_state_update(const struct thermal_cooling_device *cdev,
 32				     int state);
 33int thermal_notify_cdev_add(const struct thermal_cooling_device *cdev);
 34int thermal_notify_cdev_delete(const struct thermal_cooling_device *cdev);
 35int thermal_notify_tz_gov_change(const struct thermal_zone_device *tz,
 36				 const char *name);
 37int thermal_genl_sampling_temp(int id, int temp);
 38int thermal_genl_cpu_capability_event(int count,
 39				      struct thermal_genl_cpu_caps *caps);
 40#else
 41static inline int thermal_netlink_init(void)
 42{
 43	return 0;
 44}
 45
 46static inline int thermal_notify_tz_create(const struct thermal_zone_device *tz)
 47{
 48	return 0;
 49}
 50
 51static inline int thermal_notify_tz_delete(const struct thermal_zone_device *tz)
 52{
 53	return 0;
 54}
 55
 56static inline int thermal_notify_tz_enable(const struct thermal_zone_device *tz)
 57{
 58	return 0;
 59}
 60
 61static inline int thermal_notify_tz_disable(const struct thermal_zone_device *tz)
 62{
 63	return 0;
 64}
 65
 66static inline int thermal_notify_tz_trip_down(const struct thermal_zone_device *tz,
 67					      const struct thermal_trip *trip)
 68{
 69	return 0;
 70}
 71
 72static inline int thermal_notify_tz_trip_up(const struct thermal_zone_device *tz,
 73					    const struct thermal_trip *trip)
 74{
 75	return 0;
 76}
 77
 78static inline int thermal_notify_tz_trip_change(const struct thermal_zone_device *tz,
 79						const struct thermal_trip *trip)
 80{
 81	return 0;
 82}
 83
 84static inline int thermal_notify_cdev_state_update(const struct thermal_cooling_device *cdev,
 85						   int state)
 86{
 87	return 0;
 88}
 89
 90static inline int thermal_notify_cdev_add(const struct thermal_cooling_device *cdev)
 
 91{
 92	return 0;
 93}
 94
 95static inline int thermal_notify_cdev_delete(const struct thermal_cooling_device *cdev)
 96{
 97	return 0;
 98}
 99
100static inline int thermal_notify_tz_gov_change(const struct thermal_zone_device *tz,
101					       const char *name)
102{
103	return 0;
104}
105
106static inline int thermal_genl_sampling_temp(int id, int temp)
107{
108	return 0;
109}
110
111static inline int thermal_genl_cpu_capability_event(int count, struct thermal_genl_cpu_caps *caps)
112{
113	return 0;
114}
115
116static inline void __init thermal_netlink_exit(void) {}
117
 
 
118#endif /* CONFIG_THERMAL_NETLINK */