The property indicates this regulator should skip init setting
sequence, usually for saving boot time.
Change-Id: I40a81c84b0696c70b16ddba50aeb457412287116
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
The on/off_source value has been changed,
so we can't get the correct on/off source.
Change-Id: I7c522574f5e8d3bbc3c5d73980cdccdb4717da52
Signed-off-by: Shengfei Xu <xsf@rock-chips.com>
If a fuel gauge device doesn't have both charger and fuel gauge
capabilities, try to find devices group to support that.
Change-Id: I78d929e80e79bea304bb2b29f423c90ca12be16f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Return "FG_CAP_FUEL_GAUGE | FG_CAP_CHARGER" as default value
when there's not implementation, which compatibles with all fg drivers.
Change-Id: Ie71e1271e504c63be42af41551e10e8c2c7d89ac
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
cmd depends on DM_CHARGE_DISPLAY and default y.
Change-Id: I5e685e0020c4aa1da80ffc27e5a576bc8969c3be
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
The under-voltage protection will shutdown the LDO3 and reset the PMIC.
Change-Id: Ic84c7ad1a2eed8c1f983e761988ffb903fc878af
Signed-off-by: Shengfei Xu <xsf@rock-chips.com>
It supports charging and charging-full leds which
depends on soc value.
Change-Id: I6b37919c5bedf9b81d388853996cf83c6f75a73a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Under the charging interface,if the rtc alarm is
triggered, boot on the system.
Change-Id: I6a921bd5c6971c45b02b2be84d9d6d79e9b17a36
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
support rtc alarm interrupt and alarm trigger power up.
Change-Id: I7752f173d524f579b57b862d2788296ab1486c14
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
rk817/rk809 must restore the PMIC_POWER_EN OTP value before the system reboot.
Change-Id: Ia62cb8f5b0dc9fef8a32a3af5f087c55a9888d78
Signed-off-by: Shengfei Xu <xsf@rock-chips.com>
RK8xx switch does not need to set the voltage,
but if dts set regulator-min-microvolt/regulator-max-microvolt,
will cause regulator set value fail and not to enable this switch.
So add an empty function to return success.
Change-Id: Ifc3cfe24902123d7434f3f6560a8e530c03d0b2a
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
regulator would print value when set init voltage.
Change-Id: I8bc9df40d452ae89cced7145e8760e29d7339ac8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
1. when first power but not charge in uboot, fuel gauge is initilized
but miss saving data for kernel fuel gauge;
2. wait 75us after coulomb init, otherwise read back 0mAh;
3. always read remain capacity and print it for debug;
Change-Id: Iba30ef4e96942fcfbf61dacabf8199dc896bab64
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Because wtemp dvfs driver reads all cpu/dmc info from kernel dtb.
Change-Id: Ifd85ed976bd880cf710c58e07351ef038f3a125c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
A “battery fuel gauge” is integrated in the RK809. Using
the proprietary algorithms and the sensed battery current
and voltage, the gauge can accurately calculate the battery
capacity based on the charging/discharging characteristics
of the battery preloaded in the system. The gauge then sends
the battery capacity information to the processor through
the I2C interface.
Change-Id: I4d1d0cce8d76f4ec39dfcd00c495c64257fd4b7b
Signed-off-by: Shengfei Xu <xsf@rock-chips.com>
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>
Change-Id: I6c0f7e50e8b571106627f25ddac008a62bd2994e
Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
The io-domains on Rockchip SoCs will be supplied with 1.8V or 3.3V(3.0V)
depends on hardware design. The driver needs to config them through grf
register.
Change-Id: Ic896b94bfadd0b808da54992e58e2cf4a8fee950
Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
dm regulator uclass would verbose this message.
Change-Id: I76c73bdcf6354d7d892f75ad022be416d3ab0c09
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
this is more flexsible to match regulator type.
Change-Id: I5589b5d1d32d8ac1c6d09d64e680eddd31f2ba90
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
init regulator-state-mem wastes time a lot and is only needed when
system suspend is called, so provide regulators_enable_state_mem()
the driver that implements system suspend.
Change-Id: I2499df7caa9224879eed057d9269e8dcdce11c51
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
If CONFIG_IRQ is not enabled, cpu can't suspend to ATF or wfi,
so that the wakeup period timer is useless.
Give a message warning when CONFIG_IRQ is not enabled.
Change-Id: I9af7e7114ab5d3b3d1026a3ba19ce6cbe56399eb
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
at some time, we need virtual power mode supported by fuel gauge to
set a static adapter input current, which don't reall want charge
animation images show.
Change-Id: If256b15eb585990f5c99781f830480b0d0a83cb4
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This is mainly for debugging since voltage info is so important
when system abort at early boot flow of U-Boot or kernel. On
rockchip platforms, it usually prints vdd_arm and vdd_logic.
Change-Id: Ibb58cb8865ab6857a51a8f50d8a7633c9132985d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
It tells the reason why PMIC current powers on an last powers off,
this helps a lot for debugging when system suddenly power off or
restart due to unknown power supply cause.
Change-Id: Iec0c38dc1ac5745a9bc473848b5d617059b16faf
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
The four power source types that are detected are:
Standard downstream port (SDP)
– This is a computer USB port capable of 500mA.
Charging downstream port (CDP)
- This is typically a powered USB hub capable of 1500mA.
Dedicated charging port (DCP)
- This is a standard wall charger capable of at least 1500mA.
DCP without shorting D+/D-(FLOATING)
- This is a non-standard wall charger capable of at least 1500mA.
Change-Id: Icb3d3c02d9ef5dfbcabf0232743ad057c578dcf4
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
i2c maybe interrpted by power key interrupt, so we need to
disable local irq when i2c transfer.
Change-Id: Ifd4c1f15ebab25c7fa54e4386c72e5731bc821b4
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Usually, fuel gauge is a i2c device and we had better set a
poll seconds to update it, which can reduce i2c read/write.
Change-Id: I192e8229d3b6b7f8887a38296314e69b9dc30753
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
There is a difference between the display soc and real soc,
so it can not be directly equivalent.
Change-Id: I99dfa1e3952693053ccd853cd5802feb7eebf8b0
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
no special reason to remove, just to keep the same setting
with rkdevelop which is stable.
Change-Id: I3fe810d7080e29525cdf24c4475b0acb5380a9c5
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
1. add this property to compabile legacy pwm regulator driver
on rkdevelop;
2. give default init voltage 1.1v;
Change-Id: I7b1f989c28d91edd6e467ae1ba94299c6d695afb
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
The GAS_GUAGE_Q_INIT was written to the wrong value causing the fuel gauge to fail.
Change-Id: Idbafc110deef6f6ce93dac9a0ad81974d1f112a9
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
1. use 'NA' to indicate not unsed or not exist configure;
2. there is not configure register for ldo, so define it as NA;
Change-Id: Ic87e5c9fe6128c14a47a306a8726c487d5b96664
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
regulator_show() is used as an debug way, so its verbose
message should be detail enough, this helps a lot.
Change-Id: Iabe5fc65e8b6ff27b9c92bc3f0b6948e1013a9c8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
suspend configure result should not influence normal configure
Change-Id: I7107ad5f3303d1f1456ada5949deced5fa8e4ec2
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
this is a initial version porting from rkdevelop
commit: 64f6c0e.
Change-Id: Iadc46282e0782d0cd985cb0ee9d317cb5d94f41e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
There is an error with the fuel gauge, so we need to calibrate it.
Change-Id: I649cacaa97c69fd47bad6f6d02a7569e735b7a80
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
1. adjust error message easy to be understood;
2. show RK808 chip id as "RK808";
3. check PMIC chip id read failed;
Change-Id: Ifc4c25ccc8cac4fdd91bcf6515b1dd6aa1bf71fa
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
There are many boards in kernel do not have a regulator-init-microvolt
in pwm regulator, let's make it available.
Change-Id: Ib8235af4082f3428eb04684617a52bb68a4b2e7a
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
The save dsoc accuracy is not enough to cause the display soc
to be reduced by 1 when system reboot.
Change-Id: I35dbb0d1b2d123f65f7cd6ef74216bc1a6384d34
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
during system suspend in charge animation, we may need add
power manage control for some devices low power. Since U-Boot
don't provide standard suspend/resume callback for device. We
have to add rockchip_pm.c to write hard code to achieve this
for different platforms or boards.
Change-Id: I01f67c7c57cbcaae48d3def65eea8cab499af93b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
1. set pmic_sleep as sleep function;
2. set pmic_int active low.
Change-Id: I4bc4034e18b19dc9b1b328870db652d11173fe3a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This is the most flexsible way for all fuel gauge driver to get
fdt config info from charge animation platdata.
Change-Id: I33aa52c34f2c62c10b58003a10e5a8d1d6e5d7d3
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
1. use ofdata_to_platdata() to parse fdt;
2. clean up code.
Change-Id: I75a6cb721e10fa1f30e59b101b3db0bb19df8001
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
1. compatible fdt node used on legacy U-Boot;
2. clean up code.
Change-Id: If9ad1df379b14d096e3310568bc39d2c5820753b
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
min and max voltage are used to limit run time voltage, suspend
voltage should not limited by them.
Change-Id: I8b3660c51992d8baec6401630e3ec093b01b1260
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
charge animation need display provided by DRM_ROCKCHIP.
Change-Id: I58113e81dd2899c969d1e748548a498eb04db550
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>