- 25 Sep, 2022 19 commits
-
-
Uwe Kleine-König authored
Declarations for static symbols are useless code repetition (unless there are cyclic dependencies). Reorder some functions and variables which allows to get rid of 42 forward declarations. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
Uwe Kleine-König authored
Declarations for static symbols are useless repetition unless there are cyclic dependencies. Reorder the functions and variables to get rid of 4 forward declarations. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220924135738.234051-2-u.kleine-koenig@pengutronix.deSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Uwe Kleine-König authored
Make use of the cpp symbol DRIVER_NAME to set the driver's name and use it instead of all explicit usages of the same string. Also make use of it instead of sis5595_driver.driver.name which breaks a cyclic dependency between sis5595_probe() and sis5595_driver that in the next commit allows to drop some forward declarations. For an amd64 allyesconfig this even reduces the size of the driver by 3 bytes. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220924135738.234051-1-u.kleine-koenig@pengutronix.deSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Li Zhong authored
In adm9240_read() adm9240_fan_read() adm9240_write_fan_div(), it assumes that the caller of adm9240_write_fan_div() must hold data->update_lock. Otherwise, it may cause data races when data is updated by other threads. Signed-off-by: Li Zhong <floridsleeves@gmail.com> Link: https://lore.kernel.org/r/20220924001751.1726369-1-floridsleeves@gmail.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Jason A. Donenfeld authored
On 32-bit platforms, long is 32 bits, so (long)UINT_MAX is less than (long)SHT4X_MIN_POLL_INTERVAL, which means the clamping operation is bogus. Fix this by clamping at INT_MAX, so that the upperbound is the same on all platforms. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Link: https://lore.kernel.org/r/20220924101151.4168414-1-Jason@zx2c4.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Uwe Kleine-König authored
Declarations for static symbols are useless repetition unless there are cyclic dependencies. Reorder the functions and variables to get rid of 6 forward declarations. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220922074900.2763331-2-u.kleine-koenig@pengutronix.deSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Uwe Kleine-König authored
Make use of the cpp symbol DRIVER_NAME to set the driver's name and use it instead of all explicit usages of the same string. Also make use of it instead of sis5595_driver.driver.name which breaks a cyclic dependency between sis5595_probe() and sis5595_driver that in the next commit allows to drop some forward declarations. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220922074900.2763331-1-u.kleine-koenig@pengutronix.deSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Uwe Kleine-König authored
Several drivers manually register a devm handler to disable their clk. Convert them to devm_clk_get_enabled(). Acked-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-
Eliav Farber authored
Fix build error on 32-bit machines. Fixes: 94c025b6 ("hwmon: (mr75203) modify the temperature equation according to series 5 datasheet") Signed-off-by: Eliav Farber <farbere@amazon.com> Reported-by: kernel test robot <lkp@intel.com> Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Link: https://lore.kernel.org/r/20220921121723.6726-1-farbere@amazon.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Uwe Kleine-König authored
Declarations for static symbols are useless repetition unless there are cyclic dependencies. Reorder the functions and variables to get rid of 5 forward declarations. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220920135617.1046361-2-u.kleine-koenig@pengutronix.deSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Uwe Kleine-König authored
Make use of the cpp symbol DRIVER_NAME to set the driver's name and use it instead of all explicit usages of the same string. Also make use of it instead of vt8231_driver.driver.name which breaks a cyclic dependency between vt8231_probe() and vt8231_driver that in the next commit allows to drop some forward declarations. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220920135617.1046361-1-u.kleine-koenig@pengutronix.deSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Uwe Kleine-König authored
Declarations for static symbols are useless repetition unless there are cyclic dependencies. Reorder the functions and variables to get rid of 6 forward declarations. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220919103155.795151-3-u.kleine-koenig@pengutronix.deSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Uwe Kleine-König authored
Make use of the cpp symbol DRIVER_NAME to set the driver's name and also as name for devm_request_region(). While at it add a module alias using the new define. This is a preparation for the next cleanup commit that removes a cyclic dependency between pc87360_driver (which references pc87360_probe in .probe) and pc87360_probe() (which used pc87360_driver.driver.name). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20220919103155.795151-2-u.kleine-koenig@pengutronix.deSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
Alexander Stein authored
This adds the enable attribute which is used to select if zero PWM duty means to switch off regulator and PWM or to keep them enabled but at inactive PWM output level. Depending on the select enable mode, turn off the regulator and PWM if the PWM duty is zero, or keep them enabled. This is especially important for fan using inverted PWM signal polarity. Having regulator supplied and PWM disabled, some PWM controllers provide the active, rather than inactive signal. With this change the shutdown as well as suspend/resume paths require modifcations as well. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Link: https://lore.kernel.org/r/20220914153137.613982-6-alexander.stein@ew.tq-group.comSigned-off-by: Guenter Roeck <linux@roeck-us.net>
-
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 17 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>
-