summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/ltc4245.c
Commit message (Collapse)AuthorAgeFilesLines
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441Thomas Gleixner2019-06-051-4/+1Star
| | | | | | | | | | | | | | | | | | | | | 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 version 2 of the license extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 315 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Armijn Hemel <armijn@tjaldur.nl> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190531190115.503150771@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* hwmon: (ltc4245) Use HWMON_CHANNEL_INFO macroGuenter Roeck2019-04-161-50/+23Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood of errors, and makes the code easier to read. The conversion was done automatically with coccinelle. The semantic patch used to make this change is as follows. @r@ initializer list elements; identifier i; @@ -u32 i[] = { - elements, - 0 -}; @s@ identifier r.i,j,ty; @@ -struct hwmon_channel_info j = { - .type = ty, - .config = i, -}; @script:ocaml t@ ty << s.ty; elements << r.elements; shorter; elems; @@ shorter := make_ident (List.hd(List.rev (Str.split (Str.regexp "_") ty))); elems := make_ident (String.concat "," (List.map (fun x -> Printf.sprintf "\n\t\t\t %s" x) (Str.split (Str.regexp " , ") elements))) @@ identifier s.j,t.shorter; identifier t.elems; @@ - &j + HWMON_CHANNEL_INFO(shorter,elems) This patch does not introduce functional changes. Many thanks to Julia Lawall for providing the semantic patch. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc4245) Replace S_<PERMS> with octal valuesGuenter Roeck2019-02-181-4/+4
| | | | | | | | | | | | | 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>
* hwmon: (ltc4245) move header file out of I2C realmWolfram Sang2017-06-121-1/+1
| | | | | | | | include/linux/i2c is not for client devices. Move the header file to a more appropriate location. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc4245) Convert to use new hwmon registration APIGuenter Roeck2016-09-091-187/+175Star
| | | | | | | Simplify code and reduce code size by using the new hwmon registration API. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc4245) Remove devicetree conditionalsGuenter Roeck2014-03-031-4/+0Star
| | | | | | | | Devicetree functions are stubbed out if CONFIG_OF is undefined. Therefore, conditional compilation is unnecessary and can be removed. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <jdelvare@suse.de>
* hwmon: (ltc4245) Drop debug messagesGuenter Roeck2014-03-031-3/+0Star
| | | | | | | The debug messages in this driver have little if any value. Drop them. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <jdelvare@suse.de>
* hwmon: (ltc4245) Use device managed function to register hwmon deviceGuenter Roeck2014-03-031-19/+4Star
| | | | | | | This simplifies the code and reduces code size. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <jdelvare@suse.de>
* hwmon: (ltc4245) Convert to use hwmon_device_register_with_groupsGuenter Roeck2013-10-141-54/+24Star
| | | | Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc4245) Fix 'Macros with complex values' checkpatch errorGuenter Roeck2013-04-081-57/+59
| | | | | | | | | Fix: ERROR: Macros with complex values should be enclosed in parenthesis by unwinding the problematic macros. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: Add missing inclusions of <linux/jiffies.h>Jean Delvare2012-10-101-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 <khali@linux-fr.org> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Luca Tettamanti <kronos.it@gmail.com> Cc: Marc Hulsman <m.hulsman@tudelft.nl> Cc: Rudolf Marek <r.marek@assembler.cz>
* hwmon: (ltc4245) Convert to use devm_ functionsGuenter Roeck2012-09-241-10/+4Star
| | | | | | | Convert to use devm_ functions to reduce code size and simplify the code. Cc: Ira W. Snyder <iws@ovro.caltech.edu> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
* hwmon: (ltc4245) Fix multi-line commentsGuenter Roeck2012-03-191-3/+6
| | | | | | Cc: Ira W. Snyder <iws@ovro.caltech.edu> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Ira W. Snyder <iws@ovro.caltech.edu>
* hwmon: convert drivers/hwmon/* to use module_i2c_driver()Axel Lin2012-03-191-12/+1Star
| | | | | | | | | | | | | | | | | | 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>
* hwmon: (ltc4245) Expose all GPIO pins as analog voltagesIra W. Snyder2010-08-141-10/+167
| | | | | | | | | | | | | | | | | Add support for exposing all GPIO pins as analog voltages. Though this is not an ideal use of the chip, some hardware engineers may decide that the LTC4245 meets their design requirements when studying the datasheet. The GPIO pins are sampled in round-robin fashion, meaning that a slow reader will see stale data. A userspace application can detect this, because it will get -EAGAIN when reading from a sysfs file which contains stale data. Users can choose to use this feature on a per-chip basis by using either platform data or the OF device tree (where applicable). Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* hwmon: (ltc4245) Read only one GPIO pinIra W. Snyder2010-05-271-13/+5Star
| | | | | | | | | | | | | Read only one of the GPIO pins as an analog voltage. The ADC can be switched to a different GPIO pin at runtime, but this is not supported. Previously, this driver would report the analog voltage of the currently selected GPIO pin as all three GPIO voltages: in9_input, in10_input and in11_input. Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu> Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: stable@kernel.org
* ltc4215/ltc4245: Discard obsolete detect methodsJean Delvare2009-10-041-126/+5Star
| | | | | | | | | | | | | | There is no point in implementing a detect callback for the LTC4215 and LTC4245, as these devices can't be detected. It was there solely to handle "force" module parameters to instantiate devices, but now we have a better sysfs interface that can do the same. So we can get rid of the ugly module parameters and the detect callbacks. This shrinks the binary module sizes by 36% and 46%, respectively. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Ira W. Snyder <iws@ovro.caltech.edu>
* hwmon: (ltc4245) Clear faults at startupIra W. Snyder2009-09-231-1/+2
| | | | | | | | | When power is applied to the ltc4245 chip it sometimes reports spurious faults, which are exposed as alarms in the hwmon output. Clear the fault register when the driver is installed to clear the alarms. Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* hwmon: Add LTC4245 driverIra Snyder2009-01-071-0/+567
Add Linux support for the Linear Technology LTC4245 Multiple Supply Hot Swap controller I2C monitoring interface. Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>