arm: tegra: thermal: Added name per therm device
Joshua Primero [Fri, 16 Dec 2011 19:09:50 +0000 (11:09 -0800)]
Added name paramater per therm device so that is
easy to tell which therm device is being used
from sysfs

Change-Id: I58488b4c50ac6dc58dc00e270b613458f61a9fd6
Signed-off-by: Joshua Primero <jprimero@nvidia.com>
Reviewed-on: http://git-master/r/70929
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>

arch/arm/mach-tegra/board-cardhu-sensors.c
arch/arm/mach-tegra/board-enterprise-sensors.c
arch/arm/mach-tegra/include/mach/thermal.h
arch/arm/mach-tegra/tegra3_thermal.c
arch/arm/mach-tegra/tegra3_tsensor.c

index e8c3b33..7f3484a 100644 (file)
@@ -572,6 +572,7 @@ static void nct1008_probe_callback(struct nct1008_data *data)
                return;
        }
 
+       thermal_device->name = "nct1008";
        thermal_device->data = data;
        thermal_device->offset = TDIODE_OFFSET;
        thermal_device->get_temp = nct_get_temp;
index 14c5260..889348d 100644 (file)
@@ -94,6 +94,7 @@ static void nct1008_probe_callback(struct nct1008_data *data)
                return;
        }
 
+       thermal_device->name = "nct1008";
        thermal_device->data = data;
        thermal_device->offset = TDIODE_OFFSET;
        thermal_device->get_temp = nct_get_temp;
index 714b633..b46dcb8 100644 (file)
@@ -36,6 +36,7 @@ struct tegra_thermal_data {
 };
 
 struct tegra_thermal_device {
+       char *name;
        void *data;
        long offset;
        int (*get_temp) (void *, long *);
index 8d310cc..16bf655 100644 (file)
@@ -291,7 +291,7 @@ int tegra_thermal_set_device(struct tegra_thermal_device *device)
        thermal_state.device = device;
 
 #ifdef CONFIG_TEGRA_THERMAL_SYSFS
-       thz = thermal_zone_device_register("thermal",
+       thz = thermal_zone_device_register(thermal_state.device->name,
                                        1, /* trips */
                                        &thermal_state,
                                        &tegra_thermal_zone_ops,
index a516073..9e027c8 100644 (file)
@@ -98,6 +98,7 @@ static void tegra3_tsensor_probe_callback(struct tegra_tsensor_data *data)
                return;
        }
 
+       thermal_device->name = "tsensor";
        thermal_device->data = data;
        thermal_device->offset = TSENSOR_OFFSET;
        thermal_device->get_temp = tsensor_get_temp;