aboutsummaryrefslogtreecommitdiff
path: root/drivers/power/pmic
AgeCommit message (Collapse)AuthorFilesLines
2020-04-18pmic: pfuze100: Change error message level to debugFabio Estevam1-1/+1
In some cases U-Boot runs the same binary on different board versions. In wandboard, for example, there are versions with the PFUZE100 PMIC populated and others without it. When the PMIC is not present, it is not really useful to get PMIC error, so change the error message level to debug instead. Signed-off-by: Fabio Estevam <festevam@gmail.com> Tested-by: Heiko Schocher <hs@denx.de>
2020-03-03power: pmic: tps65941: Add support for probing the child devicesTero Kristo1-2/+2
TPS65941 can have child devices under it (like the ESM support), so probe these once the master pmic node completes probe. Signed-off-by: Tero Kristo <t-kristo@ti.com>
2020-02-05dm: core: Create a new header file for 'compat' featuresSimon Glass3-0/+3
At present dm/device.h includes the linux-compatible features. This requires including linux/compat.h which in turn includes a lot of headers. One of these is malloc.h which we thus end up including in every file in U-Boot. Apart from the inefficiency of this, it is problematic for sandbox which needs to use the system malloc() in some files. Move the compatibility features into a separate header file. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-02-05sandbox: pmic: Correct i2c pmic emulator platdata methodSimon Glass1-3/+13
This currently reads the uclass's private data in the ofdata_to_platdata method which is not allowed, since the uclass has not read it from the device tree. This happens in the probe method. Fix it by adding a probe() method and moving the code there. Signed-off-by: Simon Glass <sjg@chromium.org>
2020-01-27power: pmic: add driver for Dialog DA9063 PMICMartin Fuzzey3-0/+145
This adds the basic register access operations and child regulator binding (if a regulator driver exists). Robert Beckett: simplify accesses by using bottom bit of address as offset overflow. This avoids the need to track which page we are on. Add an option CONFIG_SPL_DM_PMIC_DA9063. Signed-off-by: Martin Fuzzey <martin.fuzzey@flowbird.group> Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
2020-01-08power: Add new PMIC PCA9450 driverYe Li4-0/+152
PCA9450 PMIC series is used to support iMX8MM (PCA9450A) and iMX8MN (PCA9450B). Add the PMIC driver for both PCA9450A and PCA9450B. Signed-off-by: Robin Gong <yibin.gong@nxp.com> Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-12-02common: Move get_ticks() function out of common.hSimon Glass1-0/+1
This function belongs in time.h so move it over and add a comment. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2019-11-23power: fan53555: add support for Silergy SYR82X and SYR83XVasily Khoruzhick1-2/+5
SYR82X and SYR83X are almost identical to FAN53555, the only difference is different die ID and revision, voltage ranges and steps. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Tested-by: Anand Moon <linux.amoon@gmail.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-11Merge tag 'u-boot-rockchip-20191110' of ↵Tom Rini1-3/+86
https://gitlab.denx.de/u-boot/custodians/u-boot-rockchip - Add support for rockchip pmic rk805,rk809, rk816, rk817 - Add rk3399 board Leez support - Fix bug in rk3328 ram driver - Adapt SPL to support ATF bl31 with entry at 0x40000 - Fix the u8 type comparision with '-1'. - Fix checkpatch warning for multi blank line and review signature.
2019-11-10power: pmic: rk809: support rk809 pmicJoseph Chen1-1/+4
The RK809 is a Power Management IC (PMIC) for multimedia and handheld devices. They contains the following components: - Regulators(5*BUCKs, 9*LDOs, 2*SWITCHes) - RTC - Clocking Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-10power: pmic: rk817: support rk817 pmicJoseph Chen1-3/+81
The RK817 is a Power Management IC (PMIC) for multimedia and handheld devices. They contains the following components: - Regulators(4*BUCKs, 1* BOOST, 9*LDOs, 1*SWITCH) - RTC - Clocking Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-10power: pmic: rk805: support rk805 pmicElaine Zhang1-0/+1
The RK805 are a Power Management IC (PMIC) for multimedia and handheld devices. They contains the following components: - Regulators(4*BUCKs, 3*LDOs) - RTC - Clocking Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-10power: pmic: rk816: support rk816 pmicElaine Zhang1-0/+1
The RK816 is a Power Management IC (PMIC) for multimedia and handheld devices. They contains the following components: - Regulators(4*BUCKs, 1*BOOST, 6*LDOs, 1*SWITCH) - RTC - Clocking Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2019-11-07power: pmic: tps65941: Add support for tps65941 family of PMICsKeerthy3-0/+91
Add support to bind the regulators/child nodes with the pmic. Signed-off-by: Keerthy <j-keerthy@ti.com>
2019-11-03power: pmic: Kconfig: add CONFIG_SPL_DM_PMIC_BD71837Peng Fan1-0/+8
Add CONFIG_SPL_DM_PMIC_BD71837 to make this driver could be used in SPL stage Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-11-03pmic: bd71837: drop DEBUG macroPeng Fan1-2/+0
Drop DEBUG macro definition which is used for debug purpose. Signed-off-by: Peng Fan <peng.fan@nxp.com>
2019-08-27stpmic1: simplify stpmic1_sysreset_requestPatrick Delaunay1-8/+1
Retrieve parent device from dev->parent instead of calling uclass_get_device_by_driver() Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-27pmu: stpmic1: change specific NVM api to MISCPatrick Delaunay1-42/+56
Use MISC u-class to export the NVM register (starting at 0xF8 offset) and avoid specific API. - SHADOW have offset < 0. - NVM have register > 0 Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-08-19sysreset: move stm32mp sysreset poweroff implementation to sysreset uclassUrja Rannikko1-0/+1
This is a generic implementation. Add CONFIG_SYSRESET_CMD_POWEROFF to signal when we need it. Enable it from the STPMIC1 config and in sandbox. The config flag is transitionary, that is it can be removed after all poweroff implementations use sysreset, and just have CMD_POWEROFF depend on sysreset. Signed-off-by: Urja Rannikko <urjaman@gmail.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com> Tested-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-07-19regulator: bd718x7: support ROHM BD71837 and BD71847 PMICsMatti Vaittinen1-5/+27
BD71837 and BD71847 is PMIC intended for powering single-core, dual-core, and quad-core SoC’s such as NXP-i.MX 8M. BD71847 is used for example on NXP imx8mm EVK. Add regulator driver for ROHM BD71837 and BD71847 PMICs. BD71837 contains 8 bucks and 7 LDOS. BD71847 is reduced version containing 6 bucks and 6 LDOs. Voltages for DVS bucks (1-4 on BD71837, 1 and 2 on BD71847) can be adjusted when regulators are enabled. For other bucks and LDOs we may have over- or undershooting if voltage is adjusted when regulator is enabled. Thus this is prevented by default. BD718x7 has a quirk which may leave power output disabled after reset if enable/disable state was controlled by SW. Thus the SW control is only allowed for BD71837 bucks 3 and 4 by default. The impact of this limitation must be evaluated board-by board and restrictions may need to be modified. (Linux driver get's these limitations from DT and we may want to implement same on u-Boot driver). Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-07-14Merge tag 'u-boot-stm32-20190712' of ↵Tom Rini1-3/+8
https://gitlab.denx.de/u-boot/custodians/u-boot-stm - syscon: add support for power off - stm32mp1: add op-tee config - stm32mp1: add specific commands: stboard and stm32key - add stm32 mailbox driver - solve many stm32 warnings when building with W=1 - update stm32 gpio driver
2019-07-13power: pmic: Kconfig: Add SPL_PMIC configs for palmas/lp873x/lp87565Keerthy1-0/+21
Add SPL_PMIC configs for palmas/lp873x/lp87565. These were missing and the Makefile already assumes them to be defined. Add the corresponding SPL config options. This enables the pmics in SPL. Signed-off-by: Keerthy <j-keerthy@ti.com>
2019-07-12pmic: stpmic1: add support for SYSRESET_POWER_OFFPatrick Delaunay1-3/+8
Adds support for SYSRESET_POWER_OFF = PMIC power off used by command power off and introduced by commit 751fed426f87 ("sysreset: Add a way to find the last reset"). The driver use SYSRESET_POWER for the PMIC-level power cycle, with restart. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-06-11regulator: bd71837: copy the bd71837 pmic driver from NXP imx u-bootMatti Vaittinen3-0/+97
https://source.codeaurora.org/external/imx/uboot-imx cherry picked, styled and merged commits: - MLK-18387 pmic: Add pmic driver for BD71837: e9a3bec2e95a - MLK-18590 pmic: bd71837: Change to use new fdt API: acdc5c297a96 Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2019-04-12stpmic1: add NVM update support in fuse commandPatrick Delaunay1-0/+114
Add functions to read/update the non volatile memory of STPMIC1 (8 bytes-register at 0xF8 address) and allow access with fuse command (bank=1, word > 0xF8). For example: STM32MP> fuse read 1 0xf8 8 Reading bank 1: Word 0x000000f8: 000000ee 00000092 000000c0 00000002 Word 0x000000fc: 000000f2 00000080 00000002 00000033 Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-04-12pmic: stpmu1: add power switch off supportPatrick Delaunay1-0/+46
Add sysreset support, and support power switch off request, needed by poweroff command. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2019-04-12power: rename stpmu1 to official name stpmic1Patrick Delaunay3-35/+35
Alignment with kernel driver name & binding introduced by https://patchwork.kernel.org/cover/10761943/ to use the final marketing name = STPMIC1. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2019-04-12power: stpmu1: rename files to stpmic1Patrick Delaunay2-2/+2
Prepare file modification for kernel alignment and rename driver to stpmic1. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2018-12-10Merge tag 'for-master-20181210' of git://git.denx.de/u-boot-rockchipTom Rini3-0/+97
Improvements: - init DRAM for RK322x in SPL - add FAN53555 PMIC/regulator driver - update MicroCrystal RV3029 driver to Kconfig and sync from Linux - add bootcount uclass and first DM-driver for bootcount
2018-12-10power: add FAN53555 family supportPhilipp Tomsich3-0/+97
This adds a driver for the FAN53555 family of regulators and wraps it in a PMIC implementation. While these devices support a 'normal' and 'suspend' mode (controlled via an external pin) to switch between two programmable voltages, this incarnation of the driver assumes that the device is always operating in 'normal' mode. Only setting/reading the programmed voltage is supported at this time and the following device functionality remains unsupported: - switching the selected voltage (via a GPIO) - disabling the voltage output via software-control This matches the functionality of the Linux driver. Tested on a RK3399-Q7 (with 'option 5' devices): setting voltages from the U-Boot shell and verifying output voltages on the board. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Tested-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2018-12-10power: make most tps drivers and the twl4030 driver compatible with DM_I2CJean-Jacques Hiblot4-10/+200
Those driver are not DM drivers per se (not using the PMIC/regulator framework) and are using the legacy I2C API. Make them compatible with the DM_I2C API. This impacts the following drivers: - palmas (used by am57xx/dra7xx evms) - tps65218 (used by am43xx evms) - tps65217 and tps65910 (used by am335x evms and am335x boneblack vboot) - twl4030 (used by omap3_logicpd) - tps65217 (used by brppt1) - twl6030 Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Heiko Schocher <hs@denx.de>
2018-11-29dm: sandbox: i2c: Use new emulator parent uclassSimon Glass1-1/+1
Update the device tree, sandbox i2c driver and tests to use the new emulation parent to hold emulators. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-11-29power: pmic: Correct debug/error outputSimon Glass18-55/+56
There is a newline missing from quite a few printf() strings in these pmic files. Fix them. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Lukasz Majewski <lukma@denx.de>
2018-07-30Kconfig: Remove trailing whitespaces in promptMichal Simek1-1/+1
Remove additional trailing whitespaces in prompt reported by kconfiglib: warning: DM_PMIC_SANDBOX (defined at drivers/power/pmic/Kconfig:133) has leading or trailing whitespace in its prompt warning: <choice> (defined at dts/Kconfig:204) has leading or trailing whitespace in its prompt Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Felix Brack <fb@ltec.ch>
2018-06-27power: pmic: Let PFUZE3000 see all 256 registersTrent Piepho2-2/+3
The PFUZE3000 uses registers addresses up to 0xff. The DM pfuze100 driver supports both pfuze100 and pfuze3000. Allow it to use the device type to return the correct number of registers. Also rename the too generic PMIC_NUM_OF_REGS enumeration value for pfuze3000 to match the other "PFUZE3000_" prefixed enumerations and the pfuze100 enumeration value PFUZE100_NUM_OF_REGS. Cc: Peng Fan <Peng.Fan@freescale.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Trent Piepho <tpiepho@impinj.com> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
2018-05-18sandbox: Rewrite i2c_pmic_emul.c to support PMIC with 3 bytes transmissionLukasz Majewski1-14/+31
This change enables support for MC34708 PMIC in sandbox. Now we can emulate the I2C transfers larger than 1 byte. Notable changes for this driver: - From now on the register number is not equal to index in the buffer, which emulates the PMIC registers - The PMIC register's pool is now dynamically allocated up till 64 regs * 3 bytes each = 192 B Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-18pmic: dm: Add support for MC34708 for PMIC DMLukasz Majewski3-0/+113
This patch adds support for MC34708 PMIC, to be used with driver model (DM). Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-18pmic: dm: Rewrite pmic_reg_{read|write|clrsetbits} to support 3 bytes ↵Lukasz Majewski1-12/+30
transmissions This commit provides support for transmissions larger than 1 byte for PMIC devices used with DM (e.g. MC34708 from NXP). Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-18pmic: Add support for setting transmission length in uclass private dataLukasz Majewski1-0/+10
The struct uc_pmic_priv's trans_len field stores the number of types to be transmitted per PMIC transfer. Signed-off-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-05-08Merge git://git.denx.de/u-boot-mmcTom Rini2-304/+0
2018-05-08power: pmic: stpmu1: Add regulator bindingsPatrice Chotard1-0/+34
Add regulator bindings to get access to regulator managed by drivers/power/regulator/stpmu1.c regulator driver. Signed-off-by: Christophe Kerello <christophe.kerello@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2018-05-08power: pmic_max77686: remove the old pmic_max77686 fileJaehoon Chung2-304/+0
max77686 pmic is supporting with max77686.c under pmic/ and regulator/ direnctroy. Remove pmic_max77686.c what didn't use anywhere. Instead, enable CONFIG_DM_REGULATOR_MAX77686 and CONFIG_DM_PMIC_MAX77686. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
2018-05-07SPDX: Convert all of our multiple license tags to Linux Kernel styleTom Rini1-2/+1
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have multiple licenses (in these cases, dual license) declared in the SPDX-License-Identifier tag. In this case we change from listing "LICENSE-A LICENSE-B" or "LICENSE-A or LICENSE-B" or "(LICENSE-A OR LICENSE-B)" to "LICENSE-A OR LICENSE-B" as per the Linux Kernel style document. Note that parenthesis are allowed so when they were used before we continue to use them. Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Tom Rini <trini@konsulko.com>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini35-71/+35
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-27Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTRTom Rini17-34/+0
We have a large number of places where while we historically referenced gd in the code we no longer do, as well as cases where the code added that line "just in case" during development and never dropped it. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-03-19pmic: add stpmu1 supportPatrick Delaunay3-0/+71
This driver implements register read/write operations for STPMU1. The STPMU1 PMIC provides 4 BUCKs, 6 LDOs, 1 VREF and 2 power switches. It is accessed via an I2C interface. This device is used with STM32MP1 SoCs. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-03-05libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>Masahiro Yamada2-2/+2
Thomas reported U-Boot failed to build host tools if libfdt-devel package is installed because tools include libfdt headers from /usr/include/ instead of using internal ones. This commit moves the header code: include/libfdt.h -> include/linux/libfdt.h include/libfdt_env.h -> include/linux/libfdt_env.h and replaces include directives: #include <libfdt.h> -> #include <linux/libfdt.h> #include <libfdt_env.h> -> #include <linux/libfdt_env.h> Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2018-02-04power: pmic/regulator allow dm be omitted by SPLPeng Fan1-1/+1
Allow the dm driver be omitted by SPL. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Jaehoon Chung <jh80.chung@samsung.com> Cc: Stefano Babic <sbabic@denx.de> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2018-01-24power: pmic: s2mps11: probe the regulator driverJaehoon Chung1-0/+28
Add the probe function to support the s2mps11 regulator driver. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Anand Moon <linux.amoon@gmail.com>
2018-01-01power: tps65910: replace error() by pr_err()Felix Brack1-2/+2
The patch replaces the former error() by the new pr_err(). This makes the TPS65910 driver conform to Masahiro's patch 'treewide:replace with error() with pr_err()' introduced October 2017. Signed-off-by: Felix Brack <fb@ltec.ch> Reviewed-by: Simon Glass <sjg@chromium.org>