aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-03-03hwmon: (max1668) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck1-49/+18
Simplify code, reduce code size, and attach hwmon attributes to hwmon device. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-03-03hwmon: (max1668) Don't hide return value from i2c_smbus_write_byte_dataGuenter Roeck1-6/+8
i2c_smbus_write_byte_data returns a valid error code. Return it to the user instead of replacing it with -EIO. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-03-03hwmon: Driver for TI ADC128D818Guenter Roeck3-0/+502
ADC128D818 is a System Monitor with Temperature Sensor. It is similar to LM80 and LM96080, but has 16 bit wide sensor registers and no fan speed monitoring. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03hwmon: Sort Kconfig entries alphabeticallyJean Delvare1-308/+308
Entries have been added at more or less random positions over time, so it becomes difficult to find what you are looking for or figure out where to insert new entries. Signed-off-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03hwmon: (lm95245) Avoid initializing the same field twiceJean Delvare1-1/+0
data is kzalloc'd, so data->valid is already 0. Signed-off-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03hwmon: (lm95241) Avoid initializing the same field twiceJean Delvare1-2/+0
data is kzalloc'd, so data->valid and data->model are already 0. Signed-off-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03hwmon: (emc2103) Return error from i2c_smbus_read_byte_dataGuenter Roeck1-1/+1
There is no reason to replace one error with another. smatch message: drivers/hwmon/emc2103.c:352 set_fan_div() info: why not propagate 'status' from i2c_smbus_read_byte_data() instead of (-5)? Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03hwmon: (smm665): Return error from i2c_smbus_read_word_swappedGuenter Roeck1-1/+1
There is no reason to replace one error code with another, and returning -1 as error code is wrong anyway. Smatch log: drivers/hwmon/smm665.c:225 smm665_read_adc() info: why not propagate 'rv' from i2c_smbus_read_word_swapped() instead of (-1)? Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03hwmon: (ltc4260) Fix trivial typoAxel Lin1-1/+1
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03hwmon: (jz4740) Use devm_ioremap_resource()Jingoo Han1-20/+5
Use devm_ioremap_resource() in order to make the code simpler, and move 'struct resource *mem' from 'struct jz4740_hwmon' to jz4740_hwmon_probe() because the 'mem' variable is used only in jz4740_hwmon_probe(). Also the redundant return value check of platform_get_resource() is removed, because the value is checked by devm_ioremap_resource(). Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03hwmon: Driver for Linear Technologies LTC2945Guenter Roeck3-0/+532
LTC2945 is a system monitor that measures current, voltage, and power. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03hwmon: Driver for Linear Technologies LTC4260Guenter Roeck3-0/+213
LTC4260 is a Positive Voltage Hot Swap Controller. The driver currently only supports voltage monitoring, not voltage control. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03hwmon: Driver for Linear Technologies LTC4222Guenter Roeck3-0/+250
Driver Linear Technologies LTC4222 Dual Hot Swap Controller The driver currently only supports voltage monitoring, not voltage control. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03hwmon: (iio_hwmon) Convert to use hwmon_device_register_with_groupsGuenter Roeck1-25/+12
Simplify code and create name attribute automatically. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-03-03hwmon: (lm95241) Convert to use devm_hwmon_device_register_with_groupsGuenter Roeck1-61/+30
Simplify code, reduce code size, and attach hwmon attributes to hwmon device. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-02-18hwmon: (max1668) Fix writing the minimum temperatureGuenter Roeck1-1/+1
When trying to set the minimum temperature, the driver was erroneously writing the maximum temperature into the chip. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: stable@vger.kernel.org # v3.2+ Reviewed-by: Jean Delvare <jdelvare@suse.de>
2014-02-13hwmon: (ntc_thermistor) Avoid math overflowDoug Anderson1-3/+3
The ntc thermistor code was doing math whose temporary result might have overflowed 32-bits. We need some casts in there to make it safe. In one example I found: - pullup_uV: 1800000 - result of iio_read_channel_raw: 3226 - 1800000 * 3226 => 0x15a1cbc80 Signed-off-by: Doug Anderson <dianders@chromium.org> Cc: stable@vger.kernel.org # 3.10+ Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-02-06hwmon: (da9055) Remove use of regmap_irq_get_virq()Adam Thomson1-4/+0
Remove use of regmap_irq_get_virq() in driver probe which was conflicting with use of platform_get_irq_byname(). platform_get_irq_byname() already returns the VIRQ number due to MFD core translation so using regmap_irq_get_virq() on that returned value results in an incorrect IRQ being requested. The driver probes then fail because of this. Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-02-02hwmon: (pmbus) Support per-page exponent in linear modeGuenter Roeck1-32/+36
Some chips use different exponents for sensors on different pages or rails. Detect and store exponent per page to support this situation. This fixes a problem with wrong voltages seen on UCD90120. Reported-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Tested-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-02-02hwmon: Fix SENSORS_TMP102 dependencies to eliminate build errorsJean Delvare1-0/+1
Similar to what was done for the lm75 driver. Add depends on THERMAL since that is what provides the register/unregister functions above, but only if THERMAL_OF was selected as this is an optional feature of the driver. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Randy Dunlap <rdunlap@infradead.org> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
2014-02-02hwmon: Fix SENSORS_LM75 dependencies to eliminate build errorsJean Delvare1-0/+1
Based on an earlier attempt by Randy Dunlap. Fix SENSORS_LM75 dependencies to eliminate build errors: drivers/built-in.o: In function `lm75_remove': lm75.c:(.text+0x12bd8c): undefined reference to `thermal_zone_of_sensor_unregister' drivers/built-in.o: In function `lm75_probe': lm75.c:(.text+0x12c123): undefined reference to `thermal_zone_of_sensor_register' Add depends on THERMAL since that is what provides the register/unregister functions above, but only if THERMAL_OF was selected as this is an optional feature of the driver. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Randy Dunlap <rdunlap@infradead.org> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
2014-01-29Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/stagingLinus Torvalds32-68/+135
Pull hwmon updates from Jean Delvare: "This include it87 driver improvements, and a tree-wide change of my e-mail address" * 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: Update Jean Delvare's e-mail address hwmon: (it87) Print proper names for the IT8771E and IT8772E hwmon: (it87) Add support for the ITE IT8603E
2014-01-29Update Jean Delvare's e-mail addressJean Delvare31-48/+47
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2014-01-29hwmon: (it87) Print proper names for the IT8771E and IT8772EJean Delvare1-0/+1
The driver prints IT8771F and IT8772F instead of IT8771E and IT8772E respectively when the driver is loaded. This is a cosmetic only bug but let's fix it. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2014-01-29hwmon: (it87) Add support for the ITE IT8603ERudolf Marek2-20/+87
Add support for IT8603E. This closes bug #57861: https://bugzilla.kernel.org/show_bug.cgi?id=57861 [JD: Fixes and clean-ups.] Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2014-01-24Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linuxLinus Torvalds2-5/+49
Pull thermal management updates from Zhang Rui: "This time, the biggest change is the work of representing hardware thermal properties in device tree infrastructure. This work includes the introduction of a device tree bindings for describing the hardware thermal behavior and limits, and also a parser to read and interpret the data, and build thermal zones and thermal binding parameters. It also contains three examples on how to use the new representation on sensor devices, using three different drivers to accomplish it. One driver is in thermal subsystem, the TI SoC thermal, and the other two drivers are in hwmon subsystem. Actually, this would be the first step of the complete work because we still need to check other potential drivers to be converted and then validate the proposed API. But the reason why I include it in this pull request is that, first, this change does not hurt any others without using this approach, second, the principle and concept of this change would not break after converting the remaining drivers. BTW, as you can see, there are several points in this change that do not belong to thermal subsystem. Because it has been suggested by Guenter R that in such cases, it is recommended to send the complete series via one single subsystem. Specifics: - representing hardware thermal properties in device tree infrastructure - fix a regression that the imx thermal driver breaks system suspend. - introduce ACPI INT3403 thermal driver to retrieve temperature data from the INT3403 ACPI device object present on some systems. - introduce debug statement for thermal core and step_wise governor. - assorted fixes and cleanups for thermal core, cpu cooling, exynos thrmal, intel powerclamp and imx thermal driver" * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (34 commits) thermal: remove const flag from .ops of imx thermal Thermal: update thermal zone device after setting emul_temp intel_powerclamp: Fix cstate counter detection. thermal: imx: add necessary clk operation Thermal cpu cooling: return error if no valid cpu frequency entry thermal: fix cpu_cooling max_level behavior thermal: rcar-thermal: Enable driver compilation with COMPILE_TEST thermal: debug: add debug statement for core and step_wise thermal: imx_thermal: add module device table drivers: thermal: Mark function as static in x86_pkg_temp_thermal.c thermal:samsung: fix compilation warning thermal: imx: correct suspend/resume flow thermal: exynos: fix error return code Thermal: ACPI INT3403 thermal driver MAINTAINERS: add thermal bindings entry in thermal domain arm: dts: make OMAP4460 bandgap node to belong to OCP arm: dts: make OMAP443x bandgap node to belong to OCP arm: dts: add cooling properties on omap5 cpu node arm: dts: add omap5 thermal data arm: dts: add omap5 CORE thermal data ...
2014-01-24Merge tag 'pm+acpi-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pmLinus Torvalds2-7/+2
Pull ACPI and power management updates from Rafael Wysocki: "As far as the number of commits goes, the top spot belongs to ACPI this time with cpufreq in the second position and a handful of PM core, PNP and cpuidle updates. They are fixes and cleanups mostly, as usual, with a couple of new features in the mix. The most visible change is probably that we will create struct acpi_device objects (visible in sysfs) for all devices represented in the ACPI tables regardless of their status and there will be a new sysfs attribute under those objects allowing user space to check that status via _STA. Consequently, ACPI device eject or generally hot-removal will not delete those objects, unless the table containing the corresponding namespace nodes is unloaded, which is extremely rare. Also ACPI container hotplug will be handled quite a bit differently and cpufreq will support CPU boost ("turbo") generically and not only in the acpi-cpufreq driver. Specifics: - ACPI core changes to make it create a struct acpi_device object for every device represented in the ACPI tables during all namespace scans regardless of the current status of that device. In accordance with this, ACPI hotplug operations will not delete those objects, unless the underlying ACPI tables go away. - On top of the above, new sysfs attribute for ACPI device objects allowing user space to check device status by triggering the execution of _STA for its ACPI object. From Srinivas Pandruvada. - ACPI core hotplug changes reducing code duplication, integrating the PCI root hotplug with the core and reworking container hotplug. - ACPI core simplifications making it use ACPI_COMPANION() in the code "glueing" ACPI device objects to "physical" devices. - ACPICA update to upstream version 20131218. This adds support for the DBG2 and PCCT tables to ACPICA, fixes some bugs and improves debug facilities. From Bob Moore, Lv Zheng and Betty Dall. - Init code change to carry out the early ACPI initialization earlier. That should allow us to use ACPI during the timekeeping initialization and possibly to simplify the EFI initialization too. From Chun-Yi Lee. - Clenups of the inclusions of ACPI headers in many places all over from Lv Zheng and Rashika Kheria (work in progress). - New helper for ACPI _DSM execution and rework of the code in drivers that uses _DSM to execute it via the new helper. From Jiang Liu. - New Win8 OSI blacklist entries from Takashi Iwai. - Assorted ACPI fixes and cleanups from Al Stone, Emil Goode, Hanjun Guo, Lan Tianyu, Masanari Iida, Oliver Neukum, Prarit Bhargava, Rashika Kheria, Tang Chen, Zhang Rui. - intel_pstate driver updates, including proper Baytrail support, from Dirk Brandewie and intel_pstate documentation from Ramkumar Ramachandra. - Generic CPU boost ("turbo") support for cpufreq from Lukasz Majewski. - powernow-k6 cpufreq driver fixes from Mikulas Patocka. - cpufreq core fixes and cleanups from Viresh Kumar, Jane Li, Mark Brown. - Assorted cpufreq drivers fixes and cleanups from Anson Huang, John Tobias, Paul Bolle, Paul Walmsley, Sachin Kamat, Shawn Guo, Viresh Kumar. - cpuidle cleanups from Bartlomiej Zolnierkiewicz. - Support for hibernation APM events from Bin Shi. - Hibernation fix to avoid bringing up nonboot CPUs with ACPI EC disabled during thaw transitions from Bjørn Mork. - PM core fixes and cleanups from Ben Dooks, Leonardo Potenza, Ulf Hansson. - PNP subsystem fixes and cleanups from Dmitry Torokhov, Levente Kurusa, Rashika Kheria. - New tool for profiling system suspend from Todd E Brandt and a cpupower tool cleanup from One Thousand Gnomes" * tag 'pm+acpi-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (153 commits) thermal: exynos: boost: Automatic enable/disable of BOOST feature (at Exynos4412) cpufreq: exynos4x12: Change L0 driver data to CPUFREQ_BOOST_FREQ Documentation: cpufreq / boost: Update BOOST documentation cpufreq: exynos: Extend Exynos cpufreq driver to support boost cpufreq / boost: Kconfig: Support for software-managed BOOST acpi-cpufreq: Adjust the code to use the common boost attribute cpufreq: Add boost frequency support in core intel_pstate: Add trace point to report internal state. cpufreq: introduce cpufreq_generic_get() routine ARM: SA1100: Create dummy clk_get_rate() to avoid build failures cpufreq: stats: create sysfs entries when cpufreq_stats is a module cpufreq: stats: free table and remove sysfs entry in a single routine cpufreq: stats: remove hotplug notifiers cpufreq: stats: handle cpufreq_unregister_driver() and suspend/resume properly cpufreq: speedstep: remove unused speedstep_get_state platform: introduce OF style 'modalias' support for platform bus PM / tools: new tool for suspend/resume performance optimization ACPI: fix module autoloading for ACPI enumerated devices ACPI: add module autoloading support for ACPI enumerated devices ACPI: fix create_modalias() return value handling ...
2014-01-14hwmon: (k10temp) Add support for Kaveri CPUsPhil Pokorny1-0/+1
Add new PCI ID to support new model "Kaveri" family. Signed-off-by: Philip Pokorny <ppokorny@penguincomputing.com> Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-01-14hwmon: (nct6775) Re-enable logical device mapping for NCT6791 during resumeGuenter Roeck1-11/+27
After a suspend/resume cycle, the NCT6791 is back to its original BIOS programming. In this state, HWMON IO access may be locked. Re-enable it during resume. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-01-14hwmon: (coretemp) Do not return -EAGAIN for low temperaturesGuenter Roeck1-8/+9
Some Intel CPUs do not set the 'valid' bit in IA32_THERM_STATUS if the temperature is too low to be measured. This condition will not change until the CPU is hot enough for its temperature to be measured. Returning an error in such conditions is not very useful. Drop checking the valid bit and just return the reported temperature instead. Reviewed-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-01-14hwmon: (da9052) Fix adc to voltage calculationAnthony Olech1-2/+2
The ADC resolution of the PMIC is 10-bits, this means that the maximum possible value is 1023 and not the 1024 as originally in the code. Signed-off-by: Anthony Olech <anthony.olech.opensource@diasemi.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-01-14hwmon: (coretemp) Refine TjMax detectionGuenter Roeck1-2/+2
Intel's turbostat code uses only 7 bits from MSR_IA32_TEMPERATURE_TARGET to read TjMax, and also only accepts it if the reported temperature is at least 85 degrees C. Play safe and do the same. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-01-14hwmon: (coretemp) Add PCI device ID for CE41x0 CPUsGuenter Roeck1-3/+1
Since we now have to use PCI IDs to detect CPU types anyway, use this mechanism to detect CE41x0 CPUs. Advantage is that it only requires a single entry and covers all variants of CE41x0, including those unknown to us. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-01-14hwmon: (coretemp) Use PCI host bridge ID to identify CPU if necessaryGuenter Roeck1-3/+30
Atom S12x0 CPUs are identified by the CPU host bridge ID. Add an override table based on PCI IDs as well as code to detect it. PCI access functions can now be called with PCI disabled, so unlike previous attempts to use PCI IDs, the code no longer depends on it. If PCI is disabled, the CPU will not be identified correctly. Since it is unlikely that anything will work in this case, this is an acceptable limitation. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-01-14hwmon: remove DEFINE_PCI_DEVICE_TABLE macroJingoo Han6-6/+6
Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro is not preferred. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-01-14hwmon: (coretemp) Fix truncated name of alarm attributesJean Delvare1-1/+1
When the core number exceeds 9, the size of the buffer storing the alarm attribute name is insufficient and the attribute name is truncated. This causes libsensors to skip these attributes as the truncated name is not recognized. Reported-by: Andreas Hollmann <hollmann@in.tum.de> Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: stable@vger.kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-01-12Merge branch 'acpi-cleanup'Rafael J. Wysocki2-7/+2
* acpi-cleanup: (22 commits) ACPI / tables: Return proper error codes from acpi_table_parse() and fix comment. ACPI / tables: Check if id is NULL in acpi_table_parse() ACPI / proc: Include appropriate header file in proc.c ACPI / EC: Remove unused functions and add prototype declaration in internal.h ACPI / dock: Include appropriate header file in dock.c ACPI / PCI: Include appropriate header file in pci_link.c ACPI / PCI: Include appropriate header file in pci_slot.c ACPI / EC: Mark the function acpi_ec_add_debugfs() as static in ec_sys.c ACPI / NVS: Include appropriate header file in nvs.c ACPI / OSL: Mark the function acpi_table_checksum() as static ACPI / processor: initialize a variable to silence compiler warning ACPI / processor: use ACPI_COMPANION() to get ACPI device ACPI: correct minor typos ACPI / sleep: Drop redundant acpi_disabled check ACPI / dock: Drop redundant acpi_disabled check ACPI / table: Replace '1' with specific error return values ACPI: remove trailing whitespace ACPI / IBFT: Fix incorrect <acpi/acpi.h> inclusion in iSCSI boot firmware module ACPI / i915: Fix incorrect <acpi/acpi.h> inclusions via <linux/acpi_io.h> SFI / ACPI: Fix warnings reported during builds with W=1 ... Conflicts: drivers/acpi/nvs.c drivers/hwmon/asus_atk0110.c
2013-12-12Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-stagingLinus Torvalds1-2/+14
Pull hwmon fix from Guenter Roeck: "Fix HIH-6130 driver to work with BeagleBone" * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: HIH-6130: Support I2C bus drivers without I2C_FUNC_SMBUS_QUICK
2013-12-12hwmon: Prevent some divide by zeros in FAN_TO_REG()Dan Carpenter3-1/+5
The "rpm * div" operations can overflow here, so this patch adds an upper limit to rpm to prevent that. Jean Delvare helped me with this patch. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Roger Lucas <vt8231@hiddenengine.co.uk> Cc: stable@vger.kernel.org Signed-off-by: Jean Delvare <khali@linux-fr.org>
2013-12-12hwmon: (w83l768ng) Fix fan speed control rangeJean Delvare1-3/+6
The W83L786NG stores the fan speed on 4 bits while the sysfs interface uses a 0-255 range. Thus the driver should scale the user input down to map it to the device range, and scale up the value read from the device before presenting it to the user. The reserved register nibble should be left unchanged. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: stable@vger.kernel.org Reviewed-by: Guenter Roeck <linux@roeck-us.net>
2013-12-12hwmon: (w83l786ng) Fix fan speed control mode setting and reportingBrian Carnes1-2/+2
The wrong mask is used, which causes some fan speed control modes (pwmX_enable) to be incorrectly reported, and some modes to be impossible to set. [JD: add subject and description.] Signed-off-by: Brian Carnes <bmcarnes@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Jean Delvare <khali@linux-fr.org>
2013-12-12hwmon: (lm90) Unregister hwmon device if interrupt setup failsGuenter Roeck1-1/+3
Commit 109b1283fb (hwmon: (lm90) Add support to handle IRQ) introduced interrupt support. Its error handling code fails to unregister the already registered hwmon device. Fixes: 109b1283fb532ac773a076748ffccf76a7067cab Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2013-12-11hwmon: HIH-6130: Support I2C bus drivers without I2C_FUNC_SMBUS_QUICKJosé Miguel Gonçalves1-2/+14
Some I2C bus drivers do not allow zero-length data transfers which are required to start a measurement with the HIH6130/1 sensor. Nevertheless, we can overcome this limitation by writing a zero dummy byte. This byte is ignored by the sensor and was verified to be working with the OMAP I2C bus driver in a BeagleBone board. Signed-off-by: José Miguel Gonçalves <jose.goncalves@inov.pt> [Guenter Roeck: Simplified complexity of write_length initialization] Cc: stable@vger.kernel.org # v3.10+ Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-12-07ACPI: Clean up inclusions of ACPI header filesLv Zheng2-8/+2
Replace direct inclusions of <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h>, which are incorrect, with <linux/acpi.h> inclusions and remove some inclusions of those files that aren't necessary. First of all, <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h> should not be included directly from any files that are built for CONFIG_ACPI unset, because that generally leads to build warnings about undefined symbols in !CONFIG_ACPI builds. For CONFIG_ACPI set, <linux/acpi.h> includes those files and for CONFIG_ACPI unset it provides stub ACPI symbols to be used in that case. Second, there are ordering dependencies between those files that always have to be met. Namely, it is required that <acpi/acpi_bus.h> be included prior to <acpi/acpi_drivers.h> so that the acpi_pci_root declarations the latter depends on are always there. And <acpi/acpi.h> which provides basic ACPICA type declarations should always be included prior to any other ACPI headers in CONFIG_ACPI builds. That also is taken care of including <linux/acpi.h> as appropriate. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Matthew Garrett <mjg59@srcf.ucam.org> Cc: Tony Luck <tony.luck@intel.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> (drivers/pci stuff) Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> (Xen stuff) Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-12-04hwmon: tmp102: expose to thermal fw via DT nodesEduardo Valentin1-0/+19
This patch adds to tmp102 temperature sensor the possibility to expose itself as thermal zone device, registered on the thermal framework. The thermal zone is built only if a device tree node describing a thermal zone for this sensor is present inside the tmp102 DT node. Otherwise, the driver behavior will be the same. Note: This patch has also been reviewed by Jean D. He has requested to perform a wider inspection of possible users of thermal and hwmon interaction API. On the other hand, the change on this patch is acceptable on first step of overall code change. Cc: Jean Delvare <khali@linux-fr.org> Cc: lm-sensors@lm-sensors.org Cc: linux-kernel@vger.kernel.org Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-12-04hwmon: lm75: expose to thermal fw via DT nodesEduardo Valentin1-5/+30
This patch adds to lm75 temperature sensor the possibility to expose itself as thermal zone device, registered on the thermal framework. The thermal zone is built only if a device tree node describing a thermal zone for this sensor is present inside the lm75 DT node. Otherwise, the driver behavior will be the same. Note: This patch has also been reviewed by Jean D. He has requested to perform a wider inspection of possible users of thermal and hwmon interaction API. On the other hand, the change on this patch is acceptable on first step of overall code change. Cc: Jean Delvare <khali@linux-fr.org> Cc: lm-sensors@lm-sensors.org Cc: linux-kernel@vger.kernel.org Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-11-27Merge branch 'acpica'Rafael J. Wysocki1-1/+0
* acpica: ACPI: Clean up incorrect inclusions of ACPICA headers ACPICA: Update version to 20131115. ACPICA: Add support to delete all objects attached to the root namespace node. ACPICA: Delete all attached data objects during namespace node deletion. ACPICA: Resources: Fix loop termination for the get AML length function. ACPICA: Tests: Add CHECKSUM_ABORT protection for test utilities. ACPICA: Debug output: Do not emit function nesting level for kernel build.
2013-11-26ACPI: Clean up incorrect inclusions of ACPICA headersLv Zheng1-1/+0
Header file <acpi/acpi.h> contains environemnt settings and architecture specific implementation that should be included before any other ACPICA headers in order to keep a consistent build environment for ACPICA users. The following internal ACPICA header files should be included from <acpi/acpi.h> and should not be included by other kernel files: <acpi/acpiosxf.h> <acpi/acpixf.h> Clean up incorrect inclusions of these files from non-ACPICA source files. [rjw: Subject and changelog] Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-11-20hwmon: (acpi_power_meter) Fix acpi_bus_get_device() return value checkYijing Wang1-3/+2
Since acpi_bus_get_device() returns plain int and not acpi_status, ACPI_FAILURE() should not be used for checking its return value. Fix that. Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-11-18hwmon: (nct6775) NCT6791 supports weight control only for CPUFANGuenter Roeck1-8/+21
Unlike other chips supported by this driver, the NCT6791 only has a single set of registers to configure weighted fan control. Enable it only for the single channel supporting it. Signed-off-by: Guenter Roeck <linux@roeck-us.net>