diff options
author | Diwakar Tundlam <dtundlam@nvidia.com> | 2013-01-17 11:44:26 -0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 12:51:10 -0700 |
commit | bcdf3d9215d476626c1798a58e99e0fb5103416e (patch) | |
tree | 01f87a5744a4ade265b831fdaa78043ec1d4fa79 /arch | |
parent | 54d165536e4da85816c90aeb2802ad7b3cf77fc9 (diff) |
arm: tegra: edp changes due to thermal_trip_info use in driver
Bug 1200075
Change-Id: I96b01b1caa468c0d376e79b416aeb329e1cb0390
Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-on: http://git-master/r/190820
(cherry picked from commit bedff5775d6dab5870a777a1b5a1abfc9e23b033)
Reviewed-on: http://git-master/r/193896
Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/board-common.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-common.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-tegra/edp.c | 8 | ||||
-rw-r--r-- | arch/arm/mach-tegra/include/mach/edp.h | 10 |
4 files changed, 19 insertions, 20 deletions
diff --git a/arch/arm/mach-tegra/board-common.c b/arch/arm/mach-tegra/board-common.c index 4a178913ca16..db7e2576b306 100644 --- a/arch/arm/mach-tegra/board-common.c +++ b/arch/arm/mach-tegra/board-common.c @@ -2,7 +2,7 @@ * board-common.c: Implement function which is common across * different boards. * - * Copyright (c) 2011-2012, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2013, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -135,16 +135,17 @@ int uart_console_debug_init(int default_debug_port) return debug_port_id; } -static void tegra_add_trip_points(struct nct_trip_temp *trips, int *num_trips, +static void tegra_add_trip_points(struct thermal_trip_info *trips, + int *num_trips, struct tegra_cooling_device *cdev_data) { int i; - struct nct_trip_temp *trip_state; + struct thermal_trip_info *trip_state; if (!trips || !num_trips || !cdev_data) return; - if (*num_trips + cdev_data->trip_temperatures_num > NCT_MAX_TRIPS) { + if (*num_trips + cdev_data->trip_temperatures_num > THERMAL_MAX_TRIPS) { WARN(1, "%s: cooling device %s has too many trips\n", __func__, cdev_data->cdev_type); return; @@ -156,14 +157,14 @@ static void tegra_add_trip_points(struct nct_trip_temp *trips, int *num_trips, trip_state->cdev_type = cdev_data->cdev_type; trip_state->trip_temp = cdev_data->trip_temperatures[i] * 1000; trip_state->trip_type = THERMAL_TRIP_ACTIVE; - trip_state->state = i + 1; + trip_state->upper = trip_state->lower = i + 1; trip_state->hysteresis = 1000; (*num_trips)++; } } -void tegra_add_cdev_trips(struct nct_trip_temp *trips, int *num_trips) +void tegra_add_cdev_trips(struct thermal_trip_info *trips, int *num_trips) { tegra_add_trip_points(trips, num_trips, tegra_core_edp_get_cdev()); tegra_add_trip_points(trips, num_trips, tegra_dvfs_get_cpu_dfll_cdev()); diff --git a/arch/arm/mach-tegra/board-common.h b/arch/arm/mach-tegra/board-common.h index 760f923b405a..408552e786be 100644 --- a/arch/arm/mach-tegra/board-common.h +++ b/arch/arm/mach-tegra/board-common.h @@ -1,7 +1,7 @@ /* * board-common.h: Common function API declaration for all board files. * - * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,11 +21,11 @@ #ifndef __MACH_TEGRA_BOARD_COMMON_H #define __MACH_TEGRA_BOARD_COMMON_H -#include <linux/nct1008.h> -#include <mach/thermal.h> +#include <linux/thermal.h> +#include <linux/platform_data/thermal_sensors.h> extern struct platform_device *uart_console_debug_device; int uart_console_debug_init(int defaul_debug_port); int tegra_vibrator_init(void); -void tegra_add_cdev_trips(struct nct_trip_temp *trips, int *num_trips); +void tegra_add_cdev_trips(struct thermal_trip_info *trips, int *num_trips); #endif diff --git a/arch/arm/mach-tegra/edp.c b/arch/arm/mach-tegra/edp.c index eac569fb8f2c..63f454365a08 100644 --- a/arch/arm/mach-tegra/edp.c +++ b/arch/arm/mach-tegra/edp.c @@ -771,10 +771,10 @@ void tegra_get_system_edp_limits(const unsigned int **limits) *limits = system_edp_limits; } -void tegra_platform_edp_init(struct nct_trip_temp *trips, int *num_trips) +void tegra_platform_edp_init(struct thermal_trip_info *trips, int *num_trips) { const struct tegra_edp_limits *cpu_edp_limits; - struct nct_trip_temp *trip_state; + struct thermal_trip_info *trip_state; int i, cpu_edp_limits_size; if (!trips || !num_trips) @@ -793,12 +793,12 @@ void tegra_platform_edp_init(struct nct_trip_temp *trips, int *num_trips) trip_state->trip_temp = cpu_edp_limits[i].temperature * 1000; trip_state->trip_type = THERMAL_TRIP_ACTIVE; - trip_state->state = i + 1; + trip_state->upper = trip_state->lower = i + 1; trip_state->hysteresis = 1000; (*num_trips)++; - if (*num_trips >= NCT_MAX_TRIPS) + if (*num_trips >= THERMAL_MAX_TRIPS) BUG(); } } diff --git a/arch/arm/mach-tegra/include/mach/edp.h b/arch/arm/mach-tegra/include/mach/edp.h index 1dac2ae7b7a0..3d99eefcf061 100644 --- a/arch/arm/mach-tegra/include/mach/edp.h +++ b/arch/arm/mach-tegra/include/mach/edp.h @@ -1,7 +1,7 @@ /* * arch/arm/mach-tegra/include/mach/edp.h * - * Copyright (c) 2011, NVIDIA Corporation. + * Copyright (c) 2011-2013, NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ #include <linux/debugfs.h> #include <linux/edp.h> #include <linux/thermal.h> -#include <linux/nct1008.h> +#include <linux/platform_data/thermal_sensors.h> struct tegra_edp_vdd_cpu_entry { char speedo_id; @@ -76,8 +76,6 @@ struct tegra_core_edp_limits { unsigned long *cap_rates_scpu_off; }; -struct nct_trip_temp; - #ifdef CONFIG_TEGRA_EDP_LIMITS struct thermal_cooling_device *edp_cooling_device_create(void *v); void tegra_init_cpu_edp_limits(unsigned int regulator_mA); @@ -87,7 +85,7 @@ void tegra_get_cpu_edp_limits(const struct tegra_edp_limits **limits, int *size) unsigned int tegra_get_edp_limit(int *get_edp_thermal_index); void tegra_get_system_edp_limits(const unsigned int **limits); int tegra_system_edp_alarm(bool alarm); -void tegra_platform_edp_init(struct nct_trip_temp *trips, int *num_trips); +void tegra_platform_edp_init(struct thermal_trip_info *trips, int *num_trips); #else static inline struct thermal_cooling_device *edp_cooling_device_create( int index) @@ -107,7 +105,7 @@ static inline void tegra_get_system_edp_limits(unsigned int **limits) {} static inline int tegra_system_edp_alarm(bool alarm) { return -1; } -static inline void tegra_platform_edp_init(struct nct_trip_temp *trips, +static inline void tegra_platform_edp_init(struct thermal_trip_info *trips, int *num_trips) {} #endif |