Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

80p248477linuxandroidpmicchargersoftwareuserguide 1848228326 PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 47
At a glance
Powered by AI
This document provides an overview of charging hardware, the charging cycle process, input current limits, and references related documents.

The purpose of this document is to provide an overview of the Linux Android PMIC charger software.

The document describes the different phases in the charging cycle including charging prequalification, charging phases (fast charge, taper charge, top-off charge), automatic recharging, charger inhibit, battery over-voltage protection, battery missing detection, and charge conditions.

Qualcomm Technologies, Inc.

Linux Android PMIC Charger Software


User Guide
80-P2484-77 B
April 3, 2017

Confidential and Proprietary – Qualcomm Technologies, Inc.

NO PUBLIC DISCLOSURE PERMITTED: Please report postings of this document on public servers or websites to:
DocCtrlAgent@qualcomm.com.
Restricted Distribution: Not to be distributed to anyone who is not an employee of either Qualcomm Technologies, Inc. or its
affiliated companies without the express approval of Qualcomm Configuration Management.
Not to be used, copied, reproduced, or modified in whole or in part, nor its contents revealed in any manner to others without the
express written permission of Qualcomm Technologies, Inc.
Qualcomm, MSM, Quick Charge, and WiPower are trademarks of Qualcomm Incorporated, registered in the United States and
other countries. Other product and brand names may be trademarks or registered trademarks of their respective owners.
This technical data may be subject to U.S. and international export, re-export, or transfer (“export”) laws. Diversion contrary to U.S.
and international law is strictly prohibited.

Qualcomm Technologies, Inc.


5775 Morehouse Drive
San Diego, CA 92121
U.S.A.

© 2016–2017 Qualcomm Technologies, Inc. All rights reserved.


Revision history

Revision Date Description


A September 2016 Initial release
B April 2017 Updated the document title and references
: There is no Rev. I, O, Q, S, X, or Z per Mil. standards.

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 2


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Contents

1 Introduction...................................................................................................... 6
1.1 Purpose.......................................................................................................................... 6
1.2 Conventions .................................................................................................................. 6
1.3 Technical assistance ...................................................................................................... 6

2 Hardware overview .......................................................................................... 7


2.1 Charge cycle ............................................................................................................... 10
2.1.1 Charging prequalification ................................................................................ 10
2.1.2 Charging phases ............................................................................................... 10
2.1.3 Automatic recharging ...................................................................................... 12
2.1.4 Charger inhibit ................................................................................................. 12
2.1.5 Battery over-voltage protection ....................................................................... 13
2.1.6 Battery missing detection ................................................................................ 13
2.1.7 Charge conditions ............................................................................................ 14
2.2 Charger detection ........................................................................................................ 15
2.3 Input current limits...................................................................................................... 17
2.3.1 Type-C ............................................................................................................. 17
2.3.2 Automatic input current limiting ..................................................................... 17
2.3.3 Step charging ................................................................................................... 18
2.4 Battery current limit .................................................................................................... 18
2.4.1 JEITA............................................................................................................... 19
2.5 Parallel charging ......................................................................................................... 21
2.6 Quick Charge and USB PD......................................................................................... 23
2.6.1 Quick Charge ................................................................................................... 23
2.6.2 USB PD ........................................................................................................... 23
2.7 USB OTG ................................................................................................................... 24
2.7.1 Simultaneous WiPower charging and OTG..................................................... 25

3 Software overview ......................................................................................... 27


3.1 Software directory structure/source code.................................................................... 27
3.2 Software architecture .................................................................................................. 27
3.2.1 Battery ............................................................................................................. 28
3.2.2 USB ................................................................................................................. 28
3.2.3 Parameters ....................................................................................................... 30
3.3 Device tree settings ..................................................................................................... 30

4 Software drivers ............................................................................................ 31


4.1 Charge cycle ............................................................................................................... 31
4.1.1 BMD ................................................................................................................ 31

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 3


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Revision history

4.2 Charger detection ........................................................................................................ 31


4.2.1 Charger presence detection .............................................................................. 31
4.3 Input current limit ....................................................................................................... 32
4.3.1 qcom,suspend-input ......................................................................................... 32
4.3.2 qcom,usb-icl-ua ............................................................................................... 33
4.3.3 qcom,dc-icl-ua ................................................................................................. 33
4.3.4 Type-C ............................................................................................................. 34
4.4 Battery current limit .................................................................................................... 34
4.4.1 qcom,fcc-max-ua ............................................................................................. 35
4.5 Parallel charging ......................................................................................................... 35
4.6 OTG and VCONN ...................................................................................................... 36
4.6.1 Example device tree......................................................................................... 36
4.6.2 VBUS and VCONN enablement ..................................................................... 36

5 Debug ............................................................................................................. 38
5.1 ADB ............................................................................................................................ 38
5.2 Log messages .............................................................................................................. 39
5.3 Case opening guidelines ............................................................................................. 39

6 FAQs ............................................................................................................... 40
6.1 How do I enable charging on the Pre-ES2 software? ................................................. 40

A Input current limits ....................................................................................... 41

B References..................................................................................................... 47
B.1 Related documents ..................................................................................................... 47
B.2 Acronyms and terms .................................................................................................. 47

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 4


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Figures

Figures
Figure 2-1 Hardware architecture ................................................................................................................ 9
Figure 2-2 Charger cycle plot .................................................................................................................... 14
Figure 2-3 BC1.2 algorithm flow............................................................................................................... 16
Figure 2-4 Float voltage compensation based on battery temperature conditions ..................................... 20
Figure 2-5 Charge current compensation based on battery temperature conditions .................................. 20
Figure 2-6 JEITA flowchart ....................................................................................................................... 21
Figure 2-7 Parallel charging application with SMB1381 .......................................................................... 22
Figure 2-8 9 V and 5 V charging time comparison.................................................................................... 23
Figure 2-9 Reverse boost (OTG/HDMI/MHL) functional flowchart ........................................................ 25
Figure 2-10 Supporting simultaneous charging and OTG operation ......................................................... 26
Figure 3-1 Software architecture................................................................................................................ 27
Figure 4-1 Charger presence detection flowchart ...................................................................................... 32
Figure 4-2 Type-C detection flowchart ...................................................................................................... 34
Figure 4-3 Battery condition detection flowchart ...................................................................................... 35

Tables
Table 2-1 BC1.2 power source types detected ............................................................................................ 15
Table 2-2 Battery current limit configuration registers.............................................................................. 18
Table 3-1 Battery processes ....................................................................................................................... 28
Table 3-2 USB processes ........................................................................................................................... 28
Table 3-3 Parameter processes................................................................................................................... 30
Table 3-4 Optional device tree settings...................................................................................................... 30
Table 4-1 Battery condition interrupts ....................................................................................................... 35

: There is no Rev. I, O, Q, S, X, or Z pandards.

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 5


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
1 Introduction

1.1 Purpose
This document describes the PMI8998 charger concept and objectives. Details provided include
software requirements, design, and verification of the charging feature.
This document is intended for software developers implementing the charging feature to comply
with feature and software design requirements. This document is also intended for test engineers
to design test plans for charging.

1.2 Conventions
Function declarations, function names, type declarations, attributes, and code samples appear in a
different font, for example, #include.
Code variables appear in angle brackets, for example, <number>.
Commands to be entered appear in a different font, for example, copy a:*.* b:.
If you are viewing this document using a color monitor, or if you print this document to a color
printer, red boldface indicates code that is to be added, and blue strikethrough indicates code
that is to be replaced or removed.
Shading indicates content that has been added or changed in this revision of the document.

1.3 Technical assistance


For assistance or clarification on information in this document, submit a case to Qualcomm
Technologies, Inc. (QTI) at https://createpoint.qti.qualcomm.com/.
If you do not have access to the CDMATech Support website, register for access or send email to
support.cdmatech@qti.qualcomm.com.

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 6


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
2 Hardware overview

The PMI8998 is a switch-mode Li-ion battery charger, input and output power controller for
portable devices. The device is used with systems using single-cell Li-ion and Li-polymer battery
packs.
The device is fully programmable via the SPMI interface. Nonvolatile configuration registers
enable device configuration in different power-up states and are used to reconfigure those settings
during operation.

Input selection and arbitration


PMI8998 uses the D+ and D- USB lines to determine the type of charger connected to the
handheld device. Input current automatically adjusts based on the power source type.
The device accepts either a general DC input (DC_IN) or a USB VBUS DC input (USB_IN) on
separate input paths. Both inputs have programmable input current limiting to protect upstream
charging sources (such as USB). The PMI8998 automatically detects and chooses the best source.
The priority between DC_IN and USB_IN, if both inputs are present, is selectable.

CAUTION: The software is coded assuming that USBIN is at a higher priority than DCIN. Changing this
code might cause issues.

PMI8998 can use the battery as the input source and provide power to the peripherals compliant
with the USB On-the-Go (OTG) specification. To enable OTG mode, reverse the internal path
and use the USB_IN input as an output, providing 5.0 V and up to 1500 mA.
The OTG_EN bit (register 0x1140[0]) is set via the regulator framework software. This bit is
controlled by the USB software for OTG Host mode support and Type-C downstream-facing port
(DFP) mode to supply VBUS.

System output supply and control


PMI8998 automatically maximizes charge current for a given power source level by detecting the
maximum stable output current of the AC/DC adapter, which allows for current level
optimization between the power adapter and the portable device.
The device also has an integrated output current path manager. PMI8998 manages the current
from the USB_IN or DC_IN inputs and routes it to one of two separate outputs – battery or
system. Because the two outputs are independently switched and PMI8998 is programmable, the
charge currents are adjusted during the operation.
A missing/disconnected/faulty battery does not block the current path of the system. If enough
current is available, the system operates from the DC_IN/USB_IN regardless of the battery state.

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 7


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

Battery charging
PMI8998 is compatible with the Alliance for Wireless Power (A4WP) version 1.2 WiPower™
wireless charging specification. When configured in this mode, the DC_IN input limits the
minimum programmable input impedance and maximum input power to 5 W per the A4WP
specification.
For the WiPower applications, the PMI8998 pairs with the Stark divide-by-two charge pump,
which communicates the power transmitting unit (PTU) state and charge pump
divide-by-two/pass-through mode through the CHG_OK and DIV2_EN pins.

IC protection
In addition to safety timers and cell temperature protection, PMI8998 includes a wide range of IC
protection features as follows:
 Input and output over-voltage/over-current protection
 Thermal shutdown
 Charger current or float voltage compensation
 Automatic battery discharge
 Battery missing detection
An open-drain STAT output indicates various status and fault conditions, which are selected via
the STAT output configuration register.
Figure 2-1 shows the PMI8998 hardware architecture.

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 8


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

WIPWR_RECHG
To QCA
CHARGE_REQ
PMI8998 Charger
WIPWR_CHG_OK
WIPWR_DIV2_EN

QI_PMA_ON WiPower PON_1


USB_IN_MID or VPH_PWR
Control PON From PM PON_OUT

WIPWR_RST_N
IDT P9027 Qi/ VCONN_EN To PM GPIO
PMA Wireless VCONN
Charging Rx 28V OVP BOOT_PWR
VDDCAP LDO
VCONN_IN VCONN (5V-6V) 4.7μF
Control 10V
(10V)
40mΩ
A4WP Wireless DC_IN DC_IN_MID
Stark AFE 2 3
Charging PRU 2.2μF
5V-10.3V 4.7uF
16V
16V

To MSM USB PHY


(10V) 13mΩ
VBUS USB_IN USB_IN_MID
4 5
1kΩ 4.7μF
USB_DP BOOT_CAP 35V
4.7uF
1kΩ
Type-C or uUSB 35V USB_DM
Current Path (20V) (12V)
connector, 5V-12V CC1_ID Control 21mΩ 43mΩ 27nF 35V
1.0 μH
12
VPH_PWR To PM8998
Buck /
Boost VDDCAP VSW_CHG VREGs Inputs
(20V) 22 μF
Control
31mΩ 6.3V
CC2 PGND_CHG
5
CC_OUT
To MSM USB PHY

Logic/ VPH_PWR
Control + 4
6V
From PM8998 KYPDPWR_N NV Memory Charge FET CP
KPD_PWR_N Control and 5mΩ
current sense VBATT_PWR
SYS_OK
4
To PM8998 PON_1
CBATT 10μF 6.3V
VBATT_SNS_P
FMB1 Battery voltage
To MSM8998 EDL pin To FG IBATT_SNS_M
sense BATT_THERM_BIAS RSNS
FMB2 VBATT_SNS_N (Optional)
To PM8998 CBL_PWR_N To FG IBATT_SNS_P
68.1k
Battery Therm
Monitor
BATT_THERM
USBPHY_ON
To 3rd party USB PHY PON Battery
VREG_S4_1p8 Battery Pack
Identification BATT_ID
To SMB1380 EN for 100k CHG_STAT
parallel charging ID
External Therm
EN_CHG Monitor AUX_THERM
AUX_THERM_BIAS

: package pin, charger module AGND 68.1k

: package pin, other modules


Phone back cover
(optional for skin temp)
: (internal) module pin

Figure 2-1 Hardware architecture

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 9


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

2.1 Charge cycle

2.1.1 Charging prequalification


When an external wall adaptor or a USB cable is connected to the corresponding input, the
charger runs a series of prequalification tests before initiating the first charge cycle. The input
voltage level must be higher than the UVLO threshold, lower than the OVLO threshold, 100 mV
(DCIN or USBIN rising) greater than the battery voltage, and the appropriate charger ENABLE
register SPMI command or EN_ENABLE input must be asserted.
If enabled, the battery voltage must be below the battery OV threshold and battery temperature
must be below the cold/hot hard thermal limits. Prequalification parameters are continuously
monitored and the charge cycle is suspended if one of the parameters is beyond its programmed
limits.

2.1.2 Charging phases


PMI8998 provides the following charging phases:
 Trickle-charge
 Preconditioning (precharge)
 Constant current (fast charge)
 Constant voltage (taper charge)
All charger phases (except trickle charge) are fully programmable, allowing various battery
charging algorithms that support multiple system designs and new battery technologies. The
following parameters are programmable:
 Precharge current
 Fast-charge current
 Termination current
 Float voltage
 Automatic recharge threshold
 Precharge voltage threshold
 Low battery voltage threshold
 Charger inhibit level
 Input current limit (DC_IN/USB_IN)
 Safety timer duration
 Battery thermal limits
 Die thermal limits
 Interrupt conditions
 Missing battery detection
 Automatic float voltage compensation level (battery IR compensation)

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 10


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

Trickle charging phase


When all prequalification conditions are met, the device checks the battery voltage to determine if
trickle-charging is required. If the battery voltage is below approximately 2.1 V a charging
current of 45 mA. This allows battery pack protection circuit reset and increasing battery voltage
level without compromising safety. The trickle-charging current source is powered from Vsys to
minimize power dissipation when charging from higher voltage inputs.

Precharging phase
When the battery voltage crosses the 2.1 V level, the charger precharges the battery to safely
charge the deeply discharged cells.
The precharge constant current is programmable from 0 mA to 1575 mA in 25 mA steps in
PRE_CHARGE_CURRENT_CFG. The CHARGER remains in this mode until the battery
voltage reaches the precharge to fast-charge voltage threshold programmed in
PRE_TO_FAST_CHARGE_THRESHOLD.
If the precharge to fast-charge voltage threshold is not exceeded before the precharge timer
expires, the charge cycle is terminated, and a corresponding timeout fault signal is asserted.
The precharge current setting is typically programmed to C/10, but can vary by battery pack.

Fast charging phase


When the battery voltage exceeds the pre-charge to fast-charge voltage threshold, the device
enters the Fast Charge mode. During this mode, the fast charge current level is set by the fast
charge register.
The fast charge current is programmable from 0 mA to 4500 mA with 25 mA steps in
FAST_CHARGE_CURRENT_CFG.
Fast charge current level (output) is limited by the following conditions:
 Input current limit setting
 Load being drawn from the VSYS output
 Thermal environment of the device
The fast-charge current setting is typically programmed to 1C-2C, but can vary by battery pack.

Taper charging phase


The following occur when the battery voltage reaches the predefined float voltage:
 Fast charge current starts decreasing exponentially
 Remaining battery capacity is filled
 Battery voltage remains constant
The charger spends a significant amount of time in constant voltage mode depending on the
following factors:
 Battery size
 Internal pack and chemical resistance
 Selected charge rate

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 11


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

The float voltage is programmable from +3.4875 V to +4.92 V in 25 mV steps in


FLOAT_VOLTAGE_CFG. The higher float voltage settings of the charger enable charging
modern battery packs with a required float voltage of 4.35 V and higher. Dynamically adjusting
the float voltage enables implementing sophisticated battery charging and control algorithms.
During the Taper Charging phase, the charger has two options (selected in CHGR_CFG2) that
determine when to terminate charging.
 Fuel gauge – Current threshold is programmed into the fuel gauge peripheral. The fuel gauge
monitors battery current using its IADC and indicates to the charger internally when the
programmed threshold has been crossed.
 Charger – Value is set in TCCC_CHARGE_CURRENT_TERMINATION and determined
by a digital algorithm. The algorithm detects the battery current by maintaining the ICHG
reference close to the actual battery current.
The programmed float voltage setting must be greater than the programmed minimum system
regulation voltage setting in VSYS_MIN_SEL_CFG.

2.1.3 Automatic recharging


The charger allows the battery to be automatically recharged when the fuel gauge indicates that
the battery must be topped off. To determine when to recharge the battery, the fuel gauge has an
option to use state-of-charge (SOC) or battery voltage. This option and its associated thresholds
are programmed in the fuel gauge module. Refer to Linux Android PMIC Fuel Gauge Software
User Guide (80-P2484-74).
A new charging cycle initiates if the following conditions are met:
 Input power supply is present
 Charging remains enabled (SPMI command)
 All prequalification parameters are met
The battery capacity remains high without having to manually restart a charging cycle.
If the charge inhibit function is enabled, the automatic recharge threshold is overridden to the
(higher) charge inhibit voltage threshold.

2.1.4 Charger inhibit


Unless the battery voltage is 50 mV, 100 mV, 200 mV, or 300 mV below the float voltage
(register 0x1072[1:0]), the charger inhibit option prevents charging initiation upon charger
insertion, power cycling, or charge enabling/disabling. This option prevents over-stressing the
battery via continuous charging cycles in systems with short run times and frequent power
cycling (input power connect/disconnect). Additional charging cycles degrade cell life at a faster
rate, which results in a poor user experience.
This feature is only active during the power cycling and manual charge enabling. If the device
enters and exits Suspend mode, charging continues if the battery is above the charge inhibit
voltage threshold.

NOTE: When this feature is enabled, the automatic recharge threshold is overridden to the same
threshold if it is set higher than the inhibit threshold.

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 12


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

2.1.5 Battery over-voltage protection


The PMI8998 charger features an analog comparator that monitors the battery voltage and
compares it to the float voltage setting. The battery overvoltage IRQ triggers and charging is
automatically disabled within 175 msec if each of the following are true:
 Charging is enabled
 Battery voltage exceeds the programmed float voltage set in the register
FLOAT_VOLTAGE_CFG by >= 100 mV
 Register CHGR_CFG2 is set to 1
This feature provides the following safety functionality:
 Does not allow the battery to charge above the float voltage
 Keeps the charger buck output (VPH) regulated when an over-voltage battery is connected
 Prevents damage to downstream devices that cannot handle higher voltage transients

2.1.6 Battery missing detection


PMI8998 battery missing detection (BMD) options include the battery pack thermal monitor and
battery identification pin.

Battery pack thermal monitor


The first option uses the battery pack thermal monitor IO (BATT_THERM). The device checks if
there is a resistor to ground on the third terminal of the battery (T) by comparing the
BATT_THERM pin voltage to the BATT_THERM_BIAS pull-up supply voltage. If the
BATT_THERM pin voltage is above 97.5% of the BATT_THERM_BIAS voltage, then the
battery is determined to be missing.
When no battery is detected, corresponding IRQ and status bits are asserted and charging is
suspended. After the battery is reconnected, charging is automatically initiated, assuming that
input power is present, all qualification parameters are met and charging is enabled. When not
used, BATT_THERM must be connected to GND for normal operation.

Battery identification pin


The battery has a resistance to ground from this pin and that value is programmed into the fuel
gauge memory. When the battery is present, its ID pin connects to the PMI’s BATT_ID pin,
which is self-biased by an internal current source.
If no battery is connected, the current source changes the BATT_ID pin to its supply voltage and
the battery is determined to be missing by the fuel gauge. After the battery is reconnected,
charging is automatically initiated if the following are true:
 Input power is present
 All qualification parameters are met
 Charging is enabled

NOTE: When not used for ID detection or MIPI BIF, the ID must be connected to GND for normal
operation.

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 13


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

2.1.7 Charge conditions


 Valid charger connection
 Input voltage < OVLO
 Input voltage > UVLO
 Input voltage > VBAT + 0.180 V
 Trickle-charge
 VBAT < 2.1 V
 IBAT 45 mA
 Precharge
 VBAT from 2.4 V to 3.0 V
 IBAT from 100 to 1500 mA
 Constant current charge
 IBAT from 0 mA to 4500 mA
 Constant voltage charge
 VFLOAT from 3.6 V to 4.79 V
 Charger cycle plot – The programmable charging algorithm is shown in Figure 2-2.

Charge Algorithm (CC-CV) vs. Time

4.50 10

Battery Voltage
4.00
Charge Current
Input current Float Voltage
3.50 Vfloat (prog) 1
Battery Voltage (V)

Log Current (A)


3.00 Trickle charge
Vbat<2.00V
Fast-charge
2.50 Vbat<Vfloat 0.1
Ichg (prog)
Charge
2.00 Taper-charge termination
Vbat=Vfloat Iterm (prog)
Pre-charge
Vbat<Vprechg
1.50 Iprechg (prog) 0.01
Pre-charge to
fast-charge
transition (prog)
1.00
Trickle to pre-charge
transition (fixed 2.00V)
0.50 0.001
0.00
Time (not to scale)

Figure 2-2 Charger cycle plot

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 14


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

2.2 Charger detection


The BC 1.2 detection algorithm is programmed to run as soon as a valid VBUS voltage is
detected or after Type-C CC detection has completed. The first step of the BC 1.2 algorithm is to
initiate the data contact detect (DCD) timeout, which is programmable to either 300 msec or 600
msec.
Per the BC 1.2 specification, DCD is implemented to detect when the data lines have made
contact, or to implement a forced DCD timeout to allow for enough time to insert the connector.
Refer to PM8998, PM8005, and PMI8998 Power Management ICS Design Guidelines
(80-P1086-5).
The PMI8998 has a dedicated USBIN_PLUGIN charger presence interrupt.
A hardware autonomous power source detection (APSD) algorithm ensures compliance with the
USB Type-C 1.2 and USB BC1.2 specifications and authenticates Quick Charge™ 2.0/3.0
adapters. If VBUS is present during APSD, BC 1.2 detection runs autonomously in parallel to
Type-C detection hardware.
The USBIN_SOURCE_CHANGE interrupt triggers if there is a change in APSD status,
HVDCP2 presence status, or HVDCP3 authentication. When one of these conditions changes and
the USBIN_SOURCE_CHANGE interrupt fires, the software checks the real-time status of
APSD, HVDCP2, and HVDCP3.

Table 2-1 BC1.2 power source types detected


Power source type Description
Standard downstream port This is a computer USB port, capable of USB1.1 (100 mA), USB2.0
(SDP) (100 mA/500 mA), or USB 3.0 (150 mA/900 mA). D+ and D- are
independently pulled down in the host with a resistance of 14.25 kΩ to
24.8 kΩ.
Charging downstream port Powered USB hub capable of a maximum of 1.5 A.
(CDP)
Dedicated charging port Standard wall charger capable of at least 500 mA and a maximum of 5 A.
(DCP) D+ and D- are shorted in the wall adapter with a maximum resistance of
200 Ω. BC1.2 and USB Type-C specifications allow up to 1.5 A to be drawn
from a DCP through a legacy cable without using proprietary charging
methods.
Other charging port (OCP) Nonstandard charger with a proprietary D+/D- configuration for charging
ports not covered by the USB charging specification 1.2. These chargers
have similar current capability to normal DCPs. D+ and D- are connected to
Vbus via a resistor divider, which gives fixed voltage levels.
Floating charger Nonstandard charger with D+ and D- floating and is not compliant with the
BC1.2 specification. This type of charger is allowed by the Type-C
specification as long as it either has a Type-C receptacle or a captive cable.

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 15


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

DCD timeout begins

MSM PHY powers on and sets D+/D-


Prevents interference
with charger detection in
lines to a high impedance state
the PMI

DCD timeout complete

Non-compliant OCP
charger connected?
Yes BC1.2 event

No

Primary detection:
Is the charger
Rerun DCD timer to CDP/DCP
SDP or CDP/DCP?
detect floating charger
SDP
OR
Slow plug-in timer
event (default)*
Secondary detection:
Is the charger
CDP CDP or DCP? DCP

BC1.2 detection BC1.2 detection


slow plugin complete complete

QC2.0 and QC3.0


APSD algorithm is run
detection

*If a floating charger is detected, hardware treats


the charger as a DCP wall charger instead of SDP.

Figure 2-3 BC1.2 algorithm flow

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 16


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

2.3 Input current limits


For a list of input current limits by charger type, refer to Appendix A.

2.3.1 Type-C
When programmed to operate in USB Type-C mode, the PMI8998 charger is fully compliant
with USB Type-C as defined in the USB Battery Charging 1.2 Compliance Plan specification
(www.usb.org).
PMI8998 operates in the following modes:
 Dual Role Power (DRP) mode
 Power Sink mode (up to 3 A input current, 4.8 A with USB Power Delivery (PD))
 Power Source mode (up to 1.5 A output current, 2.0 A with USB PD)
PMI8998 supports the following:
 Cable orientation detection for SuperSpeed USB (using the CC_OUT pin and register, analog
audio adapters, and debug mode (Rp/Rp only)
 USB PD 3.0 (conditional FR_SWAP support)
 Supply Vconn as required for active cables, AMAs, and passive e-marked cables
In addition to USB Type-C compliance, the charger includes Factory mode detection that
leverages the USB Type-C CC interface to enter a Factory Configuration mode.

2.3.2 Automatic input current limiting


An automatic input current limiting (AICL) algorithm that allows PMI8998 to automatically
maximize the current drawn from an AC/DC adapter connected to one of the following:
 USB_IN input
 Wireless charger connected to the DC_IN input
The AICL algorithm is initiated when a valid input is connected to either USB_IN or DC_IN, and
the switcher is running.
As input current increases, it reaches one of the following:
 Output current limit of the AC/DC adapter – Adapter’s output voltage begins to collapse until
it reaches the programmed V_AICL threshold
When the V_AICL threshold is reached, the charger begins a programmable deglitch time of
30 µs to 30 ms (1.1 silicon is fixed 5 msec, 2.0 is programmable 30 µs to 30 msec) and
reduces the input current draw one step at a time until the voltage recovers above V_AICL.
 Maximum programmed input current limit value in one of the following registers:
 0x1370[7:0] (USB_IN) – Maximum value (ICL_MAX) depends on APSD results
 0x1470[7:0] (DC_IN) – Maximum value depends on whether the part is configured in
standard DC_IN mode or WiPower mode (register 0x1495[0]=1 for WiPower mode)

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 17


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

USB_IN input
The AICL algorithm sets the maximum input current limit to 500 mA for USB_IN connections.
The charger must wait for BC 1.2 detection to complete before the power source is confirmed to
be capable of more than 500 mA (maximum for a USB 2.0 SDP and the worst case scenario). See
Section 2.2 for information on the BC 1.2 algorithm.
During BC 1.2 detection, the AICL algorithm remains enabled if one of the following occurs:
 BC 1.2 detects a noncompliant charger (current limit < 500 mA)
 A high-resistance cable is connected to USB_IN, which causes a large DC voltage drop
After BC 1.2 detection is completed, the new maximum input current limit is set to the value
programmed in high current register 0x1370[7:0] depending on the detection results.

Wireless charger connected to DC_IN


For DCN_IN connections, the AICL algorithm sets the maximum input current limit to one of the
following:
 Non-WiPower configurations – The value programmed in register 0x1470[7:0]
 WiPower configurations – Registers 0x1492 to 0x1498[7:0], in which the input current limit
depends on the DCIN voltage, DIV2_EN pin, and CHG_OK pin

2.3.3 Step charging


Step charging is a hardware-autonomous algorithm that enables a staircase charging profile for
lithium-ion battery packs. This algorithm allows programmable charge current values based on
programmable thresholds on battery voltage or SoC.
This implementation relies on battery characterization data from battery cell manufacturers to
determine the charging profile to be used. Software interaction for step charging is not currently
available.

2.4 Battery current limit


Battery current limit is configured via the registers listed in Table 2-2 for Precharge and
Fastcharge phases. For battery current limit configuration, see Section 3.3.

Table 2-2 Battery current limit configuration registers


Current limit Register Address Range
Precharging PRE_CHARGE_CURRENT_CFG 0x1060 0 mA-1575 mA (25 mA steps)
Fastcharging FAST_CHARGE_CURRENT_CFG[7:0] 0x1061 0 mA-4500 mA (25 mA steps)

Outside of these register configurations, the soft JEITA conditions alter the battery charging
current limitation, as described in Section 2.4.1. Refer to PM8998, PM8005, and PMI8998 Power
Management ICS Design Guidelines (80-P1086-5).

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 18


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

2.4.1 JEITA
The PMI8998 fuel gauge manages all battery thermal monitoring. The fuel gauge takes automatic
battery temperature measurements every 1.5 seconds. If the battery temperature exceeds a
preprogrammed soft or hard thermal threshold, an IRQ is generated and sent to the charger
module. There is no built-in hysteresis in the thresholds, but this hysteresis is added by
independent adjustment in software.
The temperature sensing I/O (THERM) is used for adaptive charge current or float voltage
control (that is, charge current and float voltage compensation). These features enable PMI8998
to charge the battery at a reduced current and voltage when the battery pack temperature is
between the soft and hard over-/under-temperature limits, making the device compatible with the
latest JIS8714 and JEITA standards.
The soft hot and cold temperature limits are programmable in the fuel gauge module (refer to
Linux Android PMIC Fuel Gauge Software User Guide (80-P2484-74). The corresponding soft
charge current and soft float voltage settings are also programmable.
If the battery voltage is greater than the compensated float voltage value, charging is disabled
because the termination current has been reached (see Figure 2-6). After the battery temperature
returns to the normal range, charging is only re-enabled if the battery voltage is less than the
automatic recharge voltage threshold.
If the programmed soft-limit charge current reduction value is less than the programmed
termination current value, a false termination event occurs during a JEITA soft-limit condition.
This occurs because the charge current reduces to less than the termination current value. To
avoid this event, ensure that the termination current setting is always higher than the soft-limit
current reduction setting.
I/O (THERM) also prevents excessive battery temperatures during charging. If the temperature
hard limits are exceeded and the JEITA hard limit function is enabled, battery charging is
suspended while safety timers maintain their values but are paused. During this mode, the FET
between the battery and the system is turned on only for the system to be powered by the battery,
but not for charging. The corresponding cold hard limit status and IRQ or hot hard limit status
and IRQ is asserted.
After the temperature level returns to the safe operating range (with hysteresis), charging is
automatically re-enabled, the corresponding fault bit is reset, and safety timers continue counting.
The corresponding status bit is not latched and changes in real time (with hysteresis) as the
temperature moves in or out of the temperature limits.
Charging does not start at all if the battery temperature is outside the specified temperature limits
when charging is enabled (that is, before the hold-off timer has expired).

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 19


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

Figure 2-4 Float voltage compensation based on battery temperature conditions

Figure 2-5 Charge current compensation based on battery temperature conditions

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 20


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

Figure 2-6 JEITA flowchart

2.5 Parallel charging


The following solutions enable maintaining the power dissipation at charge currents greater than
4.0 without increasing the phone case or skin temperature phone beyond an undesirable value:
 PMI8998 is paired with an external SMB1381 charger
 The two ICs charge the battery in parallel during the Constant Current mode
When both chargers are used in parallel, the current in each charger is reduced in half, so the total
power savings due to conduction loss is reduced. The heat generated spreads throughout the two
ICs in different areas of the PCB for uniform thermal distribution across the phone case.

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 21


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

AUX_THERM_
BIAS

68.1k
SMB1381
THERM2_RMT
Type-C connector
temp (optional)

USB_IN USB_IN_MID USB_IN_MID


USB_IN
4.7 μF 4.7 μF
4.7 μF 4.7 μF

System

1.0 μH 1.0 μH
VPH
22 μF 22 μF

PMI8998 SMB1381
EN_CHG
BOOT_PWR = 5V

R_UP

STAT THERM2_RMT
Fuel Gauge
AUX_THERM_ (Ibatt, Vbatt,
BIAS temp) Vbatt_PWR Vbatt_PWR
68.1k
AUX_THERM
ISNS_SMB_M VCHG
Phone back
cover (optional) ISNS_SMB_P VDISCHG

BATT_ VBATT_SNS_P VBATT_P VBATT_N


VBATT_SNS_N BATT_ID THERM
BATT_THERM
_BIAS
68.1k

Battery
Pack

ID

Figure 2-7 Parallel charging application with SMB1381

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 22


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

2.6 Quick Charge and USB PD


For details on the hardware operation of this feature, refer PMI8998 Power Management ICS
Design Guidelines (80-P1086-5).

2.6.1 Quick Charge


Quick Charge authentication occurs after secondary detection has determined that a DCP is
connected. This detection flow is stopped by disabling the HVDCP detection, in which case only
a DCP is detected. An interrupt is issued when BC 1.2 detection is done as and when HVDCP
detection is done, if HVDCP is enabled.

Figure 2-8 9 V and 5 V charging time comparison

2.6.2 USB PD
The PMI8998 features a USB PD PHY. The PD PHY is used in both Power Source and Sink
modes to communicate over a single CC line with a connected PD-capable device. Because the
rate of PD communication is faster than the debounce the PMI8998 charger uses to detect a CC
voltage change, this communication co-exists with Rp and Rd. USB PD communication is
initiated as soon as the CC lines are debounced and an Rp value of medium/high current is
detected on either CC line.

NOTE: USB PD communication is not allowed with the Rp standard, because this USB connection is no
longer supported and the pull-up resistance is not strong enough to maintain PD signal integrity.

The PMI8998 supports the following USB PD use cases:

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 23


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

PR_SWAP
Power role swap (PR_SWAP) makes the charger the power source if it was originally the power
sink, and vice versa. When swapping power roles, the Rp and Rd current sources/resistors swap
to indicate the change of power role. Additionally, if Vconn is being supplied, the source of
Vconn must not change to avoid disruption in power.
An example use case is a dongle with a charging port connected to a PMI8998 device. In this
case, the PMI8998 would provide Vbus and Vconn initially, but the dongle would initiate a
PR_SWAP if a user plugs in a charger to its charging port.

VCONN_SWAP
Vconn swap (VCONN_SWAP) changes the device providing Vconn power, either the Source or
the Sink. An example use case is an active cable connected to a powered USB hub. Because the
hub always has power, the phone requests the hub to power Vconn.

DR_SWAP
Data role swap (DR_SWAP) is the legacy USB equivalent of changing host and device roles. Is
USB Type-C and PD, this is called the upstream facing port (device or UFP) and downstream
facing port (Host or DFP).
This command only swaps the UFP and DFP roles – DR_SWAP has nothing to do with the
power flow direction.

FR_SWAP
Fast role swap (FR_SWAP) is conditionally supported by the PMI8998, because the timing
requirement allows little time to execute the swap. If the current power source is suddenly
removed, this command quickly swaps power roles.
If a powered USB hub provides Vbus and Vconn to all connected devices, FR_SWAP forces a
connected phone to provide both of these power rails within 150 µs if a user suddenly removes
the power. This prevents interruption in data and video when the power removal event occurs.

Table 2-2 USB PD swapping port behavior summary


Swap Host/data roles Rp/Rd Vbus source/sink Vconn source
PR_Swap Unchanged Swapped Swapped Unchanged
DR_Swap Swapped Unchanged Unchanged Unchanged
VCONN_Swap Unchanged Unchanged Unchanged Swapped*
* Swapping of VCONN source port

2.7 USB OTG


In the USB OTG mode, the PMI8998 uses the battery as the input source and provides power to
peripherals compliant with the USB OTG specification.
This feature is enabled by reversing the internal path and using the USB_IN input as an output,
providing 5.0 V and up to 1500 mA.
This mode is hardware autonomous on PMI8998, and detection occurs in the Fuel Gauge module.
Refer to Linux PMIC Fuel Gauge Software User Guide (80-P2484-74).

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 24


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

Figure 2-9 Reverse boost (OTG/HDMI/MHL) functional flowchart

2.7.1 Simultaneous WiPower charging and OTG


The PMI8998 supports OTG and charging operation from the USB_IN path, and charging only
through the DC_IN path. Because PMI8998 uses the same existing power train for both OTG and
charging, it is not possible to charge the battery and provide OTG power at the same time.
Because the PMI8998 includes a 5 V, 1 A boost converter to supply power to audio amplifiers,
this is repurposed for OTG.

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 25


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Hardware overview

When the audio boost is configured for OTG operation, an external OVP/OCP chip must be used
to protect the converter and provide current limiting. The configuration in Figure 2-10 enables
simultaneous wireless (DC_IN) charging and OTG support, for applications that do not require
the audio boost.
Software handles the following use cases:
1. Interrupt issued when there is a change in Rid on PMI8998.
2. If an OTG device is detected, the following sequence is executed by software:
a. Enable the USB Suspend mode in PMI8998. It prevents the switcher from enabling when
USB_IN in present.
b. Enable the audio boost.
c. Enable USB3OTG_VBUS_EN (GPIO5) to turn on the external OVP switch.
3. When the OTG device is removed, the following sequence is executed by software:
a. Disable USB3OTG_VBUS_EN (GPIO5) to turn off the external OVP switch.
b. Disable the audio boost.
c. Disable the USB Suspend mode in PMI8998.

Figure 2-10 Supporting simultaneous charging and OTG operation

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 26


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
3 Software overview

3.1 Software directory structure/source code


The Linux kernel charger driver resides in the following location:
/drivers/power/qcom-charger/qpnp-smb2.c
The Linux kernel charger driver references the following SMB library that contains most of the
base functions:
/drivers/power/qcom-charger/smb-lib.c
The software is modified via the device tree structure. The charger device tree node,
pmicobalt_charger, resides in the following location:
/arch/arm/boot/dts/qcom/msm-pmicobalt.dtsi

3.2 Software architecture


The majority of software processes relevant to the charger occur in the Linux kernel drivers listed
in Section 3.1. The following charger software architecture block diagram outlines the interfaces
between the user space, kernel, and hardware layers.

PowerDelivery, WiPower, Android Battery Service

/sys/class/power_supply/[Battery, USB, DC, BMS]


/sys/module/qcom,qpnp-smb2/parameters/ User Space

Kernel

Power supply framework

PMIC charger driver PMIC FG driver USB driver SMB charger driver
[Battery, DC] [BMS] [USB] [Parallel]

ADC ADC

SPMI bus driver I2C bus driver

PMIC hardware SMB hardware

Figure 3-1 Software architecture

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 27


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Input current limits

3.2.1 Battery
The battery processes are available via sysfs:
/sys/class/power_supply/battery

Table 3-1 Battery processes


Process Description
status Current charging status of the battery:
 POWER_SUPPLY_STATUS_DISCHARGING – Battery is discharging
 POWER_SUPPLY_STATUS_CHARGING – Battery is charging
 POWER_SUPPLY_STATUS_FULL – Battery has reached a full charge
health SDP online status
 POWER_SUPPLY_HEALTH_OVERVOLTAGE – Battery OVP is active
 POWER_SUPPLY_HEALTH_COLD – Battery temperature is in the JEITA
hard cold range and charging is disabled
 POWER_SUPPLY_HEALTH_COOL – Battery temperature is in the JEITA soft
cold range, JEITA float voltage and current compensation active if enabled
 POWER_SUPPLY_HEALTH_OVERHEAT – Battery temperature is in the
JEITA hard hot range and charging is disabled
 POWER_SUPPLY_HEALTH_WARM – Battery temperature is in the JEITA
soft hot range, JEITA float voltage and current compensation active if enabled
 POWER_SUPPLY_HEALTH_GOOD – Battery temperature is in the normal
range and is not overvoltage
present Battery presence status
input_suspend Suspend command (or suspend status) of USBIN charge path.
charge_type Current charging phase:
 POWER_SUPPLY_CHARGE_TYPE_NONE – Battery is not charging
 POWER_SUPPLY_CHARGE_TYPE_TRICKLE – Battery is charging in the
precharge phase
 POWER_SUPPLY_CHARGE_TYPE_FAST – Battery is charging in the
Fastcharge phase
 POWER_SUPPLY_CHARGE_TYPE_TAPER – Battery is charging in the taper
charge phase
capacity Current battery capacity state of charge (%SoC) as reported by the Fuel Gauge

3.2.2 USB
/sys/class/power_supply/usb

Table 3-2 USB processes


Process Description
present VBUS charger presence status on USBIN
online SDP online status
voltage_min Lowest allowed VBUS voltage when USB Power Delivery is being used
voltage_max Highest allowed VBUS voltage when USB Power Delivery is being used
voltage_now Current VBUS voltage reading
current_max Current USBIN input current limitation imposed by the usb_icl_votable vote
aggregation.

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 28


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Input current limits

Process Description
type Type of charger adapter detected (if present)
 POWER_SUPPLY_TYPE_UNKNOWN – No charger
 POWER_SUPPLY_TYPE_USB – SDP
 POWER_SUPPLY_TYPE_USB_CDP – CDP
 POWER_SUPPLY_TYPE_USB_DCP – OCP is treated as DCP
 POWER_SUPPLY_TYPE_USB_DCP – Floated wall chargers treated as DCP
 POWER_SUPPLY_TYPE_USB_DCP – DCP
 POWER_SUPPLY_TYPE_USB_HVDCP – HVDCP2/QuickCharge 2.0
 POWER_SUPPLY_TYPE_USB_HVDCP_3 – HVDCP3/QuickCharge 3.0
typec_mode Current USB Type-C mode for UFP or DFP of the PMI8998 (if Type-C is
detected)
PMI8998 in UFP mode:
 POWER_SUPPLY_TYPEC_NONE – No Type-C present
 POWER_SUPPLY_TYPEC_SOURCE_DEFAULT – PMI8998 presenting UFP
with a default power Type-C current capability detected
 POWER_SUPPLY_TYPEC_SOURCE_MEDIUM – PMI8998 presenting UFP
with a Medium power 1.5 A Type-C current capability detected
 POWER_SUPPLY_TYPEC_SOURCE_HIGH – PMI8998 presenting UFP with
a High power 3 A Type-C current capability detected
PMI8998 in DFP mode:
 POWER_SUPPLY_TYPEC_NONE – No Type-C present
 POWER_SUPPLY_TYPEC_SINK_AUDIO_ADAPTER – PMI8998 presenting
DFP for an audio adapter
 POWER_SUPPLY_TYPEC_SINK_DEBUG_ACCESSORY – PMI8998
presenting DFP for a debug accessory
 POWER_SUPPLY_TYPEC_SINK_POWERED_CABLE – PMI8998 presenting
DFP for a powered cable
 POWER_SUPPLY_TYPEC_SINK – PMI8998 presenting DFP for an attached
UFP Type-C device
 POWER_SUPPLY_TYPEC_SINK_POWERED_CABLE_ONLY – PMI8998
presenting DFP for an attached powered cable with no Type-C UFP device
attached on the other cable end
typec_power_role VBUS charger presence status on:
 USBIN POWER_SUPPLY_TYPEC_PR_NONE – No type-C present
 USBIN POWER_SUPPLY_TYPEC_PR_DUAL – PMI8998 is DFP
 USBIN POWER_SUPPLY_TYPEC_PR_SINK – PMI8998 is UFP
 USBIN POWER_SUPPLY_TYPEC_PR_SOURCE – PMI8998 is DFPF
typec_cc_orientation Indicates the orientation of the Type-C cable (if present) based on the PMI8998
CC_OUT pin:
 0 – No Type-C attached
 1 – CC1 attached
 2 – CC2 attached
pd_allowed USB power delivery allowed status (not allowed if Quick Charge is detected
because QuickCharge takes priority)
pd_active Active status of USB PD

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 29


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Input current limits

3.2.3 Parameters
/sys/module/qcom,qpnp-smb2/parameters

Table 3-3 Parameter processes


Process Description
__debug_mask Enables debug message configuration. It is recommended to set this to value to
0xFF, which enables all debug messages.

3.3 Device tree settings


For a current list of available device tree settings, refer to the following text file:
/documentation/devicetree/bindings/power/qcom-charger/qpnp-smb2.txt

Table 3-4 Optional device tree settings


Setting Description
qcom,fcc-max-ua Specifies the maximum fast charge current in micro-amps (u32 value).
qcom,usb-icl-ua Specifies the USB input current limit in micro-amps (u32 value).
qcom,dc-icl-ua Specifies the DC input current limit in micro-amps (u32 value).
qcom,suspend-input Boolean flag indicating that the charger must not draw current from any of its
input sources (USB, DC). The value type is empty.

NOTE: The qcom,suspend-input setting is in the default software device tree for pre-ES2. This
setting prevents all charging. To enable charging, remove this setting from the device tree.

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 30


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
4 Software drivers

4.1 Charge cycle


The following section provides details on battery missing detection (BMD).

4.1.1 BMD
PMI8998 provides three options for battery missing detection (BMD) (address – 70, register:
BM_CFG[2:0]):
 BATT_THERM – Battery pack thermal monitor
 BATT_ID – Battery identification pin
 BMA – Algorithm that checks for battery terminal pin presence
When not used, BATT_THERM must be connected to GND for normal operation.
When not used (for ID detection or MIPI BIF), BATT_ID must be connected to GND for normal
operation.
Refer to Section 2.1.6 for more information.

4.2 Charger detection


Charger detection includes features active upon insertion and removal.

4.2.1 Charger presence detection


The PMI8998 has a dedicated USBIN_PLUGIN charger presence interrupt.
Upon charger insertion or removal detection, the smblib_handle_usb_plugin() interrupt handler
runs. Within the VBUS presence detection interrupt handler, the regulator_enable() function
requests USB_PHY to float D+/D- pins. This setting enables APSD detection, HVDCP detection,
and authentication to be completed without interference (See Figure 4-1).
Upon charger removal, the smblib_handle_usb_plugin() event handler calls regulator_disable()
function to notify USB_PHY that the D+/D- pins can be managed. The charger presence status is
stored in the chg->vbus_present parameter (See Figure 4-1).
The USBIN_SOURCE_CHANGE interrupt triggers if there is a change in one of the following:
 APSD status
 HVDCP2 presence status
 HVDCP3 authentication
When the USBIN_SOURCE_CHANGE interrupt fires, the smblib_handle_usb_source_change()
interrupt handler runs the smblib_handle_apsd_done() function to recheck and update the charger

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 31


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Input current limits

type in software. The USB_PHY power supply is not updated until type detection is completed.
See Section 4.3.

Float USB_PHY D+/D- Report to SW of charger insertion


[regulator_enable(chg->dpdm_reg)] [chg->vbus_present = 1]

YES

Charger Insertion/ USBIN_PLUGIN IRQ


USBIN_PLUGIN_RT_STATUS = TRUE?
Removal [smblib_handle_usb_plugin()”]

NO

Release USB_PHY D+/D-


Report to SW of charger removal
[regulator_disable(chg->dpdm_reg)]
[chg->vbus_present = 0]

Figure 4-1 Charger presence detection flowchart

4.3 Input current limit


The USB and DC input current limits are configured from the device tree.

NOTE: This input current is lowered during runtime depending on a number of conditions, but the
current is never allowed to exceed these device tree settings.

4.3.1 qcom,suspend-input
Boolean flag indicating that the ccharger must not draw current from its input sources (USB,
DC).
Usage Optional
Value type <empty>

Example
/arch/arm/boot/dts/qcom/msm-pmicobalt.dtsi
pmicobalt_charger: qcom,qpnp-smb2 {
compatible = "qcom,qpnp-smb2";
#address-cells = <1>;
#size-cells = <1>;

qcom,pmic-revid = <&pmicobalt_revid>;

/* do not draw current from USB or DC */


qcom,suspend-input;

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 32


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Input current limits

dpdm-supply = <&qusb_phy0>;

NOTE: The qcom,suspend-input setting is in the default software device tree for pre-ES2. This setting
prevents all charging, to enable charging, remove this from the device tree.

4.3.2 qcom,usb-icl-ua
Specifies the USB input current limit in micro-amps.

Usage Optional
Value type <u32>

Example
/arch/arm/boot/dts/qcom/msm-pmicobalt.dtsi
pmicobalt_charger: qcom,qpnp-smb2 {
compatible = "qcom,qpnp-smb2";
#address-cells = <1>;
#size-cells = <1>;

qcom,pmic-revid = <&pmicobalt_revid>;

/* do not draw current from USB or DC */


qcom,usb-icl-ua = <3000000>;//sets the USBIN limit to 3A
dpdm-supply = <&qusb_phy0>;

4.3.3 qcom,dc-icl-ua
Specifies the DC input current limit in micro-amps.

Usage Optional
Value type <u32>

Example
/arch/arm/boot/dts/qcom/msm-pmicobalt.dtsi
pmicobalt_charger: qcom,qpnp-smb2 {
compatible = "qcom,qpnp-smb2";
#address-cells = <1>;
#size-cells = <1>;

qcom,pmic-revid = <&pmicobalt_revid>;

/* do not draw current from USB or DC */


qcom,dc-icl-ua = <3000000>;//sets the DCIN limit to 3A
dpdm-supply = <&qusb_phy0>;

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 33


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Input current limits

4.3.4 Type-C
Input current limitations based on Type-C cable capability detection is done completely in
hardware. The type-c-change interrupt notifies software of Type-C detection. The
smblib_handle_usb_typec_change() interrupt handler runs if there is a change in Type-C presence
detection. Figure 4-2 outlines the code flow for Type-C detection. Hardware limits current.

Type-C cable insertion/removal


(CC line presence change)

TYPE_C_CHANGE IRQ
[smblib_handle_usb_typec_change()]

Is CC_OUT Hi-Z?
(TYPE_C_STATUS_4_REG[0]
CC_OUT is Hi-Z, handle charger removal
Yes =0)?
[smblib_detach_usb()]
[smblib_handle_typec_cc()]

No

Is the attached Type-C device


presenting as UFP/SINK?
(TYPE_C_STATUS_4_REG[7]=1)?
[smblib_handle_typec_debounce_done()]

No

Yes

Allow USB Power Delivery to run for attached UFP/SINK


[vote(chg->pd_allowed_votable, DEFAULT_VOTER, true, 0)]

Update usb_psy
[power_supply_changed(chg->usb_psy)]

Figure 4-2 Type-C detection flowchart

4.4 Battery current limit


The smblib_handle_batt_psy_changed() interrupt handler handles each battery condition interrupt
in Table 4-1. The smblib_handle_batt_psy_changed() interrupt handler pokes the battery power
supply to recheck its properties and update accordingly.

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 34


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Input current limits

Table 4-1 Battery condition interrupts


Interrupt Description
bat-temp JEITA soft or hard event
bat-ocp Battery over current condition
bat-ov Battery over voltage condition
bat-low Low battery condition
bat-therm-or-id-missing Battery missing detection, pin based
bat-terminal-missing Battery missing detection, terminal based

bat-temp IRQ
bat-ocp IRQ
bat-ov IRQ Update the battery power_supply
Battery condition
bat-low IRQ since charging conditions have changed
interrupt triggers
bat-therm-or-id-missing [power_supply_changed(chg->batt_psy)]
bat-terminal-missing
[smblib_handle_batt_psy_changed()]

Figure 4-3 Battery condition detection flowchart

4.4.1 qcom,fcc-max-ua
Specifies the maximum fast charge current in micro-amps.

Usage Optional
Value type <u32>

Example
/arch/arm/boot/dts/qcom/msm-pmicobalt.dtsi
pmicobalt_charger: qcom,qpnp-smb2 {
compatible = "qcom,qpnp-smb2";
#address-cells = <1>;
#size-cells = <1>;

qcom,pmic-revid = <&pmicobalt_revid>;

/* do not draw current from USB or DC */


qcom,fcc-max-ua = <3000000>;//sets the FCC limit to 3A
dpdm-supply = <&qusb_phy0>;

4.5 Parallel charging


Parallel charging between PMI8998 and SMB1381 is mostly hardware autonomous. Software is
responsible for splitting the FCC between the two charger ICs.

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 35


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Input current limits

4.6 OTG and VCONN


The qpnp-smb2.c charger driver for the PMI8998 provides the following regulator structures for
supplying VBUS for OTG or for Type-C when a UFP is attached, and for supplying VCONN if
needed for Type-C.
 VBUS regulator – qcom,smb2-vbus
 VCONN regulator – qcom,smb2-vconn

4.6.1 Example device tree


/arch/arm/boot/dts/qcom/msmcobalt-regulator.dtsi
&pmicobalt_charger {
smb2_vbus: qcom,smb2-vbus {
regulator-name = "smb2-vbus";
};

smb2_vconn: qcom,smb2-vconn {
regulator-name = "smb2-vconn";
};

/arch/arm/boot/dts/qcom/msm-pmicobalt.dtsi
pmicobalt_pdphy: qcom,usb-pdphy@1700 {
compatible = "qcom,qpnp-pdphy";
reg = <0x1700 0x100>;
vdd-pdphy-supply = <&pmcobalt_l24>;
vbus-supply = <&smb2_vbus>;
vcon-supply = <&smb2_vconn>;

For information on Linux kernel regulator controls, refer to MSM8998.LA Linux Voltage
Regulator Software User Guide (80-P2484-79).

4.6.2 VBUS and VCONN enablement


The functions in this section run when VBUS or VCONN are enabled to be supplied by the
PMI8998 for OTG or Type-C. Because these features are largely hardware autonomous, the
software configures the VBUS or VCONN enable bits.

Enable or disable the VBUS supply for OTG or Type-C (PMI8998 as DFP)
smblib_vbus_regulator_enable()
Enables the OTG_EN bit in the OTG_CMD_OTG register (0x1140[0]=1).

smblib_vbus_regulator_disable()
Disables the OTG_EN bit in the OTG_CMD_OTG register (0x1140[0]=0).

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 36


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Input current limits

Enable or disable VCONN Supply for Type-C


smblib_vconn_regulator_enable()
Enables the VCONN_EN bit in the TYPE_C_INTRPT_ENB_SOFTWARE_CTRL register
(0x1368[3]=1).

smblib_vconn_regulator_disable()
Disables the VCONN_EN bit in the TYPE_C_INTRPT_ENB_SOFTWARE_CTRL register
(0x1368[3]=0).

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 37


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
5 Debug

5.1 ADB
Use the Android debug bridge (adb) shell to capture dumps from the following sources:
 PMI8998 register
 USB
 Battery power_supply sysfs nodes

ADB shell over Wi-Fi


Using the adb shell over Wi-Fi enables dump and log capture while charging.
1. Connect the device to the same Wi-Fi network as the PC is connected to (PC must be
connected to Wi-Fi).
2. In Settings, Wi-Fi/WLAN, select the network name to get the device IP address. In this
example, the IP address of the phone is 192.168.68.167.
3. Ensure that the PC is connected to same wireless network as the device.
4. Connect the device to the PC via USB and run the following adb commands:

adb shell "setprop persist.adb.tcp.port 5555"


adb tcpip 5555

5. Disconnect the device from the PC USB, and run the following commands (replace
192.168.68.167 with the device IP address):

adb connect 192.168.68.167


adb shell
cat /sys/class/power_supply/battery/*
cat /sys/calls/power_supply/usb/*
cd /sys/kernel/debug/regmap/spmi0-02
echo 0x100 > count
echo 0x21000 > address
cat data
echo 0x21100 > address
cat data
echo 0x21200 > address
cat data
echo 0x21300 > address
cat data
echo 0x21400 > address

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 38


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Input current limits

cat data
echo 0x21500 > address
cat data
echo 0x21600 > address
cat data
echo 0x21700 > address
cat data

5.2 Log messages


Enable charger logs when providing kernel logs for a charger issue.
1. Use one of the following methods to enable the PMI8998 charger logs:
 Software driver hard coded change:
/drivers/power/qcom-charger/qpnp-smb2.c
Add the text shown in red boldface and remove the text shown in blue strikethrough:

static int __debug_mask;


static int __debug_mask = 0xFF;

 Run the following commands in the adb shell (must be reissued every power cycle):
adb root && adb wait-for-device
adb shell
echo 0xFF > /sys/module/qcom,qpnp-smb2/parameters/__debug_mask

2. Collect the kernel logs using the following adb shell command:

adb shell dmesg > klog.txt

5.3 Case opening guidelines


Always provide the following information using the methods described in Sections 5.1 and 5.2:
 Boot kernel logs (which show the configuration process)
 Charger kernel logs
 Register dumps capturing the issue
If it is a charger detection issue, always provide waveforms of D+, D-, VBUS, CC1, CC2,
VCONN, and IUSB current capturing the issue.

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 39


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
6 FAQs

6.1 How do I enable charging on the Pre-ES2 software?


Remove qcom, suspend-input; from the pmicobalt_charger device tree node:
Add the text shown in red boldface and remove the text shown in blue strikethrough:
/arch/arm/boot/dts/qcom/msm-pmicobalt.dtsi

pmicobalt_charger: qcom,qpnp-smb2 {
compatible = "qcom,qpnp-smb2";
#address-cells = <1>;
#size-cells = <1>;

qcom,pmic-revid = <&pmicobalt_revid>;

/* do not draw current from USB or DC */


qcom,suspend-input;
dpdm-supply = <&qusb_phy0>;

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 40


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
A Input current limits

The input current limits by charger type in the following table only applies to 2.0 silicon for PMI8998 (not 1.0 silicon).
Use BC1.2 for
Type-C Legacy ICL min ICL start
BC1.2 result DCP, OCP, or ICL max (mA) Charger type
result cable? (mA) (mA)
floating?
SDP_100 / Standard Yes N/A 25 100/150 100/150 Legacy charger with Type-A to Type-C
USB100 (disabled) current cable
SDP_100 / Medium No N/A 25 500 max(ICL_CFG, Type-C 1.5 A charger with Type-C to
USB100 (disabled) current 1500 mA) Type-C cable
SDP_100 / Medium Yes N/A 25 100/150 100/150 SDP charger with noncompliant legacy
USB100 (disabled) current Type-A to Type-C cable
SDP_100 / High No N/A 25 500 max(ICL_CFG, Type-C 3.0 A charger with Type-C to
USB100 (disabled) current 3000 mA) Type-C cable
SDP_100 / High Yes N/A 25 100/150 100/150 SDP charger with noncompliant legacy
USB100 (disabled) current Type-A to Type-C cable
SDP_500 / Standard Yes N/A 25 500 500/900 Legacy charger with Type-A to Type-C
USB500 (disabled) current cable
SDP_500 / Medium No N/A 25 500 max(ICL_CFG, Type-C 1.5 A charger with Type-C to
USB500 (disabled) current 1500 mA) Type-C cable
SDP_500 / Medium Yes N/A 25 500 500/900 SDP charger with noncompliant legacy
USB500 (disabled) current Type-A to Type-C cable
SDP_500 / High No N/A 25 500 max(ICL_CFG, Type-C 3.0 A charger with Type-C to
USB500 (disabled) current 3000 mA) Type-C cable
SDP_500 / High Yes N/A 25 500 500/900 SDP charger with noncompliant legacy
USB500 (disabled) current Type-A to Type-C cable
USBAC (disabled) Standard Yes N/A 25 500 max(ICL_CFG, Legacy charger with Type-A to Type-C
current 1500 mA) cable
USBAC (disabled) Medium No N/A 25 500 max(ICL_CFG, Type-C 1.5 A charger with Type-C to
current 1500 mA) Type-C cable

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 41


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Input current limits

Use BC1.2 for


Type-C Legacy ICL min ICL start
BC1.2 result DCP, OCP, or ICL max (mA) Charger type
result cable? (mA) (mA)
floating?
USBAC (disabled) Medium Yes N/A 25 500 max(ICL_CFG, Unknown charger with noncompliant
current 1500 mA) legacy Type-A to Type-C cable or
captive 1.5 A Type-C charger
USBAC (disabled) High No N/A 25 500 max(ICL_CFG, Type-C 3.0 A charger with Type-C to
current 3000 mA) Type-C cable
USBAC (disabled) High Yes N/A 25 500 max(ICL_CFG, Unknown charger with noncompliant
current 3000 mA) legacy Type-A to Type-C cable or
captive 3.0 A Type-C charger
CDP Standard Yes N/A 25 500 min(ICL_CFG, 1500 mA) CDP charger with legacy Type-A to
current Type-C cable
CDP Medium No N/A 25 500 max(ICL_CFG, CDP Type-C 1.5 A charger with Type-C
current 1500 mA) to Type-C cable
CDP Medium Yes N/A 25 500 min(ICL_CFG, 1500 mA) CDP charger with noncompliant legacy
current Type-A to Type-C cable
CDP High No N/A 25 500 max(ICL_CFG, CDP Type-C 3.0 A charger with Type-C
current 3000 mA) to Type-C cable
CDP High Yes N/A 25 500 min(ICL_CFG, 1500 mA) CDP charger with noncompliant legacy
current Type-A to Type-C cable
Floating_100 Standard Yes N/A 25 100/150 100/150 Floating charger with legacy Type-A to
current Type-C cable
Floating_100 Medium No N/A 25 500 max(ICL_CFG, Floating Type-C 1.5 A charger with
current 1500 mA) Type-C to Type-C cable
Floating_100 Medium Yes N/A 25 100/150 100/150 Floating charger with noncompliant
current legacy Type-A to Type-C cable or
captive 1.5 A Type-C charger
Floating_100 High No N/A 25 500 max(ICL_CFG, Floating Type-C 3.0 A charger with
current 3000 mA) Type-C to Type-C cable
Floating_100 High Yes N/A 25 100/150 100/150 Floating charger with noncompliant
current legacy Type-A to Type-C cable or
captive 3.0 A Type-C charger
Floating_500 Standard Yes N/A 25 500 500/900 Floating charger with legacy Type-A to
current Type-C cable
Floating_500 Medium No N/A 25 500 max(ICL_CFG, Floating Type-C 1.5 A charger with
current 1500 mA) Type-C to Type-C cable

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 42


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Input current limits

Use BC1.2 for


Type-C Legacy ICL min ICL start
BC1.2 result DCP, OCP, or ICL max (mA) Charger type
result cable? (mA) (mA)
floating?
Floating_500 Medium Yes N/A 25 500 500/900 Floating charger with noncompliant
current legacy Type-A to Type-C cable or
captive 1.5 A Type-C charger
Floating_500 High No N/A 25 500 max(ICL_CFG, Floating Type-C 3.0 A charger with
current 3000 mA) Type-C to Type-C cable
Floating_500 High Yes N/A 25 500 500/900 Floating charger with noncompliant
current legacy Type-A to Type-C cable or
captive 3.0 A Type-C charger
Floating_HC Standard Yes N/A 25 500 ICL_CFG Floating charger with legacy Type-A to
current Type-C cable
Floating_HC Medium No N/A 25 500 max(ICL_CFG, Floating Type-C 1.5 A charger with
current 1500 mA) Type-C to Type-C cable
Floating_HC Medium Yes No 25 500 max(ICL_CFG, Floating charger with noncompliant
current 1500 mA) legacy Type-A to Type-C cable or
captive 1.5 A Type-C charger
Floating_HC Medium Yes Yes 25 500 ICL_CFG Floating charger with noncompliant
current legacy Type-A to Type-C cable or
captive 1.5 A Type-C charger
Floating_HC High No N/A 25 500 max(ICL_CFG, Floating Type-C 3.0 A charger with
current 3000 mA) Type-C to Type-C cable
Floating_HC High Yes No 25 500 max(ICL_CFG, Floating charger with noncompliant
current 3000 mA) legacy Type-A to Type-C cable or
captive 3.0 A Type-C charger
Floating_HC High Yes Yes 25 500 ICL_CFG Floating charger with noncompliant
current legacy Type-A to Type-C cable or
captive 3.0 A Type-C charger
OCP_500 Standard Yes N/A 25 500 500 Proprietary charger with legacy Type-A
current to Type-C cable
OCP_500 Medium No N/A 25 500 max(ICL_CFG, Proprietary Type-C 1.5 A charger with
current 1500 mA) Type-C to Type-C cable
OCP_500 Medium Yes N/A 25 500 500 Proprietary charger with noncompliant
current legacy Type-A to Type-C cable
OCP_500 High No N/A 25 500 max(ICL_CFG, Proprietary Type-C 3.0 A charger with
current 3000 mA) Type-C to Type-C cable

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 43


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Input current limits

Use BC1.2 for


Type-C Legacy ICL min ICL start
BC1.2 result DCP, OCP, or ICL max (mA) Charger type
result cable? (mA) (mA)
floating?
OCP_500 High Yes N/A 25 500 500 Proprietary charger with noncompliant
current legacy Type-A to Type-C cable
OCP_HC Standard Yes N/A 25 500 ICL_CFG Proprietary charger with legacy Type-A
current to Type-C cable
OCP_HC Medium No N/A 25 500 max(ICL_CFG, Proprietary Type-C 1.5 A charger with
current 1500 mA) Type-C to Type-C cable
OCP_HC Medium Yes No 25 500 max(ICL_CFG, Proprietary charger with noncompliant
current 1500 mA) legacy Type-A to Type-C cable
OCP_HC Medium Yes Yes 25 500 ICL_CFG Proprietary charger with noncompliant
current legacy Type-A to Type-C cable
OCP_HC High No 25 500 max(ICL_CFG, Proprietary Type-C 3.0 A charger with
current 3000 mA) Type-C to Type-C cable
OCP_HC High Yes No 25 500 max(ICL_CFG, Proprietary charger with noncompliant
current 3000 mA) legacy Type-A to Type-C cable
OCP_HC High Yes Yes 25 500 ICL_CFG Proprietary charger with noncompliant
current legacy Type-A to Type-C cable
DCP Standard Yes N/A 25 500 ICL_CFG DCP charger with legacy Type-A to
current Type-C cable
DCP Medium No N/A 25 500 max(ICL_CFG, DCP Type-C 1.5 A charger with Type-C
current 1500 mA) to Type-C cable
DCP Medium Yes No 25 500 max(ICL_CFG, DCP charger with noncompliant legacy
current 1500 mA) Type-A to Type-C cable or captive 1.5 A
Type-C charger
DCP Medium Yes Yes 25 500 ICL_CFG DCP charger with noncompliant legacy
current Type-A to Type-C cable or captive 1.5 A
Type-C charger
DCP High No N/A 25 500 max(ICL_CFG, DCP Type-C 3.0 A charger with Type-C
current 3000 mA) to Type-C cable
DCP High Yes No 25 500 max(ICL_CFG, DCP charger with noncompliant legacy
current 3000 mA) Type-A to Type-C cable or captive 3.0 A
Type-C charger
DCP High Yes Yes 25 500 ICL_CFG DCP charger with noncompliant legacy
current Type-A to Type-C cable or captive 3.0 A
Type-C charger

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 44


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Input current limits

Use BC1.2 for


Type-C Legacy ICL min ICL start
BC1.2 result DCP, OCP, or ICL max (mA) Charger type
result cable? (mA) (mA)
floating?
HVDCP Standard Yes N/A 25 500 3000 HVDCP charger with legacy Type-A to
current Type-C cable
HVDCP Medium No N/A 25 500 3000 HVDCP Type-C 1.5 A charger with
current Type-C to Type-C cable
HVDCP Medium Yes N/A 25 500 3000 HVDCP charger with noncompliant
current legacy Type-A to Type-C cable
HVDCP High No N/A 25 500 3000 HVDCP Type-C 3.0 A charger with
current Type-C to Type-C cable
HVDCP High Yes N/A 25 500 3000 HVDCP charger with noncompliant
current legacy Type-A to Type-C cable
Powered audio Ra N/A N/A 25 500 500 Powered audio adapter
SDP_100 / Disabled N/A N/A 25 100/150 100/150 USB 1.0 SDP charger
USB100 (disabled)
SDP_500 / Disabled N/A N/A 25 500 500/900 USB 2.0 SDP charger
USB500 (disabled)
USBAC (disabled) Disabled N/A N/A 25 500 ICL_CFG Unknown charger
CDP Disabled N/A N/A 25 500 max(ICL_CFG, CDP charger
1500 mA)
Floating_100 Disabled N/A N/A 25 100/150 100/150 Noncompliant floating charger
Floating_500 Disabled N/A N/A 25 500 500/900 Noncompliant floating charger
Floating_HC Disabled N/A N/A 25 500 ICL_CFG Noncompliant floating charger
OCP_500 Disabled N/A N/A 25 500 500 Noncompliant proprietary charger
OCP_HC Disabled N/A N/A 25 500 ICL_CFG Noncompliant proprietary charger
DCP Disabled N/A N/A 25 500 ICL_CFG DCP charger
HVDCP Disabled N/A N/A 25 500 ICL_CFG HVDCP charger
SDP_100 / Floating N/A N/A 25 100/150 100/150 SDP charger with noncompliant type-C
USB100 (disabled) charger or cable
SDP_500 / Floating N/A N/A 25 500 500/900 SDP charger with noncompliant type-C
USB500 (disabled) charger or cable
USBAC (disabled) Floating N/A N/A 25 500 ICL_CFG Unknown charger with noncompliant
type-C charger or cable

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 45


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
Linux Android PMIC Charger Software User Guide Input current limits

Use BC1.2 for


Type-C Legacy ICL min ICL start
BC1.2 result DCP, OCP, or ICL max (mA) Charger type
result cable? (mA) (mA)
floating?
CDP Floating N/A N/A 25 500 min(ICL_CFG, 1500 mA) CDP charger with noncompliant type-C
charger or cable
Floating_100 Floating N/A N/A 25 100/150 100/150 Floating charger with noncompliant type-
C charger or cable
Floating_500 Floating N/A N/A 25 500 500/900 Floating charger with noncompliant type-
C charger or cable
Floating_HC Floating N/A N/A 25 500 ICL_CFG Floating charger with noncompliant type-
C charger or cable
OCP_500 Floating N/A N/A 25 500 500 Proprietary charger with noncompliant
type-C charger or cable
OCP_HC Floating N/A N/A 25 500 ICL_CFG Proprietary charger with noncompliant
type-C charger or cable
DCP Floating N/A N/A 25 500 ICL_CFG DCP charger with noncompliant type-C
charger or cable
HVDCP Floating N/A N/A 25 500 ICL_CFG HVDCP charger with noncompliant
type-C charger or cable
9 V/12V charger N/A N/A N/A 25 500 ICL_CFG High-voltage charger
Type-C FMB FMB N/A N/A 25 1500 3000 or 4000 Type-C factory mode boot
uUSB FMB FMB N/A N/A 25 1500 3000 or 4000 Type-C factory mode boot
DCIN Qi N/A N/A N/A 25 25 or 500 ICL_CFG Qi charger likely chooses 25 mA for
ICL_START
DCIN WiPower N/A N/A N/A 25 25 or 500 ICL_CFG WiPower charger likely chooses ADC
method for AICLL

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 46


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION
B References

B.1 Related documents


Title Number

Qualcomm Technologies, Inc.


PM8998, PM8005, and PMI8998 Power Management ICs Design Guidelines 80-P1086-5
PMI8998 Hardware Register Description 80-P1087-2X
Linux Android PMIC Fuel Gauge Software User Guide 80-P2484-74
MSM8998.LA Linux Voltage Regulator Software User Guide 80-P2484-79
Resources
USB Battery Charging 1.2 Compliance Plan www.usb.org

B.2 Acronyms and terms


Acronym or term Definition
BC1.2 Battery charging specification 1.2
CDP Charging downstream port
CV Constant voltage
DCD Data contact detect
DCP Dedicated charging port
DFP Downstream facing port
ICHG Battery current
ICL Input current limit
OCP Other charging port
SDP Standard downstream port
SOC State of charge
UFP Upstream facing port

80-P2484-77 B Confidential and Proprietary – Qualcomm Technologies, Inc. 47


MAY CONTAIN U.S. AND INTERNATIONAL EXPORT CONTROLLED INFORMATION

You might also like