ARM: tegra: nct: Use new nct platform data
[linux-3.10.git] / arch / arm / mach-tegra / board-roth-sensors.c
index aed266c..0103ead 100644 (file)
@@ -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