summaryrefslogtreecommitdiff
path: root/drivers/hwmon/tegra-tsensor.c
AgeCommit message (Collapse)Author
2012-08-23hwmon: tegra: tsensor:Fix compilation errorNagaraja Kolur
Bug 1024886 Resolved compilation error for unused code. Signed-off-by: Nagaraja Kolur <nkolur@nvidia.com> Change-Id: I9167d8129a9cba0fc6cb203180e07192d66db439 Reviewed-on: http://git-master/r/120581 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Nagaraj Kolur <nkolur@nvidia.com> Tested-by: Nagaraj Kolur <nkolur@nvidia.com> Reviewed-by: Vijaya Bhaskar <vbhaskar@nvidia.com> Reviewed-by: Wahed Syed <wsyed@nvidia.com> Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com>
2012-07-16hwmon: tegra: tsensor:Simplify counter calculationDaniel Fu
Simplify the temp to counter conversion in tsensor, Also it can improve a little bit accuracy of temp to counter conversion. Change-Id: I5764334d5d94e317dd9400bc03cb5d7a64096ee0 Signed-off-by: Daniel Fu <danifu@nvidia.com> Reviewed-on: http://git-master/r/115340 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2012-07-12hwmon: tegra: tsensor: improve counter accuracyDaniel Fu
When set threshold of tsensor,convert the temp to counter. The counter convert from temp is with ~1.8C average error. Improved the accuracy, make it to be ~0.1C. Bug 1015288 Change-Id: Icab03b559eaeb8846dd1191869afe39c9965f934 Signed-off-by: Daniel Fu <danifu@nvidia.com> Reviewed-on: http://git-master/r/114904 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2012-07-09hwmon: tsensor: fix system hang in 0C.Linqiang Pu
Changed the low temp to 0C since 20C is very easy to trigger thermal alert under -15C to 15C environment temperature. And the thermal alert will run into endless alert from tsensor_work_func. Also revised suspend and resume routine to cancel the work when suspending and disable/enable irq. Bug 999175 Signed-off-by: Linqiang Pu <dpu@nvidia.com> (cherry picked from commit 6a909bfa690991438be298d4933946a92e4929c4) Change-Id: Icafc6d5f0164204cc0cb7bea64bef2fadadbfbfd Reviewed-on: http://git-master/r/111550 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
2012-07-09hwmon: tegra: improve tsensor accuracyBitan Biswas
tsensor driver uses fixed point approximations. Improved accuracy of tsensor temperature reading - adding support to handle negative temperature to counter conversions and vice-versa bug 1001632 bug 999175 Signed-off-by: Bitan Biswas <bbiswas@nvidia.com> (cherry picked from commit 86ae0bdc3fbd34a5a1d0e08f7721ed527ddf5408) Change-Id: I5f6df85611d502a6dda1186234078fe973d7ca75 Reviewed-on: http://git-master/r/100576 Tested-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2012-04-19drivers: resolve compilation time warningsSanjay Singh Rawat
bug 949219 Change-Id: I5942ba86bd1cbe1f1bd06a7c9f51a10d83e6cabb Signed-off-by: Sanjay Singh Rawat <srawat@nvidia.com> Reviewed-on: http://git-master/r/92819 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
2012-04-13drivers: hwmon: tsensor: Enable tsensor hw resetJoshua Primero
Enabled hw reset in tsensor if temperature exceeds given temperature limit. bug 966994 Change-Id: I2444c97c97c45b2d190a224388876d592d983c7f Signed-off-by: Joshua Primero <jprimero@nvidia.com> Reviewed-on: http://git-master/r/93030 Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User
2012-02-27drivers: tsensor: added tsensor low temp interfaceJoshua Primero
Added function to retrieve tsensor driver's lowest temperature support Signed-off-by: Joshua Primero <jprimero@nvidia.com> Reviewed-on: http://git-master/r/70931 (cherry picked from commit f81c5b945b2104969fd1a391d0e5df8f0900710d) Change-Id: I8bf3f7c7fb3ab4730bfb6700b2ae5edec44c7da2 Reviewed-on: http://git-master/r/85960 Reviewed-by: Joshua Primero <jprimero@nvidia.com> Tested-by: Joshua Primero <jprimero@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2012-01-24hwmon: tsensor: Only enable one sensorJoshua Primero
Only enable one sensor at a time to save power. bug 928188 Reviewed-on: http://git-master/r/76025 Change-Id: I1d3c21783cbe579568ff9e9ef3ce2e48220e7edb Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Signed-off-by: Joshua Primero <jprimero@nvidia.com> Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/76823 Reviewed-by: Automatic_Commit_Validation_User
2011-12-21hwmon: tegra: tsensor: enabled probe callbackJoshua Primero
Enabled probe callback in probe function now that callback function parameter was added to tsensor data structure. Reviewed-on: http://git-master/r/62022 (cherry picked from commit 388f5aa8ac8b84bf247db8ebd3dcd05b2788b3d5) Reviewed-on: http://git-master/r/64560 (cherry picked from commit c58aad90a5226b1a13c4e5397de800d5d7fdfa84) Change-Id: I4cd66ebdf33e54048166207ab7012e4b74b5350d Signed-off-by: Joshua Primero <jprimero@nvidia.com> Reviewed-on: http://git-master/r/67239 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2011-12-21hwmon: tegra: tsensor: EDP support for tsensorJoshua Primero
Added support for EDP in tsensor. Since low limit interrupts are not supported in hardware TH2 was used for upper limit and TH0/TH1 as lower limit. Also added generic functions to enable tsensor for thermal refactoring. Bug 912597 Change-Id: I8f1e126e1fe11c69aa03dee0a20a26ef2b7dc6a0 Signed-off-by: Joshua Primero <jprimero@nvidia.com> Reviewed-on: http://git-master/r/66554 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Colin McCabe <cmccabe@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2011-11-30hwmon: tegra-tsensor: minor cleanupColin Patrick McCabe
* when outputting to sysfs, we only have to worry about not overflowing a single page in memory. * don't use strcat * avoid passing data between functions by mutating global strings Change-Id: I8914a9ee282c63a4259c1bcaf9e550328a5664ec Signed-off-by: Colin Patrick McCabe <cmccabe@nvidia.com> Reviewed-on: http://git-master/r/63672 Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Rebase-Id: Rd3426d0c534a846624a4d55be851a88c67ba6d67
2011-11-30hwmon: tegra: tsensor: coefficient updateBitan Biswas
m, n and p coefficients updated for fuse revision 21 and beyond. - code cleanup done. fixed checkpatch warnings. bug 842208 Reviewed-on: http://git-master/r/53808 (cherry picked from commit 488785f279a5642fffde3d48d62c77f46a20b63a) Reviewed-on: http://git-master/r/55026 (cherry picked from commit 49a5b4cf51ed43e2a9d25a2603e84ed835446832) Change-Id: I83db5a746d5960c799fbf09e2334ecc608c44d39 Reviewed-on: http://git-master/r/57367 Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Tested-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Rebase-Id: R49c36a57132c60260e1ab9d9f2aa68bf3602c962
2011-11-30hwmon: tegra: tsensor: newer revision supportBitan Biswas
Tsensor driver had support for chip revisions 1 and 2 only. Updated the driver to support later chip revisions. - Additionally error handling code corrected bug 864922 Original-Change-Id: I58230b7aa6c343930739f27bcc26e129092a9b4d Reviewed-on: http://git-master/r/47728 Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Tested-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Hanumanth Venkateswa Moganty <vmoganty@nvidia.com> Rebase-Id: Rc4cd2ebc90e7e6cbfd48bdcade89c02626a2629c
2011-11-30hwmon: tegra: tsensor: more error printsBitan Biswas
In case of tsensor probe failure in temperature calculation sanity test step, added more prints. bug 865024 Original-Change-Id: Ie74b25cc162fc17c83127d832c14dbd1c603a8e5 Reviewed-on: http://git-master/r/47518 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: Rec20a2726eae6e0779761beb6510f59ef3aab6f1
2011-11-30hwmon: tegra: tsensor: fuse revision correctedBitan Biswas
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 <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R52f072ab4fc835ae803f4e44fcca768c751d9e4c
2011-11-30hwmon: tegra: tsensor: resume delay removedBitan Biswas
tsensor resume was taking ~20msec because of msleep call. Removed the unnecessary delay. bug 862265 Original-Change-Id: I6138a5cd1f19e947cdbfdc8e8d0d236e7c3c8824 Reviewed-on: http://git-master/r/46683 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R047a7044707b35fc4e1743f2272aef7e275e92a1
2011-11-30hwmon: tegra: tsensor: error propagationBitan Biswas
tsensor probe was not propagating error from a called function. Later suspend/resume was getting called causing crash. Fixed the code. bug 863316 Original-Change-Id: I1851d75aeeee332bc582fe45fd7c1c8f0521b5c7 Reviewed-on: http://git-master/r/46890 Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Tested-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com> Rebase-Id: R77a15193c8ae51746ff477f3d877825dd81ecd34
2011-11-30hwmon: tegra: tsensor: log messages reformattedBitan Biswas
Formatted the tsensor driver log message's new line location to match prints from other drivers. bug 860513 Original-Change-Id: I4a03ecce246ac9847fb1562159bfd9cbcf95ab14 Reviewed-on: http://git-master/r/45501 Tested-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Rebase-Id: R1f3169b9a05d51ddb81d5066d78afc342f2199fb
2011-11-30hwmon: tegra: tsensor: disable hardware resetBitan Biswas
Hardware reset and clock divide feature of tsensor is disabled as the temperature readings are not accurate. Incorrect threshold calculations and temperature readings are seen to show tsensor reset during boot up. bug 860513 Original-Change-Id: Ib64259f3e400eddde54056dae495983930b5c107 Reviewed-on: http://git-master/r/45487 Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Tested-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com> Reviewed-by: Hanumanth Venkateswa Moganty <vmoganty@nvidia.com> Rebase-Id: R01841af1297ed369ea52e6207358cc13296c93e3
2011-11-30hwmon: tegra: tsensor: creating sys nodes under hwmonvenu byravarasu
Though tsensor driver was registered as hwmon driver, sys nodes were not geting created under /sys/class/hwmon. Hence fixing it. bug 858158 Original-Change-Id: I6ca226c2a22385c4d0d9ef747267ab0e3060d905 Reviewed-on: http://git-master/r/44313 Tested-by: Venu Byravarasu <vbyravarasu@nvidia.com> Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Rebase-Id: Ra210ae46da9c4598014ad3dce31fb7472aa304d3
2011-11-30hwmon: tegra: tsensor: error handling changeBitan Biswas
tsensor setup function error path corrected to return error. bug 857074 Original-Change-Id: I8c4be4868546d39c6c49de9eee4d20afe75f075a Reviewed-on: http://git-master/r/43714 Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Tested-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Rebase-Id: Rac3c6ffe339d05186ea38e07e03c517a5d5319ba
2011-11-30hwmon: tegra: tsensor: fix threshold configurationBitan Biswas
tsensor driver changed as follows: 1. conversion of temperature reading into tsensor counter was not working earlier. Fixed this. 2. supported tsensor0 usage for upcoming fuse revision 21 3. tsensor specific fuse data extracted using public fuse APIs bug 851791 bug 855165 Original-Change-Id: I53247f3e029396d5fde479ea168eb279fcae6135 Reviewed-on: http://git-master/r/41037 Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Tested-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Reviewed-by: Narendra Damahe <ndamahe@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Rebase-Id: R8261421f7a6fd72b14488ac536b98c48e8329c58
2011-11-30hwmon: tegra: tsensor: lp0 save/restore configurationBitan Biswas
tsensor configuration needs to be saved before lp0 and restored after lp0 resume else POR values are seen after lp0 resume. - Config0, Config1 and Config2 registers are saved and restored bug 851791 Original-Change-Id: I95532d995af4fa71e169209bb1788fc4152290fe Reviewed-on: http://git-master/r/41819 Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Tested-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Narendra Damahe <ndamahe@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Rebase-Id: Raceac7154fc86486f2726cdd13637d7e8d1e6828
2011-11-30hwmon: tegra: tsensor: set STOP bit in suspendBitan Biswas
tsensor STOP bit is set before suspend. This disables the counters and prevents OVERFLOW interrupt in LP1 mode bug 850683 Original-Change-Id: I01fbc9529ecc25ce96f50a5fbf599c9bce2157b5 Reviewed-on: http://git-master/r/40656 Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Tested-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Rebase-Id: Rbdf02380a72c8f75449a0a3e52007e5883f62d4b
2011-11-30hwmon:tegra:tsensor driver addedBitan Biswas
Tegra integrated temperature sensor(tsensor) driver added - TH3 counter < current counter causes hardware reset - TH2 counter < current counter causes CPU clock to be halved - sysfs interface provided for select operations - interrupts TH1 TH2 and TH3 working - used recommended N,M and clk source settings - tsensor counter to temperature conversion added tsensor1 counter being used for temperature computations. Bug 661228 Original-Change-Id: I0fa405c0f542d1b215162291bd913a9ccd55a0f5 Reviewed-on: http://git-master/r/36083 Tested-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Rebase-Id: R3c910b4fdc630ffee2135d3d649e25015d2b7206