aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/regulator (follow)
AgeCommit message (Collapse)AuthorFilesLines
2025-05-27Merge tag 'regulator-v6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulatorLinus Torvalds13-262/+774
Pull regulator updates from Mark Brown: "This is a very quiet release, there was no work on the core and a good chunk of the updates were the result of conversions to use newer GPIO APIs. We did gain support for Analog ADP5055 and TI TPS65214 devices, and there's a new restart handler for the PCA9450 which allows devices using it to be properly power cycled on reboot, but otherwise it's minor fixes and API updates" * tag 'regulator-v6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (24 commits) regulator: qcom_spmi: Constify struct spmi_voltage_range regulator: max8952: Correct Samsung "Electronics" spelling in copyright headers regulator: dt-bindings: mt6357: Drop fixed compatible requirement regulator: gpio: Use dev_err_probe regulator: pca9450: Add restart handler regulator: da9121: Fix Wvoid-pointer-to-enum-cast warning regulator: tps65219: Add TI TPS65214 Regulator Support regulator: tps65219: Add support for TPS65215 Regulator IRQs regulator: tps65219: Add support for TPS65215 regulator resources regulator: tps65219: Update struct names regulator: pf9453: convert to use maple tree register cache regulator: max20086: Change enable gpio to optional regulator: max20086: Fix MAX200086 chip id regulator: adp5055: Remove unneeded semicolon regulator: adp5055: remove duplicate device table regulator: adp5055: Add driver for adp5055 regulator: dt-bindings: adi,adp5055-regulator: Add adp5055 support regulator: don't compare raw GPIO descriptor pointers regulator: rpi-panel-attiny: use new GPIO line value setter callbacks regulator: rpi-panel-attiny: use lock guards for the state mutex ...
2025-05-19regulator: qcom_spmi: Constify struct spmi_voltage_rangeChristophe JAILLET1-37/+32
'struct spmi_voltage_range' are only modified at runtime to compile a field, n_voltages, that could be computed at compile time. So, simplify spmi_calculate_num_voltages() and compute n_voltages at compile time within the SPMI_VOLTAGE_RANGE macro. Constifying these structures moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig: Before: ====== text data bss dec hex filename 85437 26776 512 112725 1b855 drivers/regulator/qcom_spmi-regulator.o After: ===== text data bss dec hex filename 86857 24760 512 112129 1b601 drivers/regulator/qcom_spmi-regulator.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link: https://patch.msgid.link/ef2a4b6df61e19470ddf6cbd1f3ca1ce88a3c1a0.1747570556.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-14regulator: max20086: fix invalid memory accessCosmin Tanislav1-1/+6
max20086_parse_regulators_dt() calls of_regulator_match() using an array of struct of_regulator_match allocated on the stack for the matches argument. of_regulator_match() calls devm_of_regulator_put_matches(), which calls devres_alloc() to allocate a struct devm_of_regulator_matches which will be de-allocated using devm_of_regulator_put_matches(). struct devm_of_regulator_matches is populated with the stack allocated matches array. If the device fails to probe, devm_of_regulator_put_matches() will be called and will try to call of_node_put() on that stack pointer, generating the following dmesg entries: max20086 6-0028: Failed to read DEVICE_ID reg: -121 kobject: '\xc0$\xa5\x03' (000000002cebcb7a): is not initialized, yet kobject_put() is being called. Followed by a stack trace matching the call flow described above. Switch to allocating the matches array using devm_kcalloc() to avoid accessing the stack pointer long after it's out of scope. This also has the advantage of allowing multiple max20086 to probe without overriding the data stored inside the global of_regulator_match. Fixes: bfff546aae50 ("regulator: Add MAX20086-MAX20089 driver") Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com> Link: https://patch.msgid.link/20250508064947.2567255-1-demonsingur@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-13regulator: gpio: Use dev_err_probeNishanth Menon1-6/+4
During probe the gpio driver may not yet be available. Use dev_err_probe to provide just the pertinent log. Since dev_err_probe takes care of reporting the error value, drop the redundant ret variable while at it. Signed-off-by: Nishanth Menon <nm@ti.com> Link: https://patch.msgid.link/20250512185727.2907411-1-nm@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-12regulator: pca9450: Add restart handlerPaul Geurts1-0/+27
When restarting a CPU powered by the PCA9450 power management IC, it is beneficial to use the PCA9450 to power cycle the CPU and all its connected peripherals to start up in a known state. The PCA9450 features a cold start procedure initiated by an I2C command. Add a restart handler so that the PCA9450 is used to restart the CPU. The restart handler sends command 0x14 to the SW_RST register, initiating a cold reset (Power recycle all regulators except LDO1, LDO2 and CLK_32K_OUT) As the PCA9450 is a PMIC specific for the i.MX8M family CPU, the restart handler priority is set just slightly higher than imx2_wdt and the PSCI restart handler. This makes sure this restart handler takes precedence. Signed-off-by: Paul Geurts <paul.geurts@prodrive-technologies.com> Link: https://patch.msgid.link/20250505115936.1946891-1-paul.geurts@prodrive-technologies.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-10regulator: da9121: Fix Wvoid-pointer-to-enum-cast warningKrzysztof Kozlowski1-1/+1
'subvariant_id' is an enum, thus cast of pointer on 64-bit compile test with clang and W=1 causes: da9121-regulator.c:1132:24: error: cast to smaller integer type 'enum da9121_subvariant' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast] Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20250509142448.257199-2-krzysztof.kozlowski@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-02regulator: tps65219: Add TI TPS65214 Regulator SupportShree Ramamoorthy2-13/+69
Add support for TPS65214 regulators (bucks and LDOs) to the TPS65219 Regulator Driver as the TPS65214/TPS65214/TPS65219 PMIC devices have significant register map overlap. TPS65214 is a Power Management IC with 3 Buck regulators (like TPS65215/TPS65219) and has 2 LDOs (like TPS65215). Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com> Link: https://patch.msgid.link/20250425205736.76433-5-s-ramamoorthy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-02regulator: tps65219: Add support for TPS65215 Regulator IRQsShree Ramamoorthy1-18/+50
Isolate all changes involving regulator IRQ types: - Adding in TPS65215 resources - Organize what resources are common vs device-specific - How the chip_data uses these resource structs - Restructure the probe() for multi-PMIC support. Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com> Link: https://patch.msgid.link/20250425205736.76433-4-s-ramamoorthy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-02regulator: tps65219: Add support for TPS65215 regulator resourcesShree Ramamoorthy2-18/+75
Isolate all changes involving TPS65215 regulator desc and range resources. - 'chipid' will identify which PMIC to support, and the corresponding chip_data struct element to use in probe(). The chip_data struct is helpful for any new PMICs added to this driver. The goal is to add future PMIC info to necessary structs and minimize probe() function edits. - The probe() will now loop through common (overlapping) regulators first, then device-specific structs identified in the chip_data struct. - Add TI TPS65215 PMIC to the existing platform_device_id struct, so the regulator probe() can handle which PMIC chip_data information to use. Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com> Link: https://patch.msgid.link/20250425205736.76433-3-s-ramamoorthy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-05-02regulator: tps65219: Update struct namesShree Ramamoorthy1-16/+21
Isolate changes that involve renaming to indicate this resource is only for TPS65219 or if it will be common for both devices. The renames are in preparation for adding TPS65215 support. Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com> Link: https://patch.msgid.link/20250425205736.76433-2-s-ramamoorthy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-24regulator: pf9453: convert to use maple tree register cacheBo Liu1-1/+1
The maple tree register cache is based on a much more modern data structure than the rbtree cache and makes optimisation choices which are probably more appropriate for modern systems than those made by the rbtree cache. Signed-off-by: Bo Liu <liubo03@inspur.com> Link: https://patch.msgid.link/20250424010855.2662-1-liubo03@inspur.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-23regulator: max20086: Fixes chip id and enable gpioMark Brown1-2/+2
Merge series from João Paulo Gonçalves <jpaulo.silvagoncalves@gmail.com>: I'm working on integrating a system with a MAX20086 and noticed these small issues in the driver: the chip ID for MAX20086 is 0x30 and not 0x40. Also, in my use case, the enable pin is always enabled by hardware, so the enable GPIO isn't needed. Without these changes, the driver fails to probe.
2025-04-22regulator: max20086: Change enable gpio to optionalJoão Paulo Gonçalves1-1/+1
The enable pin can be configured as always enabled by the hardware. Make the enable gpio request optional so the driver doesn't fail to probe when `enable-gpios` property is not present in the device tree. Cc: stable@vger.kernel.org Fixes: bfff546aae50 ("regulator: Add MAX20086-MAX20089 driver") Signed-off-by: João Paulo Gonçalves <jpaulo.silvagoncalves@gmail.com> Link: https://patch.msgid.link/20250420-fix-max20086-v1-2-8cc9ee0d5a08@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-22regulator: max20086: Fix MAX200086 chip idJoão Paulo Gonçalves1-1/+1
>From MAX20086-MAX20089 datasheet, the id for a MAX20086 is 0x30 and not 0x40. With the current code, the driver will fail on probe when the driver tries to identify the chip id from a MAX20086 device over I2C. Cc: stable@vger.kernel.org Fixes: bfff546aae50 ("regulator: Add MAX20086-MAX20089 driver") Signed-off-by: João Paulo Gonçalves <jpaulo.silvagoncalves@gmail.com> Link: https://patch.msgid.link/20250420-fix-max20086-v1-1-8cc9ee0d5a08@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-14regulator: adp5055: Remove unneeded semicolonChen Ni1-1/+1
Remove unnecessary semicolons reported by Coccinelle/coccicheck and the semantic patch at scripts/coccinelle/misc/semicolon.cocci. Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Link: https://patch.msgid.link/20250414021950.3755819-1-nichen@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-10regulator: adp5055: remove duplicate device tableArnd Bergmann1-6/+0
When building with -Wunused-const-variable, gcc points out an device table that is not referenced anywhere: drivers/regulator/adp5055-regulator.c:346:34: error: unused variable 'adp5055_dt_ids' [-Werror,-Wunused-const-variable] 346 | static const struct of_device_id adp5055_dt_ids[] = { | ^~~~~~~~~~~~~~ The contents are the same as the second table in that file, so just remove this copy. Fixes: 147b2a96f24e ("regulator: adp5055: Add driver for adp5055") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://patch.msgid.link/20250410141006.866813-1-arnd@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-09Add support for ADP5055 triple buck regulator.Mark Brown3-0/+442
Merge series from Alexis Czezar Torreno <alexisczezar.torreno@analog.com>: Introduce a regulator driver support for ADP5055. The device combines 3 high performance buck regulators in a 43-termminal land grid array package. The device enables direct connection to high input voltages up to 18V with no preregulator. Channel 1 and 2 deliver a programmable output current of 3.5A or 7.5A or provide a single output with up to 14A in parallel operation. Channel 3 has a programmable output current of 1.5A or 3A.
2025-04-09gpio: don't compare raw GPIO descriptor pointersMark Brown1-1/+1
Merge series from Bartosz Golaszewski <brgl@bgdev.pl>: Handling of shared GPIOs in the kernel needs some improvements. Let's start with a simple change of not comparing GPIO descriptor pointers directly as there's nothing that guarantees that the same physical pin will always be represented by a single GPIO descriptor obtained by calling gpiod_get().
2025-04-09regulator: adp5055: Add driver for adp5055Alexis Czezar Torreno3-0/+442
Add ADI ADP5055 driver support. The device consists of 3 buck regulators able to connect to high input voltages of up to 18V with no preregulators. Signed-off-by: Alexis Czezar Torreno <alexisczezar.torreno@analog.com> Link: https://patch.msgid.link/20250409-upstream-adp5055-v6-2-faa6e810deb1@analog.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-09regulator: don't compare raw GPIO descriptor pointersBartosz Golaszewski1-1/+1
There's no API contract saying that two GPIO descriptor pointers obtained with a call to gpiod_get() (or one of the variants), that refer to the same physical GPIO pin, always point to the same structure. Use the dedicated comparator function. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://patch.msgid.link/20250407-gpiod-is-equal-v1-2-7d85f568ae6e@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-08regulator: rpi-panel-attiny: use new GPIO line valueMark Brown1-54/+29
Merge series from Bartosz Golaszewski <brgl@bgdev.pl>: struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. We're in the process of converting all GPIO drivers to using the new API. This series converts the only GPIO controller under drivers/regulator/ and - while at it - refactors the code a bit.
2025-04-08regulator: rpi-panel-attiny: use new GPIO line value setter callbacksBartosz Golaszewski1-2/+4
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://patch.msgid.link/20250408-gpiochip-set-rv-regulator-v1-4-a18b6154b31a@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-08regulator: rpi-panel-attiny: use lock guards for the state mutexBartosz Golaszewski1-23/+14
Use mutex lock guards from linux/cleanup.h to simplify the driver code. Note that ret must be initialized in order to avoid a build warning as scoped_guard() is implemented as a for loop. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://patch.msgid.link/20250408-gpiochip-set-rv-regulator-v1-3-a18b6154b31a@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-08regulator: rpi-panel-attiny: use devres for mutex managementBartosz Golaszewski1-27/+12
Simplify the probe() code and remove the remove() callback by using devres to manage the mutex resources. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://patch.msgid.link/20250408-gpiochip-set-rv-regulator-v1-2-a18b6154b31a@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-08regulator: rpi-panel-attiny: don't double-check GPIO rangeBartosz Golaszewski1-3/+0
GPIO core already checks GPIO ranges, there's no need to check it again in the set() callback. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://patch.msgid.link/20250408-gpiochip-set-rv-regulator-v1-1-a18b6154b31a@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-07regulator: s5m8767: Convert to GPIO descriptorsMark Brown1-108/+38
Merge series from From git@z Thu Jan 1 00:00:00 1970 Peng Fan <peng.fan@nxp.com>: Update the driver to fetch buck_gpio and buck_ds as GPIO descriptors. Then drop the usage of 'of_gpio.h' which should be deprecated. Based on commit 84618d5e31cf ("regulator: max8997: Convert to GPIO descriptors") as a reference to make the changes. With the quirk fix for s5m8767 in of_gpio_try_fixup_polarity, the polarity will be active-high, even if exynos5250 spring DTS wrongly use active-low polarity. So using GPIO descriptors, it should work as before.
2025-04-07regulator: pf9453: Improve documentation for pf9453_regulator_set_ramp_delay_regmapYang Li1-0/+1
The function pf9453_regulator_set_ramp_delay_regmap lacked detailed parameter descriptions and return value explanations in its documentation. This patch improves the documentation by adding specific details about the parameters, their usage, and the return values, enhancing clarity for developers. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=20168 Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://patch.msgid.link/20250407064532.22680-1-yang.lee@linux.alibaba.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-07regulator: s5m8767: Convert to GPIO descriptorsPeng Fan1-108/+38
Update the driver to fetch buck_gpio and buck_ds as GPIO descriptors. Then drop the usage of 'of_gpio.h' which should be deprecated. Based on commit 84618d5e31cf ("regulator: max8997: Convert to GPIO descriptors") as a reference to make the changes. With the quirk fix for s5m8767 in of_gpio_try_fixup_polarity, the polarity will be active-high, even if exynos5250 spring DTS wrongly use active-low polarity. So using GPIO descriptors, it should work as before. Signed-off-by: Peng Fan <peng.fan@nxp.com> Acked-by: Mark Brown <broonie@kernel.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20250327004945.563765-2-peng.fan@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-04-02Merge tag 'objtool-urgent-2025-04-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tipLinus Torvalds1-2/+2
Pull objtool fixes from Ingo Molnar: "These are objtool fixes and updates by Josh Poimboeuf, centered around the fallout from the new CONFIG_OBJTOOL_WERROR=y feature, which, despite its default-off nature, increased the profile/impact of objtool warnings: - Improve error handling and the presentation of warnings/errors - Revert the new summary warning line that some test-bot tools interpreted as new regressions - Fix a number of objtool warnings in various drivers, core kernel code and architecture code. About half of them are potential problems related to out-of-bounds accesses or potential undefined behavior, the other half are additional objtool annotations - Update objtool to latest (known) compiler quirks and objtool bugs triggered by compiler code generation - Misc fixes" * tag 'objtool-urgent-2025-04-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (36 commits) objtool/loongarch: Add unwind hints in prepare_frametrace() rcu-tasks: Always inline rcu_irq_work_resched() context_tracking: Always inline ct_{nmi,irq}_{enter,exit}() sched/smt: Always inline sched_smt_active() objtool: Fix verbose disassembly if CROSS_COMPILE isn't set objtool: Change "warning:" to "error: " for fatal errors objtool: Always fail on fatal errors Revert "objtool: Increase per-function WARN_FUNC() rate limit" objtool: Append "()" to function name in "unexpected end of section" warning objtool: Ignore end-of-section jumps for KCOV/GCOV objtool: Silence more KCOV warnings, part 2 objtool, drm/vmwgfx: Don't ignore vmw_send_msg() for ORC objtool: Fix STACK_FRAME_NON_STANDARD for cold subfunctions objtool: Fix segfault in ignore_unreachable_insn() objtool: Fix NULL printf() '%s' argument in builtin-check.c:save_argv() objtool, lkdtm: Obfuscate the do_nothing() pointer objtool, regulator: rk808: Remove potential undefined behavior in rk806_set_mode_dcdc() objtool, ASoC: codecs: wcd934x: Remove potential undefined behavior in wcd934x_slim_irq_handler() objtool, Input: cyapa - Remove undefined behavior in cyapa_update_fw_store() objtool, panic: Disable SMAP in __stack_chk_fail() ...
2025-04-01Merge tag 'char-misc-6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-miscLinus Torvalds1-28/+9
Pull char / misc / IIO driver updates from Greg KH: "Here is the big set of char, misc, iio, and other smaller driver subsystems for 6.15-rc1. Lots of stuff in here, including: - loads of IIO changes and driver updates - counter driver updates - w1 driver updates - faux conversions for some drivers that were abusing the platform bus interface - coresight driver updates - rust miscdevice binding updates based on real-world-use - other minor driver updates All of these have been in linux-next with no reported issues for quite a while" * tag 'char-misc-6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (292 commits) samples: rust_misc_device: fix markup in top-level docs Coresight: Fix a NULL vs IS_ERR() bug in probe misc: lis3lv02d: convert to use faux_device tlclk: convert to use faux_device regulator: dummy: convert to use the faux device interface bus: mhi: host: Fix race between unprepare and queue_buf coresight: configfs: Constify struct config_item_type doc: iio: ad7380: describe offload support iio: ad7380: add support for SPI offload iio: light: Add check for array bounds in veml6075_read_int_time_ms iio: adc: ti-ads7924 Drop unnecessary function parameters staging: iio: ad9834: Use devm_regulator_get_enable() staging: iio: ad9832: Use devm_regulator_get_enable() iio: gyro: bmg160_spi: add of_match_table dt-bindings: iio: adc: Add i.MX94 and i.MX95 support iio: adc: ad7768-1: remove unnecessary locking Documentation: ABI: add wideband filter type to sysfs-bus-iio iio: adc: ad7768-1: set MOSI idle state to prevent accidental reset iio: adc: ad7768-1: Fix conversion result sign iio: adc: ad7124: Benefit of dev = indio_dev->dev.parent in ad7124_parse_channel_config() ...
2025-04-01Merge tag 'mm-nonmm-stable-2025-03-30-18-23' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mmLinus Torvalds2-10/+10
Pull non-MM updates from Andrew Morton: - The series "powerpc/crash: use generic crashkernel reservation" from Sourabh Jain changes powerpc's kexec code to use more of the generic layers. - The series "get_maintainer: report subsystem status separately" from Vlastimil Babka makes some long-requested improvements to the get_maintainer output. - The series "ucount: Simplify refcounting with rcuref_t" from Sebastian Siewior cleans up and optimizing the refcounting in the ucount code. - The series "reboot: support runtime configuration of emergency hw_protection action" from Ahmad Fatoum improves the ability for a driver to perform an emergency system shutdown or reboot. - The series "Converge on using secs_to_jiffies() part two" from Easwar Hariharan performs further migrations from msecs_to_jiffies() to secs_to_jiffies(). - The series "lib/interval_tree: add some test cases and cleanup" from Wei Yang permits more userspace testing of kernel library code, adds some more tests and performs some cleanups. - The series "hung_task: Dump the blocking task stacktrace" from Masami Hiramatsu arranges for the hung_task detector to dump the stack of the blocking task and not just that of the blocked task. - The series "resource: Split and use DEFINE_RES*() macros" from Andy Shevchenko provides some cleanups to the resource definition macros. - Plus the usual shower of singleton patches - please see the individual changelogs for details. * tag 'mm-nonmm-stable-2025-03-30-18-23' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (77 commits) mailmap: consolidate email addresses of Alexander Sverdlin fs/procfs: fix the comment above proc_pid_wchan() relay: use kasprintf() instead of fixed buffer formatting resource: replace open coded variant of DEFINE_RES() resource: replace open coded variants of DEFINE_RES_*_NAMED() resource: replace open coded variant of DEFINE_RES_NAMED_DESC() resource: split DEFINE_RES_NAMED_DESC() out of DEFINE_RES_NAMED() samples: add hung_task detector mutex blocking sample hung_task: show the blocker task if the task is hung on mutex kexec_core: accept unaccepted kexec segments' destination addresses watchdog/perf: optimize bytes copied and remove manual NUL-termination lib/interval_tree: fix the comment of interval_tree_span_iter_next_gap() lib/interval_tree: skip the check before go to the right subtree lib/interval_tree: add test case for span iteration lib/interval_tree: add test case for interval_tree_iter_xxx() helpers lib/rbtree: add random seed lib/rbtree: split tests lib/rbtree: enable userland test suite for rbtree related data structure checkpatch: describe --min-conf-desc-length scripts/gdb/symbols: determine KASLR offset on s390 ...
2025-03-29Merge tag 'mfd-next-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfdLinus Torvalds2-3/+93
Pull MFD updates from Lee Jones: "Maxim MAX77705: - Added core MFD driver. - Added charger driver. - Added devicetree bindings for the charger and MFD core. - Added Haptic controller support via the input subsystem. - Added LED support. - Added support to simple-mfd-i2c for fuel gauge and hwmon. Samsung S2MPU05 (Exynos7870 PMIC): - Added core MFD support. - Added Regulator support for 21 LDOs and 5 BUCKs. - Added devicetree bindings for regulators and the PMIC core. TI TPS65215 & TPS65214: - Added support to the existing TPS65219 driver. - Added devicetree bindings. STMicroelectronics STM32MP25: - Added support to the stm32-timers MFD driver. - Added devicetree bindings. Congatec Board Controller (CGBC): - Added HWMON support for internal sensors. - Added support for the conga-SA8 module. Microchip LAN969X: - Enabled the at91-usart MFD driver for this architecture. MediaTek MT6359: - Added mfd_cell for mt6359-accdet to allow its driver to probe. Other misc driver updates: - AXP20X (AXP717): Added AXP717_TS_PIN_CFG register to writeable regs for temperature sensor configuration. - SM501: Switched to using BIT() macro to mitigate potential integer overflows in GPIO functions. - ENE KB3930: Added a NULL pointer check for off_gpios during probe to prevent potential dereference. - SYSCON: Added a check for invalid resource size to prevent issues from DT misconfiguration. - CGBC: Corrected signedness issues in cgbc_session_request - intel_soc_pmic_chtdc_ti / intel_soc_pmic_crc: Removed unneeded explicit assignment to REGCACHE_NONE. - ipaq-micro / tps65010: Switched to using str_enable_disable() helpers for clarity and potential size reduction. - upboard-fpga: Removed unnecessary ACPI_PTR() annotation. - max8997: Removed unused max8997_irq_exit() function, using devm_* helpers instead. - lp3943: Dropped unused #include <linux/pwm.h> from the header file. - db8500-prcmu: Removed needless return statements in void APIs. - qnap-mcu: Replaced commas with semicolons between expressions for correctness. - STA2X11: Removed the core MFD driver as the underlying platform support was removed. - EZX-PCAP: Removed the unused pcap_adc_sync function. - PCF50633 (OpenMoko PMIC): Removed the entire driver (core, adc, gpio, irq) as the underlying s3c24xx platform support was removed. Devicetree updates: - Converted fsl,mcu-mpc8349emitx binding to YAML - Added qcom,msm8937-tcsr compatible - Added microchip,sama7d65-flexcom compatible - Added rockchip,rk3528-qos syscon compatible - Added airoha,en7581-pbus-csr syscon compatible - Added microchip,sama7d65-ddr3phy syscon compatible - Added microchip,sama7d65-sfrbu syscon compatible" * tag 'mfd-next-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (49 commits) mfd: cgbc-core: Add support for conga-SA8 dt-bindings: mfd: syscon: Add microchip,sama7d65-sfrbu dt-bindings: mfd: syscon: Add microchip,sama7d65-ddr3phy mfd: cgbc: Add support for HWMON dt-bindings: mfd: syscon: Add the pbus-csr node for Airoha EN7581 SoC mfd: cgbc-core: Cleanup signedness in cgbc_session_request() mfd: pcf50633: Remove remaining PCF50633 support mfd: pcf50633: Remove unused platform IRQ code mfd: pcF50633-gpio: Remove unused driver mfd: pcf50633-adc: Remove unused driver mfd: qnap-mcu: Convert commas to semicolons in qnap_mcu_exec() mfd: mt6397-core: Add mfd_cell for mt6359-accdet dt-bindings: mfd: syscon: Add rk3528 QoS register compatible dt-bindings: mfd: atmel,sama5d2-flexcom: Add microchip,sama7d65-flexcom mfd: ezx-pcap: Remove unused pcap_adc_sync mfd: db8500-prcmu: Remove needless return in three void APIs mfd: Remove STA2x11 core driver mfd: max77620: Allow building as a module mfd: ene-kb3930: Fix a potential NULL pointer dereference dt-bindings: mfd: qcom,tcsr: Add compatible for MSM8937 ...
2025-03-25Merge tag 'regulator-v6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulatorLinus Torvalds11-173/+1030
Pull regulator updates from Mark Brown: "This has been a very quiet release, we've got support for one device added, another removed, and some smaller fixes and API improvements. The main thing of note is the rework of the PCA9450 LDO5 handling. - A rework of the handling of LDO5 on the PCA9450, this was quite wrong in how it handled the SD_VSEL conrol and only worked for some system designs. This includes a DTS update since there was a not quite ABI compatible change as part of the fix - A devres change introducing devm_kmemdup_array() was pulled in so it could be used with some regulator conversions to that function, this pulled in some other devres and IIO stuff that was part of the same pull request - Removal of the PCF50633 driver, the SoC for the OpenMoko platform that used it has been removed - Support for the NXP PF9453" * tag 'regulator-v6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (24 commits) regulator: axp20x: AXP717: dcdc4 doesn't have delay regulator: dt-bindings: rtq2208: Cleanup whitespace regulator: dt-bindings: rtq2208: Mark fixed LDO VOUT property as deprecated regulator: rtq6752: make const read-only array fault_mask static regulator: pf9453: add PMIC PF9453 support regulator: dt-bindings: pca9450: Add nxp,pf9453 compatible string regulator: pcf50633-regulator: Remove regulator: pca9450: Handle hardware with fixed SD_VSEL for LDO5 regulator: cros-ec: use devm_kmemdup_array() regulator: devres: use devm_kmemdup_array() regulator: Add (devm_)of_regulator_get() devres: Introduce devm_kmemdup_array() iio: imu: st_lsm9ds0: Replace device.h with what is needed driver core: Split devres APIs to device/devres.h err.h: move IOMEM_ERR_PTR() to err.h regulator: pca9450: Remove duplicate code in probe regulator: ad5398: Fix incorrect power down bit mask regulator: pca9450: Fix enable register for LDO5 regulator: pca9450: Fix control register for LDO5 Revert "regulator: pca9450: Add SD_VSEL GPIO for LDO5" ...
2025-03-25objtool, regulator: rk808: Remove potential undefined behavior in rk806_set_mode_dcdc()Josh Poimboeuf1-2/+2
If 'ctr_bit' is negative, the shift counts become negative, causing a shift of bounds and undefined behavior. Presumably that's not possible in normal operation, but the code generation isn't optimal. And undefined behavior should be avoided regardless. Improve code generation and remove the undefined behavior by converting the signed variables to unsigned. Fixes the following warning with an UBSAN kernel: vmlinux.o: warning: objtool: rk806_set_mode_dcdc() falls through to next function rk806_get_mode_dcdc() vmlinux.o: warning: objtool: .text.rk806_set_mode_dcdc: unexpected end of section Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: Mark Brown <broonie@kernel.org> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: https://lore.kernel.org/r/2023abcddf3f524ba478d64339996f25dc4097d2.1742852847.git.jpoimboe@kernel.org Closes: https://lore.kernel.org/oe-kbuild-all/202503182350.52KeHGD4-lkp@intel.com/
2025-03-19regulator: axp20x: AXP717: dcdc4 doesn't have delayPhilippe Simons1-10/+4
According to AXP717 user manual, DCDC4 doesn't have a ramp delay like DCDC1/2/3 do. Remove it from the description and cleanup the macros. Signed-off-by: Philippe Simons <simons.philippe@gmail.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Link: https://patch.msgid.link/20250318205147.42850-1-simons.philippe@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-03-17regulator: rtq6752: make const read-only array fault_mask staticColin Ian King1-1/+1
Don't populate the const read-only array fault_mask on the stack at run time, instead make it static. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://patch.msgid.link/20250317165845.525593-1-colin.i.king@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-03-17regulator: rtq2208: Fix the LDO DVS capabilityChiYuan Huang1-78/+55
Use the hidden bank register to identify whether the LDO voltage is fixed or variable. Remove the read of 'richtek,fixed-microvolt' property. Fixes: af1296d15d89 ("regulator: rtq2208: Add fixed LDO VOUT property and check that matches the constraints") Signed-off-by: ChiYuan Huang <cy_huang@richtek.com> Link: https://patch.msgid.link/dae0321b710518ce32260336e3cc9caf2ba84215.1742204502.git.cy_huang@richtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-03-17regulator: rtq2208: Fix incorrect buck converter phase mappingChiYuan Huang1-18/+71
Use the hidden bank RG to get the correct buck converter phase mapping. Fixes: 85a11f55621a ("regulator: rtq2208: Add Richtek RTQ2208 SubPMIC") Signed-off-by: ChiYuan Huang <cy_huang@richtek.com> Link: https://patch.msgid.link/ae3245aa713f76000dbd20b4ad6f66d30611d3b8.1742204502.git.cy_huang@richtek.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-03-16regulator: allow user configuration of hardware protection actionAhmad Fatoum2-10/+10
When the core detects permanent regulator hardware failure or imminent power failure of a critical supply, it will call hw_protection_shutdown in an attempt to do a limited orderly shutdown followed by powering off the system. This doesn't work out well for many unattended embedded systems that don't have support for shutdown and that power on automatically when power is supplied: - A brief power cycle gets detected by the driver - The kernel powers down the system and SoC goes into shutdown mode - Power is restored - The system remains oblivious to the restored power - System needs to be manually power cycled for a duration long enough to drain the capacitors Allow users to fix this by calling the newly introduced hw_protection_trigger() instead: This way the hw_protection commandline or sysfs parameter is used to dictate the policy of dealing with the regulator fault. Link: https://lkml.kernel.org/r/20250217-hw_protection-reboot-v3-8-e1c09b090c0c@pengutronix.de Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com> Cc: Benson Leung <bleung@chromium.org> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Fabio Estevam <festevam@denx.de> Cc: Guenter Roeck <groeck@chromium.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Lukasz Luba <lukasz.luba@arm.com> Cc: Mark Brown <broonie@kernel.org> Cc: Matteo Croce <teknoraver@meta.com> Cc: "Rafael J. Wysocki" <rafael@kernel.org> Cc: Rob Herring (Arm) <robh@kernel.org> Cc: Rui Zhang <rui.zhang@intel.com> Cc: Sascha Hauer <kernel@pengutronix.de> Cc: "Serge E. Hallyn" <serge@hallyn.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-03-16regulator: pf9453: add PMIC PF9453 supportJoy Zou3-0/+887
Support new PMIC PF9453, which is totally difference with PCA9450. So create new file for it. The PF9453 is a single chip Power Management IC (PMIC) specifically designed for i.MX 91 processor. It provides power supply solutions for IoT (Internet of Things), smart appliance, and portable applications where size and efficiency are critical. The device provides four high efficiency step-down regulators, three LDOs, one 400 mA load switch and 32.768 kHz crystal oscillator driver. Signed-off-by: Joy Zou <joy.zou@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20250314-pf9453-v5-2-ab0cf1f871b0@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-03-14regulator: dummy: convert to use the faux device interfaceGreg Kroah-Hartman1-28/+9
The dummy regulator driver does not need to create a platform device, it only did so because it was simple to do. Change it over to use the faux bus instead as this is NOT a real platform device, and it makes the code even smaller than before. Reviewed-by: Mark Brown <broonie@kernel.org> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Link: https://lore.kernel.org/r/2025021027-outclass-stress-59dd@gregkh Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-03-13regulator: check that dummy regulator has been probed before using itChristian Eggers1-1/+11
Due to asynchronous driver probing there is a chance that the dummy regulator hasn't already been probed when first accessing it. Cc: stable@vger.kernel.org Signed-off-by: Christian Eggers <ceggers@arri.de> Link: https://patch.msgid.link/20250313103051.32430-3-ceggers@arri.de Signed-off-by: Mark Brown <broonie@kernel.org>
2025-03-13regulator: s2mps11: Add support for S2MPU05 regulatorsKaustabh Chakraborty2-3/+93
S2MPU05 is a PMIC by manufactured by Samsung, particularly used in Exynos7870 based devices. Add driver support for controlling its 21 LDO and 5 BUCK regulators. Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org> Acked-by: Mark Brown <broonie@kernel.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20250301-exynos7870-pmic-regulators-v3-3-808d0b47a564@disroot.org Signed-off-by: Lee Jones <lee@kernel.org>
2025-03-11regulator: pcf50633-regulator: RemoveDr. David Alan Gilbert3-132/+0
The pcf50633 was used as part of the OpenMoko devices but the support for its main chip was recently removed in: commit 61b7f8920b17 ("ARM: s3c: remove all s3c24xx support") See https://lore.kernel.org/all/Z8z236h4B5A6Ki3D@gallifrey/ Remove it. Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Link: https://patch.msgid.link/20250311014959.743322-6-linux@treblig.org Signed-off-by: Mark Brown <broonie@kernel.org>
2025-03-11regulator: dummy: force synchronous probingChristian Eggers1-1/+1
Sometimes I get a NULL pointer dereference at boot time in kobject_get() with the following call stack: anatop_regulator_probe() devm_regulator_register() regulator_register() regulator_resolve_supply() kobject_get() By placing some extra BUG_ON() statements I could verify that this is raised because probing of the 'dummy' regulator driver is not completed ('dummy_regulator_rdev' is still NULL). In the JTAG debugger I can see that dummy_regulator_probe() and anatop_regulator_probe() can be run by different kernel threads (kworker/u4:*). I haven't further investigated whether this can be changed or if there are other possibilities to force synchronization between these two probe routines. On the other hand I don't expect much boot time penalty by probing the 'dummy' regulator synchronously. Cc: stable@vger.kernel.org Fixes: 259b93b21a9f ("regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in 4.14") Signed-off-by: Christian Eggers <ceggers@arri.de> Link: https://patch.msgid.link/20250311091803.31026-1-ceggers@arri.de Signed-off-by: Mark Brown <broonie@kernel.org>
2025-03-05regulator: core: Fix deadlock in create_regulator()Ludvig Pärsson1-33/+43
Currently, we are unnecessarily holding a regulator_ww_class_mutex lock when creating debugfs entries for a newly created regulator. This was brought up as a concern in the discussion in commit cba6cfdc7c3f ("regulator: core: Avoid lockdep reports when resolving supplies"). This causes the following lockdep splat after executing `ls /sys/kernel/debug` on my platform: ====================================================== WARNING: possible circular locking dependency detected 5.15.167-axis9-devel #1 Tainted: G O ------------------------------------------------------ ls/2146 is trying to acquire lock: ffffff803a562918 (&mm->mmap_lock){++++}-{3:3}, at: __might_fault+0x40/0x88 but task is already holding lock: ffffff80014497f8 (&sb->s_type->i_mutex_key#3){++++}-{3:3}, at: iterate_dir+0x50/0x1f4 which lock already depends on the new lock. [...] Chain exists of: &mm->mmap_lock --> regulator_ww_class_mutex --> &sb->s_type->i_mutex_key#3 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sb->s_type->i_mutex_key#3); lock(regulator_ww_class_mutex); lock(&sb->s_type->i_mutex_key#3); lock(&mm->mmap_lock); *** DEADLOCK *** This lock dependency still exists on the latest kernel and using a newer non-tainted kernel would still cause this problem. Fix by moving sysfs symlinking and creation of debugfs entries to after the release of the regulator lock. Fixes: cba6cfdc7c3f ("regulator: core: Avoid lockdep reports when resolving supplies") Fixes: eaa7995c529b ("regulator: core: avoid regulator_resolve_supply() race condition") Signed-off-by: Ludvig Pärsson <ludvig.parsson@axis.com> Link: https://patch.msgid.link/20250305-regulator_lockdep_fix-v1-1-ab938b12e790@axis.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-03-03regulator: pca9450: Handle hardware with fixed SD_VSEL for LDO5Frieder Schrempf1-0/+7
There are two ways to set the output voltage of the LD05 regulator. First by writing to the voltage selection registers and second by toggling the SD_VSEL signal. Usually board designers connect SD_VSEL to the VSELECT signal controlled by the USDHC controller, but in some cases the signal is hardwired to a fixed low level (therefore selecting 3.3V as initial value for allowing to boot from the SD card). In these cases, the voltage is only determined by the value of the LDO5CTRL_L register. Introduce a property nxp,sd-vsel-fixed-low to let the driver know that SD_VSEL is low and there is no GPIO to actually get that information from dynamically. Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> Link: https://patch.msgid.link/20250303132258.50204-1-frieder@fris.de Signed-off-by: Mark Brown <broonie@kernel.org>
2025-02-28Convert regulator drivers to useMark Brown2-5/+4
Merge series from Raag Jadav <raag.jadav@intel.com>: This series converts regulator drivers to use the newly introduced[1] devm_kmemdup_array() helper. [1] https://lore.kernel.org/r/20250212062513.2254767-1-raag.jadav@intel.com
2025-02-28regulator: cros-ec: use devm_kmemdup_array()Raag Jadav1-2/+2
Convert to use devm_kmemdup_array() and while at it, make the size robust against type changes. Signed-off-by: Raag Jadav <raag.jadav@intel.com> Link: https://patch.msgid.link/20250228072057.151436-3-raag.jadav@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-02-28regulator: devres: use devm_kmemdup_array()Raag Jadav1-3/+2
Convert to use devm_kmemdup_array() which is more robust. Signed-off-by: Raag Jadav <raag.jadav@intel.com> Link: https://patch.msgid.link/20250228072057.151436-2-raag.jadav@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>