diff options
author | Joshua Primero <jprimero@nvidia.com> | 2012-11-20 15:54:31 -0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 12:44:27 -0700 |
commit | d0923a3674fe01a53ecdeb35223fc4d43c975696 (patch) | |
tree | 1ca9bd29312f71e9fba775409bc505395b700101 | |
parent | c3aaad45e3b1799e9ebcce7bb7e6142cefde7e20 (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>
-rw-r--r-- | arch/arm/mach-tegra/board-dalmore-sensors.c | 51 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-pluto-sensors.c | 51 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-roth-sensors.c | 51 |
3 files changed, 93 insertions, 60 deletions
diff --git a/arch/arm/mach-tegra/board-dalmore-sensors.c b/arch/arm/mach-tegra/board-dalmore-sensors.c index aff2e5504dba..57deb4080e25 100644 --- a/arch/arm/mach-tegra/board-dalmore-sensors.c +++ b/arch/arm/mach-tegra/board-dalmore-sensors.c @@ -103,15 +103,19 @@ static struct nct1008_platform_data dalmore_nct1008_pdata = { .shutdown_ext_limit = 90, /* C */ .shutdown_local_limit = 120, /* C */ - /* Thermal Throttling */ - .passive = { - .enable = true, - .type = "dalmore-nct", - .trip_temp = 80000, - .tc1 = 0, - .tc2 = 1, - .passive_delay = 2000, - } + .passive_delay = 2000, + + .num_trips = 1, + .trips = { + /* Thermal Throttling */ + [0] = { + .cdev_type = "dalmore-nct", + .trip_temp = 80000, + .trip_type = THERMAL_TRIP_PASSIVE, + .state = THERMAL_NO_LIMIT, + .hysteresis = 0, + }, + }, }; static struct i2c_board_info dalmore_i2c4_nct1008_board_info[] = { @@ -573,26 +577,33 @@ static int dalmore_nct1008_init(void) if (nct1008_port >= 0) { #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 = &dalmore_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 = &dalmore_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 diff --git a/arch/arm/mach-tegra/board-pluto-sensors.c b/arch/arm/mach-tegra/board-pluto-sensors.c index 20ce651a20e9..ec6a325c0e06 100644 --- a/arch/arm/mach-tegra/board-pluto-sensors.c +++ b/arch/arm/mach-tegra/board-pluto-sensors.c @@ -280,15 +280,19 @@ static struct nct1008_platform_data pluto_nct1008_pdata = { .shutdown_ext_limit = 90, /* C */ .shutdown_local_limit = 120, /* C */ - /* Thermal Throttling */ - .passive = { - .enable = true, - .type = "pluto-nct", - .trip_temp = 80000, - .tc1 = 0, - .tc2 = 1, - .passive_delay = 2000, - } + .passive_delay = 2000, + + .num_trips = 1, + .trips = { + /* Thermal Throttling */ + [0] = { + .cdev_type = "pluto-nct", + .trip_temp = 80000, + .trip_type = THERMAL_TRIP_PASSIVE, + .state = THERMAL_NO_LIMIT, + .hysteresis = 0, + }, + }, }; static struct i2c_board_info pluto_i2c4_nct1008_board_info[] = { @@ -718,26 +722,33 @@ static int pluto_nct1008_init(void) if (nct1008_port >= 0) { #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 = &pluto_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 = &pluto_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 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 |