]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
arm: tegra12: soctherm: use high precision mode
authorDiwakar Tundlam <dtundlam@nvidia.com>
Mon, 14 Oct 2013 19:08:52 +0000 (12:08 -0700)
committerDiwakar Tundlam <dtundlam@nvidia.com>
Fri, 18 Oct 2013 22:27:17 +0000 (15:27 -0700)
Enabling high precision mode for T12x as it supports high precision
temperature sensing with 0.5C resolution of temperatures and 1C
resolution of thresholds.

Bug 1291108

Change-Id: Ie4d9e1273f793c581e88e5061176f74e87e7cd00
Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-on: http://git-master/r/299047

arch/arm/mach-tegra/tegra11_soctherm.c

index 68b24cd4a6c844c59d3e01fb93f25eb1b6036278..82d05085f82f397cb0ce23b6b58c1752308e092d 100644 (file)
 #include "gpio-names.h"
 
 /* Min temp granularity specified as X in 2^X.
- * -1: Hi precision option: 2^-1 = 0.5C
+ * -1: Hi precision option: 2^-1 = 0.5C (T12x onwards)
  *  0: Lo precision option: 2^0  = 1.0C
- *  NB: We must use lower precision (0) due to cp_fuse corrections
- *  (see Sec9.2 T35_Thermal_Sensing_IAS.docx)
  */
+#ifdef CONFIG_ARCH_TEGRA_12x_SOC
+static const int precision = -1; /* Use high precision on T12x */
+#else
 static const int precision; /* default 0 -> low precision */
+#endif
+
 #define LOWER_PRECISION_FOR_CONV(val)  ((!precision) ? ((val)*2) : (val))
 #define LOWER_PRECISION_FOR_TEMP(val)  ((!precision) ? ((val)/2) : (val))
 #define PRECISION_IS_LOWER()           ((!precision))
@@ -2009,6 +2012,7 @@ static int soctherm_init_platform_data(void)
                sensor_defaults = default_t12x_sensor_params;
        else
                BUG();
+
        /* initialize default values for unspecified params */
        for (i = 0; i < TSENSE_SIZE; i++) {
                therm = &plat_data.therm[tsensor2therm_map[i]];