summaryrefslogtreecommitdiff
path: root/drivers/power
Commit message (Collapse)AuthorAgeLines
* sunxi: axp221: Add VBUS detection supportChen-Yu Tsai2015-03-10-0/+16
| | | | | | | | | | | Some of the AXP PMICs support VBUS detection, i.e. checking whether VBUS power input is available and usable (supplied by an external source). A few boards use this instead of a separate GPIO to detect VBUS on USB OTG. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Merge branch 'master' of git://git.denx.de/u-boot-sunxiTom Rini2015-02-02-3/+1
|\
| * sunxi: rsb: Move rsb_set_device_mode() call to rsb_init()Hans de Goede2015-02-02-3/+1
| | | | | | | | | | | | | | | | It turns out that the device_mode_data is rsb specific, rather then slave specific, so integrate the rsb_set_device_mode() call into rsb_init(). Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* | dm: i2c: Provide an offset length parameter where neededSimon Glass2015-01-29-1/+1
| | | | | | | | | | | | | | | | | | | | Rather than assuming that the chip offset length is 1, allow it to be provided. This allows chips that don't use the default offset length to be used (at present they are only supported by the command line 'i2c' command which sets the offset length explicitly). Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de>
* | dm: i2c: Rename driver model I2C functions to permit compatibilitySimon Glass2015-01-29-4/+4
|/ | | | | | | | | | | Add a dm_ prefix to driver model I2C functions so that we can keep the old ones around. This is a little unfortunate, but on reflection it is too difficult to change the API. We can undo this rename when most boards and drivers are converted to use driver model for I2C. Signed-off-by: Simon Glass <sjg@chromium.org>
* sunxi: axp221: Add ELDO[1-3] supportSiarhei Siamashka2015-01-22-0/+43
| | | | | | | | | | | | | | | | | | And also add Kconfig option for selecting ELDO3 voltage. The reason for having this option is that the Android kernel sets ELDO3 to 1.2V when powering up LCD in the case if 'lcd_if' configuration variable is set to 6 (LCD_IF_EXT_DSI) in the FEX file. Most likely to supply power for a SSD2828 chip. However on the MSI Primo81 tablet, which is using this particular 'lcd_if = 6' setup for LCD, setting the ELDO3 voltage appears to be unnecessary and it works regardless. Having no schematics of this tablet, I can only guess that 1.2V is supplied to SSD2828 in some other way. Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* sunxi: axp209: Disable interrupts when intializing the axp209Hans de Goede2015-01-22-1/+13
| | | | | | | | | | We do not use the axp209 interrupt, and at least in my mini-x (which does not have a power button) the pwr-button pin and the irq pin are soldered together, so if the axp209 keeps it irq asserted too long it will see a 10s pwr-button press and hard power off the board, disabling the irqs fixes this. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* Merge branch 'master' of git://git.denx.de/u-boot-tiTom Rini2015-01-16-0/+48
|\
| * pmic: add tps62362 simple wrapper codeFelipe Balbi2015-01-13-0/+48
| | | | | | | | | | | | | | | | 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>
* | sunxi: axp221: Add support for controlling the drivebus pinHans de Goede2015-01-14-0/+36
| | | | | | | | | | | | | | | | | | The axp221 / axp223's N_VBUSEN pin can be configured as an output rather then an input, add axp_drivebus_enable() and _disable() functions to set the pin in output mode and control it. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* | sunxi: axp221: Protect axp221_init against multiple callsHans de Goede2015-01-14-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The voltage setting code knows it needs to call axp221_init before calling the various voltage setting functions. But users of axp utility functions like axp221_get_sid() do not know this, so the utility functions always call axp221_init() to ensure that the p2wi / rsb setup magic has been done. Since doing this repeatedly is quite expensive, add a check to axp221_init so that it only does the initialization once. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* | sunxi: axp221: correct ALDO2 description for sun6iChen-Yu Tsai2015-01-14-5/+5
| | | | | | | | | | | | | | | | | | ALDO2 is used to power LPDDR2 SDRAM on both the reference design and the Hummingbird A31, when this type of RAM is present. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* | sunxi: gpio: Add support for gpio pins on the AXP209 pmicHans de Goede2015-01-14-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some boards use GPIO-s on the pmic, one example of this is the A13-OLinuXino board, which uses gpio0 of the axp209 for the lcd-power signal. This commit adds support for gpio pins on the AXP209 pmic, the sunxi_gpio.c changes are universal, adding gpio support for the other AXP pmics (when necessary) should be a matter of adding the necessary axp_gpio_foo functions to their resp. drivers, and add "#define AXP_GPIO" to their header file. Note this commit only adds support for the non device-model version of the gpio code, patches for adding support to the device-model version are very welcome. The string representation for these gpio-s is AXP0-#, the 0 in the AXP0 prefix is there in case we need to support gpio-s on more then 1 pmic in the future. At least A80 boards have 2 pmics, and we may end up needing to support gpio-s on both. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* | sunxi: axp221: Explicitly turn off unused voltagesHans de Goede2015-01-14-14/+104
| | | | | | | | | | | | | | | | | | Explicitly turn off unused voltages, rather then leaving them as is. Likewise explictly enabled the dcdc convertors, rather then assuming they are already enabled at boot. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* | sunxi: axp221: Make dcdc1 voltage configurableHans de Goede2015-01-14-0/+10
| | | | | | | | | | | | | | | | | | | | The dcdc1 voltage is typically used as generic 3.3V IO voltage for things like GPIO-s, sdcard interfaces, etc. On most boards this is undervolted to 3.0V to safe battery, but not on all, make it configurable so that we can use the same settings as the original firmware on all boards. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* | sunxi: axp221: Add Kconfig help and sane defaults for typical ldo usageHans de Goede2015-01-14-6/+14
| | | | | | | | | | | | | | | | | | Some of the ldo-s of the axp221 are used in the same way on most boards, add comments to the Kconfig help text to reflect this, and give them defaults matching their typical usage. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* | sunxi: axp221: Add axp223 supportHans de Goede2015-01-14-25/+71
| | | | | | | | | | | | | | | | | | The axp223 appears to be the same as the axp221, except that it uses the rsb to communicate rather then the p2wi. At least all the registers we use are 100% the same. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* | sun6i: axp221: Add axp221_get_sid functionHans de Goede2015-01-14-0/+27
|/ | | | | | | | For sun6i the SID is stored in the pmic, rather then in the SoC itself, add a function to retreive the sid. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* power: Add AMS AS3722 PMIC supportThierry Reding2014-12-18-0/+265
| | | | | | | | | 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>
* dm: i2c: tegra: Convert to driver modelSimon Glass2014-12-11-20/+7
| | | | | | | | | | | | | | | | | | | | | | This converts all Tegra boards over to use driver model for I2C. The driver is adjusted to use driver model and the following obsolete CONFIGs are removed: - CONFIG_SYS_I2C_INIT_BOARD - CONFIG_I2C_MULTI_BUS - CONFIG_SYS_MAX_I2C_BUS - CONFIG_SYS_I2C_SPEED - CONFIG_SYS_I2C This has been tested on: - trimslice (no I2C) - beaver - Jetson-TK1 It has not been tested on Tegra 114 as I don't have that board. Acked-by: Heiko Schocher <hs@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge branch 'master' of git://git.denx.de/u-boot-tiTom Rini2014-12-08-12/+18
|\
| * twl4030: device-index-specific MMC power initializations, common ramp-up delayPaul Kocialkowski2014-12-04-11/+17
| | | | | | | | | | | | | | | | | | Not every device has multiple MMC slots available, so it makes sense to enable only the required LDOs for the available slots. Generic code in omap_hsmmc will enable both VMMC1 and VMMC2, in doubt. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-by: Tom Rini <trini@ti.com>
| * arm: omap: add support for am57xx devicesFelipe Balbi2014-12-04-1/+1
| | | | | | | | | | | | | | | | just add a few ifdefs around because this device is very similar to dra7xxx. Signed-off-by: Felipe Balbi <balbi@ti.com> Reviewed-by: Tom Rini <trini@ti.com>
* | Replace <compiler.h> with <linux/compiler.h>Masahiro Yamada2014-12-08-1/+1
|/ | | | | | Including <linux/compiler.h> is enough for general use. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* arm: odroid: pmic77686: allow buck voltage settingsSuriyan Ramasami2014-11-17-3/+49
| | | | | | | | 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>
* sun6i: Add basic axp221 driverOliver Schinagl2014-11-13-0/+234
| | | | | | | | | | | | | | | | | | The A31 uses the AXP221 pmic for various voltages. Signed-off-by: Oliver Schinagl <oliver@schinagl.nl> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk> -- Changes in v2: -Rebase Changes in v3: -Add support for all dldo and aldo-s -Add Kconfig option to select building AXP221 and to select voltage of dldo and aldo-s Changes in v4: -Add axp221_setbits helper function -Use symbolic names for enabled bits in CTRL1 - CTRL3 registers
* power_spi.c: Rewrite pmic_reg functionTom Rini2014-11-07-23/+10
| | | | | | | | | | | | | The pmic_spi_free function isn't ever used, and as the frameworks stand today, cannot be, so remove it. Integrate the probe function into pmic_reg as it's not really a "probe" today. Finally, add an err label for the common failure cases. Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Przemyslaw Marczak <p.marczak@samsung.com> Cc: Stefano Babic <sbabic@denx.de> Signed-off-by: Tom Rini <trini@ti.com> Acked-by: Stefano Babic <sbabic@denx.de>
* twl4030: VMMC2 3.2V enable on MMC initPaul Kocialkowski2014-10-31-0/+6
| | | | | | | | | This enables the VMMC2 LDO, which powers the MMC2 device. When the device starts from MMC2, this has already been enabled by the BootROM, but when starting from peripheral boot (USB, UART), it is not the case. Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
* sunxi: axp152: dcdc3 scale is 50mV / step not 25mV / stepHans de Goede2014-10-13-1/+1
| | | | | | | | | | Currently uboot wrongly uses 25mV / step for dcdc3, this is a copy and paste error introduced when adding the axp152_mvolt_to_target during review of the axp152.c driver. This results in u-boot setting Vddr to 2.3V instead of 1.5V. This commit fixes this. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* cros_ec: exynos: Use the correct tps65090 driver in each caseSimon Glass2014-10-08-1/+1
| | | | | | | | | | Exynos 5250 boards (snow, spring) use the I2C driver but Exynos 5420 boards cannot due to a hardware design decision. Select the correct driver to use in each case. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Ajay Kumar <ajaykumar.rs@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* cros_ec: power: Add a tunnelled version of the tps65090 driverSimon Glass2014-10-08-0/+219
| | | | | | | | | | | | | Unfortunately on Pit the AP has no direct access to the tps65090 but must talk through the EC (over SPI) to the EC's I2C bus. When driver model supports PMICs this will be relatively easy. In the meantime the best approach is to duplicate the driver. It will be refactored once driver model support is expanded. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Ajay Kumar <ajaykumar.rs@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* kconfig: add blank Kconfig filesMasahiro Yamada2014-09-24-0/+0
| | | | | | | | This would be useful to start moving various config options. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* pmic: pmic_pfuze100: Use a shorter name for PMIC nameFabio Estevam2014-08-08-1/+1
| | | | | | | | | | | It is redundant to use 'PFUZE100_PMIC' as the PMIC name because we already know it is a PMIC. Call it simply 'PFUZE100' instead. Cc: Tim Harvey <tharvey@gateworks.com> Cc: Markus Niebel <Markus.Niebel@tq-group.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
* Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'Albert ARIBAUD2014-07-28-0/+22
|\
| * tps65218/am43xx_evm: Add power framework support to TPS65218Tom Rini2014-07-25-0/+22
| | | | | | | | | | | | | | | | 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>
* | sunxi: Add axp152 pmic supportHans de Goede2014-07-18-0/+98
| | | | | | | | | | | | | | | | | | | | Add support for the x-powers axp152 pmic which is found on most A10s boards and enable it for the r7-tv-dongle board. Signed-off-by: Henrik Nordstrom <henrik@henriknordstrom.net> Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* | sunxi: Add axp209 pmic supportHenrik Nordstrom2014-07-18-0/+168
|/ | | | | | | | | | | Add support for the x-powers axp209 pmic which is found on most A10, A13 and A20 boards. And enable AXP209 support for the Cubietruck and Cubieboard boards. Signed-off-by: Henrik Nordstrom <henrik@henriknordstrom.net> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
* Merge remote-tracking branch 'u-boot-samsung/master'Albert ARIBAUD2014-07-01-5/+8
|\ | | | | | | | | | | | | | | Conflicts: boards.cfg Conflict was trivial between goni maintainer change and lager_nor removal.
| * PMIC: MAX77686: fix invalid bus checkJeroen Hofstee2014-06-23-5/+8
| | | | | | | | | | | | | | | | | | | | | | Since p->bus is unsigned checking for negative values is optimized away. Since bus is already used as an argument use tmp. While at it, don't declare variables in the middle of a function. cc: Rajeshwari Shinde <rajeshwari.s@samsung.com> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* | pmic: tps65090: correct checking i2c busJeroen Hofstee2014-06-19-1/+1
|/ | | | | | | | | | The function tps65090_init checks the i2c bus of p->bus. However the pointer p is not intialiased at this point. Check the local variable bus instead. cc: Tom Wai-Hong Tam <waihong@chromium.org> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl> Acked-by: Simon Glass <sjg@chromium.org>
* power: Add support for the TPS65218 PMICTom Rini2014-06-06-0/+98
| | | | | | | 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-02-8/+323
|\
| * power: Explicitly select pmic device's busAaron Durbin2014-05-28-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The current pmic i2c code assumes the current i2c bus is the same as the pmic device's bus. There is nothing ensuring that to be true. Therefore, select the proper bus before performing a transaction. Signed-off-by: Aaron Durbin <adurbin@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Heiko Schocher <hs@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * power: Add support for TPS65090 PMU chip.Tom Wai-Hong Tam2014-05-28-0/+311
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-28-5/+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: Rename CONFIG_PMIC_... to CONFIG_POWER_...Simon Glass2014-05-28-3/+3
| | | | | | | | | | | | | | | | | | Commit be3b51aa did this mostly, but several have been added since. Do the job again. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* | Merge remote-tracking branch 'u-boot/master'Albert ARIBAUD2014-05-20-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: boards.cfg Conflicts were trivial once u-boot-arm/master boards.cfg was reformatted (commit 6130c146) to match u-boot/master's own reformatting (commit 1b37fa83).
| * | tps6586x: staticize funtionsManish Badarkhe2014-05-12-2/+2
| |/ | | | | | | | | | | Make funtions static which are locally used in file. Signed-off-by: Manish Badarkhe <badarkhe.manish@gmail.com>
* | power: Add support for LTC3676 PMICTim Harvey2014-05-09-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | 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-09-1/+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>