aboutsummaryrefslogtreecommitdiff
path: root/drivers/hwmon/tmp102.c
AgeCommit message (Collapse)AuthorFilesLines
2014-05-21hwmon: (tmp102) Convert to use hwmon_device_register_with_groupsGuenter Roeck1-26/+20
Simplify code, reduce code size, and attach sysfs attributes to hwmon device. Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2014-05-21hwmon: (tmp102) Introduce dev variable in probe functionGuenter Roeck1-14/+14
The pointer to client->dev is used several times in the probe function. Simplify code by introducing a separate variable for it. Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2013-12-04hwmon: tmp102: expose to thermal fw via DT nodesEduardo Valentin1-0/+19
This patch adds to tmp102 temperature sensor the possibility to expose itself as thermal zone device, registered on the thermal framework. The thermal zone is built only if a device tree node describing a thermal zone for this sensor is present inside the tmp102 DT node. Otherwise, the driver behavior will be the same. Note: This patch has also been reviewed by Jean D. He has requested to perform a wider inspection of possible users of thermal and hwmon interaction API. On the other hand, the change on this patch is acceptable on first step of overall code change. Cc: Jean Delvare <[email protected]> Cc: [email protected] Cc: [email protected] Acked-by: Guenter Roeck <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
2013-04-07hwmon: Fix checkpatch warning 'quoted string split across lines'Guenter Roeck1-2/+2
Cc: Corentin Labbe <[email protected]> Cc: Mark M. Hoffman <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: Juerg Haefliger <[email protected]> Cc: Andreas Herrmann <[email protected]> Cc: Rudolf Marek <[email protected]> Cc: Jim Cromie <[email protected]> Cc: Roger Lucas <[email protected]> Cc: Marc Hulsman <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2013-01-25hwmon: Replace SENSORS_LIMIT with clamp_valGuenter Roeck1-1/+1
SENSORS_LIMIT and the generic clamp_val have the same functionality, and clamp_val is more efficient. This patch reduces text size by 9052 bytes and bss size by 11624 bytes for x86_64 builds. Signed-off-by: Guenter Roeck <[email protected]> Acked-by: George Joseph <[email protected]> Acked-by: Jean Delvare <[email protected]>
2012-11-28hwmon: remove use of __devexitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Jean Delvare <[email protected]> Cc: Alistair John Strachan <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: Juerg Haefliger <[email protected]> Cc: Andreas Herrmann <[email protected]> Cc: Clemens Ladisch <[email protected]> Cc: Rudolf Marek <[email protected]> Cc: Jim Cromie <[email protected]> Cc: "Mark M. Hoffman" <[email protected]> Cc: Roger Lucas <[email protected]> Acked-by: Guenter Roeck <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-28hwmon: remove use of __devinitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Jean Delvare <[email protected]> Cc: Alistair John Strachan <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: Juerg Haefliger <[email protected]> Cc: Andreas Herrmann <[email protected]> Cc: Clemens Ladisch <[email protected]> Cc: Rudolf Marek <[email protected]> Cc: Jim Cromie <[email protected]> Cc: "Mark M. Hoffman" <[email protected]> Cc: Roger Lucas <[email protected]> Acked-by: Guenter Roeck <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-28hwmon: remove use of __devexit_pBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Jean Delvare <[email protected]> Cc: Alistair John Strachan <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: Juerg Haefliger <[email protected]> Cc: Andreas Herrmann <[email protected]> Cc: Clemens Ladisch <[email protected]> Cc: Rudolf Marek <[email protected]> Cc: Jim Cromie <[email protected]> Cc: "Mark M. Hoffman" <[email protected]> Cc: Roger Lucas <[email protected]> Acked-by: Guenter Roeck <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-10-10hwmon: Add missing inclusions of <linux/jiffies.h>Jean Delvare1-0/+1
Many hwmon drivers use jiffies but omit the inclusion of the header file. Fix that, and also fix one driver which was including the header file but didn't need it. Signed-off-by: Jean Delvare <[email protected]> Acked-by: Guenter Roeck <[email protected]> Acked-by: Luca Tettamanti <[email protected]> Cc: Marc Hulsman <[email protected]> Cc: Rudolf Marek <[email protected]>
2012-07-21hwmon: (tmp102) Convert to use devm_ functionsGuenter Roeck1-10/+4
Convert to use devm_ functions to reduce code size and simplify the code. Signed-off-by: Guenter Roeck <[email protected]> Acked-by: Jean Delvare <[email protected]>
2012-03-18hwmon: convert drivers/hwmon/* to use module_i2c_driver()Axel Lin1-11/+1
This patch converts the drivers in drivers/hwmon/* to use the module_i2c_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <[email protected]> Cc: Corentin Labbe <[email protected]> Cc: Dirk Eibach <[email protected]> Cc: "Mark M. Hoffman" <[email protected]> Cc: Steve Glendinning <[email protected]> Cc: Riku Voipio <[email protected]> Cc: Guillaume Ligneul <[email protected]> Cc: David George <[email protected]> Cc: "Hans J. Koch" <[email protected]> Cc: Marc Hulsman <[email protected]> Cc: Rudolf Marek <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2012-01-05hwmon: replaced strict_str* with kstr*Frans Meulenbroeks1-1/+1
replaced strict_strtol with kstrtol and replaced strict_strtuol with kstrtuol This satisfies checkpatch -f Compile tested only: no warnings or errors given Signed-off-by: Frans Meulenbroeks <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2011-11-04hwmon: Use i2c_smbus_{read,write}_word_swappedJean Delvare1-27/+17
Make use of the new i2c_smbus_{read,write}_word_swapped functions. This makes the driver code more compact and readable. It also ensures proper error handling. Signed-off-by: Jean Delvare <[email protected]> Acked-by: Jonathan Cameron <[email protected]> Acked-by: Guenter Roeck <[email protected]> Cc: Dirk Eibach <[email protected]> Cc: "Mark M. Hoffman" <[email protected]> Cc: Guillaume Ligneul <[email protected]>
2011-03-31Fix common misspellingsLucas De Marchi1-1/+1
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <[email protected]>
2010-06-03i2c: Remove all i2c_set_clientdata(client, NULL) in driversWolfram Sang1-2/+0
I2C drivers can use the clientdata-pointer to point to private data. As I2C devices are not really unregistered, but merely detached from their driver, it used to be the drivers obligation to clear this pointer during remove() or a failed probe(). As a couple of drivers forgot to do this, it was agreed that it was cleaner if the i2c-core does this clearance when appropriate, as there is no guarantee for the lifetime of the clientdata-pointer after remove() anyhow. This feature was added to the core with commit e4a7b9b04de15f6b63da5ccdd373ffa3057a3681 to fix the faulty drivers. As there is no need anymore to clear the clientdata-pointer, remove all current occurrences in the drivers to simplify the code and prevent confusion. Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Mark Brown <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-by: Richard Purdie <[email protected]> Acked-by: Dmitry Torokhov <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2010-05-27hwmon: (tmp102) Don't always stop chip at exitJean Delvare1-10/+28
Only stop the chip at driver exit if it was stopped when driver was loaded. Leave it running otherwise. Also restore the device configuration if probe failed, to not leave the system in a dangling state. Signed-off-by: Jean Delvare <[email protected]> Cc: Steven King <[email protected]>
2010-05-27hwmon: (tmp102) Fix suspend and resume functionsJean Delvare1-4/+12
Suspend and resume functions shouldn't overwrite the configuration register. They should only alter the one bit they have to touch. Also don't assume that register reads and writes always succeed. Handle errors properly, shall they happen. Signed-off-by: Jean Delvare <[email protected]> Cc: Steven King <[email protected]>
2010-05-27hwmon: (tmp102) Various fixesJean Delvare1-36/+34
Fixes from my driver review: http://lists.lm-sensors.org/pipermail/lm-sensors/2010-March/028051.html Only the small changes are in there, more important changes will come later separately as time permits. * Drop the remnants of the now gone detect function * The TMP102 has no known compatible chip * Include the right header files * Clarify why byte swapping of register values is needed * Strip resolution info bit from temperature register value * Set cache lifetime to 1/3 second * Don't arbitrarily reject limit values; clamp as needed * Make limit writing unconditional * Don't check for transaction types the driver doesn't use * Properly check for error when setting configuration * Report error on failed probe * Make the driver load automatically where needed * Various other minor fixes Signed-off-by: Jean Delvare <[email protected]> Cc: Steven King <[email protected]>
2010-05-27hwmon: Driver for TI TMP102 temperature sensorSteven King1-0/+297
Driver for the TI TMP102. The TI TMP102 is similar to the LM75. It differs from the LM75 by having a 16-bit conf register and the temp registers have a minimum resolution of 12 bits; the extended conf register can select 13-bit resolution (which this driver does) and also change the update rate (which this driver currently doesn't use). [JD: Fix tmp102_exit tag, must be __exit, not __init.] Signed-off-by: Steven King <[email protected]> Signed-off-by: Jean Delvare <[email protected]>