treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / thermal / intel / int340x_thermal / int340x_thermal_zone.h
blob3b4971df1b33b00534123783f3da2e2670d4abb9
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * int340x_thermal_zone.h
4 * Copyright (c) 2015, Intel Corporation.
5 */
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
14 struct active_trip {
15 int temp;
16 int id;
17 bool valid;
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;
24 int aux_trip_nr;
25 int psv_temp;
26 int psv_trip_id;
27 int crt_temp;
28 int crt_trip_id;
29 int hot_temp;
30 int hot_trip_id;
31 struct thermal_zone_device *zone;
32 struct thermal_zone_device_ops *override_ops;
33 void *priv_data;
34 struct acpi_lpat_conversion_table *lpat_table;
37 struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *,
38 struct thermal_zone_device_ops *override_ops);
39 void int340x_thermal_zone_remove(struct int34x_thermal_zone *);
40 int int340x_thermal_read_trips(struct int34x_thermal_zone *int34x_zone);
42 static inline void int340x_thermal_zone_set_priv_data(
43 struct int34x_thermal_zone *tzone, void *priv_data)
45 tzone->priv_data = priv_data;
48 static inline void *int340x_thermal_zone_get_priv_data(
49 struct int34x_thermal_zone *tzone)
51 return tzone->priv_data;
54 static inline void int340x_thermal_zone_device_update(
55 struct int34x_thermal_zone *tzone,
56 enum thermal_notify_event event)
58 thermal_zone_device_update(tzone->zone, event);
61 #endif