blob: 11f2f5260c3adda6073102141dd5f9cc23ca4676 [file] [log] [blame]
Srinivas Pandruvada5fbf7f22015-01-16 15:59:03 -08001/*
2 * int340x_thermal_zone.h
3 * Copyright (c) 2015, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 */
15
16#ifndef __INT340X_THERMAL_ZONE_H__
17#define __INT340X_THERMAL_ZONE_H__
18
19#define INT340X_THERMAL_MAX_ACT_TRIP_COUNT 10
20
21struct active_trip {
22 unsigned long temp;
23 int id;
24 bool valid;
25};
26
27struct int34x_thermal_zone {
28 struct acpi_device *adev;
29 struct active_trip act_trips[INT340X_THERMAL_MAX_ACT_TRIP_COUNT];
30 unsigned long *aux_trips;
31 int aux_trip_nr;
32 unsigned long psv_temp;
33 int psv_trip_id;
34 unsigned long crt_temp;
35 int crt_trip_id;
36 unsigned long hot_temp;
37 int hot_trip_id;
38 struct thermal_zone_device *zone;
39 struct thermal_zone_device_ops *override_ops;
40 void *priv_data;
41};
42
43struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *,
44 struct thermal_zone_device_ops *override_ops);
45void int340x_thermal_zone_remove(struct int34x_thermal_zone *);
46
47static inline void int340x_thermal_zone_set_priv_data(
48 struct int34x_thermal_zone *tzone, void *priv_data)
49{
50 tzone->priv_data = priv_data;
51}
52
53static inline void *int340x_thermal_zone_get_priv_data(
54 struct int34x_thermal_zone *tzone)
55{
56 return tzone->priv_data;
57}
58
59static inline void int340x_thermal_zone_device_update(
60 struct int34x_thermal_zone *tzone)
61{
62 thermal_zone_device_update(tzone->zone);
63}
64
65#endif