Commit Graph

9 Commits

Author SHA1 Message Date
Mark Brown c67bb84434
regulator: Use container_of_const() when all types are
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>:

Use container_of_const(), which is preferred over container_of(), when
the argument 'ptr' and returned pointer are already const, for better
code safety and readability.

Some drivers already have const everywhere, so container_of_const can be
directly used. In few other drivers, the final pointer can be constified
that way.
2025-11-26 21:21:57 +00:00
Krzysztof Kozlowski 6341646f72
regulator: pf9453: Constify pointers to 'regulator_desc' wrap struct
Pointer to 'struct regulator_desc' is a pointer to const and the
wrapping structure (container) is not being modified, thus entire syntax
can be replaced to preferred and safer container_of_const().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20251126-container-of-const-regulator-v1-8-eeec378144d4@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-26 18:44:32 +00:00
Andy Shevchenko 6bd1ad97eb
regulator: pf9453: Fix kernel doc for mux_poll()
The validator is not happy:

Warning: drivers/regulator/pf9453-regulator.c:303 This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst

Update the kernel-doc accordingly.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20251106114628.2302762-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-06 13:08:13 +00:00
Joy Zou 2ecc8c0898
regulator: pf9453: remove unused I2C_LT register
Remove unused I2C_LT registers, which not defined in PF9453 datasheet.

Signed-off-by: Joy Zou <joy.zou@nxp.com>
Link: https://patch.msgid.link/20251103-b4-next-pf9453-v1-3-a025d536eee1@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-03 13:15:31 +00:00
Joy Zou 0144a2b29d
regulator: pf9453: remove low power mode
Remove low power mode support to align with the Rev.1.0 -- 25 June 2025
datasheet, which no longer support this feature.

Datasheet is available at
https://www.nxp.com/docs/en/data-sheet/PF9453.pdf.

Signed-off-by: Joy Zou <joy.zou@nxp.com>
Link: https://patch.msgid.link/20251103-b4-next-pf9453-v1-2-a025d536eee1@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-03 13:15:31 +00:00
Joy Zou a2d4691b3f
regulator: pf9453: change the device ID register address
Remove unnecessary register OTP_Ver and change the device ID address to
0x1. Previous version chip is never mass production. So not broken
compatibility.

Signed-off-by: Joy Zou <joy.zou@nxp.com>
Link: https://patch.msgid.link/20251103-b4-next-pf9453-v1-1-a025d536eee1@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-03 13:15:30 +00:00
Bo Liu 5410aa3aa7
regulator: pf9453: convert to use maple tree register cache
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-24 12:56:29 +01:00
Yang Li b3d9e96c96
regulator: pf9453: Improve documentation for pf9453_regulator_set_ramp_delay_regmap
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-07 12:57:44 +01:00
Joy Zou 0959b67063
regulator: pf9453: add PMIC PF9453 support
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-16 23:34:01 +00:00