aboutsummaryrefslogtreecommitdiff
path: root/drivers/power/pmic
AgeCommit message (Collapse)AuthorFilesLines
2024-03-14power: pmic: rk8xx: fix duplicate promptQuentin Schulz1-1/+1
SPL_PMIC_RK8XX and PMIC_RK8XX both share the same prompt making it difficult to know at first glance in menuconfig what's for what, let's fix this by adding "in SPL" at the end of the prompt for the SPL symbol. Cc: Quentin Schulz <foss+uboot@0leil.net> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2024-03-14power: rk8xx: add support for RK806Quentin Schulz1-0/+91
This adds support for RK806, only the SPI variant has been tested. The communication "protocol" over SPI is the following: - write three bytes: - 1 byte: [0:3] length of the payload, [6] Enable CRC, [7] Write - 1 byte: LSB register address - 1 byte: MSB register address - write/read length of payload The CRC is always disabled for now. The RK806 technically supports I2C as well, and this should be able to support it without any change, but it wasn't tested. The DT node name prefix for the buck converters has changed in the Device Tree and is now dcdc-reg. The logic for buck converters is however manageable within the current logic inside the rk8xx regulator driver. The same cannot be said for the NLDO and PLDO. Because pmic_bind_children() parses the DT nodes and extracts the LDO index from the DT node name, NLDO and PLDO will have overlapping indices. Therefore, we need a separate logic from the already-existing ldo callbacks. Let's reuse as much as possible though. Cc: Quentin Schulz <foss+uboot@0leil.net> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2024-02-28pmic: raa215300: Bind sysreset driverPaul Barker1-0/+9
If SYSRESET support is enabled for the RAA215300 PMIC, we need to bind the raa215300_sysreset driver as a child device of the PMIC. Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-02-28pmic: Add Renesas RAA215300 PMIC driverPaul Barker3-0/+51
The RZ/G2L SMARC module is powered via a Renesas RAA215300 PMIC which provides several voltage converters, a real time clock (RTC) and reset control. A basic driver is implemented for this device so that we can read, write and dump the PMIC registers. The raa215300_bind() function is added as a stub, binding of the sysreset driver will be added in a later patch. Additional features of this PMIC (such as reset control) may be supported by future patches. Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-01-16pmic: qcom: dont use dev_read_addr to get USIDCaleb Connolly1-4/+11
Linux DTs stuff a value indicating if the USID is a USID or a GSID in the reg property, the Linux SPMI driver then reads the two address cells separately. U-boot's dev_read_addr() doesn't know how to handle this, so use ofnode_read_u32_index() to get just the USID. The Qcom pmic driver doesn't have support for GSID handling, so just ignore the second value for now. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Tested-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2023-12-19drivers: gpio: implement PALMAS GPIO cellSvyatoslav Ryhel1-1/+9
Add gpio driver for TI Palmas series PMIC. This has 8 gpio which can work as input/output. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2023-12-19drivers: gpio: implement MAX77663 GPIO cellSvyatoslav Ryhel1-0/+9
MAXIM Semiconductor's PMIC, MAX77663 has 8 GPIO pins and 3 GPIO-like pins. It also supports interrupts from these pins. Add GPIO driver for these pins to control via GPIO APIs. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2023-11-12power: regulator: add AXP313 supportAndre Przywara1-0/+1
The X-Powers AXP313a is a small PMIC with just three buck converters and three LDOs, one of which is actually fixed (so not modelled here). Add the compatible string and the respective regulator ranges to allow drivers to adjust voltages. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-11-10tree-wide: Replace http:// link with https:// link for ti.comNishanth Menon1-1/+1
Replace instances of http://www.ti.com with https://www.ti.com Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-03sysreset: implement PALMAS sysreset functionsSvyatoslav Ryhel1-2/+31
PALMAS PMIC family has embedded poweroff function used by some device to initiane device power off. Implement it as sysreset driver. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2023-11-03sysreset: implement TPS65910 sysreset functionsSvyatoslav Ryhel1-1/+11
TPS65910/TPS65911 PMICs have embedded power control functions used by some device to initiane device power off. Implement it as sysreset driver. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2023-11-03sysreset: implement TPS80031 sysreset functionsSvyatoslav Ryhel1-1/+10
TPS80031/TPS80032 PMICs have embedded power control functions used by some device to initiane device power off. Implement it as sysreset driver. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2023-11-03sysreset: implement MAX77663 sysreset functionsSvyatoslav Ryhel1-1/+10
MAX77663 PMIC has embedded poweroff function used by some device to initiane device power off. Implement it as sysreset driver. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2023-11-03power: pmic: tps65910: add TPS65911 PMIC supportSvyatoslav Ryhel1-3/+12
Add support to bind the regulators/child nodes with the pmic. Also adds the pmic i2c based read/write functions to access pmic registers. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-03power: pmic: add the base TPS80031 PMIC supportSvyatoslav Ryhel3-0/+94
Add support to bind the regulators/child nodes with the pmic. Also adds the pmic i2c based read/write functions to access pmic registers. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-03power: pmic: add the base MAX77663 PMIC supportSvyatoslav Ryhel3-0/+91
Add support to bind the regulators/child nodes with the pmic. Also adds the pmic i2c based read/write functions to access pmic registers. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-11-03power: pmic: palmas: support TI TPS65913 PMICSvyatoslav Ryhel1-0/+1
Existing PALMAS PMIC driver is fully compatible with TI TPS65913 PMIC found in many Tegra 4 devices, like Tegra Note 7 and ASUS TF701T. TPS65913 shares same structure of regulators like TPS659038 so data can be reused. Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # NVIDIA Tegratab Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2023-10-07power: pmic: rk8xx: Fix power-on source check in SPLJonas Karlman1-7/+13
The commit 30975fb73d51 ("rockchip: Add option to prevent booting on power plug-in") introduce an option to prevent booting a device when the device was powered on due to power plug-in instead of pressing a power button. This feature works by checking the power-on source during PMIC probe and powers off the device if power-on source was power plug-in. This check currently runs very late at PMIC probe in U-Boot proper. Fix so that the power-on source check can work at probe time in SPL. Also enable probe after bind and remove the PMIC banner in SPL. With this we can use ROCKCHIP_RK8XX_DISABLE_BOOT_ON_POWERON and SPL_PMIC_RK8XX to power off the device very quickly after TPL instead of after TF-A and U-Boot proper has been loaded and run. DDR V1.18 f366f69a7d typ 23/07/17-15:48:58 ln LP4/4x derate en, other dram:1x trefi ddrconfig:7 LPDDR4X, 324MHz BW=32 Col=10 Bk=8 CS0 Row=17 CS1 Row=17 CS=2 Die BW=16 Size=8192MB change to: 324MHz clk skew:0x64 change to: 528MHz clk skew:0x58 change to: 780MHz clk skew:0x58 change to: 1056MHz(final freq) clk skew:0x40 out Power Off due to plug-in event Fixes: 30975fb73d51 ("rockchip: Add option to prevent booting on power plug-in") Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2023-10-07power: pmic: rk8xx: Use sysreset implementation of the poweroff commandJonas Karlman1-0/+1
Select SYSRESET_CMD_POWEROFF to use the sysreset implementation of the poweroff command when PMIC_RK8XX is enabled. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2023-09-24common: Drop linux/printk.h from common headerSimon Glass20-0/+20
This old patch was marked as deferred. Bring it back to life, to continue towards the removal of common.h Move this out of the common header and include it only where needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-06-16pmic: stpmic1: support new prefix node name for regulatorPatrick Delaunay1-0/+2
The '_' character is discouraged in the node name, this patch adds the new prefix of regulator subnode, with the '-' character, in STM32MP1 driver to support the new naming rule in Linux kernel device trees. It is a preliminary patch before Linux device tree synchronization for STMicroelectronics boards. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2023-03-30power: pmic: Add NXP PCA9451A PMIC supportYe Li1-0/+1
PCA9451A uses similar BUCKs and LDO regulators as PCA9450B/C but has LDO2 and LDO3 removed. So reuse pca9450 PMIC and regulator driver and add new type for PCA9451A. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Marek Vasut <marex@denx.de>
2023-02-07power: Drop unused muic_max8997 driverSimon Glass2-75/+0
This is not used. Drop the driver and Kconfig option. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-30pmic: pca9450: Make warm reset on WDOG_B assertionMarek Vasut1-1/+10
The default configuration of the PMIC behavior makes the PMIC power cycle most regulators on WDOG_B assertion. This power cycling causes the memory contents of OCRAM to be lost. Some systems neeeds some memory that survives reset and reboot, therefore this patch is created. The implementation is taken almost verbatim from Linux commit 2364a64d0673f ("regulator: pca9450: Make warm reset on WDOG_B assertion") Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2023-01-23power: pmic: axp: Bind regulators from the DTSamuel Holland1-0/+18
Now that a regulator driver exists for this PMIC, hook it up to the device tree "regulators" subnodes. Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2023-01-23power: pmic: axp: Provide a variant ID in the driver dataSamuel Holland1-9/+9
Subordinate regulator drivers can use this enumerated ID instead of matching the compatible string again. Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2022-12-23global: Migrate CONFIG_POWER_PFUZE3000_I2C_ADDR to CFGTom Rini1-1/+1
Perform a simple rename of CONFIG_POWER_PFUZE3000_I2C_ADDR to CFG_POWER_PFUZE3000_I2C_ADDR Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-23global: Migrate CONFIG_POWER_PFUZE100_I2C_ADDR to CFGTom Rini1-1/+1
Perform a simple rename of CONFIG_POWER_PFUZE100_I2C_ADDR to CFG_POWER_PFUZE100_I2C_ADDR Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-23global: Migrate CONFIG_POWER_LTC3676_I2C_ADDR to CFGTom Rini1-1/+1
Perform a simple rename of CONFIG_POWER_LTC3676_I2C_ADDR to CFG_POWER_LTC3676_I2C_ADDR Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-22Convert CONFIG_POWER_PCA9450 to KconfigTom Rini1-0/+3
This converts the following to Kconfig: CONFIG_POWER_PCA9450 Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-21Merge tag 'v2023.01-rc4' into nextTom Rini1-0/+4
Prepare v2023.01-rc4 Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-12dm: pmic: ignore disabled node in pmic_bind_childrenPatrick Delaunay1-0/+4
Ignore the disabled children node in pmic_bind_children() so the disabled regulators in device tree are not registered. This patch is based on the dm_scan_fdt_node() code - only the activated nodes are bound - and it solves possible issue when a deactivated regulator is bound, error for duplicated regulator name for example. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-12-05Convert CONFIG_POWER_LTC3676 et al to KconfigTom Rini2-3/+31
This converts the following to Kconfig: CONFIG_POWER_FSL CONFIG_POWER_FSL_MC13892 CONFIG_POWER_HI6553 CONFIG_POWER_LTC3676 CONFIG_POWER_PFUZE100 CONFIG_POWER_PFUZE3000 CONFIG_POWER_SPI CONFIG_POWER_TPS65090_EC CONFIG_POWER_TPS65218 CONFIG_POWER_TPS65910 Signed-off-by: Tom Rini <trini@konsulko.com>
2022-12-05power: pmic: Guard non-DM_PMIC drivers with a check for POWER_LEGACYTom Rini2-5/+10
As we have more legacy PMIC drivers to move to Kconfig, guard them all with POWER_LEGACY or SPL_POWER_LEGACY. Do the same kind of check for building the drivers too. This also means that we need to resort the list slightly in the Makefile. Cc: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-11-07drivers: power: pmic: Enable use of rn5t567 PMIC in SPLMartyn Welch2-1/+9
The support added later in this series tweaks the PMIC voltages in the SPL. Enable support for the rn5t567 in SPL builds to allow this to be done cleanly. Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2022-11-07drivers: power: pmic: Add support for rn5t568 PMICMartyn Welch1-0/+1
Add support for the rn5t568 PMIC to the rn5t567 driver. Signed-off-by: Martyn Welch <martyn.welch@collabora.com> Reviewed-by: Jaehoon Chung <j80.chung@samsung.com>
2022-11-07regulator: bd718x7: Only bind children when PMIC_CHILDREN is enabledAdam Ford1-4/+5
If the bd718x7 is required, but PMIC_CHILDREN is disabled, this driver throws a compile error. Fix this by putting the function to bind children into an if-statement checking for PMIC_CHILDREN. Allowing PMIC_CHILDREN to be disabled in SPL saves some space and still permits some read/write functions to access the PMIC in early startup. Signed-off-by: Adam Ford <aford173@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Fabio Estevam <festevam@gmail.com>
2022-10-26power: fan53555: Fix missing newline in error messageMichal Suchanek1-1/+1
Avoid concatenation with following message. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2022-09-29sandbox: power: Update PMIC driver to use logSimon Glass1-4/+6
Use the log functions instead of pr_...() so we can avoid using __func__. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2022-08-26pmic: Convert pm8916 driver to a generic Qcom PMIC driverSumit Garg3-26/+26
Since both pm8916.c and pm8916_gpio.c are already supporting multiple Qcom SoCs, it makes sense to rename these drivers to pmic_qcom.c and qcom_pmic_gpio.c respectively. Also, these driver can be extended to support additional functionality if required for other Qcom SoCs. Along with this import latest DT binding: qcom,spmi-pmic.txt from Linux kernel and thereby remove pm8916.txt. Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
2022-06-29rockchip: Add option to prevent booting on power plug-inChris Morgan1-0/+34
For Rockchip boards with the all rk8xx series PMICs (excluding the rk808), it is sometimes desirable to not boot whenever the device is plugged in. An example would be for the Odroid Go Advance. This provides a configurable option to check the PMIC says it was powered because of a plug-in event. If the value is 1 and this option is selected, the device shuts down shortly after printing a message to console stating the reason why it's shutting down. Powering up the board with the power button is not affected. This patch parallels the work done in the following patch series: https://lore.kernel.org/u-boot/20220121133732.2397273-1-andre.przywara@arm.com/ Signed-off-by: Chris Morgan <macromorgan@hotmail.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2022-06-29power: pmic: rk8xx: Support sysreset shutdown methodChris Morgan1-1/+49
Add support for sysreset shutdown for this PMIC. The values were pulled from the various datasheets, but for now it has only been tested on the rk817 (for an Odroid Go Advance). Signed-off-by: Chris Morgan <macromorgan@hotmail.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2022-06-28pmic: pca9450: Add optional SD_VSEL GPIO for LDO5Frieder Schrempf1-0/+27
LDO5 has two separate control registers. LDO5CTRL_L is used if the input signal SD_VSEL is low and LDO5CTRL_H if it is high. The current driver implementation only uses LDO5CTRL_H. To make this work on boards that have SD_VSEL connected to a GPIO, we add support for specifying an optional GPIO and setting it to high at probe time. In the future we might also want to add support for boards that have SD_VSEL set to a fixed low level. In this case we need to change the driver to be able to use the LDO5CTRL_L register. This is a port of the same change in the Linux kernel: 8c67a11bae88 ("regulator: pca9450: Add SD_VSEL GPIO for LDO5") Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> Reviewed-by: Fabio Estevam <festevam@denx.de> Tested-by: Fabio Estevam <festevam@denx.de>
2022-06-14pmic: pca9450: add DM_I2C dependencies in KconfigRasmus Villemoes1-1/+3
The pca9450 driver uses dm_i2c_{read,write}, which are (unsurprisingly) only available with DM_I2C. Make sure one can't create an unbuildable .config by adding proper dependencies. While here, append "in SPL" to the prompt for the SPL_ variant so it doesn't read the same as the one for the non-SPL_ variant. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2022-05-20pmic: pca9450: Add regulator driverMarek Vasut1-3/+3
Add PCA9450 regulator driver. This is complementary driver for the BUCKn and LDOn regulators provided by the PCA9450 PMIC driver. Currently the driver permits reading the settngs and configuring the BUCKn and LDOn regulators. Reviewed-by: Fabio Estevam <festevam@denx.de> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <festevam@denx.de> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de>
2022-05-20pmic: pca9450: Add upstream regulators subnode matchMarek Vasut1-0/+2
The upstream DT regulators node subnodes are named BUCKn and LDOn, the downstream DT regulators node subnodes are named buckn and ldon, add the upstream match. Reviewed-by: Fabio Estevam <festevam@denx.de> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <festevam@denx.de> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de>
2022-05-09power: add driver for the TPS65219 PMICNeil Armstrong3-0/+95
The TPS65219 I2S PMIC features 3 Buck converters and 4 linear regulators, 2 GPOs, 1 GPIO, and 3 multi-function-pin. This adds the PMIC driver, loading the regulator sub-nodes. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2022-04-12pmic: pca9450: Add PCA9450C compatible stringMarek Vasut1-0/+1
Add DT compatible string for PCA9450C PMIC. This is a variant of the PCA9450 PMIC with 6 A dual-phase buck regulator and 3 A buck regulator, and is software-wise compatible with the PCA9450B. This variant of the PCA9450 is designed for use as companion PMIC for i.MX8MP. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <festevam@denx.de> Cc: Peng Fan <peng.fan@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Reviewed-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2022-04-05power: pmic: Provide DM_PMIC support for tps65217 driverLukasz Majewski1-0/+82
The tps65217 PMIC driver is used with am335x SoC based designs. It is used in the SPL (MLO) as well, so the DM conversion only is for u-boot proper. This driver only allows simple reading/writing/dumping of the content of its registers and requires the DM_I2C for proper operation. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2022-04-05power: Rename CONFIG_POWER_TPS65217 with CONFIG_PMIC_TPS65217Lukasz Majewski2-1/+9
Up till now the CONFIG_POWER_TPS65217 has been defined in several header files for am335x SoC. This patch renames it to CONFIG_PMIC_TPS65217, which better reflects the role of this IC circuit. Moreover, new CONFIG_PMIC_TPS65217 has been introduced in Kconfig to be used with boards, which both support DM_PMIC and DM_I2C. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> [trini: Migrate all other platforms as well] Signed-off-by: Tom Rini <trini@konsulko.com>