aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/tmp421.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157Thomas Gleixner1-10/+1
Based on 3 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [graeme] [gregory] [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema] [hk] [hemahk]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1105 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-15hwmon: (tmp421) Fix build warningGuenter Roeck1-1/+1
The following build warning is seen if CONFIG_OF is disabled. drivers/hwmon/tmp421.c:73:34: warning: ‘tmp421_of_match’ defined but not used Mark tmp421_of_match as __maybe_unused to fix the problem. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-02-18hwmon: (tmp421) Replace S_<PERMS> with octal valuesGuenter Roeck1-2/+2
Replace S_<PERMS> with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-01-17hwmon: (tmp421) Correct the misspelling of the tmp442 compatible attribute in OF device ID tableCheng-Min Ao1-1/+1
Correct a typo in OF device ID table The last one should be 'ti,tmp442' Signed-off-by: Cheng-Min Ao <tony_ao@wiwynn.com> Signed-off-by: Yu-Hsiang Chen <matt_chen@wiwynn.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2018-10-10hwmon: (tmp421) make const array 'names' staticColin Ian King1-2/+4
The const array 'names' can be made static, saves populating it on the stack and will make it read-only. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-04-02hwmon: (tmp421) Add OF device ID tableJavier Martinez Canillas1-2/+33
The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID and that the MODALIAS reported will always be of the form i2c:<device>. But this could change in the future so the correct approach is to have an OF device ID table if the devices are registered via OF. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-09-08hwmon: (tmp421) Convert to use new hwmon registration APIGuenter Roeck1-75/+58
Simplify code and reduce code size by using the new hwmon registration API. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-08-04hwmon: (tmp421) Drop FSF mailing addressGuenter Roeck1-4/+0
The FSF mailing address can and will change over time, so drop it. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-08-04hwmon: (tmp421) Add support for TMP441 and TMP442Guenter Roeck1-4/+17
TMP441 and TMP442 are compatible to TMP421 and TMP422. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-08-04hwmon: (tmp421) Strengthen detect functionGuenter Roeck1-0/+14
Not all supported chips support the entire I2C address range. Only accept specific chips at the addresses supported by that chip. Check for invalid values in conversion rate and status registers. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-05-21hwmon: (tmp421) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck1-32/+15
Use devm_hwmon_device_register_with_groups API to attach attributes to hwmon device, simplify code, and reduce code size. Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-09-11hwmon: (tmp421) Fix return valueSachin Kamat1-1/+1
Propagate return value obtained from i2c_smbus_read_byte_data() instead of hardcoding. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Andre Prendel <andre.prendel@gmx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-07hwmon: Fix checkpatch warning 'quoted string split across lines'Guenter Roeck1-4/+3
Cc: Corentin Labbe <corentin.labbe@geomatys.fr> Cc: Mark M. Hoffman <mhoffman@lightlink.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Juerg Haefliger <juergh@gmail.com> Cc: Andreas Herrmann <herrmann.der.user@googlemail.com> Cc: Rudolf Marek <r.marek@assembler.cz> Cc: Jim Cromie <jim.cromie@gmail.com> Cc: Roger Lucas <vt8231@hiddenengine.co.uk> Cc: Marc Hulsman <m.hulsman@tudelft.nl> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-07-21hwmon: (tmp421) Convert to use devm_ functionsGuenter Roeck1-9/+4
Convert to use devm_ functions to reduce code size and simplify the code. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jean Delvare <khali@linux-fr.org>
2012-03-18hwmon: convert drivers/hwmon/* to use module_i2c_driver()Axel Lin1-12/+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 <axel.lin@gmail.com> Cc: Corentin Labbe <corentin.labbe@geomatys.fr> Cc: Dirk Eibach <eibach@gdsys.de> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Steve Glendinning <steve.glendinning@smsc.com> Cc: Riku Voipio <riku.voipio@iki.fi> Cc: Guillaume Ligneul <guillaume.ligneul@gmail.com> Cc: David George <david.george@ska.ac.za> Cc: "Hans J. Koch" <hjk@hansjkoch.de> Cc: Marc Hulsman <m.hulsman@tudelft.nl> Cc: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2012-01-03switch ->is_visible() to returning umode_tAl Viro1-1/+1
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-28hwmon: I2C addresses are constantJean Delvare1-2/+2
We can mark normal_i2c const. Almost all drivers do that already, so fix the 3 remaining ones before they are used as (bad) examples for new drivers. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: George Joseph <george.joseph@fairview5.com> Reviewed-by: Guenter Roeck <guenter.roeck@ericsson.com>
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 <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>
2010-03-05hwmon: Fix off-by-one kind valuesJean Delvare1-2/+2
Recent changes on the I2C front have left off-by-one array indexes in 3 hwmon drivers. Fix them. Faulty commit: e5e9f44c2 i2c: Drop I2C_CLIENT_INSMOD_2 to 8 Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Andre Prendel <andre.prendel@gmx.de> Cc: stable@kernel.org
2010-03-05hwmon: (tmp421) Fix temperature conversionsJean Delvare1-2/+4
The low bits of temperature registers are status bits, they must be masked out before converting the register values to temperatures. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Andre Prendel <andre.prendel@gmx.de> Cc: stable@kernel.org
2010-03-05hwmon: (tmp421) Restore missing inputsJean Delvare1-7/+7
An off-by-one error caused some inputs to not be created by the driver when they should. TMP421 gets only one input instead of two, TMP422 gets two instead of three, etc. Fix the bug by listing explicitly the number of inputs each device has. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Andre Prendel <andre.prendel@gmx.de> Cc: stable@kernel.org
2009-12-14i2c: Drop I2C_CLIENT_INSMOD_2 to 8Jean Delvare1-2/+1
These macros simply declare an enum, so drivers might as well declare it themselves. This puts an end to the arbitrary limit of 8 chip types per i2c driver. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Wolfram Sang <w.sang@pengutronix.de>
2009-12-14i2c: Get rid of struct i2c_client_address_dataJean Delvare1-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>
2009-12-14i2c: Drop the kind parameter from detect callbacksJean Delvare1-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>
2009-12-09hwmon: (tmp401/tmp421) Clean up detect functionsJean Delvare1-24/+21
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: Andre Prendel <andre.prendel@gmx.de>
2009-09-15hwmon: Add driver for Texas Instruments TMP421/422/423 sensor chipsAndre Prendel1-0/+347
Add support for Texas Instruments TMP421/422/423 temperature sensor IC. TI's TMP421/422/423 are I2C temperature sensor chips. These chips are similar to TI's TMP401/411 chips, but with reduced functionality (only temperature measurement). The chips have one local sensor and up to three (TMP423) remote sensors. Signed-off-by: Andre Prendel <andre.prendel@gmx.de> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>