aboutsummaryrefslogtreecommitdiff
path: root/drivers/hwmon/ad7314.c
AgeCommit message (Collapse)AuthorFilesLines
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 149Thomas Gleixner1-2/+1
Based on 1 normalized pattern(s): licensed under the gpl 2 or later extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 82 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Kate Stewart <[email protected]> Reviewed-by: Richard Fontana <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-12-16hwmon: (ad7314) Use permission specific SENSOR[_DEVICE]_ATTR variantsGuenter Roeck1-5/+4
Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_<PERMS> in the driver 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 <[email protected]>
2016-06-27hwmon: (ad7314) Convert to devm_hwmon_device_register_with_groupsAxel Lin1-41/+7
Use ATTRIBUTE_GROUPS macro and devm_hwmon_device_register_with_groups() to simplify the code a bit. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2015-10-28spi: Drop owner assignment from spi_driversAndrew F. Davis1-1/+0
An spi_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Andrew F. Davis <[email protected]> Acked-by: Jonathan Cameron <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2015-01-25hwmon: (ad7314) Do proper sign extensionRasmus Villemoes1-2/+3
The comment above (data << 2) >> 2 explains what the intention is: To use bit 13 of the 14-bit value data as the sign bit. However, this doesn't work due to C's promotion rules. data has type s16, but data << 2 has type int. To get sign extension, that expression would have to be cast back to an s16 before being shifted (at which point C's promotion rules would then kick in again and promote the left operand to int). As it stands, both expressions are no-ops for any value of data. Avoid these subtleties by using the existing API for this. sign_extend32 works equally well for 8 and 16 bit types. Signed-off-by: Rasmus Villemoes <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2013-04-07hwmon: (ad7314) use spi_get_drvdata() and spi_set_drvdata()Jingoo Han1-2/+2
Use the wrapper functions for getting and setting the driver data using spi_device instead of using dev_{get|set}_drvdata with &spi->dev, so we can directly pass a struct spi_device. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2013-04-07hwmon: Fix checkpatch warning 'quoted string split across lines'Guenter Roeck1-2/+1
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]>
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-09-23hwmon: (ad7314) Convert to use devm_ functionsGuenter Roeck1-10/+6
Convert to use devm_ functions to reduce code size and simplify the code. Signed-off-by: Guenter Roeck <[email protected]>
2012-09-18hwmon: (ad7314) Add 'name' sysfs attributeGuenter Roeck1-0/+8
The 'name' sysfs attribute is mandatory for hwmon devices, but was missing in this driver. Cc: Jonathan Cameron <[email protected]> Cc: [email protected] Signed-off-by: Guenter Roeck <[email protected]> Acked-by: Jean Delvare <[email protected]> Acked-by: Jonathan Cameron <[email protected]>
2012-05-20hwmon: (ad7314) Remove unused defines, and rename OFFSET to SHIFTGuenter Roeck1-9/+2
Remove unused defines AD7314_PD, AD7314_TEMP_SIGN, and ADT7301_TEMP_SIGN. Rename AD7314_TEMP_OFFSET to the more appropriate AD7314_TEMP_SHIFT. Signed-off-by: Guenter Roeck <[email protected]> Cc: Jonathan Cameron <[email protected]> Acked-by: Jean Delvare <[email protected]>
2012-04-22hwmon: (ad7314) Fix build warningGuenter Roeck1-7/+5
The following build warning is seen in some configurations. drivers/hwmon/ad7314.c: In function 'ad7314_show_temperature': drivers/hwmon/ad7314.c:70: warning: 'data' may be used uninitialized in this function Fix by overloading the return value from ad7314_spi_read with both data and error code (the returned data is really u16 and needs to be converted into a signed value anyway). Signed-off-by: Guenter Roeck <[email protected]> Cc: Jonathan Cameron <[email protected]> Acked-by: Jean Delvare <[email protected]>
2012-04-03hwmon: (ad7314) Adds missing spi_dev initializationGraeme Smecher1-0/+1
This driver was recently moved from IIO (where it worked) to hwmon (where it doesn't.) This breakage occured because the hwmon version neglected to correctly initialize a reference to spi_dev in its drvdata. The result is a segfault every time the temperature is queried. Signed-off-by: Graeme Smecher <[email protected]> Cc: [email protected] # 3.2+ Signed-off-by: Guenter Roeck <[email protected]>
2012-03-18hwmon: convert drivers/hwmon/* to use module_spi_driver()Axel Lin1-11/+1
This patch converts the drivers in drivers/hwmon/* to use the module_spi_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <[email protected]> Cc: Sonic Zhang <[email protected]> Cc: Marc Pignat <[email protected]> Cc: Paul Thomas <[email protected]> Cc: Eric Miao <[email protected]> Acked-by: Sonic Zhang <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2011-11-25hwmon: Remove redundant spi driver bus initializationLars-Peter Clausen1-1/+0
In ancient times it was necessary to manually initialize the bus field of an spi_driver to spi_bus_type. These days this is done in spi_register_driver(), so we can drop the manual assignment. The patch was generated using the following coccinelle semantic patch: // <smpl> @@ identifier _driver; @@ struct spi_driver _driver = { .driver = { - .bus = &spi_bus_type, }, }; // </smpl> Signed-off-by: Lars-Peter Clausen <[email protected]> Cc: Jean Delvare <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: [email protected] Signed-off-by: Guenter Roeck <[email protected]>
2011-10-24hwmon: AD7314 driver (ported from IIO)Jonathan Cameron1-0/+186
Driver for AD7314, ADT7301, and ADT7302, ported from IIO. Currently dropped power down mode support. Signed-off-by: Jonathan Cameron <[email protected]> [[email protected]: Added MODULE_DEVICE_TABLE] Signed-off-by: Guenter Roeck <[email protected]>