]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
thermal: Update THERMAL_MAX_TRIPS to 48
authorSai Gurrappadi <sgurrappadi@nvidia.com>
Fri, 8 Nov 2013 01:51:45 +0000 (17:51 -0800)
committerDiwakar Tundlam <dtundlam@nvidia.com>
Sat, 16 Nov 2013 00:45:04 +0000 (16:45 -0800)
Also changed mask field from int to u64 to support the larger trip point
number.

Change-Id: I5ab2b381de8094ed0477998ec300164b51e81d7f
Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/327982
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
arch/arm/mach-tegra/tegra11_soctherm.c
drivers/misc/nct1008.c
drivers/misc/therm_est.c
drivers/thermal/thermal_core.c
include/linux/thermal.h

index 0ef2dda0d67ee9f56b01746b308b87fcebee02c7..ebe86a505a4fb813c96950934266eadfbd4880e8 100644 (file)
@@ -1312,7 +1312,7 @@ static int __init soctherm_thermal_sys_init(void)
                thz[i] = thermal_zone_device_register(
                                        name,
                                        therm->num_trips,
-                                       (1 << therm->num_trips) - 1,
+                                       (1ULL << therm->num_trips) - 1,
                                        (void *)TSENSE_SIZE + i,
                                        &soctherm_ops,
                                        therm->tzp,
index 32a62f474343fa6b480cc22d5ea8aea4280339cf..b25342d9341001adbd5b4117bddbc94a792f72e1 100644 (file)
@@ -1185,7 +1185,7 @@ static int nct1008_probe(struct i2c_client *client,
        struct nct1008_data *data;
        int err;
        int i;
-       int mask = 0;
+       u64 mask = 0;
        char nct_int_name[THERMAL_NAME_LENGTH];
        char nct_ext_name[THERMAL_NAME_LENGTH];
 
@@ -1242,7 +1242,7 @@ static int nct1008_probe(struct i2c_client *client,
        for (i = 0; i < data->plat_data.num_trips; i++)
                if (strcmp(data->plat_data.trips[i].cdev_type,
                                                "shutdown_warning"))
-                       mask |= (1 << i);
+                       mask |= (1ULL << i);
 
        if (data->plat_data.loc_name) {
                strcpy(nct_int_name, "Tboard_");
index b0c09f4fd5b684a167596a9dbafb51fff17059d7..351e9493b9f38149706bb3b2129d0fad73499203 100644 (file)
@@ -743,7 +743,7 @@ static int therm_est_probe(struct platform_device *pdev)
 
        est->thz = thermal_zone_device_register(dev_name(&pdev->dev),
                                                est->num_trips,
-                                               (1 << est->num_trips) - 1,
+                                               (1ULL << est->num_trips) - 1,
                                                est,
                                                &therm_est_ops,
                                                est->tzp,
index 81c306466ea515343c4d42384922f7311fb8cc31..77625099df623304b5f1986925d252ef18f4c485 100644 (file)
@@ -210,13 +210,13 @@ static void print_bind_err_msg(struct thermal_zone_device *tz,
                                tz->type, cdev->type, ret);
 }
 
-static void __bind(struct thermal_zone_device *tz, int mask,
+static void __bind(struct thermal_zone_device *tz, u64 mask,
                        struct thermal_cooling_device *cdev)
 {
        int i, ret;
 
        for (i = 0; i < tz->trips; i++) {
-               if (mask & (1 << i)) {
+               if (mask & (1ULL << i)) {
                        ret = thermal_zone_bind_cooling_device(tz, i, cdev,
                                        THERMAL_NO_LIMIT, THERMAL_NO_LIMIT);
                        if (ret)
@@ -225,13 +225,13 @@ static void __bind(struct thermal_zone_device *tz, int mask,
        }
 }
 
-static void __unbind(struct thermal_zone_device *tz, int mask,
+static void __unbind(struct thermal_zone_device *tz, u64 mask,
                        struct thermal_cooling_device *cdev)
 {
        int i;
 
        for (i = 0; i < tz->trips; i++)
-               if (mask & (1 << i))
+               if (mask & (1ULL << i))
                        thermal_zone_unbind_cooling_device(tz, i, cdev);
 }
 
@@ -1623,7 +1623,7 @@ EXPORT_SYMBOL(thermal_zone_device_find_by_name);
  *
  * Return: 0 on success, the proper error value otherwise.
  */
-static int create_trip_attrs(struct thermal_zone_device *tz, int mask)
+static int create_trip_attrs(struct thermal_zone_device *tz, u64 mask)
 {
        int indx;
        int size = sizeof(struct thermal_attr) * tz->trips;
@@ -1671,7 +1671,7 @@ static int create_trip_attrs(struct thermal_zone_device *tz, int mask)
                                                tz->trip_temp_attrs[indx].name;
                tz->trip_temp_attrs[indx].attr.attr.mode = S_IRUGO;
                tz->trip_temp_attrs[indx].attr.show = trip_point_temp_show;
-               if (mask & (1 << indx)) {
+               if (mask & (1ULL << indx)) {
                        tz->trip_temp_attrs[indx].attr.attr.mode |= S_IWUSR;
                        tz->trip_temp_attrs[indx].attr.store =
                                                        trip_point_temp_store;
@@ -1746,7 +1746,7 @@ static void remove_trip_attrs(struct thermal_zone_device *tz)
  * IS_ERR*() helpers.
  */
 struct thermal_zone_device *thermal_zone_device_register(const char *type,
-       int trips, int mask, void *devdata,
+       int trips, u64 mask, void *devdata,
        const struct thermal_zone_device_ops *ops,
        const struct thermal_zone_params *tzp,
        int passive_delay, int polling_delay)
index bb5c44040f240b37ddc5e9a74b49f5bcbc21d37a..1b7c812ff2a4ffff35950d4cb5e89af00a867b10 100644 (file)
@@ -30,7 +30,7 @@
 #include <linux/workqueue.h>
 
 #define THERMAL_TRIPS_NONE     -1
-#define THERMAL_MAX_TRIPS      32
+#define THERMAL_MAX_TRIPS      48
 #define THERMAL_NAME_LENGTH    20
 
 /* invalid cooling state */
@@ -217,7 +217,7 @@ struct thermal_bind_params {
         * thermal zone and cdev, for a particular trip point.
         * See Documentation/thermal/sysfs-api.txt for more information.
         */
-       int trip_mask;
+       u64 trip_mask;
        int (*match) (struct thermal_zone_device *tz,
                        struct thermal_cooling_device *cdev);
 };
@@ -237,7 +237,7 @@ struct thermal_genl_event {
 };
 
 /* Function declarations */
-struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
+struct thermal_zone_device *thermal_zone_device_register(const char *, int, u64,
                void *, const struct thermal_zone_device_ops *,
                const struct thermal_zone_params *, int, int);
 void thermal_zone_device_unregister(struct thermal_zone_device *);