summaryrefslogtreecommitdiffstats
path: root/include/power
Commit message (Collapse)AuthorAgeFilesLines
* pmic: pfuze100 fix typoPeng Fan2015-05-191-1/+1
| | | | | | Change PUZE_100_SW1ABCONF to PFUZE100_SW1ABCONF Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
* test: dm: add sandbox PMIC framework testsPrzemyslaw Marczak2015-05-141-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds new file to sandbox driver model test environment. The file is: test/dm/power.c, and it includes tests for PMIC framework, which includes PMIC uclass and REGULATOR uclass. All tests are based od Sandbox PMIC emulated device. Some test constants for this device are defined in the header: include/power/sandbox_pmic.h PMIC tests includes: - pmic get - tests, that pmic_get() returns the requested device - pmic I/O - tests I/O by writing and reading some values to PMIC's registers and then compares, that the write/read values are equal. The regulator tests includes: - Regulator get by devname/platname - Voltage set/get - Current set/get - Enable set/get - Mode set/get - Autoset - List autoset For the regulator 'get' test, the returned device pointers are compared, and their names are also compared to the requested one. Every other test, first sets the given attribute and next try to get it. The test pass, when the set/get values are equal. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Acked-by: Simon Glass <sjg@chromium.org> Tested on sandbox: Tested-by: Simon Glass <sjg@chromium.org>
* sandbox: add: sandbox PMIC device drivers: I2C emul, pmic, regulatorPrzemyslaw Marczak2015-05-141-0/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds emulation of sandbox PMIC device, which includes: - PMIC I2C emulation driver - PMIC I/O driver (UCLASS_PMIC) - PMIC regulator driver (UCLASS_REGULATOR) The sandbox PMIC has 12 significant registers and 4 as padding to 16 bytes, which allows using 'i2c md' command with the default count (16). The sandbox PMIC provides regulators: - 2x BUCK - 2x LDO Each, with adjustable output: - Enable state - Voltage - Current limit (LDO1/BUCK1 only) - Operation mode (different for BUCK and LDO) Each attribute has it's own register, beside the enable state, which depends on operation mode. The header file: sandbox_pmic.h includes PMIC's default register values, which are set on i2c pmic emul driver's probe() method. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Acked-by: Simon Glass <sjg@chromium.org> Tested on sandbox: Tested-by: Simon Glass <sjg@chromium.org>
* dm: regulator: uclass driver code cleanupPrzemyslaw Marczak2015-05-141-57/+59
| | | | | | | | | | | | | | | | | | | This cleanup includes: - remove of the preprocessor macros which pointed to long name functions - update of the names of some regulator uclass driver functions - cleanup of the function regulator_autoset() - reword of some comments of regulator uclass header file - regulator_get_by_platname: check error for uclass_find_* function calls - add function: regulator_name_is_unique - regulator post_bind(): check regulator name uniqueness - fix mistakes in: regulator/Kconfig - regulator.h: update comments - odroid u3: cleanup the regulator calls Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Acked-by: Simon Glass <sjg@chromium.org> Tested on sandbox: Tested-by: Simon Glass <sjg@chromium.org>
* dm: pmic: code cleanup of PMIC uclass driverPrzemyslaw Marczak2015-05-141-19/+20
| | | | | | | | | | | | | | | | | The cleanup includes: - pmic.h - fix mistakes in a few comments - pmic operations: value 'reg_count' - redefine as function call - fix function name: pmic_bind_childs() -> pmic_bind_children() - pmic_bind_children: change the 'while' loop with the 'for' - add implementation of pmic_reg_count() method - pmic_bind_children() - update function call name - Kconfig: add new line at the end of file - Update MAX77686 driver code Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Acked-by: Simon Glass <sjg@chromium.org> Tested on sandbox: Tested-by: Simon Glass <sjg@chromium.org>
* dm: regulator: add max77686 regulator driverPrzemyslaw Marczak2015-05-142-23/+38
| | | | | | | | | | | | | | This commit adds support to MAX77686 regulator driver, based on a driver model regulator's API. It implements almost all regulator operations, beside those for setting and geting the Current value. For proper bind and operation it requires the MAX77686 PMIC driver. New file: drivers/power/regulator/max77686.c New config: CONFIG_DM_REGULATOR_MAX77686 Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: pmic: add max77686 pmic driverPrzemyslaw Marczak2015-05-141-2/+8
| | | | | | | | | | | | | | | This is the implementation of driver model PMIC driver. The max77686 PMIC driver implements read/write operations and driver bind method - to bind its childs. This driver will try to bind the regulator devices by using it's child info array with regulator prefixes and driver names. This should succeed when compatible regulator driver is compiled. If no regulator driver found, then the pmic can still provide read/write operations, and can be used with PMIC function calls. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: regulator: add implementation of driver model regulator uclassPrzemyslaw Marczak2015-05-141-0/+384
| | | | | | | | | | | | | | | | | | This commit introduces the implementation of dm regulator API. Device tree support allows for auto binding. And by the basic uclass operations, it allows to driving the devices in a common way. For detailed informations, please look into the header file. Core files: - drivers/power/regulator-uclass.c - provides regulator common functions api - include/power/regulator.h - define all structures required by the regulator Changes: - new uclass-id: UCLASS_REGULATOR - new config: CONFIG_DM_REGULATOR Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Acked-by: Simon Glass <sjg@chromium.org>
* dm: pmic: add implementation of driver model pmic uclassPrzemyslaw Marczak2015-05-141-0/+189
| | | | | | | | | | | | | | | | | | | | | | | | This commit introduces the PMIC uclass implementation. It allows providing the basic I/O interface for PMIC devices. For the multi-function PMIC devices, this can be used as I/O parent device, for each IC's interface. Then, each PMIC particular function can be provided by the child device's operations, and the child devices will use its parent for read/write by the common API. Core files: - 'include/power/pmic.h' - 'drivers/power/pmic/pmic-uclass.c' The old pmic framework is still kept and is independent. For more detailed informations, please look into the header file. Changes: - new uclass-id: UCLASS_PMIC - new config: CONFIG_DM_PMIC Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Acked-by: Simon Glass <sjg@chromium.org>
* power: Export register access functions from as3722Simon Glass2015-05-131-0/+3
| | | | | | | | With the full PMIC framework we may be able to avoid this. But for now we need access to the PMIC. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
* power: pfuze100: fix LDO_EN bit valueTim Harvey2015-04-221-1/+1
| | | | | | | | The LDO_EN is bit 4, not value 4. This is only used on the Ventana boards so we will change it in the header as the other values there are in terms of values and not bit numbers. Signed-off-by: Tim Harvey <tharvey@gateworks.com>
* board/BuR/common: Take usage of am335x LCD-DisplayHannes Petermaier2015-03-051-0/+1
| | | | | | | a summary screen to the lcd. Values are taken from environment and or devicetree blob. Signed-off-by: Hannes Petermaier <oe5hpm@oevsv.at>
* pmic: fix missing SWITCH_SIZEStefano Babic2015-02-111-0/+2
| | | | | | | Applying ccbb18713b279f1326479cc10664d247206e9e76, the define disappeared. Fix it. Signed-off-by: Stefano Babic <sbabic@denx.de>
* pmic:pfuz100 add switch mode and more registersPeng Fan2015-02-101-0/+53
| | | | | | | Add more pfuze register offset. And switch mode definition. Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
* pmic:pfuze add macro for setting voltagePeng Fan2015-02-101-0/+2
| | | | | | | "#define PFUZE100_SW1ABC_SETP(x) ((x - 3000) / 250)" This macro is for configuring SW1A/B/C Output Voltage easily. Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
* pmic: add tps62362 simple wrapper codeFelipe Balbi2015-01-131-0/+29
| | | | | | | | This regulator is used with AM437x IDK to feed VDD_MPU, without means to scale VDD_MPU we can't support higher frequencies. Signed-off-by: Felipe Balbi <balbi@ti.com>
* power: tps65218: define all valid VDD_MPU voltagesFelipe Balbi2015-01-131-0/+3
| | | | | | | | DCDC1 is used as VDD_MPU in all known boards, let's define all other valid voltages for that rail so it can be used by our boards. Signed-off-by: Felipe Balbi <balbi@ti.com>
* power: Add AMS AS3722 PMIC supportThierry Reding2014-12-181-0/+27
| | | | | | | | | The AS3722 provides a number of DC/DC converters and LDOs as well as 8 GPIOs. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
* Merge branch 'master' of http://git.denx.de/u-boot-samsungTom Rini2014-11-261-0/+3
|\
| * arm: odroid: pmic77686: allow buck voltage settingsSuriyan Ramasami2014-11-171-0/+3
| | | | | | | | | | | | | | | | Allow to set the buck voltage for the max77686. This will be used to reset the SMC LAN9730 ethernet on the odroids. Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* | power: pfuze100: Update definitions for buck regulatorsYe.Li2014-11-201-0/+80
|/ | | | | | | | Add definitions for buck regulators (SW1A/B/C) registers and voltage values. Signed-off-by: Ye.Li <B37916@freescale.com> Reviewed-by: Przemyslaw Marczak <p.marczak@samsung.com>
* tps65218/am43xx_evm: Add power framework support to TPS65218Tom Rini2014-07-251-0/+1
| | | | | | | | Add in an init function for the drivers/power framework so we can dump and read the registers via i2c. Cc: Łukasz Majewski <l.majewski@samsung.com> Signed-off-by: Tom Rini <trini@ti.com>
* power/pmic.h: Add prototype for power_init_board.Tom Rini2014-07-251-0/+1
| | | | | | | | As this is a weak function that we may override, provide a prototype for it. Cc: Łukasz Majewski <l.majewski@samsung.com> Signed-off-by: Tom Rini <trini@ti.com>
* Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'Albert ARIBAUD2014-06-301-0/+4
|\
| * mx6sabred: Add PFUZE100 PMIC supportFabio Estevam2014-05-281-0/+4
| | | | | | | | | | | | | | | | mx6sabresd boards have a PFUZE100 PMIC connected to I2C2 bus. Add support for it Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
* | power: Add support for the TPS65218 PMICTom Rini2014-06-061-0/+63
| | | | | | | | | | | | | | Add a driver for the TPS65218 PMIC which is used by TI AM43xx SoCs and may be used by TI AM335x SoCs. Signed-off-by: Tom Rini <trini@ti.com>
* | Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'Albert ARIBAUD2014-06-024-3/+78
|\ \ | |/ |/|
| * power: Add support for TPS65090 PMU chip.Tom Wai-Hong Tam2014-05-281-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds driver support for the TPS65090 PMU. Support includes hooking into the pmic infrastructure so that the pmic commands can be used on the console. The TPS65090 supports the following functionality: - fet enable/disable/querying - getting and setting of charge state Even though it is connected to the pmic infrastructure it does not hook into the pmic charging charging infrastructure. The device tree binding is from Linux, but only a small subset of functionality is supported. Signed-off-by: Tom Wai-Hong Tam <waihong@chromium.org> Signed-off-by: Hatim Ali <hatim.rv@samsung.com> Signed-off-by: Katie Roberts-Hoffman <katierh@chromium.org> Signed-off-by: Rong Chang <rongchang@chromium.org> Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Signed-off-by: Aaron Durbin <adurbin@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * power: Add PMIC_ prefix to CHARGER_EN/DISABLESimon Glass2014-05-283-3/+5
| | | | | | | | | | | | | | | | This enum should be common across all PMICs rather than having it independently defined with the same name in multiple places. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* | power: Add support for LTC3676 PMICTim Harvey2014-05-091-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | The LTC3676 PMIC includes four DC/DC converters, and three 300mA LDO Regulators (two Adjustable). The DC/DC converters are adjustable based on a resistor devider (board-specific). This adds support for the LTC3676 by creating a namespace unique init function that uses the PMIC API to allocate a pmic and defines the registers. Signed-off-by: Tim Harvey <tharvey@gateworks.com> Acked-by: Stefano Babic <sbabic@denx.de>
* | power: make pfuze100 be able to coexist with other pmicsTim Harvey2014-05-091-0/+1
|/ | | | | | | Avoid uding pmic_init() as this forces the model of only allowing a single PMIC driver to be built at a time. Signed-off-by: Tim Harvey <tharvey@gateworks.com>
* Merge branch 'master' of git://git.denx.de/u-boot-armStefano Babic2014-03-052-1/+2
|\
| * trats2: add LCD download menu supportPrzemyslaw Marczak2014-02-031-1/+0
| | | | | | | | | | Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * trats2: Code cleanup.Przemyslaw Marczak2014-02-031-0/+2
| | | | | | | | | | | | | | | | | | | | Remove wrong and unused env variables Trats2 is not as GT-I8800. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Acked-by: Jaehoon Chung <jh80.chung@samsung.com> Cc: Piotr Wilczek <p.wilczek@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* | power: add PFUZE100 PMIC driverTim Harvey2014-03-051-0/+96
|/ | | | | Signed-off-by: Tim Harvey <tharvey@gateworks.com> Acked-by: Stefano Babic <sbabic@denx.de>
* pmic: max77686: fix the wrong offsetJaehoon Chung2013-10-141-1/+1
| | | | | | 0x1D is reserved. So BUCK3DVS1 is started from 0x1e. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
* Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'Albert ARIBAUD2013-10-113-0/+166
|\
| * drivers:power:max77693: add support for new multi function pmic max77693Piotr Wilczek2013-09-253-0/+166
| | | | | | | | | | | | | | | | | | This patch add support for new multi function pmic max77693. The driver is split into three modules: pmic, muic and fuelgage. Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* | am335x:Handle worst case scenario for Errata 1.0.24Steve Kipisz2013-09-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | In Errata 1.0.24, if the board is running at OPP50 and has a warm reset, the boot ROM sets the frequencies for OPP100. This patch attempts to drop the frequencies back to OPP50 as soon as possible in the SPL. Then later the voltages and frequencies up set higher. Cc: Enric Balletbo i Serra <eballetbo@iseebcn.com> Cc: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Steve Kipisz <s-kipisz2@ti.com> [trini: Adapt to current framework] Signed-off-by: Tom Rini <trini@ti.com>
* | drivers/power/pmic: Add tps65910 driverPhilip, Avinash2013-09-201-0/+77
| | | | | | | | | | | | | | | | | | | | Add a driver for the TPS65910 PMIC that is found in the AM335x GP EVM, AM335x EVM SK and others. Signed-off-by: Philip, Avinash <avinashphilip@ti.com> [trini: Split and rework Avinash's changes into new drivers/power framework] Signed-off-by: Tom Rini <trini@ti.com>
* | drivers/power/pmic: Add tps65217 driverGreg Guyotte2013-09-201-0/+82
|/ | | | | | | | | | Add a driver for the TPS65217 PMIC that is found in the Beaglebone family of boards. Signed-off-by: Greg Guyotte <gguyotte@ti.com> [trini: Split and rework Greg's changes into new drivers/power framework] Signed-off-by: Tom Rini <trini@ti.com>
* drivers:power:max77686: add function to set voltage and modePiotr Wilczek2013-08-301-0/+26
| | | | | | | | | | This patch add new functions to pmic max77686 to set voltage and mode. Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Rajeshwari Shinde <rajeshwari.s@samsung.com> Acked-by: Tom Rini <trini@ti.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-249-153/+9
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* exynos: Adjust the starting MIF voltage to 1.05vBernie Thompson2013-06-241-0/+2
| | | | | | | | | | | | Some Exynos5250 silicon may require 1.05v on the MIF to be stable, so to be safe we can default to 1.05v instead of 1.00v. This can be set optimally later in the boot process by the kernel. The 0x6 value for 1.05v comes from the MAX77686 datasheet. Signed-off-by: Bernie Thompson <bhthompson@chromium.org> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* SMDK5250: Add PMIC voltage settingsRajeshwari Shinde2013-02-201-0/+32
| | | | | | | | This patch adds required pmic voltage settings for SMDK5250. Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* POWER: MAX77686: Modified as per the latest ImplementationRajeshwari Shinde2012-12-111-0/+158
| | | | | | | | | | Moved the pmic_max77686.c max77686_pmic.h to drivers/power and made required changes accordingly Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* Merge branch 'master' of git://git.denx.de/u-boot into resolveMinkyu Kang2012-12-101-0/+2
| | | | | | | | | | | Conflicts: README board/samsung/universal_c210/universal.c drivers/misc/Makefile drivers/power/power_fsl.c include/configs/mx35pdk.h include/configs/mx53loco.h include/configs/seaboard.h
* arm:trats:pmic: Default PMIC(MAX8997) initialization for Samsung's TRATS boardŁukasz Majewski2012-11-141-0/+9
| | | | | | | | Default PMIC (MAX8997) initialization for Samsung's TRATS development board. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: Minkyu Kang <mk7.kang@samsung.com>
* pmic:max8997: Function for calculating LDO internal register valueŁukasz Majewski2012-11-141-0/+2
| | | | | | | | | Function for calculating LDO internal register value from passed micro Volt. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: Stefano Babic <sbabic@denx.de>
* pmic:fuel-gauge: Support for MAX17042 fuel-gaugeŁukasz Majewski2012-11-142-0/+164
| | | | | | | | | | | | | Support for MAX17042 fuel-gauge (FG), which is built into the MAX8997 power management device. Special file - fg_battery_cell_params.h with cells characteristics added. The FG device will work with redesigned PMIC framework. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: Stefano Babic <sbabic@denx.de>
OpenPOWER on IntegriCloud