1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * int340x_thermal_zone.h
4 * Copyright (c) 2015, Intel Corporation.
7 #ifndef __INT340X_THERMAL_ZONE_H__
8 #define __INT340X_THERMAL_ZONE_H__
10 #include <acpi/acpi_lpat.h>
12 #define INT340X_THERMAL_MAX_ACT_TRIP_COUNT 10
20 struct int34x_thermal_zone {
21 struct acpi_device *adev;
22 struct active_trip act_trips[INT340X_THERMAL_MAX_ACT_TRIP_COUNT];
23 unsigned long *aux_trips;
31 struct thermal_zone_device *zone;
32 struct thermal_zone_device_ops *override_ops;
34 struct acpi_lpat_conversion_table *lpat_table;
35 struct mutex trip_mutex;
38 struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *,
39 struct thermal_zone_device_ops *override_ops);
40 void int340x_thermal_zone_remove(struct int34x_thermal_zone *);
41 int int340x_thermal_read_trips(struct int34x_thermal_zone *int34x_zone);
43 static inline void int340x_thermal_zone_set_priv_data(
44 struct int34x_thermal_zone *tzone, void *priv_data)
46 tzone->priv_data = priv_data;
49 static inline void *int340x_thermal_zone_get_priv_data(
50 struct int34x_thermal_zone *tzone)
52 return tzone->priv_data;
55 static inline void int340x_thermal_zone_device_update(
56 struct int34x_thermal_zone *tzone,
57 enum thermal_notify_event event)
59 thermal_zone_device_update(tzone->zone, event);