- 09 Sep, 2024 1 commit
-
-
Christophe JAILLET authored
'struct regulator_desc' is not modified in this driver. Constifying this structure moves some data to a read-only section, so increase overall security, especially when the structure holds some function pointers. On a x86_64, with allmodconfig: Before: ====== text data bss dec hex filename 3516 5320 32 8868 22a4 drivers/regulator/mp5416.o After: ===== text data bss dec hex filename 8508 320 32 8860 229c drivers/regulator/mp5416.o -- Compile tested only Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://patch.msgid.link/fd8d1307f211ec7754f46b6678c04309556003bc.1725807320.git.christophe.jaillet@wanadoo.frSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 07 Sep, 2024 1 commit
-
-
Mark Brown authored
Merge series from Andre Przywara <andre.przywara@arm.com>: This is remainder of the AXP717 fix series, containing support for the boost regulator. This is meant to increase the battery voltage to the 5 volts required to provide the USB VBUS power. It's the usual trinity of DT bindings patch (1/3), the MFD part describing the PMIC registers (2/3) and the final patch to model the regulator (3/3). Compared to v2, this drops the merged patches, and just retains the boost related parts. It also changes the internal name of the register to AXP717_MODULE_EN_CONTROL_2, since there is another control register we will need later for battery support.
-
- 06 Sep, 2024 3 commits
-
-
Andre Przywara authored
The AXP717 also contains an adjustable boost regulator, to provide the 5V USB VBUS rail when running on battery. Add the regulator description that states the voltage range this regulator can cover. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: John Watts <contact@jookia.org> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Link: https://patch.msgid.link/20240816001824.6028-4-andre.przywara@arm.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Andre Przywara authored
The AXP717 also contains a boost regulator, to provide the 5V USB VBUS rail when running on battery. Add the registers to the MFD description to be able to use them from the regulator driver. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: John Watts <contact@jookia.org> Acked-by: Lee Jones <lee@kernel.org> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Link: https://patch.msgid.link/20240816001824.6028-3-andre.przywara@arm.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Andre Przywara authored
The X-Powers AXP717 contains a boost regulator, that it meant to provide the 5V USB VBUS voltage when the devices operates on battery. Add the name "boost" to the regexp describing the allowed node names, to allow the regulator to be described in the devicetree. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Acked-by: Lee Jones <lee@kernel.org> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Link: https://patch.msgid.link/20240816001824.6028-2-andre.przywara@arm.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 05 Sep, 2024 1 commit
-
-
Andy Shevchenko authored
Refactor of_get_*regulator() to decrease indentation and increase readability. No functional changes intended. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://patch.msgid.link/20240904190856.1221459-1-andy.shevchenko@gmail.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 04 Sep, 2024 1 commit
-
-
Chen-Yu Tsai authored
There's still a bit of OF-specific code in the regulator device lookup function. Move those bits of code over to of_regulator.c, and create a new function of_regulator_dev_lookup() to encapsulate the code moved out of regulator_dev_lookup(). Also mark of_find_regulator_by_node() as static, since there are no other users in other compile units. There are no functional changes. A line alignment was also fixed. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://patch.msgid.link/20240904090016.2841572-4-wenst@chromium.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 29 Aug, 2024 10 commits
-
-
Chen-Yu Tsai authored
Previous commits cleaning up kerneldoc used the term "negative error number" to refer to error condition return values. Update remaining instances of other terminology such as "error code" or "errno" as well so the whole regulator subsystem is unified. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20240829085131.1361701-11-wenst@chromium.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Chen-Yu Tsai authored
of_regulator_bulk_get_all() has a comment section that pretty much resembles a kerneldoc block, except that the block begins with "/*" instead of "/**". Fix that and also rework the "Return" section and the error code terminology so that it is the same as the other kerneldoc blocks in the same file. Fixes: 27b9ecc7 ("regulator: Add of_regulator_bulk_get_all") Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20240829085131.1361701-10-wenst@chromium.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Chen-Yu Tsai authored
kernel-doc complains about missing "Return" section for the function regulator_irq_map_event_simple(). Add a "Return" section for it based on its behavior. The function actually always returns 0, but fills in fields in its @rid parameter as needed. Expand the description of the parameter to cover this. While at it fix a typo found in the description of the same function. Reported-by: Matti Vaittinen <mazziesaccount@gmail.com> Closes: https://lore.kernel.org/all/e341240e-1c1f-49a2-91cd-440888fdbda0@gmail.com/Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20240829085131.1361701-9-wenst@chromium.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Chen-Yu Tsai authored
kernel-doc complains about missing "Return" section for the function regulator_register_always_on(). Add a "Return" section for it based on its behavior. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20240829085131.1361701-8-wenst@chromium.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Chen-Yu Tsai authored
kernel-doc complains about missing "Return" section for kerneldoc of of_get_fixed_voltage_config(). The kerneldoc has a description about the return values, just not in the format kernel-doc wants. Convert it to use the proper "Return:" section header. The existing description have been reworded and moved around to fit the grammar and formatting. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20240829085131.1361701-7-wenst@chromium.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Chen-Yu Tsai authored
kernel-doc complains about missing "Return" section for many documented functions in the regulator OF-specific code. These all have descriptions about the return values, just not in the format kernel-doc wants. Convert these to use the proper "Return:" section header. The existing descriptions have been reworded and moved around to fit the grammar and formatting. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20240829085131.1361701-6-wenst@chromium.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Chen-Yu Tsai authored
kernel-doc complains about missing "Return" section for many documented functions in the regulator core. Some with free-form return value descriptions have been fixed in the previous patch. The remaining are completely missing any mention of return values. Add "Return" sections to these kerneldoc blocks with basic descriptions. In a few cases where the functions don't call even more functions and the error numbers are known, those are documented in detail. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20240829085131.1361701-5-wenst@chromium.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Chen-Yu Tsai authored
kernel-doc complains about missing "Return" section for many documented functions in the regulator core. Many of them actually have descriptions about the return values, just not in the format kernel-doc wants. Convert these to use the proper "Return:" section header. The existing descriptions have been reworded and moved around to fit the grammar and formatting. In a few cases where the functions don't call even more functions and the error numbers are known, those are documented in detail. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20240829085131.1361701-4-wenst@chromium.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Chen-Yu Tsai authored
The kerneldoc for regulator_is_supported_voltage() states that the return value is a boolean. That is not correct, as it could return an error number if the check failed. Fix the description by expanding it to cover the valid return values and error conditions. The description is also converted to a proper "Return" section. Fixes: c5f3939b ("regulator: core: Support fixed voltages in regulator_is_supported_voltage()") Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20240829085131.1361701-3-wenst@chromium.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Chen-Yu Tsai authored
kernel-doc complains that _regulator_check_status_enabled() is missing a short description. Since the current description is already quite short, just trim it a bit more and use it as the short description. Fixes: f7d7ad42 ("regulator: Allow regulators to verify enabled during enable()") Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20240829085131.1361701-2-wenst@chromium.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 28 Aug, 2024 2 commits
-
-
Rob Herring (Arm) authored
Use of_property_read_bool() to read boolean properties rather than of_find_property(). This is part of a larger effort to remove callers of of_find_property() and similar functions. of_find_property() leaks the DT property pointer which is a problem for dynamically allocated nodes which may be freed. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20240828130056.3481050-2-robh@kernel.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Rob Herring (Arm) authored
There's no need to check for presence of "qcom,saw-reg" before parsing it. If the property doesn't exist, parsing it will return NULL. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20240828130056.3481050-1-robh@kernel.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 22 Aug, 2024 5 commits
-
-
Mark Brown authored
Merge series from Chen-Yu Tsai <wenst@chromium.org>: Here are some cleanups for some bits that I saw while reworking my I2C device tree component prober to use of_regulator_bulk_get_all(). These are not directly related to that series, so I send them separately here.
-
Krzysztof Kozlowski authored
Allocate the memory with scoped/cleanup.h to reduce error handling (less error paths) and make the code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240822161231.106744-1-krzysztof.kozlowski@linaro.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Chen-Yu Tsai authored
Currently in of_regulator_bulk_get_all(), if any regulator request fails, the error path releases all regulators already requested, but leaves the |struct regulator_bulk_data| memory to the caller to free, and also leaves the regulator consumer pointers dangling. The latter behavior is not documented, and may not be what the caller is expecting. Instead, explicitly clean up everything on error, and make it clear that the result pointer is only update if the whole request succeeds. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://patch.msgid.link/20240822072047.3097740-4-wenst@chromium.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Chen-Yu Tsai authored
If regulator_get() in of_regulator_bulk_get_all() returns an error, that error gets overridden and -EINVAL is always passed out. This masks probe deferral requests and likely won't work properly in all cases. Fix this by letting of_regulator_bulk_get_all() return the original error code. Fixes: 27b9ecc7 ("regulator: Add of_regulator_bulk_get_all") Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://patch.msgid.link/20240822072047.3097740-3-wenst@chromium.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Chen-Yu Tsai authored
The original error message simply said "get() with no identifier" without any context as to what was requested or what device the request was related to. The only thing the user or developer could do was grep for the message in the full source tree. Amend the error message to be more specific, and also use dev_* to associate the error message with a device. Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://patch.msgid.link/20240822072047.3097740-2-wenst@chromium.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 15 Aug, 2024 1 commit
-
-
Mark Brown authored
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>: Make code a bit smaller/simpler, with less of_node_put() thanks to cleanup.h.
-
- 14 Aug, 2024 10 commits
-
-
Bartosz Golaszewski authored
Add support for the swctrl-gpios property which contains the phandle to the GPIO indicating the clock supply to the BT module. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://patch.msgid.link/20240813185827.154779-3-brgl@bgdev.plSigned-off-by: Mark Brown <broonie@kernel.org>
-
Bartosz Golaszewski authored
Add description of the PMU of the WCN6855 model. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://patch.msgid.link/20240813185827.154779-2-brgl@bgdev.plSigned-off-by: Mark Brown <broonie@kernel.org>
-
Bartosz Golaszewski authored
The Bluetooth module is obviously not an ath11k so drop the word. Fixes: b5cb34c9 ("regulator: dt-bindings: describe the PMU module of the QCA6390 package") Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://patch.msgid.link/20240813185827.154779-1-brgl@bgdev.plSigned-off-by: Mark Brown <broonie@kernel.org>
-
Krzysztof Kozlowski authored
Use scoped for_each_available_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240814-cleanup-h-of-node-put-regulator-v1-7-87151088b883@linaro.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Krzysztof Kozlowski authored
Use scoped for_each_available_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240814-cleanup-h-of-node-put-regulator-v1-6-87151088b883@linaro.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Krzysztof Kozlowski authored
Use scoped for_each_available_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240814-cleanup-h-of-node-put-regulator-v1-5-87151088b883@linaro.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Krzysztof Kozlowski authored
Obtain the device node reference with scoped/cleanup.h to reduce error handling and make the code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240814-cleanup-h-of-node-put-regulator-v1-4-87151088b883@linaro.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Krzysztof Kozlowski authored
Obtain the device node reference with scoped/cleanup.h to reduce error handling and make the code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240814-cleanup-h-of-node-put-regulator-v1-3-87151088b883@linaro.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Krzysztof Kozlowski authored
Obtain the device node reference with scoped/cleanup.h and use scoped for_each_child_of_node_scoped() to reduce error handling and make the code a bit simpler. Add also brackets {} over outer for loop for code readability. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240814-cleanup-h-of-node-put-regulator-v1-2-87151088b883@linaro.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
Krzysztof Kozlowski authored
Obtain the device node reference with scoped/cleanup.h and use scoped for_each_child_of_node_scoped() to reduce error handling and make the code a bit simpler. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20240814-cleanup-h-of-node-put-regulator-v1-1-87151088b883@linaro.orgSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 13 Aug, 2024 3 commits
-
-
Mark Brown authored
Merge series from Andrei Simion <andrei.simion@microchip.com>: In this series of patches, support for the *-supply property [1] is added (correlated with supply_name [2]) from the core regulator. Link [1]: https://github.com/torvalds/linux/blob/master/drivers/regulator/core.c#L471 Link [2]: https://github.com/torvalds/linux/blob/master/drivers/regulator/core.c#L2064 I modified the mcp16502.c driver and the dts that use this PMIC. We added these improvements to provide a complete description of the board power scheme.
-
Andrei Simion authored
Update the yaml schema with info about input supply phandle for each buck and ldo according with the PMIC MCP16502 Datasheet. Signed-off-by: Andrei Simion <andrei.simion@microchip.com> Link: https://patch.msgid.link/20240812135231.43744-3-andrei.simion@microchip.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
Andrei Simion authored
Based on the datasheet [1] (Block Diagram) PVIN[1-4] and LVIN represent the input voltage supply for each BUCKs respective LDOs. Update the driver to align with the datasheet [1]. [1]: https://ww1.microchip.com/downloads/aemDocuments/documents/APID/ProductDocuments/DataSheets/MCP16502-Data-Sheet-DS20006275.pdfCo-developed-by: Mihai Sain <mihai.sain@microchip.com> Signed-off-by: Mihai Sain <mihai.sain@microchip.com> Signed-off-by: Andrei Simion <andrei.simion@microchip.com> Link: https://patch.msgid.link/20240812135231.43744-2-andrei.simion@microchip.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 07 Aug, 2024 1 commit
-
-
Macpaul Lin authored
Convert the MediaTek MT6397 regulator bindings to DT schema. Signed-off-by: Sen Chu <sen.chu@mediatek.com> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://patch.msgid.link/20240807091738.18387-1-macpaul.lin@mediatek.comSigned-off-by: Mark Brown <broonie@kernel.org>
-
- 06 Aug, 2024 1 commit
-
-
Christophe JAILLET authored
'struct linear_range' are not modified in these drivers. Constifying this structure moves some data to a read-only section, so increase overall security. This is also more consistent with the other struct linear_range declaration above. On a x86_64, with allmodconfig, as an example: Before: ====== text data bss dec hex filename 20767 4544 0 25311 62df drivers/regulator/bd9576-regulator.o After: ===== text data bss dec hex filename 21023 4288 0 25311 62df drivers/regulator/bd9576-regulator.o Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://patch.msgid.link/a4e37991ea7b47145ab033128c8dd49f73a983e6.1722949232.git.christophe.jaillet@wanadoo.frSigned-off-by: Mark Brown <broonie@kernel.org>
-