diff options
-rw-r--r-- | arch/arm/mach-tegra/board-ardbeg-power.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-ardbeg-sensors.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-loki-power.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-norrin-power.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-tegra/tegra11_soctherm.c | 10 | ||||
-rw-r--r-- | drivers/misc/tegra-fuse/tegra11x_fuse_offsets.h | 52 | ||||
-rw-r--r-- | drivers/misc/tegra-fuse/tegra12x_fuse_offsets.h | 8 |
7 files changed, 46 insertions, 52 deletions
diff --git a/arch/arm/mach-tegra/board-ardbeg-power.c b/arch/arm/mach-tegra/board-ardbeg-power.c index a5343abdd1da..08ed22817cf2 100644 --- a/arch/arm/mach-tegra/board-ardbeg-power.c +++ b/arch/arm/mach-tegra/board-ardbeg-power.c @@ -717,8 +717,7 @@ static struct soctherm_throttle voltmon_throttle = { int __init ardbeg_soctherm_init(void) { - s32 base_cp, shft_cp; - u32 base_ft, shft_ft; + int cp_rev, ft_rev; struct board_info pmu_board_info; struct board_info board_info; enum soctherm_therm_id therm_cpu; @@ -731,6 +730,9 @@ int __init ardbeg_soctherm_init(void) ardbeg_therm_pop, sizeof(ardbeg_therm_pop)); } + cp_rev = tegra_fuse_calib_base_get_cp(NULL, NULL); + ft_rev = tegra_fuse_calib_base_get_ft(NULL, NULL); + /* Bowmore and P1761 are T132 platforms: ATE rev check (TODO) */ if (board_info.board_id == BOARD_E1971 || board_info.board_id == BOARD_P1761 || @@ -747,8 +749,7 @@ int __init ardbeg_soctherm_init(void) } /* do this only for supported CP,FT fuses */ - if ((tegra_fuse_calib_base_get_cp(&base_cp, &shft_cp) >= 0) && - (tegra_fuse_calib_base_get_ft(&base_ft, &shft_ft) >= 0)) { + if ((cp_rev >= 0) && (ft_rev >= 0)) { tegra_platform_edp_init( ardbeg_soctherm_data.therm[therm_cpu].trips, &ardbeg_soctherm_data.therm[therm_cpu].num_trips, diff --git a/arch/arm/mach-tegra/board-ardbeg-sensors.c b/arch/arm/mach-tegra/board-ardbeg-sensors.c index d720850f2eec..c22b74c277e6 100644 --- a/arch/arm/mach-tegra/board-ardbeg-sensors.c +++ b/arch/arm/mach-tegra/board-ardbeg-sensors.c @@ -1673,8 +1673,6 @@ static struct i2c_board_info ardbeg_i2c_nct72_board_info[] = { static int ardbeg_nct72_init(void) { - s32 base_cp, shft_cp; - u32 base_ft, shft_ft; int nct72_port = TEGRA_GPIO_PI6; int ret = 0; int i; @@ -1683,8 +1681,8 @@ static int ardbeg_nct72_init(void) tegra_get_board_info(&board_info); /* raise NCT's thresholds if soctherm CP,FT fuses are ok */ - if ((tegra_fuse_calib_base_get_cp(&base_cp, &shft_cp) >= 0) && - (tegra_fuse_calib_base_get_ft(&base_ft, &shft_ft) >= 0)) { + if ((tegra_fuse_calib_base_get_cp(NULL, NULL) >= 0) && + (tegra_fuse_calib_base_get_ft(NULL, NULL) >= 0)) { ardbeg_nct72_pdata.sensors[EXT].shutdown_limit += 20; for (i = 0; i < ardbeg_nct72_pdata.sensors[EXT].num_trips; i++) { diff --git a/arch/arm/mach-tegra/board-loki-power.c b/arch/arm/mach-tegra/board-loki-power.c index 18565d4763b4..fa39f36cc8a9 100644 --- a/arch/arm/mach-tegra/board-loki-power.c +++ b/arch/arm/mach-tegra/board-loki-power.c @@ -1038,12 +1038,9 @@ static struct soctherm_platform_data loki_soctherm_data = { int __init loki_soctherm_init(void) { - s32 base_cp, shft_cp; - u32 base_ft, shft_ft; - /* do this only for supported CP,FT fuses */ - if ((tegra_fuse_calib_base_get_cp(&base_cp, &shft_cp) >= 0) && - (tegra_fuse_calib_base_get_ft(&base_ft, &shft_ft) >= 0)) { + if ((tegra_fuse_calib_base_get_cp(NULL, NULL) >= 0) && + (tegra_fuse_calib_base_get_ft(NULL, NULL) >= 0)) { tegra_platform_edp_init( loki_soctherm_data.therm[THERM_CPU].trips, &loki_soctherm_data.therm[THERM_CPU].num_trips, diff --git a/arch/arm/mach-tegra/board-norrin-power.c b/arch/arm/mach-tegra/board-norrin-power.c index 78709dcf818a..4afd7c760b9f 100644 --- a/arch/arm/mach-tegra/board-norrin-power.c +++ b/arch/arm/mach-tegra/board-norrin-power.c @@ -285,8 +285,6 @@ static struct soctherm_platform_data norrin_soctherm_data = { int __init norrin_soctherm_init(void) { - s32 base_cp, shft_cp; - u32 base_ft, shft_ft; struct board_info pmu_board_info; struct board_info board_info; enum soctherm_therm_id therm_cpu; @@ -297,8 +295,8 @@ int __init norrin_soctherm_init(void) therm_cpu = THERM_PLL; /* do this only for supported CP,FT fuses */ - if ((tegra_fuse_calib_base_get_cp(&base_cp, &shft_cp) >= 0) && - (tegra_fuse_calib_base_get_ft(&base_ft, &shft_ft) >= 0)) { + if ((tegra_fuse_calib_base_get_cp(NULL, NULL) >= 0) && + (tegra_fuse_calib_base_get_ft(NULL, NULL) >= 0)) { tegra_platform_edp_init( norrin_soctherm_data.therm[therm_cpu].trips, &norrin_soctherm_data.therm[therm_cpu].num_trips, diff --git a/arch/arm/mach-tegra/tegra11_soctherm.c b/arch/arm/mach-tegra/tegra11_soctherm.c index 8ef29964fcc6..351bb854b7e5 100644 --- a/arch/arm/mach-tegra/tegra11_soctherm.c +++ b/arch/arm/mach-tegra/tegra11_soctherm.c @@ -1447,12 +1447,10 @@ static int soctherm_bind(struct thermal_zone_device *thz, int i; struct soctherm_therm *therm = thz->devdata; struct thermal_trip_info *trip_state; - u32 base_cp, base_ft; - s32 shft_cp, shft_ft; /* skip binding cooling devices on improperly fused soctherm */ - if (tegra_fuse_calib_base_get_cp(&base_cp, &shft_cp) < 0 || - tegra_fuse_calib_base_get_ft(&base_ft, &shft_ft) < 0) + if (tegra_fuse_calib_base_get_cp(NULL, NULL) < 0 || + tegra_fuse_calib_base_get_ft(NULL, NULL) < 0) return 0; for (i = 0; i < therm->num_trips; i++) { @@ -2753,11 +2751,9 @@ static int soctherm_fuse_read_tsensor(enum soctherm_sense sensor) s16 therm_a, therm_b; s32 div, mult, actual_tsensor_ft, actual_tsensor_cp; int fuse_rev; - u32 base_cp; - s32 shft_cp; struct soctherm_fuse_correction_war *war; - fuse_rev = tegra_fuse_calib_base_get_cp(&base_cp, &shft_cp); + fuse_rev = tegra_fuse_calib_base_get_cp(NULL, NULL); if (fuse_rev < 0) return fuse_rev; pr_debug("%s: fuse_rev %d\n", __func__, fuse_rev); diff --git a/drivers/misc/tegra-fuse/tegra11x_fuse_offsets.h b/drivers/misc/tegra-fuse/tegra11x_fuse_offsets.h index 38495300dc3d..1507d845ea07 100644 --- a/drivers/misc/tegra-fuse/tegra11x_fuse_offsets.h +++ b/drivers/misc/tegra-fuse/tegra11x_fuse_offsets.h @@ -229,19 +229,21 @@ int tegra_fuse_calib_base_get_cp(u32 *base_cp, s32 *shifted_cp) s32 cp; u32 val = tegra_fuse_readl(FUSE_VSENSOR_CALIB_0); - *base_cp = (((val) & - (FUSE_BASE_CP_MASK << FUSE_BASE_CP_SHIFT)) - >> FUSE_BASE_CP_SHIFT); - if (!(*base_cp)) { - pr_err("soctherm: ERROR: Improper FUSE. SOC_THERM disabled.\n"); + if (!val) return -EINVAL; - } - cp = (((val) & - (FUSE_SHIFT_CP_MASK << FUSE_SHIFT_CP_SHIFT)) - >> FUSE_SHIFT_CP_SHIFT); - *shifted_cp = ((s32)(cp) << - (32 - FUSE_SHIFT_CP_BITS) >> - (32 - FUSE_SHIFT_CP_BITS)); + + if (base_cp) + *base_cp = (((val) & (FUSE_BASE_CP_MASK + << FUSE_BASE_CP_SHIFT)) + >> FUSE_BASE_CP_SHIFT); + + cp = (((val) & (FUSE_SHIFT_CP_MASK + << FUSE_SHIFT_CP_SHIFT)) + >> FUSE_SHIFT_CP_SHIFT); + if (shifted_cp) + *shifted_cp = ((s32)(cp) + << (32 - FUSE_SHIFT_CP_BITS) + >> (32 - FUSE_SHIFT_CP_BITS)); return 0; } @@ -250,19 +252,21 @@ int tegra_fuse_calib_base_get_ft(u32 *base_ft, s32 *shifted_ft) s32 ft; u32 val = tegra_fuse_readl(FUSE_VSENSOR_CALIB_0); - *base_ft = (((val) & - (FUSE_BASE_FT_MASK << FUSE_BASE_FT_SHIFT)) - >> FUSE_BASE_FT_SHIFT); - if (!(*base_ft)) { - pr_err("soctherm: ERROR: Improper FUSE. SOC_THERM disabled.\n"); + if (!val) return -EINVAL; - } - ft = (((val) & - (FUSE_SHIFT_FT_MASK << FUSE_SHIFT_FT_SHIFT)) - >> FUSE_SHIFT_FT_SHIFT); - *shifted_ft = ((s32)(ft) << - (32 - FUSE_SHIFT_FT_BITS) >> - (32 - FUSE_SHIFT_FT_BITS)); + + if (base_ft) + *base_ft = (((val) & (FUSE_BASE_FT_MASK + << FUSE_BASE_FT_SHIFT)) + >> FUSE_BASE_FT_SHIFT); + + ft = (((val) & (FUSE_SHIFT_FT_MASK + << FUSE_SHIFT_FT_SHIFT)) + >> FUSE_SHIFT_FT_SHIFT); + if (shifted_ft) + *shifted_ft = ((s32)(ft) << + (32 - FUSE_SHIFT_FT_BITS) >> + (32 - FUSE_SHIFT_FT_BITS)); return 0; } diff --git a/drivers/misc/tegra-fuse/tegra12x_fuse_offsets.h b/drivers/misc/tegra-fuse/tegra12x_fuse_offsets.h index 3d54bb888f20..432a6d26d35c 100644 --- a/drivers/misc/tegra-fuse/tegra12x_fuse_offsets.h +++ b/drivers/misc/tegra-fuse/tegra12x_fuse_offsets.h @@ -345,8 +345,8 @@ int tegra_fuse_calib_base_get_cp(u32 *base_cp, s32 *shifted_cp) if (base_cp) *base_cp = (((val) & (FUSE_BASE_CP_MASK - << FUSE_BASE_CP_SHIFT)) - >> FUSE_BASE_CP_SHIFT); + << FUSE_BASE_CP_SHIFT)) + >> FUSE_BASE_CP_SHIFT); val = tegra_fuse_readl(FUSE_SPARE_REALIGNMENT_REG_0); cp = (((val) & (FUSE_SHIFT_CP_MASK @@ -387,8 +387,8 @@ int tegra_fuse_calib_base_get_ft(u32 *base_ft, s32 *shifted_ft) if (base_ft) *base_ft = (((val) & (FUSE_BASE_FT_MASK - << FUSE_BASE_FT_SHIFT)) - >> FUSE_BASE_FT_SHIFT); + << FUSE_BASE_FT_SHIFT)) + >> FUSE_BASE_FT_SHIFT); ft_or_cp2 = (((val) & (FUSE_SHIFT_FT_MASK << FUSE_SHIFT_FT_SHIFT)) |