From 51c4dfe933c2238d671630e979725b1684d3ae49 Mon Sep 17 00:00:00 2001 From: Bitan Biswas Date: Fri, 12 Aug 2011 14:56:17 +0530 Subject: hwmon: tegra: tsensor: fuse revision corrected tsensor functionality is enabled based on fuse revision. The fuse revision is to be interpreted as an unsigned integer while it is interpreted as a decimal number. Corrected this. bug 863460 Original-Change-Id: I42dbfe406c3ee5b016664410db1b916997e1fe60 Reviewed-on: http://git-master/r/46899 Reviewed-by: Varun Colbert Tested-by: Varun Colbert Rebase-Id: R52f072ab4fc835ae803f4e44fcca768c751d9e4c --- drivers/hwmon/tegra-tsensor.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'drivers/hwmon') diff --git a/drivers/hwmon/tegra-tsensor.c b/drivers/hwmon/tegra-tsensor.c index c28733f51e8c..025be5426b92 100644 --- a/drivers/hwmon/tegra-tsensor.c +++ b/drivers/hwmon/tegra-tsensor.c @@ -1615,16 +1615,22 @@ static int __devinit tegra_tsensor_probe(struct platform_device *pdev) goto err5; } + /* fuse revisions less than TSENSOR_FUSE_REVISION_DECIMAL_REV1 + bypass tsensor driver init */ /* tsensor active instance decided based on fuse revision */ err = tegra_fuse_get_revision(®); if (err) goto err6; - /* instance 1 is used for fuse revision 8 till 20 */ - /* instance 0 is used for fuse revision 21 onwards */ - if ((reg & 0xf) >= TSENSOR_FUSE_REVISION_DECIMAL_REV1) - tsensor_index = 1; - else if ((reg & 0xf) >= TSENSOR_FUSE_REVISION_DECIMAL_REV2) + /* check for higher revision done first */ + /* instance 0 is used for fuse revision + TSENSOR_FUSE_REVISION_DECIMAL_REV2 onwards */ + if (reg >= TSENSOR_FUSE_REVISION_DECIMAL_REV2) tsensor_index = 0; + /* instance 1 is used for fuse revision + TSENSOR_FUSE_REVISION_DECIMAL_REV1 till + TSENSOR_FUSE_REVISION_DECIMAL_REV2 */ + else if (reg >= TSENSOR_FUSE_REVISION_DECIMAL_REV1) + tsensor_index = 1; pr_info("tsensor active instance=%d\n", tsensor_index); /* tegra tsensor - setup and init */ -- cgit v1.2.3