summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
Commit message (Collapse)AuthorAgeFilesLines
* hwmon: convert drivers/hwmon/* to use module_platform_driver()Axel Lin2011-11-2611-130/+11
| | | | | | | | | | | | | | | | | | | This patch converts the drivers in drivers/hwmon/* to use the module_platform_driver() macro which makes the code smaller and a bit simpler. Cc: Donggeun Kim <dg77.kim@samsung.com> Cc: Simon Guinot <sguinot@lacie.com> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: MyungJoo Ham <myungjoo.ham@samsung.com> Cc: Ben Dooks <ben@simtec.co.uk> Cc: Hans de Goede <hdegoede@redhat.com> Cc: J Keerthy <j-keerthy@ti.com> Cc: David S. Miller <davem@davemloft.net> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: Remove redundant spi driver bus initializationLars-Peter Clausen2011-11-252-2/+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 <lars@metafoo.de> Cc: Jean Delvare <khali@linux-fr.org> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Cc: lm-sensors@lm-sensors.org Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* hwmon: (exynos4_tmu) Fix Kconfig dependencyDonggeun Kim2011-11-171-1/+1
| | | | | | | | | Rename dependency of EXYNOS4_TMU in Kconfig to the existing one. Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* Merge branch 'modsplit-Oct31_2011' of ↵Linus Torvalds2011-11-061-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits) Revert "tracing: Include module.h in define_trace.h" irq: don't put module.h into irq.h for tracking irqgen modules. bluetooth: macroize two small inlines to avoid module.h ip_vs.h: fix implicit use of module_get/module_put from module.h nf_conntrack.h: fix up fallout from implicit moduleparam.h presence include: replace linux/module.h with "struct module" wherever possible include: convert various register fcns to macros to avoid include chaining crypto.h: remove unused crypto_tfm_alg_modname() inline uwb.h: fix implicit use of asm/page.h for PAGE_SIZE pm_runtime.h: explicitly requires notifier.h linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h miscdevice.h: fix up implicit use of lists and types stop_machine.h: fix implicit use of smp.h for smp_processor_id of: fix implicit use of errno.h in include/linux/of.h of_platform.h: delete needless include <linux/module.h> acpi: remove module.h include from platform/aclinux.h miscdevice.h: delete unnecessary inclusion of module.h device_cgroup.h: delete needless include <linux/module.h> net: sch_generic remove redundant use of <linux/module.h> net: inet_timewait_sock doesnt need <linux/module.h> ... Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in - drivers/media/dvb/frontends/dibx000_common.c - drivers/media/video/{mt9m111.c,ov6650.c} - drivers/mfd/ab3550-core.c - include/linux/dmaengine.h
| * drivers/hwmon: add module.h to ultra45_env.cPaul Gortmaker2011-10-311-0/+1
| | | | | | | | | | | | | | This file needs the full module.h header and up to now was just implicitly capitalizing on it being present already. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
* | hwmon: (w83627ehf) Fix broken driver initGuenter Roeck2011-11-061-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 2265cef2 (hwmon: (w83627ehf) Properly report PECI and AMD-SI sensor types) results in kernel panic if data->temp_label was not initialized. The problem was found with chip W83627DHG-P. Add check if data->temp->label was set before use. Based on incomplete patch by Alexander Beregalov. Reported-by: Alexander Beregalov <a.beregalov@gmail.com> Tested-by: Alexander Beregalov <a.beregalov@gmail.com> Cc: stable@kernel.org Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* | hwmon: (coretemp) Fix for non-SMP buildsJean Delvare2011-11-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The definition of TO_ATTR_NO in the non-SMP case is wrong. As the SMP definition resolves to the correct value, just use this for both cases. Without this fix the temperature attributes are named temp0_* instead of temp2_*, so libsensors won't pick them. Broken since kernel 3.0. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Phil Sutter <phil@nwl.cc> Cc: stable@kernel.org Acked-by: Durgadoss R <Durgadoss.r@intel.com> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | hwmon: (w83627ehf) Add support for the W83627UHGJean Delvare2011-11-042-28/+125
| | | | | | | | | | | | | | | | | | | | | | This is essentially a stripped down version of the W83627DHG. Noticeable difference is that it is still powered with +5V, as older models, even though the ADC resolution is 8 mV as newer models have. Thanks to Ulf Bruman (Saab Group) for doing all the testing. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | hwmon: (w83627ehf) Clean up probe functionJean Delvare2011-11-041-21/+32
| | | | | | | | | | | | | | | | | | | | | | | | The probe function has grown pretty large, I think it's time for some cleanups, starting with these two simple ones: * Move temp3/in6 check for the W83667HG later in the function, where it is done for all other chip types. * Move temperature register setting to a separate function, to avoid code duplication. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | hwmon: (w83627ehf) Properly report PECI and AMD-SI sensor typesJean Delvare2011-11-041-1/+8
| | | | | | | | | | | | | | | | | | | | When temperature sources are PECI or AMD-SI agents, it makes no sense to report their type as diode or thermistor. Instead we must report their digital nature. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: stable@kernel.org Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | hwmon: Use i2c_smbus_{read,write}_word_swappedJean Delvare2011-11-0419-234/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | Make use of the new i2c_smbus_{read,write}_word_swapped functions. This makes the driver code more compact and readable. It also ensures proper error handling. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Dirk Eibach <eibach@gdsys.de> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Guillaume Ligneul <guillaume.ligneul@gmail.com>
* | hwmon: (smsc47b397) Fix checkpatch errorsJean Delvare2011-11-041-5/+8
| | | | | | | | | | Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | hwmon: (lm90) Make code more readableJean Delvare2011-11-041-74/+69
| | | | | | | | | | | | | | | | | | | | | | | | Clean up the code to make it more readable: * Remove reg_ and new_ prefixes from variable names, they made the names longer, causing extra line breaks, while not adding much value. * Introduce struct device dev* = &client->dev in two functions, to avoid repeating client->dev everywhere in these functions. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | hwmon: (lm90) Fix warningsJean Delvare2011-11-041-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With some configuration option combinations, we get the following warnings: drivers/hwmon/lm90.c: In function 'lm90_detect': drivers/hwmon/lm90.c:1114: warning: 'chip_id' may be used uninitialized in this function drivers/hwmon/lm90.c:1114: warning: 'reg_config1' may be used uninitialized in this function drivers/hwmon/lm90.c:1114: warning: 'reg_convrate' may be used uninitialized in this function drivers/hwmon/lm90.c:1187: warning: 'reg_emerg2' may be used uninitialized in this function drivers/hwmon/lm90.c:1187: warning: 'reg_status2' may be used uninitialized in this function We can solve these easily by reading the register values first and checking for errors later. These errors should be very rare, even in the case of failed detection, so this change has no impact on performance. And this makes checkpatch.pl happier. Reported-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | hwmon: (ibmaem) Avoid repeated memory allocationsJean Delvare2011-11-041-8/+20
| | | | | | | | | | | | | | | | | | | | Preallocate a buffer for the response to sensor reads, and reuse it for each read instead of allocating a new one each time. This should be faster and should also avoid memory fragmentation. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Darrick J. Wong <djwong@us.ibm.com> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | hwmon: (ibmaem) Make instance initializations independentJean Delvare2011-11-041-10/+2
| | | | | | | | | | | | | | | | | | There is no good reason that I can see why the failure to initialize one instance should prevent other instances from being initialized. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Darrick J. Wong <djwong@us.ibm.com> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | hwmon: (ibmaem) Fix error pathsJean Delvare2011-11-041-8/+12
| | | | | | | | | | | | | | | | | | | | | | I am under the impression that error paths in functions aem_init_aem1_inst() and aem_init_aem2_inst() are incorrect. In several cases, the function returns 0 on error, which I suspect is not intended. Fix this by properly tracking error codes. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Darrick J. Wong <djwong@us.ibm.com> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | hwmon: (lm73) Make detection less problematicJean Delvare2011-11-041-4/+18
| | | | | | | | | | | | | | | | | | | | | | Word reads can cause trouble with some I2C devices, so do as much detection as we can using only byte reads, and only use a word read in the end to confirm the positive match. Also properly handle read errors. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Robert Casanova <robertcasanova@nanometrics.ca>
* | hwmon: Avoid building drivers for powerpc that read/write ISA addressesDean Nelson2011-11-041-2/+13
| | | | | | | | | | | | | | | | | | | | | | A modprobe of hwmon drivers that read/write ISA addresses on a powerpc results in a kernel Oops. These reads/writes are being done via the inb()/in_8() and outb()/out_8() macros. Prevent these drivers from being built for powerpc. Signed-off-by: Dean Nelson <dnelson@redhat.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* | Merge branch 'for-next' of git://git.infradead.org/users/sameo/mfd-2.6Linus Torvalds2011-11-031-6/+6
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'for-next' of git://git.infradead.org/users/sameo/mfd-2.6: (80 commits) mfd: Fix missing abx500 header file updates mfd: Add missing <linux/io.h> include to intel_msic x86, mrst: add platform support for MSIC MFD driver mfd: Expose TurnOnStatus in ab8500 sysfs mfd: Remove support for early drop ab8500 chip mfd: Add support for ab8500 v3.3 mfd: Add ab8500 interrupt disable hook mfd: Convert db8500-prcmu panic() into pr_crit() mfd: Refactor db8500-prcmu request_clock() function mfd: Rename db8500-prcmu init function mfd: Fix db5500-prcmu defines mfd: db8500-prcmu voltage domain consumers additions mfd: db8500-prcmu reset code retrieval mfd: db8500-prcmu tweak for modem wakeup mfd: Add db8500-pcmu watchdog accessor functions for watchdog mfd: hwacc power state db8500-prcmu accessor mfd: Add db8500-prcmu accessors for PLL and SGA clock mfd: Move to the new db500 PRCMU API mfd: Create a common interface for dbx500 PRCMU drivers mfd: Initialize DB8500 PRCMU regs ... Fix up trivial conflicts in arch/arm/mach-imx/mach-mx31moboard.c arch/arm/mach-omap2/board-omap3beagle.c arch/arm/mach-u300/include/mach/irqs.h drivers/mfd/wm831x-spi.c
| * | hwmon: Convert mc13783-adc to mc13xxx APIUwe Kleine-König2011-10-241-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The mc13783_... functions are going to be removed, so switch to the more generic API. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* | | drivers/hwmon/hwmon.c: convert idr to ida and use ida_simple_get()Jonathan Cameron2011-10-311-39/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A straightforward looking use of idr for a device id. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Tejun Heo <tj@kernel.org> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Acked-by: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | | hwmon: convert idr to ida and use ida_simple interfaceJonathan Cameron2011-10-311-24/+8
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hwmon was using an idr with a NULL pointer, so convert to an ida which then allows use of Rusty's ida_simple_get. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Tejun Heo <tj@kernel.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: David Airlie <airlied@linux.ie> Cc: Thomas Hellstrom <thellstrom@vmware.com> Cc: Evgeniy Polyakov <zbr@ioremap.net> Cc: Darrick J. Wong <djwong@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | Merge branch 'x86-microcode-for-linus' of ↵Linus Torvalds2011-10-281-24/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip * 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86, microcode, AMD: Add microcode revision to /proc/cpuinfo x86, microcode: Correct microcode revision format coretemp: Get microcode revision from cpu_data x86, intel: Use c->microcode for Atom errata check x86, intel: Output microcode revision in /proc/cpuinfo x86, microcode: Don't request microcode from userspace unnecessarily Fix up trivial conflicts in arch/x86/kernel/cpu/amd.c (conflict between moving AMD BSP code to cpu_dev helper function and adding AMD microcode revision to /proc/cpuinfo code)
| * | coretemp: Get microcode revision from cpu_dataAndi Kleen2011-10-141-24/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the ucode revision is available in cpu_data remove the existing code in coretemp.c to query it manually. Read the ucode revision from cpu_data instead Signed-off-by: Andi Kleen <ak@linux.intel.com> Acked-by: H. Peter Anvin <hpa@zytor.com> Cc: jbeulich@novell.com Cc: fenghua.yu@intel.com Cc: khali@linux-fr.org Link: http://lkml.kernel.org/r/1318466795-7393-3-git-send-email-andi@firstfloor.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
* | | hwmon: (w83627ehf) Better fix for negative temperature valuesJean Delvare2011-10-241-25/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is more efficient to left-align 8-bit temperature values, so that 8-bit and 9-bit temperature values can be handled exactly the same way in the rest of the code. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (w83627ehf) Uninline is_word_sizedJean Delvare2011-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Helper function is_word_sized has grown too much to be kept inline. It was OK when there were only 6 word-sized registers but support for new devices have made the list much longer. The function is also called from more places than before. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (lm75) Document why clones are not detectedJean Delvare2011-10-241-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Explain why clones of the LM75 are generally not detected by the driver, and why this isn't going to change. Also update the documentation to reflect the list of chip names currently supported by the driver. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (w83627ehf) Move fan pins check to a separate functionJean Delvare2011-10-241-53/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move the check of fan pin usage to a separate function. This improves readability, and will make it easier to integrate chip-specific conditions. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (w83627ehf) Skip reading unused voltage registersJean Delvare2011-10-241-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | When in6 is missing, don't read the corresponding registers, it's a waste of time. The logic is similar to what we do for fans and temperatures. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (lm75) Add support for Analog Devices ADT75Michael Hennerich2011-10-242-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add datasheet reference and device ID for ADT75. The ADT75, like some other LM75 derivatives, needs to be instantiated using methods 1, 2, or 4. For more information see Documentation/i2c/instantiating-devices. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (pmbus_core) Simplify sign extensionsGuenter Roeck2011-10-241-13/+4
| | | | | | | | | | | | | | | | | | | | | Shift operations can be used for sign extensions. Use it. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | | hwmon: (pmbus) Add support for Lineage Power DC-DC convertersGuenter Roeck2011-10-241-0/+4
| | | | | | | | | | | | | | | | | | | | | Add device IDs and reference to datasheets for Lineage Power DC-DC converters. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | | hwmon: (pmbus/ltc2978) Add support for LTC3880 to LTC2978 driverGuenter Roeck2011-10-242-14/+127
| | | | | | | | | | | | | | | | | | | | | | | | The LTC3880 PMBus command set is comparable to LTC2978. Add support for it to the LTC2978 driver. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | | hwmon: (pmbus/ltc2978) Explicit driver for LTC2978Guenter Roeck2011-10-244-2/+307
| | | | | | | | | | | | | | | | | | | | | | | | Provide explicit driver for LTC2978 to enable support for minimum and peak attributes. Remove ltc2978 chip id from generic pmbus driver. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | | hwmon: (pmbus) Add support for TEMP2 peak attributesGuenter Roeck2011-10-242-5/+43
| | | | | | | | | | | | | | | | | | | | | | | | At least one PMBus chip supports peak attributes for READ_TEMPERATURE2. Add virtual registers to be able to report it to the user. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | | hwmon: AD7314 driver (ported from IIO)Jonathan Cameron2011-10-243-0/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Driver for AD7314, ADT7301, and ADT7302, ported from IIO. Currently dropped power down mode support. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> [guenter.roeck@ericsson.com: Added MODULE_DEVICE_TABLE] Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (pmbus) Add support for Intersil power management chipsGuenter Roeck2011-10-243-0/+268
| | | | | | | | | | | | | | | | | | | | | | | | Add support for Intersil / Zilker Labs ZL2004, ZL2006, ZL2008, ZL2105, ZL2106, ZL6100, and ZL6105. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | | hwmon: (pmbus) Always call _pmbus_read_byte in core driverGuenter Roeck2011-10-246-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Always call _pmbus_read_byte() instead of pmbus_read_byte() in PMBus core driver. With this change, device specific read functions can be implemented for all registers. Since the device specific read_byte function is now always called, we need to be more careful with page validations. Only fail if the passed page number is larger than 0, since -1 means "current page". Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | | hwmon: (pmbus) Replace EINVAL return codes with more appropriate errorsGuenter Roeck2011-10-244-13/+13
| | | | | | | | | | | | | | | | | | | | | EINVAL was over-used in the code. Replace it with more appropriate errors. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
* | | hwmon/f71882fg: Make the decision wether to register fan attr. per fanHans de Goede2011-10-241-65/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch the f71882fg driver completely fails to initialize on systems which have reserved settings in the pwm enable register, and it disables all auto pwm sysfs attributes if any fan is controlled by a digital sensor reading. This patch changes the fail to initialize into don't register any attributes for the fan for which there are reserved settings in the pwm enable register and also makes the not registering of auto pwm sysfs attributes a per fan thing. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon/f71882fg: Add a f71882fg_create_fan_sysfs_files helper functionHans de Goede2011-10-241-44/+64
| | | | | | | | | | | | | | | | | | | | | | | | This is a preparation patch for not registering fan/pwm attributes for some fans (rather then register them for all or for none). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon/f71882fg: Make all fan/pwm attr tables 2 dimensionalHans de Goede2011-10-241-24/+26
| | | | | | | | | | | | | | | | | | | | | | | | This is a preparation patch for not registering fan/pwm attributes for some fans (rather then register them for all or for none). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (exynos4_tmu) Remove IRQF_DISABLEDYong Zhang2011-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit [c58543c8: genirq: Run irq handlers with interrupts disabled], we run all interrupt handlers with interrupts disabled and we even check and yell when an interrupt handler returns with interrupts enabled (see commit [b738a50a: genirq: Warn when handler enables interrupts]). So now this flag is a NOOP and can be removed. Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: Add driver for EXYNOS4 TMUDonggeun Kim2011-10-243-0/+535
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows to read temperature from TMU(Thermal Management Unit) of SAMSUNG EXYNOS4 series of SoC. Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
* | | hwmon: (pmbus/adm1275) Add support for ADM1276Guenter Roeck2011-10-242-10/+54
| | | | | | | | | | | | | | | | | | | | | | | | ADM1276 is mostly compatible to ADM1275, with added support for input power measurement. Add support for it to the ADM1275 driver. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>
* | | hwmon: (pmbus/adm1275) Add support for second current limitGuenter Roeck2011-10-241-7/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ADM1275 supports a second current limit, which can be configured as either lower or upper limit. Add support for it and report it as either lower or upper critical current limit. Also replace error return code EINVAL for unsupported pages with ENXIO as this is more appropriate for the observed condition. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>
* | | hwmon: (pmbus) Don't return errors from driver remove functionsGuenter Roeck2011-10-2410-21/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Driver remove functions have an error return value, but rarely return an error in practice. If a driver does return an error from its remove function, the driver won't be unloaded and is expected to stay alive. pmbus_do_remove() is defined as returning an int, but always returns 0 (no error). Calling code passes that return value on to high level driver remove functions, but does not evaluate it and removes driver data even if pmbus_do_remove() returned an error (which it in practice never does). Even if this code could never cause a real problem, it is nevertheless conceptually wrong. To reduce confusion and simplify the code, change pmbus_do_remove() to be a void function, and have PMBus client drivers always return zero in their driver remove functions. Reported-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>
* | | hwmon: (pmbus) Add comments explaining internal driver API return valuesGuenter Roeck2011-10-241-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | Return values for functions reading/writing manufacturer specific registers are poorly explained. Add comments to improve documentation. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>
* | | hwmon: (w83627ehf) add caseopen detectionDmitry Artamonow2011-10-241-0/+62
| |/ |/| | | | | | | | | | | | | | | Export caseopen alarm status into userspace for Winbond W83627* and Nuvoton NCT677[56] chips and implement alarm clear attribute. Second caseopen alarm on NCT6776 is also supported. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
OpenPOWER on IntegriCloud