diff options
author | Joshua Primero <jprimero@nvidia.com> | 2012-11-20 15:54:31 -0800 |
---|---|---|
committer | Mrutyunjay Sawant <msawant@nvidia.com> | 2012-12-04 23:28:49 -0800 |
commit | 25a7d8d23616ca67e4486e8670d004e2628e3f5c (patch) | |
tree | d813db881e7beb7a285bd91908cd2e85c1fed86d /arch/arm/mach-tegra/board-roth-sensors.c | |
parent | 941b913b1f6898063d4a43f7c089b3a0bfec901c (diff) |
ARM: tegra: nct: Use new nct platform data
Utilize the updated nct platform data structure. Multiple active cooling
devices can also be used now.
Change-Id: I009b34d0156c679882040c86b9e583261617071a
Signed-off-by: Joshua Primero <jprimero@nvidia.com>
Reviewed-on: http://git-master/r/165189
Reviewed-by: Mrutyunjay Sawant <msawant@nvidia.com>
Tested-by: Mrutyunjay Sawant <msawant@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/board-roth-sensors.c')
-rw-r--r-- | arch/arm/mach-tegra/board-roth-sensors.c | 51 |
1 files changed, 31 insertions, 20 deletions
diff --git a/arch/arm/mach-tegra/board-roth-sensors.c b/arch/arm/mach-tegra/board-roth-sensors.c index aed266c2cf46..0103eadc30dc 100644 --- a/arch/arm/mach-tegra/board-roth-sensors.c +++ b/arch/arm/mach-tegra/board-roth-sensors.c @@ -90,15 +90,19 @@ static struct nct1008_platform_data roth_nct1008_pdata = { .shutdown_ext_limit = 90, /* C */ .shutdown_local_limit = 120, /* C */ - /* Thermal Throttling */ - .passive = { - .enable = true, - .type = "roth-nct", - .trip_temp = 80000, - .tc1 = 0, - .tc2 = 1, - .passive_delay = 2000, - } + .passive_delay = 2000, + + .num_trips = 1, + .trips = { + /* Thermal Throttling */ + [0] = { + .cdev_type = "roth-nct", + .trip_temp = 80000, + .trip_type = THERMAL_TRIP_PASSIVE, + .state = THERMAL_NO_LIMIT, + .hysteresis = 0, + }, + }, }; static struct nct1008_platform_data roth_nct1008_lr_pdata = { @@ -197,26 +201,33 @@ static int roth_nct1008_init(void) #ifdef CONFIG_TEGRA_EDP_LIMITS const struct tegra_edp_limits *cpu_edp_limits; - struct nct1008_cdev *active_cdev; int cpu_edp_limits_size; int i; + int trip; + struct nct1008_platform_data *data = &roth_nct1008_pdata; + struct nct_trip_temp *trip_state; /* edp capping */ tegra_get_cpu_edp_limits(&cpu_edp_limits, &cpu_edp_limits_size); - if ((cpu_edp_limits_size > MAX_THROT_TABLE_SIZE) || - (cpu_edp_limits_size > MAX_ACTIVE_TEMP_STATE)) + if (cpu_edp_limits_size > MAX_THROT_TABLE_SIZE) BUG(); - active_cdev = &roth_nct1008_pdata.active; - active_cdev->enable = true; - active_cdev->type = "edp"; - active_cdev->hysteresis = 1000; - for (i = 0; i < cpu_edp_limits_size-1; i++) { - active_cdev->states[i].trip_temp = - cpu_edp_limits[i].temperature * 1000; - active_cdev->states[i].state = i + 1; + trip = data->num_trips; + trip_state = &data->trips[trip]; + + trip_state->cdev_type = "edp"; + trip_state->trip_temp = + cpu_edp_limits[i].temperature * 1000; + trip_state->trip_type = THERMAL_TRIP_ACTIVE; + trip_state->state = i + 1; + trip_state->hysteresis = 1000; + + data->num_trips++; + + if (data->num_trips > NCT_MAX_TRIPS) + BUG(); } #endif |