aboutsummaryrefslogtreecommitdiff
path: root/drivers/hwmon/adcxx.c
AgeCommit message (Collapse)AuthorFilesLines
2019-05-24treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61Thomas Gleixner1-14/+1
Based on 1 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 you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 675 mass ave cambridge ma 02139 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 441 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Michael Ellerman <[email protected]> (powerpc) Reviewed-by: Richard Fontana <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Kate Stewart <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2018-12-16hwmon: (adcxx) Use permission specific SENSOR[_DEVICE]_ATTR variantsGuenter Roeck1-22/+22
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]>
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]>
2013-10-18hwmon: (adcxx) Remove redundant spi_set_drvdataSachin Kamat1-2/+0
Driver core sets driver data to NULL upon failure or remove. Signed-off-by: Sachin Kamat <[email protected]> Cc: Marc Pignat <[email protected]> Acked-by: Marc Pignat <[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: (adcxx) Simplify show_name functionGuenter Roeck1-4/+1
Display device name using to_spi_device(dev)->modalias instead of computing it from the number of ADC channels. This is cleaner and reduces code size. Signed-off-by: Guenter Roeck <[email protected]>
2012-09-23hwmon: (adcxx) Convert to use devm_ functionsGuenter Roeck1-3/+1
Convert to use devm_ functions to reduce code size and simplify the code. Signed-off-by: Guenter Roeck <[email protected]>
2012-03-18hwmon: convert drivers/hwmon/* to use module_spi_driver()Axel Lin1-12/+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]>
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-05-25hwmon: Use helper functions to set and get driver dataJean Delvare1-8/+8
Use helper functions to set and get driver data. This is more elegant. Signed-off-by: Jean Delvare <[email protected]> Cc: Andreas Herrmann <[email protected]> Acked-by: Guenter Roeck <[email protected]>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo1-0/+1
implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <[email protected]> Guess-its-ok-by: Christoph Lameter <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Lee Schermerhorn <[email protected]>
2010-03-06drivers/hwmon/adcxx.c: fix for single-channel ADCsJosé Miguel Gonçalves1-5/+10
While testing an ADC121S021 in an embedded board with a S3C2142 SoC (ARM core), I have found that the 'adcxx' driver does not handle correctly single channel ADCs from this chip family. For single channel chips you must only issue one read transfer for correct measurement. Signed-off-by: Jose Miguel Goncalves <[email protected]> Cc: Marc Pignat <[email protected]> Cc: Anton Vorontsov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2009-09-23hwmon: adxx: convert to device table matchingAnton Vorontsov1-85/+16
Make the code a little bit nicer, and shorter. Signed-off-by: Anton Vorontsov <[email protected]> Cc: Marc Pignat <[email protected]> Cc: David Brownell <[email protected]> Cc: David Woodhouse <[email protected]> Cc: Grant Likely <[email protected]> Cc: Jean Delvare <[email protected]> Cc: Ben Dooks <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Acked-by: Marc Pignat <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2008-08-15hwmon: ADC124S501 generic driverMarc Pignat1-0/+329
SPI driver for analog to digital converters national semiconductor ADC081S101, ADC124S501, ... Code for 8 channels by Tobias Himmer. This driver adds support for National Semiconductor ADC<bb><c>S<sss> chip family, where: * bb is the resolution in number of bits (8, 10, 12) * c is the number of channels (1, 2, 4, 8) * sss is the maximum conversion speed (021 for 200 kSPS, 051 for 500 kSPS and 101 for 1 MSPS) [[email protected]: coding-style fixes] Signed-off-by: Marc Pignat <[email protected]> Cc: Tobias Himmer <[email protected]> Cc: "Mark M. Hoffman" <[email protected]> Cc: Jean Delvare <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>