aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/lm75.c
Commit message (Collapse)AuthorAgeFilesLines
* hwmon: (lm75) Speed up detectionJean Delvare2011-03-211-21/+19
| | | | | | | | | | | | | | | | | | | Make the LM75/LM75A device detection faster: * Don't read the current temperature value when we don't use it. * Check for unused bits in the configuration register as soon as we have read its value. * Don't use word reads, not all devices support this, and some which don't misbehave when you try. * Check for cycling register values every 40 register addresses instead of every 8, it's 5 times faster and just as efficient. Some of these improvements come straight from the user-space sensors-detect script, so both detection routines are in line now. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Len Sorensen <lsorense@csclub.uwaterloo.ca> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (lm75) Add detection of the National Semiconductor LM75ALen Sorensen2011-03-211-15/+41
| | | | | | | | Add support for detection of the National Semiconductor LM75A using the ID register value. Signed-off-by: Len Sorensen <lsorense@csclub.uwaterloo.ca> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* hwmon: (lm75) Trivial changes to pacify the checkpatchShubhrajyoti D2010-10-281-21/+23
| | | | | | | Some trivial changes to pacify the checkpatch. Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* hwmon: (lm75) Make the writing to sysfs more robustShubhrajyoti D2010-10-281-1/+6
| | | | | | | | | Currently we get the checkpatch warning consider using strict_strtol in preference to simple_strtol. Also we should not allow any partially numeric values. Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* hwmon: (lm75) Add suspend/resume featureShubhrajyoti Datta2010-08-141-0/+39
| | | | | | | | There is a shutdown feature at suspend it can be enabled to reduce current consumption and resume it can be switched off. Signed-off-by: Shubhrajyoti Datta <shubhrajyoti@ti.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Remove all i2c_set_clientdata(client, NULL) in driversWolfram Sang2010-06-031-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 <w.sang@pengutronix.de> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Richard Purdie <rpurdie@linux.intel.com> Acked-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* hwmon: (lm75) Add support for the Texas Instruments TMP105Shubhrajyoti Datta2010-05-271-0/+2
| | | | | | | | | Add support for the Texas Instruments TMP105 temperature sensor device. Signed-off-by: Shubhrajyoti Datta <shubhrajyoti@ti.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Drop I2C_CLIENT_INSMOD_1Jean Delvare2009-12-141-8/+2
| | | | | | | | This macro simply declares an enum, so drivers might as well declare it themselves. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Wolfram Sang <w.sang@pengutronix.de>
* i2c: Get rid of struct i2c_client_address_dataJean Delvare2009-12-141-1/+1
| | | | | | | | | Struct i2c_client_address_data only contains one field at this point, which makes its usefulness questionable. Get rid of it and pass simple address lists around instead. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Wolfram Sang <w.sang@pengutronix.de>
* i2c: Drop the kind parameter from detect callbacksJean Delvare2009-12-141-1/+1
| | | | | | | | The "kind" parameter always has value -1, and nobody is using it any longer, so we can remove it. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Wolfram Sang <w.sang@pengutronix.de>
* hwmon: Clean up detect functionsJean Delvare2009-12-091-30/+26
| | | | | | | | | | | | As kind is now hard-coded to -1, there is room for code clean-ups. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Corentin Labbe <corentin.labbe@geomatys.fr> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Juerg Haefliger <juergh@gmail.com> Cc: Riku Voipio <riku.voipio@iki.fi> Acked-by: "Hans J. Koch" <hjk@linutronix.de> Cc: Rudolf Marek <r.marek@assembler.cz>
* hwmon: struct device - replace bus_id with dev_name(), dev_set_name()Kay Sievers2009-01-061-1/+1
| | | | | Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* hwmon: (lm75) Drop legacy i2c driverJean Delvare2008-08-101-92/+22
| | | | | | | | Drop the legacy lm75 driver, and add a detect callback to the new-style driver to achieve the same functionality. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: David Brownell <david-b@pacbell.net>
* hwmon: (lm75) add new-style driver bindingDavid Brownell2008-07-311-47/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More LM75 updates: - Teach the LM75 driver to use new-style driver binding: * Create a second driver struct, using new-style driver binding methods cribbed from the legacy code. * Add a MODULE_DEVICE_TABLE (for "newER-style binding") * The legacy probe logic delegates its work to this new code. * The legacy driver now uses the name "lm75_legacy". - More careful initialization. Chips are put into 9-bit mode so the current interconversion routines will never fail. - Save the original chip configuration, and restore it on exit. (Among other things, this normally turns off the mode where the chip is constantly sampling ... and thus saves power.) So the new-style code should catch all chips that boards declare, while the legacy code catches others. This particular coexistence strategy may need some work yet ... legacy modes might best be set up explicitly by some tool not unlike "sensors-detect". (Or else completely eradicated...) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
* hwmon: (lm75) cleanup/reorgDavid Brownell2008-07-311-39/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | Minor cleanup and reorg of the lm75 code. - Kconfig provides a larger list of lm75-compatible chips - A top comment now says what the driver does (!) ... as in, just what sort of sensor is this?? - Section comments now delineate the various sections of the driver: hwmon attributes, driver binding, register access, module glue. One driver binding function moved out of the attribute section, as did the driver struct itself. - Minor tweaks to legacy probe logic: correct a comment, and remove a pointless variable. - Whitespace, linelength, and comment fixes. This patch should include no functional changes. It's preparation for adding new-style (driver model) I2C driver binding. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Jean Delvare <khali@linux-fr.org> Acked-by: Laurent Pinchart <laurentp@cse-semaphore.com> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
* hwmon: (lm75) sensor reading bugfixDavid Brownell2008-06-191-5/+15
| | | | | | | | | | LM75 sensor reading bugfix: never save error status as valid sensor output. This could be improved, but at least this prevents certain rude failure modes. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
* hwmon: (lm75) Fix an incorrect commentJean Delvare2008-04-271-4/+1
| | | | | | | | | | | High-byte first is not opposite to the usual practice - that's what almost all hardware monitoring drivers do. It is opposite to the SMBus standard though. Also delete a duplicate comment. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
* hwmon: normal_i2c arrays should be constMark M. Hoffman2008-02-181-1/+1
| | | | Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
* hwmon: Discard useless I2C driver IDsJean Delvare2008-02-071-1/+0
| | | | | | | | | Many I2C hwmon drivers define a driver ID but no other code references these, meaning that they are useless. Discard them, along with a few IDs which are defined but never used at all. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
* hwmon: Convert from class_device to deviceTony Jones2007-10-091-5/+5
| | | | | | | | | Convert from class_device to device for hwmon_device_register/unregister Signed-off-by: Tony Jones <tonyj@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
* hwmon: Allow writing of negative trigger temperaturesChristian Hohnstaedt2007-10-091-1/+1
| | | | | | | | | - replace differing temperature variable types by long - use strtol() instead of strtoul() for conversion Signed-off-by: Christian Hohnstaedt <chohnstaedt@innominate.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
* hwmon/lm75: Use dynamic sysfs callbacksJean Delvare2007-05-081-38/+44
| | | | | | | This lets us get rid of macro-generated functions and shrinks the driver size by about 8%. Signed-off-by: Jean Delvare <khali@linux-fr.org>
* hwmon: Fix unchecked return status, batch 1Mark M. Hoffman2006-09-281-5/+19
| | | | | | | | | | | | hwmon: Fix unchecked return status, batch 1 Fix up some hwmon drivers so that they no longer ignore return status from device_create_file(). Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] hwmon: Semaphore to mutex conversionsIngo Molnar2006-03-231-6/+7
| | | | | | | | | | | | | convert drivers/hwmon/*.c semaphore use to mutexes. the conversion was generated via scripts, and the result was validated automatically via a script as well. all affected hwmon drivers were build-tested. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] I2C: Remove .owner setting from i2c_driver as it's no longer neededGreg Kroah-Hartman2006-01-051-1/+0
| | | | | | | | | | Now that i2c_add_driver() doesn't need the module owner to be set by hand, we can delete it from the drivers. This patch catches all of the drivers that I found in the current tree (if a driver sets the .owner by hand, it's not a problem, just not needed.) Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Cc: Jean Delvare <khali@linux-fr.org>
* [PATCH] i2c: Drop i2c_driver.{owner,name}, 3 of 11Laurent Riffard2006-01-051-2/+4
| | | | | | | | | | | We should use the i2c_driver.driver's .name and .owner fields instead of the i2c_driver's ones. This patch updates the hwmon drivers. Signed-off-by: Laurent Riffard <laurent.riffard@free.fr> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] i2c: Drop i2c_driver.flags, 2 of 3Jean Delvare2006-01-051-1/+0
| | | | | | | | | | | Just about every i2c chip driver sets the I2C_DF_NOTIFY flag, so we can simply make it the default and drop the flag. If any driver really doesn't want to be notified when i2c adapters are added, that driver can simply omit to set .attach_adapter. This approach is also more robust as it prevents accidental NULL pointer dereferences. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] hwmon: kzalloc conversionDeepak Saxena2005-10-281-2/+1
| | | | | | | | | Use kzalloc instead of kmalloc+memset in all hardware monitoring drivers. Signed-off-by: Deepak Saxena <dsaxena@plexity.net> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] hwmon: hwmon vs i2c, second round (06/11)Jean Delvare2005-09-051-2/+1
| | | | | | | | | | | The only thing left in i2c-sensor.h are module parameter definition macros. It's only an extension of what i2c.h offers, and this extension is not sensors-specific. As a matter of fact, a few non-sensors drivers use them. So we better merge them in i2c.h, and get rid of i2c-sensor.h altogether. Signed-off-by: Jean Delvare <khali@linux-fr> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] hwmon: hwmon vs i2c, second round (04/11)Jean Delvare2005-09-051-2/+2
| | | | | | | | i2c_probe and i2c_detect now do the exact same thing and operate on the same data structure, so we can have everyone call i2c_probe. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (8/9)Jean Delvare2005-09-051-10/+0
| | | | | | | | | Kill all uses of i2c_is_isa_adapter except for the hybrid drivers (it87, lm78, w83781d). The i2c-isa adapter not being registered with the i2c core anymore, drivers don't have to fear being erroneously attached to it. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] I2C: Separate non-i2c hwmon drivers from i2c-core (7/9)Jean Delvare2005-09-051-1/+0
| | | | | | | | | | | Kill normal_isa in header files, documentation and all chip drivers, as it is no more used. normal_i2c could be renamed to normal, but I decided not to do so at the moment, so as to limit the number of changes. This might be done later as part of the i2c_probe/i2c_detect merge. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] I2C hwmon: add hwmon sysfs class to driversMark M. Hoffman2005-09-051-1/+14
| | | | | | | | | This patch modifies sensors chip drivers to make use of the new sysfs class "hwmon". Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] hwmon: soften lm75 initializationJean Delvare2005-09-051-2/+6
| | | | | | | | | The LM75 initialization is a bit agressive, it arbitrarily reconfigures the chip. Make it only change the bit it needs. This is a port from the 2.4 kernel version of the driver (lm_sensors). Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [PATCH] I2C: Move hwmon drivers (2/3)Jean Delvare2005-07-111-0/+296
Part 2: Move the driver files themselves. Note that the patch "adds trailing whitespace", because it does move the files as-is, and some files happen to have trailing whitespace. From: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>