0001
0002
0003
0004
0005
0006
0007 #ifndef __INT340X_THERMAL_ZONE_H__
0008 #define __INT340X_THERMAL_ZONE_H__
0009
0010 #include <acpi/acpi_lpat.h>
0011
0012 #define INT340X_THERMAL_MAX_ACT_TRIP_COUNT 10
0013
0014 struct active_trip {
0015 int temp;
0016 int id;
0017 bool valid;
0018 };
0019
0020 struct int34x_thermal_zone {
0021 struct acpi_device *adev;
0022 struct active_trip act_trips[INT340X_THERMAL_MAX_ACT_TRIP_COUNT];
0023 unsigned long *aux_trips;
0024 int aux_trip_nr;
0025 int psv_temp;
0026 int psv_trip_id;
0027 int crt_temp;
0028 int crt_trip_id;
0029 int hot_temp;
0030 int hot_trip_id;
0031 struct thermal_zone_device *zone;
0032 struct thermal_zone_device_ops *override_ops;
0033 void *priv_data;
0034 struct acpi_lpat_conversion_table *lpat_table;
0035 };
0036
0037 struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *,
0038 struct thermal_zone_device_ops *override_ops);
0039 void int340x_thermal_zone_remove(struct int34x_thermal_zone *);
0040 int int340x_thermal_read_trips(struct int34x_thermal_zone *int34x_zone);
0041
0042 static inline void int340x_thermal_zone_set_priv_data(
0043 struct int34x_thermal_zone *tzone, void *priv_data)
0044 {
0045 tzone->priv_data = priv_data;
0046 }
0047
0048 static inline void *int340x_thermal_zone_get_priv_data(
0049 struct int34x_thermal_zone *tzone)
0050 {
0051 return tzone->priv_data;
0052 }
0053
0054 static inline void int340x_thermal_zone_device_update(
0055 struct int34x_thermal_zone *tzone,
0056 enum thermal_notify_event event)
0057 {
0058 thermal_zone_device_update(tzone->zone, event);
0059 }
0060
0061 #endif