From 84325931ccddb09f6313466fb272e8125569ae07 Mon Sep 17 00:00:00 2001 From: Dominik Sliwa Date: Tue, 21 Nov 2017 16:35:43 +0000 Subject: backports:Backports for tegra 3.1 kernel Signed-off-by: Dominik Sliwa --- backport-include/linux/export.h | 4 ++-- backport-include/linux/netdevice.h | 2 +- backport-include/linux/random.h | 4 +++- backport-include/linux/suspend.h | 14 ++++++++++++++ backport-include/linux/thermal.h | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 backport-include/linux/suspend.h (limited to 'backport-include/linux') 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 -#if LINUX_VERSION_IS_GEQ(3,2,0) +#if LINUX_VERSION_IS_GEQ(3,1,0) #include_next #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/netdevice.h b/backport-include/linux/netdevice.h index d92c95a..af8185c 100644 --- a/backport-include/linux/netdevice.h +++ b/backport-include/linux/netdevice.h @@ -334,7 +334,7 @@ static inline void netif_trans_update(struct net_device *dev) (_dev)->needs_free_netdev = true; #endif -#if LINUX_VERSION_IS_LESS(4,14,0) +#if LINUX_VERSION_IN_RANGE(3,10,0, 4,13,0) static inline int _bp_netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev) { diff --git a/backport-include/linux/random.h b/backport-include/linux/random.h index 7d817d8..fa016cc 100644 --- a/backport-include/linux/random.h +++ b/backport-include/linux/random.h @@ -12,7 +12,9 @@ static inline void add_device_randomness(const void *buf, unsigned int size) } #endif -#if LINUX_VERSION_IS_LESS(3,8,0) +/* #if LINUX_VERSION_IS_LESS(3,8,0) */ +/* already backported in our kernels */ +#if 0 /* backports 496f2f9 */ #define prandom_seed(_seed) srandom32(_seed) #define prandom_u32() random32() diff --git a/backport-include/linux/suspend.h b/backport-include/linux/suspend.h new file mode 100644 index 0000000..6030718 --- /dev/null +++ b/backport-include/linux/suspend.h @@ -0,0 +1,14 @@ +#ifndef __BP_LINUX_SUSPEND_H +#define __BP_LINUX_SUSPEND_H +#include_next + +#if LINUX_VERSION_IS_LESS(3,18,0) +static inline void pm_system_wakeup(void) +{ +#if LINUX_VERSION_IS_GEQ(3,10,0) + freeze_wake(); +#endif +} +#endif + +#endif /* __BP_LINUX_SUSPEND_H */ 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 +#include + +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; -- cgit v1.2.3