4. Autonomous Charging
●
This is a new feature supported by PM8058.
●
With autonomous charging, the PMIC is able to control
charging without software intervention.
●
The autonomous charging algorithm is implemented in a
state machine; once it begins, it executes a sequence of
predetermined states until charging is completed.
5.
6. Select Appropriate Power Source for VDD
●
Battery Power
– A charger is not present.
– or an invalid charger is present. (VCHG is below 3.3V or above 7V)
– or valid charger is present but it is an intelligent USB device and
the battery is not severely depleted.
●
External Charger Power
– A regular charger (not an intelligent USB device) is present and
valid.
– or an intelligent USB charger is present and valid, but battery is
severely depleted and the LOW_CURR_BOOT register bit is set
to 1. (meaning that the PMIC can perform a low current boot)
●
Auto-trickle Charging
– An intelligent USB charging device is present.
– and the battery is severely depleted.
– and the LOW_CURR_BOOT register bit is set to 0.
8. Register Battery Client to Modem
BATTERY_VOLTAGE_UP
BATTERY_VOLTAGE_DOWN
BATTERY_VOLTAGE_ABOVE_THIS_LEVEL
BATTERY_VOLTAGE_BELOW_THIS_LEVEL
BATTERY_VOLTAGE_LEVEL
BATTERY_ALL_ACTIVITY
VBATT_CHG_EVENTS
BATTERY_VOLTAGE_UNKNOWN
Get Battery and Charger status
11. Charging LED Behavior
●
Framework has its charging LED behavior.
●
Charger Presence
– Battery Capacity < 10%: Red Solid LED
– 90% > Battery Capacity > 10 %: Red + Green Solid
LED
– Battery Capacity > 90%: Green Solid LED
●
No Charger Presence
– Battery Capacity < 10%: Red Blink LED
13. Charging Notification Delay
●
QA expectation: DUT should show charging notification , charging LED,
charging icon or charging splash images, immediately when insert
AC/USB cable into DUT.
●
Root Cause:
- Different HW Design
- Before FB0: An external charging IC is adopted.
- Charging LED can be lit up immediately once the USB/AC
cable insert into DUT.
- FB0: Use PM8058 autonomous charging.
- Different SW Architecture
- Before FB0: Host can control charging IC directly.
- RPC calls are not necessary.
- UEvent can be sent as early as possible once the charging
configuration is finished.
- FB0: Host have to notify Modem to turn on charging by RPC calls.
14. Charging Notification Delay(cont.)
• Possible Solutions
– Charging LED Improvement:
1. Modify HW layout to let charging LED be lit up by
HW first.
2. Light up charging LED by Modem tasks first.
3. Light up charging LED once the USB/AC cable
insertion event has been received by USB driver.
– Charging Icon Improvement:
• Trigger UEvent once the USB/AC cable insertion
event has been received by USB driver.
15. Removed Battery Intentionally
●
DUT will not shutdown when removing battery with AC/USB
cable plugged
●
Root Cause:
– Modem should notify Host immediately when battery is
removed.
●
Solutions:
– in OS Mode
●
Modem notify Host by RPC callback.
– in Power-Off Charging Mode
●
Modem have to provide a shared memory command
for Host to check battery status in LK.
16. Modem BATT/CHG Events
●
As mentioned in Page 9, Modem will send BATT/CHG event
once battery voltage changes or charger status changes if our
battery registers a battery client to Modem.
– The battery event is sent when battery voltage has a
100mV variation.
●
This event is very difficult to observe.
●
FB0 has gauge IC.
●
The battery status updates by polling in current battery
driver.
– The charger event is sent when the charger is inserted or
removed.
– And so on……
17. Unconfigured Current (USBIF)
●
USB device cannot draw 500mA current before it is
configured.
●
Unconfigured current is 100mA
●
Solution: Set charging current to 100mA when USB device
is in SET_ADDRESS_STATE.