summaryrefslogtreecommitdiff
path: root/backport-include
diff options
context:
space:
mode:
authorDominik Sliwa <dominik.sliwa@toradex.com>2017-07-04 11:53:51 +0200
committerDominik Sliwa <dominik.sliwa@toradex.com>2017-08-21 17:21:16 +0200
commit84d6642e4d1609562abb421341c9a90c023247a1 (patch)
treeffcc2b23e887c7d5615303067978e185e67072cc /backport-include
parent52409fae3e4b8d16b68b61902fc09075cd97b75d (diff)
backports:fix compilation with toradex kernels
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Diffstat (limited to 'backport-include')
-rw-r--r--backport-include/linux/export.h4
-rw-r--r--backport-include/linux/random.h3
-rw-r--r--backport-include/linux/thermal.h34
3 files changed, 38 insertions, 3 deletions
diff --git a/backport-include/linux/export.h b/backport-include/linux/export.h
index 6f6cb6a..a3c7799 100644
--- a/backport-include/linux/export.h
+++ b/backport-include/linux/export.h
@@ -3,7 +3,7 @@
#include <linux/version.h>
-#if LINUX_VERSION_IS_GEQ(3,2,0)
+#if LINUX_VERSION_IS_GEQ(3,1,0)
#include_next <linux/export.h>
#else
#ifndef pr_fmt
@@ -14,6 +14,6 @@
#undef pr_fmt
#undef backport_undef_pr_fmt
#endif
-#endif /* LINUX_VERSION_IS_GEQ(3,2,0) */
+#endif /* LINUX_VERSION_IS_GEQ(3,1,0) */
#endif /* _COMPAT_LINUX_EXPORT_H */
diff --git a/backport-include/linux/random.h b/backport-include/linux/random.h
index a9dda73..bf16bff 100644
--- a/backport-include/linux/random.h
+++ b/backport-include/linux/random.h
@@ -12,7 +12,8 @@ static inline void add_device_randomness(const void *buf, unsigned int size)
}
#endif
-#if LINUX_VERSION_IS_LESS(3,8,0)
+#if 0
+/* #if LINUX_VERSION_IS_LESS(3,8,0) */
/* backports 496f2f9 */
#define prandom_seed(_seed) srandom32(_seed)
#define prandom_u32() random32()
diff --git a/backport-include/linux/thermal.h b/backport-include/linux/thermal.h
index 108a8cf..b0dc643 100644
--- a/backport-include/linux/thermal.h
+++ b/backport-include/linux/thermal.h
@@ -5,6 +5,40 @@
#if LINUX_VERSION_IS_LESS(3,8,0)
#include <linux/errno.h>
+#include <linux/err.h>
+
+enum thermal_trend {
+ THERMAL_TREND_STABLE, /* temperature is stable */
+ THERMAL_TREND_RAISING, /* temperature is raising */
+ THERMAL_TREND_DROPPING, /* temperature is dropping */
+ THERMAL_TREND_RAISE_FULL, /* apply highest cooling action */
+ THERMAL_TREND_DROP_FULL, /* apply lowest cooling action */
+};
+
+struct backport_thermal_zone_device_ops {
+ int (*bind) (struct thermal_zone_device *,
+ struct thermal_cooling_device *);
+ int (*unbind) (struct thermal_zone_device *,
+ struct thermal_cooling_device *);
+ int (*get_temp) (struct thermal_zone_device *, int *);
+ int (*get_mode) (struct thermal_zone_device *,
+ enum thermal_device_mode *);
+ int (*set_mode) (struct thermal_zone_device *,
+ enum thermal_device_mode);
+ int (*get_trip_type) (struct thermal_zone_device *, int,
+ enum thermal_trip_type *);
+ int (*get_trip_temp) (struct thermal_zone_device *, int, int *);
+ int (*set_trip_temp) (struct thermal_zone_device *, int, int);
+ int (*get_trip_hyst) (struct thermal_zone_device *, int, int *);
+ int (*set_trip_hyst) (struct thermal_zone_device *, int, int);
+ int (*get_crit_temp) (struct thermal_zone_device *, int *);
+ int (*set_emul_temp) (struct thermal_zone_device *, int);
+ int (*get_trend) (struct thermal_zone_device *, int,
+ enum thermal_trend *);
+ int (*notify) (struct thermal_zone_device *, int,
+ enum thermal_trip_type);
+};
+#define thermal_zone_device_ops LINUX_BACKPORT(thermal_zone_device_ops)
struct thermal_bind_params {
struct thermal_cooling_device *cdev;