- 25 Sep, 2022 5 commits
-
-
Alexander Stein authored
Regular calls to set_pwm don't hold the mutex, but the upcoming update_enable support needs to call set_pwm with the mutex being held. So provide the previous behavior in set_pwm (handling the lock), while adding __set_pwm which assumes the lock being held. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20220914153137.613982-5-alexander.stein@ew.tq-group.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Alexander Stein authored
This handles enabling/disabling the regulator in a single function, while keeping the enables/disabled balanced. This is a preparation when regulator is switched from different code paths. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Link: https://lore.kernel.org/r/20220914153137.613982-4-alexander.stein@ew.tq-group.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Alexander Stein authored
Instead of comparing the current to the new pwm duty to decide whether to enable the PWM, use a dedicated flag. Also apply the new PWM duty in any case. This is a preparation to enable/disable the regulator dynamically. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Link: https://lore.kernel.org/r/20220914153137.613982-3-alexander.stein@ew.tq-group.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Alexander Stein authored
In preparation for dynamically switching regulator, split the power on and power off sequence into separate functions. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20220914153137.613982-2-alexander.stein@ew.tq-group.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Duke Du authored
Add the pmbus driver for TEXAS tps546d24 Buck Converter. The vout mode of tps546d24 supported relative data format, which is not supported by the PMBus core. Signed-off-by: Duke Du <dukedu83@gmail.com> Link: https://lore.kernel.org/r/1662951668-9849-1-git-send-email-Duke.Du@quantatw.com [groeck: Add __maybe_unused to tps546d24_of_match declaration] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
- 20 Sep, 2022 4 commits
-
-
Ibrahim Tilki authored
Add maintainer for hwmon/max31760 driver Signed-off-by: Ibrahim Tilki <Ibrahim.Tilki@analog.com> Link: https://lore.kernel.org/r/20220910171945.48088-5-Ibrahim.Tilki@analog.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Ibrahim Tilki authored
Adding bindings for Analog Devices MAX31760 Fan-Speed Controller Signed-off-by: Ibrahim Tilki <Ibrahim.Tilki@analog.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20220910171945.48088-4-Ibrahim.Tilki@analog.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Ibrahim Tilki authored
Adding documentation for max31760 fan speed controller Signed-off-by: Ibrahim Tilki <Ibrahim.Tilki@analog.com> Link: https://lore.kernel.org/r/20220910171945.48088-3-Ibrahim.Tilki@analog.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Ibrahim Tilki authored
MAX31760 is a precision fan speed controller with nonvolatile lookup table. Device has one internal and one external temperature sensor support. Controls two fans and measures their speeds. Generates hardware alerts when programmable max and critical temperatures are exceeded. Signed-off-by: Ibrahim Tilki <Ibrahim.Tilki@analog.com> Reviewed-by: Nurettin Bolucu <Nurettin.Bolucu@analog.com> Link: https://lore.kernel.org/r/20220910171945.48088-2-Ibrahim.Tilki@analog.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
- 19 Sep, 2022 31 commits
-
-
Eliav Farber authored
Fix: "ERROR: space required before the open parenthesis '('" All of the errors were introduced before this series of patches. Signed-off-by: Eliav Farber <farbere@amazon.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20220908152449.35457-22-farbere@amazon.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Eliav Farber authored
This change adds debugfs to read and write temperature sensor coefficients - g, h, j and cal5. The coefficients can vary between product and product, so it can be very useful to be able to modify them on the fly during the calibration process. e.g.: cat /sys/kernel/debug/940f23d0000.pvt/ts_coeff_cal5 4096 echo 83000 > sys/kernel/debug/940f23d0000.pvt/ts_coeff_g Signed-off-by: Eliav Farber <farbere@amazon.com> Link: https://lore.kernel.org/r/20220908152449.35457-21-farbere@amazon.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Eliav Farber authored
Use thermal coefficients from the device tree if they exist. Otherwise, use default values according to the series (5 or 6). All coefficients can be used or only part of them. The coefficients shall be used for fine tuning the default values since coefficients can vary between product and product. Signed-off-by: Eliav Farber <farbere@amazon.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20220908152449.35457-20-farbere@amazon.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Eliav Farber authored
Add optional temperature coefficient properties: *) moortec,ts-coeff-g *) moortec,ts-coeff-h *) moortec,ts-coeff-cal5 *) moortec,ts-coeff-j If defined they shall be used instead of defaults. The coefficients were added to device tree on top of the series property (which can be used to select between series 5 and series 6), because coefficients can vary between product and product, and code defaults might not be accurate enough. Signed-off-by: Eliav Farber <farbere@amazon.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20220908152449.35457-19-farbere@amazon.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Eliav Farber authored
The current equation used in code is aligned to series 5: T = G + H * (n / cal5 - 0.5) + J * F Where: G = 60, H = 200, cal5 = 4094, J = -0.1, F = frequency clock in MHz Series 6 has a slightly different equation: T = G + H * (n / cal5 - 0.5) and a different set of coefficients: G = 57.4, H = 249.4, cal5 = 4096 This change supports equation and coefficients for both series. (for series 6, J is set to 0). The series is determined according to “moortec,ts-series” property in the device tree. If absent, series 5 is assumed to be the default. Signed-off-by: Eliav Farber <farbere@amazon.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20220908152449.35457-18-farbere@amazon.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Eliav Farber authored
Add optional "moortec,ts-series" property to define the temperature equation and coefficients that shall be used to convert the digital output to value in milli-Celsius. Supported series: 5 (default) and 6. Series 5: T = G + H * (n / cal5 - 0.5) + J * F Where: G = 60, H = 200, cal5 = 4094, J = -0.1, F = frequency clock in MHz Series 6: T = G + H * (n / cal5 - 0.5) Where: G = 57.4, H = 249.4, cal5 = 4096 Signed-off-by: Eliav Farber <farbere@amazon.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20220908152449.35457-17-farbere@amazon.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Peter Robinson authored
The SENSORS_ASPEED is part of the Aspeed silicon so it makes sense to depend on ARCH_ASPEED and for compile testing. Signed-off-by: Peter Robinson <pbrobinson@gmail.com> Link: https://lore.kernel.org/r/20220916120936.372591-1-pbrobinson@gmail.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Eliav Farber authored
Modify the equation and coefficients used to convert the digital output to temperature according to series 5 of the Moortec Embedded Temperature Sensor (METS) datasheet: T = G + H * (n / cal5 - 0.5) + J * F Where: *) G = 60, H = 200, cal5 = 4094, J = -0.1. *) F = frequency clock in MHz. *) n is the digital output. In code, the G, H and J coefficients are multiplied by a factor of 1000 to get the temperature in milli-Celsius. Final result is clamped in case it exceeds min/max thresholds. Change is done since it is unclear where the current equation and coefficients came from. Signed-off-by: Eliav Farber <farbere@amazon.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20220908152449.35457-16-farbere@amazon.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Eliav Farber authored
Add support for mr76006 pre-scaler which provides divide-by-2 scaling of the input voltage, so that it can be presented to the VM for measurement within its range (the VM input range is limited from -0.1V to 1V). The driver reads from the device-tree all the channels that use the mr76006 pre-scaler and multiplies the voltage result by a factor of 2, to represent to the user with the actual voltage input source. Channels that are not in the device-tree are multiplied by a factor of 1. Signed-off-by: Eliav Farber <farbere@amazon.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20220908152449.35457-15-farbere@amazon.com [groeck: Addressed conflicts against commit d59eacaa] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
Eliav Farber authored
Add support for mr76006 pre-scaler which provides divide-by-2 scaling of the input voltage, so that it can be presented to the VM for measurement within its range (the VM input range is limited to -0.1V to 1V). The new "moortec,vm-pre-scaler-x2" property lists the channels that use the mr76006 pre-scaler. The driver will use this list to multiply the voltage result by 2, to present to the user with the actual voltage input source. Signed-off-by: Eliav Farber <farbere@amazon.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20220908152449.35457-14-farbere@amazon.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Eliav Farber authored
Add active channel support per voltage monitor. The number of active channels is read from the device-tree. When absent in device-tree, all channels are assumed to be used. This shall be useful to expose sysfs only for inputs that are connected to a voltage source. Setting number of active channels to 0, means that entire VM sensor is not used. Signed-off-by: Eliav Farber <farbere@amazon.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20220908152449.35457-13-farbere@amazon.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Eliav Farber authored
Add optional "moortec,vm-active-channels" property to define the number of active channels per VM. This shall be useful to avoid exposing sysfs for reading inputs that are not connected to any voltage source. Signed-off-by: Eliav Farber <farbere@amazon.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20220908152449.35457-12-farbere@amazon.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Eliav Farber authored
Add device-tree vendor prefix for Moortec Semiconductor Ltd. Website: https://moortec.com/ Moortec were acquired by Synopsys so link above leads to: https://www.synopsys.com/solutions/silicon-lifecycle-management.htmlSigned-off-by: Eliav Farber <farbere@amazon.com> Acked-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20220908152449.35457-11-farbere@amazon.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Aleksandr Mezin authored
No known differences from already supported devices. Signed-off-by: Aleksandr Mezin <mezin.alexander@gmail.com> Link: https://lore.kernel.org/r/20220918115506.61870-1-mezin.alexander@gmail.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Guenter Roeck authored
Static analyzers report: drivers/hwmon/emc2305.c:194 emc2305_set_cur_state() warn: impossible condition '(val > 255) => (0-255 > 255)' 'val' is u8 and thus can never be larger than 255. In theory the operation calculating 'val' could result in a value larger than 255, but this won't happen because its parameter has already been range checked and it is guaranteed that the result never exceeds 255. Remove the unnecessary value check. Cc: Michael Shych <michaelsh@nvidia.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
Eliav Farber authored
Don't fail the probe function and don't deassert the reset controller if a "reset" property doesn't exist in the device tree. Change is done for SOCs that don't support a reset controller. Signed-off-by: Eliav Farber <farbere@amazon.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20220908152449.35457-10-farbere@amazon.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Eliav Farber authored
Change "resets" property to be optional instead of required, for SOCs that don't support a reset controller. Signed-off-by: Eliav Farber <farbere@amazon.com> Acked-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20220908152449.35457-9-farbere@amazon.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Eliav Farber authored
This changes adds a detailed description for the mr75203 controller and for some of the analog IPs controlled by it. Signed-off-by: Eliav Farber <farbere@amazon.com> Acked-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20220908152449.35457-8-farbere@amazon.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Aleksa Savic authored
Extend aquacomputer_d5next driver to expose various hardware sensors of the Aquacomputer High Flow Next flow sensor, which communicates through a proprietary USB HID protocol. The High Flow Next exposes +5V voltages, water quality, conductivity and flow readings. A temperature sensor can be connected to it, in which case it provides its reading and an estimation of the dissipated/absorbed power in the liquid cooling loop. Additionally, serial number and firmware version are exposed through debugfs. Registry offsets were discovered and tested by users on Github [1] [2]. [1] https://github.com/aleksamagicka/aquacomputer_d5next-hwmon/issues/8 [2] https://github.com/aleksamagicka/aquacomputer_d5next-hwmon/pull/34Signed-off-by: Aleksa Savic <savicaleksa83@gmail.com> Link: https://lore.kernel.org/r/20220907100739.806571-1-savicaleksa83@gmail.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Alexandru Gagniuc authored
On systems with more than one tps23861, creating the debugfs directory for additional devices fails with debugfs: Directory 'tps23861' with parent '/' already present! To resolve this, include the hwmon device name in the directory name. Since the name is unique, this guarantees that the debugfs directory is unique. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20220907015405.16547-2-mr.nuke.me@gmail.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Alexandru Gagniuc authored
When reading the 'port_status' debugfs entry, some I2C registers were read more than once. This looks inefficient in an I2C trace. To reduce I2C traffic, update tps23861_port_status_show() to only read each register once. Indexing the port number from 0 instead of 1 also allows simplifying things a bit. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Link: https://lore.kernel.org/r/20220907015405.16547-1-mr.nuke.me@gmail.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Jiapeng Chong authored
./drivers/hwmon/emc2305.c: 14 linux/version.h not needed. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=2024Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Link: https://lore.kernel.org/r/20220901022332.40248-1-jiapeng.chong@linux.alibaba.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Michael Shych authored
Add description of emc2305 driver. Signed-off-by: Michael Shych <michaelsh@nvidia.com> Reviewed-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20220810171552.56417-4-michaelsh@nvidia.com [groeck: Fixed htmldocs warnings] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
Michael Shych authored
Add driver for Microchip EMC2301/2/3/5 RPM-based PWM Fan Speed Controller. Modify Makefile and Kconfig to support Microchip EMC2305 RPM-based PWM Fan Speed Controller. Signed-off-by: Michael Shych <michaelsh@nvidia.com> Reviewed-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20220810171552.56417-3-michaelsh@nvidia.com [groeck: Drop unnecessary () around DIV_ROUND_CLOSEST()] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
Michael Shych authored
Introduce platform data structure for EM2305 driver to allow configuration device PWMs and thermal zones by passing required platform data to the driver. If no platform data is provided, the driver is supposed to work with default settings. Signed-off-by: Michael Shych <michaelsh@nvidia.com> Reviewed-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20220810171552.56417-2-michaelsh@nvidia.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Justin Ledford authored
The MAX31790 has a tach input enable bit in each fan's configuration register. This is only enabled by the driver if RPM mode is selected, but the driver doesn't provide a way to independently enable tachometer input regardless of the regulator mode. By adding the fanN_enable sysfs files, we can decouple the tach input from the regulator mode. Also update the documentation. Signed-off-by: Justin Ledford <justinledford@google.com> Link: https://lore.kernel.org/r/20220829195930.2521755-1-justinledford@google.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Andy Shevchenko authored
There are no users outside of PWM core of the of_pwm_get(). Make it static. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220826172642.16404-3-andriy.shevchenko@linux.intel.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Andy Shevchenko authored
The devm_of_pwm_get() has recently lost its single user, drop the dead API as well. Note, the new code should use either plain pwm_get() or managed devm_pwm_get() or devm_fwnode_pwm_get() APIs. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220826172642.16404-2-andriy.shevchenko@linux.intel.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Andy Shevchenko authored
There is no need to call OF specific devm_of_pwm_get() since the device node parameter duplicates in the device parameter. Hence we may safely replace it by plain devm_pwm_get() call. This allows to drop devm_of_pwm_get() as no more users will be. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220826172642.16404-1-andriy.shevchenko@linux.intel.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Christophe JAILLET authored
The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code, the error handling paths and avoid the need of a dedicated function used with devm_add_action_or_reset(). Based on my test with allyesconfig, this reduces the .o size from: text data bss dec hex filename 2419 1472 0 3891 f33 drivers/hwmon/sparx5-temp.o down to: 2155 1472 0 3627 e2b drivers/hwmon/sparx5-temp.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/cfe4c965074b5ecbe03830b05e038b4594c7b970.1661336689.git.christophe.jaillet@wanadoo.frSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Armin Wolf authored
When dell-smm-hwmon is loaded on a machine with a buggy BIOS with the option "force" being enabled, it wrongly prints that the buggy features where disabled. This may cause users to wrongly assume that the driver still protects them from these BIOS bugs even with "force" being enabled. Replace the messages with two messages each which are depending on the value of the "force" parameter. The messages which are being printed when "force" is not set use dev_notice() instead of dev_warn() since they only serve as a notice. Tested on a Dell Inspiron 3505. Signed-off-by: Armin Wolf <W_Armin@gmx.de> Link: https://lore.kernel.org/r/20220822174053.8750-3-W_Armin@gmx.deSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-