aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-09-03hwmon: w83795: Fan control option isn't that dangerousJean Delvare1-6/+1
I have been using SENSORS_W83795_FANCTRL for several years and never had any problem. When the driver was added, I had not tested that part of the driver yet so I wanted to be super cautious, but time has shown that it works just fine. In the long run I even believe that we should drop the option and enable the feature unconditionally. It doesn't do anything until the user explicitly starts twiddling with sysfs attributes anyway. Signed-off-by: Jean Delvare <jdelvare@suse.de> Link: https://lore.kernel.org/r/20190806102123.3118bcc5@endymion Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03hwmon: (npcm750-pwm-fan) Remove dev_err() usage after platform_get_irq()Stephen Boyd1-3/+1
We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Cc: Jean Delvare <jdelvare@suse.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: linux-hwmon@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stephen Boyd <swboyd@chromium.org> [groeck: Dropped jz4740-hwmon.c (driver is being removed)] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03hwmon: (acpi_power_meter) Change log level for 'unsafe software power cap'Wang Shenran1-2/+2
At boot time, the acpi_power_meter driver logs the following error level message: "Ignoring unsafe software power cap". Having read about it from a few sources, it seems that the error message can be quite misleading. While the message can imply that Linux is ignoring the fact that the system is operating in potentially dangerous conditions, the truth is the driver found an ACPI_PMC object that supports software power capping. The driver simply decides not to use it, perhaps because it doesn't support the object. The best solution is probably changing the log level from error to warning. All sources I have found, regarding the error, have downplayed its significance. There is not much of a reason for it to be on error level, while causing potential confusions or misinterpretations. Signed-off-by: Wang Shenran <shenran268@gmail.com> Link: https://lore.kernel.org/r/20190724080110.6952-1-shenran268@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03hwmon: (nct6775) Integrate new model nct6116Björn Gerhart1-6/+174
Add support for NCT6116D to nct6775 driver. Signed-off-by: Bjoern Gerhart <gerhart@posteo.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03hwmon: (adt7475) Convert to use hwmon_device_register_with_groups()Grant McEwan1-96/+50
hwmon_device_register() is a deprecated function and produces a warning. Converting the driver to use the hwmon_device_register_with_groups() instead. Signed-off-by: Grant McEwan <grant.mcewan@alliedtelesis.co.nz> Link: https://lore.kernel.org/r/20190721225530.28799-2-grant.mcewan@alliedtelesis.co.nz Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03hwmon: (w83781d) convert to i2c_new_dummy_deviceWolfram Sang1-3/+3
Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an ERRPTR which we use in error handling. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20190722172611.3797-4-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03hwmon: (smm665) convert to i2c_new_dummy_deviceWolfram Sang1-3/+3
Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an ERRPTR which we use in error handling. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20190722172611.3797-3-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03hwmon: (asb100) convert to i2c_new_dummy_deviceWolfram Sang1-6/+6
Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an ERRPTR which we use in error handling. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20190722172611.3797-2-wsa+renesas@sang-engineering.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03hwmon: (k10temp) Add support for AMD family 17h, model 70h CPUsMarcel Bocu1-0/+1
It would seem like model 70h is behaving in the same way as model 30h, so let's just add the new F3 PCI ID to the list of compatible devices. Unlike previous Ryzen/Threadripper, Ryzen gen 3 processors do not need temperature offsets anymore. This has been reported in the press and verified on my Ryzen 3700X by checking that the idle temperature reported by k10temp is matching the temperature reported by the firmware. Vicki Pfau sent an identical patch after I checked that no-one had written this patch. I would have been happy about dropping my patch but unlike for his patch series, I had already Cc:ed the x86 people and they already reviewed the changes. Since Vicki has not answered to any email after his initial series, let's assume she is on vacation and let's avoid duplication of reviews from the maintainers and merge my series. To acknowledge Vicki's anteriority, I added her S-o-b to the patch. v2, suggested by Guenter Roeck and Brian Woods: - rename from 71h to 70h Signed-off-by: Vicki Pfau <vi@endrift.com> Signed-off-by: Marcel Bocu <marcel.p.bocu@gmail.com> Tested-by: Marcel Bocu <marcel.p.bocu@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: x86@kernel.org Cc: "Woods, Brian" <Brian.Woods@amd.com> Cc: Clemens Ladisch <clemens@ladisch.de> Cc: Jean Delvare <jdelvare@suse.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: linux-hwmon@vger.kernel.org Link: https://lore.kernel.org/r/20190722174653.2391-1-marcel.p.bocu@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03hwmon: (k8temp) update to use new hwmon registration APIRobert Karszniewicz1-164/+69
Removes: - hwmon_dev from k8temp_data struct, as that is now passed to callbacks, anyway. - other k8temp_data struct fields, too. - k8temp_update_device() Also reduces binary size: text data bss dec hex filename 4139 1448 0 5587 15d3 drivers/hwmon/k8temp.ko.bak 3103 1220 0 4323 10e3 drivers/hwmon/k8temp.ko Signed-off-by: Robert Karszniewicz <avoidr@firemail.cc> Signed-off-by: Robert Karszniewicz <avoidr@riseup.net> Link: https://lore.kernel.org/r/20190721120051.28064-1-avoidr@riseup.net Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03hwmon: (pmbus/max31785) Remove a useless #defineChristophe JAILLET1-2/+0
There is a typo in MAX37185_NUM_FAN_PAGES. To be consistent, it should be MAX31785_NUM_FAN_PAGES (1 and 7 switched). At line 24, we already have: #define MAX31785_NR_FAN_PAGES 6 and MAX37185_NUM_FAN_PAGES seems to be unused. It is likely that it is only a typo and/or a left-over. So, axe it. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/20190721101553.20911-1-christophe.jaillet@wanadoo.fr Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03hwmon: (lm75) add support for PCT2075Daniel Mack1-0/+10
The NXP PCT2075 is largely compatible with other chips already supported by the LM75 driver. It uses an 11-bit resolution and defaults to 100 ms sampling period. The datasheet is here: https://www.nxp.com/docs/en/data-sheet/PCT2075.pdf Signed-off-by: Daniel Mack <daniel@zonque.org> Link: https://lore.kernel.org/r/20190711124504.7580-2-daniel@zonque.org [groeck: Documentation update] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03hwmon: Remove ads1015 driverGuenter Roeck3-335/+0
A driver for ADS1015 with more functionality is available in the iio subsystem. Remove the hwmon driver as duplicate. If the chip is used for hardware monitoring, the iio->hwmon bridge should be used. Cc: Dirk Eibach <eibach@gdsys.de> Link: https://lore.kernel.org/r/1562004758-13025-1-git-send-email-linux@roeck-us.net Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-08-31hwmon (coretemp) Fix a memory leak bugWenwen Wang1-1/+2
In coretemp_init(), 'zone_devices' is allocated through kcalloc(). However, it is not deallocated in the following execution if platform_driver_register() fails, leading to a memory leak. To fix this issue, introduce the 'outzone' label to free 'zone_devices' before returning the error. Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu> Link: https://lore.kernel.org/r/1566248402-6538-1-git-send-email-wenwen@cs.uga.edu Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-08-31hwmon: (lm75) Fix write operations for negative temperaturesGuenter Roeck1-1/+1
Writes into limit registers fail if the temperature written is negative. The regmap write operation checks the value range, regmap_write accepts an unsigned int as parameter, and the temperature value passed to regmap_write is kept in a variable declared as long. Negative values are converted large unsigned integers, which fails the range check. Fix by type casting the temperature to u16 when calling regmap_write(). Cc: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk> Fixes: e65365fed87f ("hwmon: (lm75) Convert to use regmap") Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-08-31hwmon: pmbus: ucd9000: remove unneeded includeBartosz Golaszewski1-1/+0
Build bot reports the following build issue after commit 9091373ab7ea ("gpio: remove less important #ifdef around declarations): In file included from drivers/hwmon/pmbus/ucd9000.c:19:0: >> include/linux/gpio/driver.h:576:1: error: redefinition of 'gpiochip_add_pin_range' gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, ^~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/hwmon/pmbus/ucd9000.c:18:0: include/linux/gpio.h:245:1: note: previous definition of 'gpiochip_add_pin_range' was here gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, ^~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/hwmon/pmbus/ucd9000.c:19:0: >> include/linux/gpio/driver.h:583:1: error: redefinition of 'gpiochip_add_pingroup_range' gpiochip_add_pingroup_range(struct gpio_chip *chip, ^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/hwmon/pmbus/ucd9000.c:18:0: include/linux/gpio.h:254:1: note: previous definition of 'gpiochip_add_pingroup_range' was here gpiochip_add_pingroup_range(struct gpio_chip *chip, ^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/hwmon/pmbus/ucd9000.c:19:0: >> include/linux/gpio/driver.h:591:1: error: redefinition of 'gpiochip_remove_pin_ranges' gpiochip_remove_pin_ranges(struct gpio_chip *chip) ^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/hwmon/pmbus/ucd9000.c:18:0: include/linux/gpio.h:263:1: note: previous definition of 'gpiochip_remove_pin_ranges' was here gpiochip_remove_pin_ranges(struct gpio_chip *chip) This is caused by conflicting defines from linux/gpio.h and linux/gpio/driver.h. Drivers should not include both the legacy and the new API headers. This driver doesn't even use linux/gpio.h so remove it. Reported-by: kbuild test robot <lkp@intel.com> Cc: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Link: https://lore.kernel.org/r/20190808080144.6183-1-brgl@bgdev.pl Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-08-28hwmon: pwm-fan: Use platform_get_irq_optional()Thierry Reding1-1/+1
The PWM fan interrupt is optional, so we don't want an error message in the kernel log if it wasn't specified. Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Link: https://lore.kernel.org/r/20190828083411.2496-2-thierry.reding@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-12firmware: arm_scmi: Drop async flag in sensor_ops->reading_getSudeep Holla1-1/+1
SENSOR_DESCRIPTION_GET provides attributes to indicate if the sensor supports asynchronous read. Ideally we should be able to read that flag and use asynchronous reads for any sensors with that attribute set. In order to add that support, let's drop the async flag passed to sensor_ops->reading_get and dynamically switch between sync and async flags based on the attributes as provided by the firmware. Cc: linux-hwmon@vger.kernel.org Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2019-08-07hwmon: (lm75) Fixup tmp75b clr_maskIker Perez del Palomar Sustatxa1-1/+1
The configuration register of the tmp75b sensor is 16bit long, however the first byte is reserved, so there is not no need to take care of it. Because the order of the bytes is little endian and it is only necessary to write one byte, the desired bits must be shifted into a 8 bit range. Fixes: 39abe9d88b30 ("hwmon: (lm75) Add support for TMP75B") Cc: stable@vger.kernel.org Signed-off-by: Iker Perez del Palomar Sustatxa <iker.perez@codethink.co.uk> Link: https://lore.kernel.org/r/20190801075324.4638-1-iker.perez@codethink.co.uk Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-08-07hwmon: (nct7802) Fix wrong detection of in4 presenceGuenter Roeck1-3/+3
The code to detect if in4 is present is wrong; if in4 is not present, the in4_input sysfs attribute is still present. In detail: - Ihen RTD3_MD=11 (VSEN3 present), everything is as expected (no bug). - If we have RTD3_MD!=11 (no VSEN3), we unexpectedly have a in4_input file under /sys and the "sensors" command displays in4_input. But as expected, we have no in4_min, in4_max, in4_alarm, in4_beep. Fix is_visible function to detect and report in4_input visibility as expected. Reported-by: Gilles Buloz <Gilles.Buloz@kontron.com> Cc: Gilles Buloz <Gilles.Buloz@kontron.com> Cc: stable@vger.kernel.org Fixes: 3434f37835804 ("hwmon: Driver for Nuvoton NCT7802Y") Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-07-31docs: i2c: convert to ReST and add to driver-api booksetMauro Carvalho Chehab2-2/+2
Convert each file at I2C subsystem, renaming them to .rst and adding to the driver-api book. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Acked-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2019-07-30hwmon: Drop obsolete JZ4740 driverPaul Cercueil3-146/+0
The JZ4740 boards now use the iio-hwmon driver. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Tested-by: Artur Rojek <contact@artur-rojek.eu> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Paul Burton <paul.burton@mips.com>
2019-07-21hwmon: (nct6775) Fix register address and added missed tolerance for nct6106Björn Gerhart1-1/+2
Fixed address of third NCT6106_REG_WEIGHT_DUTY_STEP, and added missed NCT6106_REG_TOLERANCE_H. Fixes: 6c009501ff200 ("hwmon: (nct6775) Add support for NCT6102D/6106D") Signed-off-by: Bjoern Gerhart <gerhart@posteo.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-07-21hwmon: (occ) Fix division by zero issueLei YU1-2/+4
The code in occ_get_powr_avg() invokes div64_u64() without checking the divisor. In case the divisor is zero, kernel gets an "Division by zero in kernel" error. Check the divisor and make it return 0 if the divisor is 0. Fixes: c10e753d43eb ("hwmon (occ): Add sensor types and versions") Signed-off-by: Lei YU <mine260309@gmail.com> Reviewed-by: Eddie James <eajames@linux.ibm.com> Link: https://lore.kernel.org/r/1562813088-23708-1-git-send-email-mine260309@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-07-19Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/socLinus Torvalds1-0/+48
Pull ARM SoC-related driver updates from Olof Johansson: "Various driver updates for platforms and a couple of the small driver subsystems we merge through our tree: - A driver for SCU (system control) on NXP i.MX8QXP - Qualcomm Always-on Subsystem messaging driver (AOSS QMP) - Qualcomm PM support for MSM8998 - Support for a newer version of DRAM PHY driver for Broadcom (DPFE) - Reset controller support for Bitmain BM1880 - TI SCI (System Control Interface) support for CPU control on AM654 processors - More TI sysc refactoring and rework" * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (84 commits) reset: remove redundant null check on pointer dev soc: rockchip: work around clang warning dt-bindings: reset: imx7: Fix the spelling of 'indices' soc: imx: Add i.MX8MN SoC driver support soc: aspeed: lpc-ctrl: Fix probe error handling soc: qcom: geni: Add support for ACPI firmware: ti_sci: Fix gcc unused-but-set-variable warning firmware: ti_sci: Use the correct style for SPDX License Identifier soc: imx8: Use existing of_root directly soc: imx8: Fix potential kernel dump in error path firmware/psci: psci_checker: Park kthreads before stopping them memory: move jedec_ddr.h from include/memory to drivers/memory/ memory: move jedec_ddr_data.c from lib/ to drivers/memory/ MAINTAINERS: Remove myself as qcom maintainer soc: aspeed: lpc-ctrl: make parameter optional soc: qcom: apr: Don't use reg for domain id soc: qcom: fix QCOM_AOSS_QMP dependency and build errors memory: tegra: Fix -Wunused-const-variable firmware: tegra: Early resume BPMP soc/tegra: Select pinctrl for Tegra194 ...
2019-07-11Merge tag 'char-misc-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-miscLinus Torvalds2-2/+3
Pull char / misc driver updates from Greg KH: "Here is the "large" pull request for char and misc and other assorted smaller driver subsystems for 5.3-rc1. It seems that this tree is becoming the funnel point of lots of smaller driver subsystems, which is fine for me, but that's why it is getting larger over time and does not just contain stuff under drivers/char/ and drivers/misc. Lots of small updates all over the place here from different driver subsystems: - habana driver updates - coresight driver updates - documentation file movements and updates - Android binder fixes and updates - extcon driver updates - google firmware driver updates - fsi driver updates - smaller misc and char driver updates - soundwire driver updates - nvmem driver updates - w1 driver fixes All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (188 commits) coresight: Do not default to CPU0 for missing CPU phandle dt-bindings: coresight: Change CPU phandle to required property ocxl: Allow contexts to be attached with a NULL mm fsi: sbefifo: Don't fail operations when in SBE IPL state coresight: tmc: Smatch: Fix potential NULL pointer dereference coresight: etm3x: Smatch: Fix potential NULL pointer dereference coresight: Potential uninitialized variable in probe() coresight: etb10: Do not call smp_processor_id from preemptible coresight: tmc-etf: Do not call smp_processor_id from preemptible coresight: tmc-etr: alloc_perf_buf: Do not call smp_processor_id from preemptible coresight: tmc-etr: Do not call smp_processor_id() from preemptible docs: misc-devices: convert files without extension to ReST fpga: dfl: fme: align PR buffer size per PR datawidth fpga: dfl: fme: remove copy_to_user() in ioctl for PR fpga: dfl-fme-mgr: fix FME_PR_INTFC_ID register address. intel_th: msu: Start read iterator from a non-empty window intel_th: msu: Split sgt array and pointer in multiwindow mode intel_th: msu: Support multipage blocks intel_th: pci: Add Ice Lake NNPI support intel_th: msu: Fix single mode with disabled IOMMU ...
2019-07-11Merge tag 'hwmon-for-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-stagingLinus Torvalds17-457/+864
Pull hwmon updates from Guenter Roeck: - New drivers for Infineon PXE1610 and IRPS5401 - Minor improvements, cleanup, and fixes in several drivers * tag 'hwmon-for-v5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (33 commits) hwmon: (ina3221) Add of_node_put() before return hwmon: (gpio-fan) fix sysfs notifications and udev events for gpio-fan alarms hwmon: (gpio-fan) move fan_alarm_init after devm_hwmon_device_register_with_groups hwmon: (lm90) Introduce function to update configuration register hwmon: (lm90) Cache configuration register value hwmon: (lm90) Fix max6658 sporadic wrong temperature reading hwmon: (nct7904) Changes comments in probe function. hwmon: (nct7904) Add error handling in probe function. hwmon: Convert remaining drivers to use SPDX identifier hwmon: (max6650) Fix unused variable warning hwmon: (pmbus/adm1275) Fix power sampling support hwmon: (lm90) simplify getting the adapter of a client hwmon: (asus_atk0110) no need to check return value of debugfs_create functions hwmon: (max6650) Fix minor formatting issues hwmon: (max6650) Improve error handling in max6650_update_device hwmon: (max6650) Read non-volatile registers only once hwmon: (max6650) Convert to use devm_hwmon_device_register_with_info hwmon: (max6650) Simplify alarm handling hwmon: (max6650) Cache alarm_en register hwmon: (max6650) Declare valid as boolean ...
2019-07-08Merge branch 'x86-topology-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tipLinus Torvalds1-18/+18
Pull x86 topology updates from Ingo Molnar: "Implement multi-die topology support on Intel CPUs and expose the die topology to user-space tooling, by Len Brown, Kan Liang and Zhang Rui. These changes should have no effect on the kernel's existing understanding of topologies, i.e. there should be no behavioral impact on cache, NUMA, scheduler, perf and other topologies and overall system performance" * 'x86-topology-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/intel/rapl: Cosmetic rename internal variables in response to multi-die/pkg support perf/x86/intel/uncore: Cosmetic renames in response to multi-die/pkg support hwmon/coretemp: Cosmetic: Rename internal variables to zones from packages thermal/x86_pkg_temp_thermal: Cosmetic: Rename internal variables to zones from packages perf/x86/intel/cstate: Support multi-die/package perf/x86/intel/rapl: Support multi-die/package perf/x86/intel/uncore: Support multi-die/package topology: Create core_cpus and die_cpus sysfs attributes topology: Create package_cpus sysfs attribute hwmon/coretemp: Support multi-die/package powercap/intel_rapl: Update RAPL domain name and debug messages thermal/x86_pkg_temp_thermal: Support multi-die/package powercap/intel_rapl: Support multi-die/package powercap/intel_rapl: Simplify rapl_find_package() x86/topology: Define topology_logical_die_id() x86/topology: Define topology_die_id() cpu/topology: Export die_id x86/topology: Create topology_max_die_per_package() x86/topology: Add CPUID.1F multi-die/package support
2019-07-08hwmon: (ina3221) Add of_node_put() before returnNishka Dasgupta1-1/+3
Each iteration of for_each_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the return. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Link: https://lore.kernel.org/r/20190706132130.3129-1-nishkadg.linux@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-07-08hwmon: (gpio-fan) fix sysfs notifications and udev events for gpio-fan alarmsChristian Schneider1-2/+2
sysfs_notify() and kobject_uevent() are passed the wrong device. fan_data->hwmon_dev needs to be passed, so that sysfs notification goes to right place and generated uevent has the right information Signed-off-by: Christian Schneider <cschneider@radiodata.biz> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-07-08hwmon: (gpio-fan) move fan_alarm_init after devm_hwmon_device_register_with_groupsChristian Schneider1-7/+7
This makes it possible to use the hwmon_dev in fan_alarm_notify(). Otherwise it would be possible, that a interupt arrives and fan_alarm_notify() is executed, before hwmon_dev is initialized. Signed-off-by: Christian Schneider <cschneider@radiodata.biz> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-07-08hwmon: (lm90) Introduce function to update configuration registerGuenter Roeck1-49/+40
The code to update the configuration register is repeated several times. Move it into a separate function. At the same time, un-inline lm90_select_remote_channel() and leave it up to the compiler to decide what to do with it. Also remove the 'client' argument from lm90_select_remote_channel() and from lm90_write_convrate() and take it from struct lm90_data instead where needed. This patch reduces code size by more than 800 bytes on x86_64. Cc: Boyang Yu <byu@arista.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-07-08hwmon: (lm90) Cache configuration register valueGuenter Roeck1-31/+28
The configuration register does not change on its own. Yet, it is read in various locations, modified, and written back. Simplify and optimize the code by caching its value and by only writing it back when needed. Cc: Boyang Yu <byu@arista.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-07-08hwmon: (lm90) Fix max6658 sporadic wrong temperature readingBoyang Yu1-4/+38
max6658 may report unrealistically high temperature during the driver initialization, for which, its overtemp alarm pin also gets asserted. For certain devices implementing overtemp protection based on that pin, it may further trigger a reset to the device. By reproducing the problem, the wrong reading is found to be coincident with changing the conversion rate. To mitigate this issue, set the stop bit before changing the conversion rate and unset it thereafter. After such change, the wrong reading is not reproduced. Apply this change only to the max6657 kind for now, controlled by flag LM90_PAUSE_ON_CONFIG. Signed-off-by: Boyang Yu <byu@arista.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-07-08hwmon: (nct7904) Changes comments in probe function.amy.shih1-2/+2
Linux style for comments is the C89 "/* ... */" style, changes the comments to Linux style. Signed-off-by: amy.shih <amy.shih@advantech.com.tw> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-07-08hwmon: (nct7904) Add error handling in probe function.amy.shih1-5/+18
When register read and write operations return errors, needs to add error handling. Signed-off-by: amy.shih <amy.shih@advantech.com.tw> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-07-03Merge tag 'fsi-for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/fsi into char-misc-nextGreg Kroah-Hartman2-2/+3
Joel writes: FSI changes for 5.3 - Add MAINTAINERS entry. There is now a git tree and a mailing list/patchwork for collecting FSI patches - Bug fix for error driver registration error paths - Correction for the OCC hwmon driver to meet the spec * tag 'fsi-for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/fsi: fsi/core: Fix error paths on CFAM init OCC: FSI and hwmon: Add sequence numbering MAINTAINERS: Add FSI subsystem
2019-07-03OCC: FSI and hwmon: Add sequence numberingEddie James2-2/+3
Sequence numbering of the commands submitted to the OCC is required by the OCC interface specification. Add sequence numbering and check for the correct sequence number on the response. Signed-off-by: Eddie James <eajames@linux.ibm.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Lei YU <mine260309@gmail.com> Signed-off-by: Joel Stanley <joel@jms.id.au>
2019-06-23hwmon: Convert remaining drivers to use SPDX identifierGuenter Roeck2-19/+1
This gets rid of the unnecessary license boilerplate, and avoids having to deal with individual patches one by one. No functional changes intended. Reviewed-by: Corentin Labbe <clabbe.montjoie@gmail.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-06-23hwmon: (max6650) Fix unused variable warningArnd Bergmann1-10/+9
The newly added variable is only used in an #if block: drivers/hwmon/max6650.c: In function 'max6650_probe': drivers/hwmon/max6650.c:766:33: error: unused variable 'cooling_dev' [-Werror=unused-variable] Change the #if to if() so the compiler can see what is actually going on. Fixes: a8463754a5a9 ("hwmon: (max6650) Use devm function to register thermal device") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-06-23hwmon: (pmbus/adm1275) Fix power sampling supportGuenter Roeck1-19/+65
Not every chip supported by this driver supports setting the number of samples for power averaging. Also, the power monitoring register is not always a 16-bit register, and the configuration bits used for voltage sampling are different depending on the register width. Some conditional code is needed to fix the problem. On top of all that, the compiler complains about problems with FIELD_GET and FIELD_PREP macros if the file is built with W=1. Avoid using those macros to silence the warning. Cc: Krzysztof Adamski <krzysztof.adamski@nokia.com> Cc: Alexander Sverdlin <alexander.sverdlin@nokia.com> Reviewed-by: Krzysztof Adamski <krzysztof.adamski@nokia.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-06-23hwmon: (lm90) simplify getting the adapter of a clientWolfram Sang1-1/+1
We have a dedicated pointer for that, so use it. Much easier to read and less computation involved. Reported-by: Peter Rosin <peda@axentia.se> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-06-23hwmon: (asus_atk0110) no need to check return value of debugfs_create functionsGreg Kroah-Hartman1-20/+3
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Luca Tettamanti <kronos.it@gmail.com> Cc: Jean Delvare <jdelvare@suse.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: linux-hwmon@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-06-23hwmon: (max6650) Fix minor formatting issuesGuenter Roeck1-5/+4
CHECK: struct mutex definition without comment CHECK: Alignment should match open parenthesis Cc: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-06-23hwmon: (max6650) Improve error handling in max6650_update_deviceGuenter Roeck1-7/+24
Pass errors from i2c_smbus_read_byte_data() back to the caller of max6650_update_device(). Cc: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-06-23hwmon: (max6650) Read non-volatile registers only onceGuenter Roeck1-8/+15
Only tachometer and alarm status registers are modified by the chip. All other registers only need to be read only once, and reading them repeatedly does not add any value. Cc: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-06-23hwmon: (max6650) Convert to use devm_hwmon_device_register_with_infoGuenter Roeck1-261/+247
Convert driver to use devm_hwmon_device_register_with_info to simplify the code and to reduce its size. Cc: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-06-23hwmon: (max6650) Simplify alarm handlingGuenter Roeck1-6/+3
Instead of re-reading the alarm register after reporting an alarm, mark cached values as invalid. While this results in always reading all data on subsequent reads, it is quite unlikely that such reads will actually happen before the cache times out. The upside is avoiding unnecessary unconditional i2c read operations. Cc: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-06-23hwmon: (max6650) Cache alarm_en registerGuenter Roeck1-3/+9
The alarm_en register is read each time the is_visible function is called. Since it is a configuration register, this is completely unnecessary. Read it once and cache its value. Cc: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-06-23hwmon: (max6650) Declare valid as booleanGuenter Roeck1-2/+2
Declare valid as boolean to match its use case. Cc: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>