Commit graph

1626 commits

Author SHA1 Message Date
Konstantin Makariev
f8d0c870f7 bos0614_mmi: added features
Added the following features:

  1) BOS0614 registers dump sysfs
  2) reading device tree and applying default config
     in case of power cut

Change-Id: I53f1b7069ea4d74aa8b02ac525765951fe29bcce
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1889879
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
2021-03-30 09:11:11 -05:00
Konstantin Makariev
f69d9ac4a3 synaptics_mmi_class: fix build issue
Reverse condition in makefile

Change-Id: I1493d459e35bf11473ee6b053a9bb347635d0f6e
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1912717
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
2021-03-30 09:05:34 -05:00
litong
8ea2460efc Support fw update at device startup for berlin.
TP:
1. Support init.mmi.touch.sh service to force flash TP FW.
2. Add power status sys node

Release Info format,take 21031801 as an example:
ext_release_byte0 [0x01]
ext_release_byte1 [0x18]
ext_release_byte2 [0x03]
ext_release_byte3 [0x21]

Change-Id: I8ffa0244dfc10257ce92cc8f2fbc9841e8ead4c9
Reviewed-on: https://gerrit.mot.com/1904886
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Tested-by: Jira Key
Submit-Approved: Jira Key
2021-03-29 05:43:27 -05:00
Konstantin Makariev
b319fda667 fixup! (CR) synaptics_mmi_class: banks cli bringup
Update makefiles to avoid enabling mutually exclusive options

Mot-CRs-fixed: (CR)

Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Change-Id: I3a6f8df5e2296bdf3f1bee11f1c0733a1b6f72d0
Reviewed-on: https://gerrit.mot.com/1911535
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key
2021-03-29 01:40:38 -05:00
Konstantin Makariev
98ba7bde0b synaptics_mmi_class: banks cli bringup
Synaptics DSX driver is still used in older products in its non-class
version. Version utilizing MMI touchscreen class has more dependencies
and it seems easier to maintain if it's kept separate.

This change combines the following:

1) added MMI status check into probe
2) added module dependencies
3) fixed up panel notifications

Change-Id: I0fcb165c39ef09e0fbd4d5b82ef8130df51ec627
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1887465
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
2021-03-26 03:00:14 -05:00
xuwei9
6145705632 smb:integrate charge pump ffc feature
Support battery ffc feature
at Qcom
Porting: (CR)

Change-Id: I8858601f3f6a003e303b330f42fe7167c2c0d801
Signed-off-by: xuwei9 <xuwei9@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1908651
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Lu Chai <chailu1@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2021-03-24 21:12:34 -05:00
Konstantin Makariev
0b819d2b1d stmicro_mmi: build and config ids
Setup meaningful config and build IDs info to allow for automated
firmware update. Driver will be using release info field of ST
sysinfo as config ID while build ID will become a combination of
FW CFG and CFG version.

Change-Id: I53cec2619ed6afaa83994e7cd40a8254791437a8
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1902864
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: litong <litong20@motorola.com>
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
2021-03-24 08:31:48 -05:00
litong
8113c08da6 Remove pressure events
TP:
If we support ABS_MT_PRESSURE event, when we keep touching the screen
during the boot process, it will cause the touch to be unresponsive
after booting, and all input events will be treated as HOVER events in
framwrok.

Change-Id: I75d33a691bba5729b066df3b80fb1681ce97b5c9
Reviewed-on: https://gerrit.mot.com/1908277
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
2021-03-23 21:24:31 -05:00
xuwei9
5b0f4c7760 charger:bq25960 30w charger support
bq25960 30w charger support
at driver

Change-Id: Ia1f4bd4004afb43c6f1d46c4b38d0818164b4d0e
Signed-off-by: xuwei9 <xuwei9@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1903631
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2021-03-17 04:34:15 -05:00
xuwei9
999ad43b03 charger:enable charger rate at 30w charger
enable charger rate at
30w charger

Change-Id: I6679c021a71ea44022c8fd948b8aca1e7cbdb415
Signed-off-by: xuwei9 <xuwei9@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1903634
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2021-03-17 04:34:08 -05:00
litong
47ea99c046 Enable irq during touch resume for berlin.
TP:
Enable interrupt during touchscreen resume for berlin.

Change-Id: Ie8c6bf171b64a2ae6b03bd69b5f94e3227147d7a
Reviewed-on: https://gerrit.mot.com/1903341
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wei Deng <dengwei1@motorola.com>
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Submit-Approved: Jira Key
2021-03-17 00:49:42 -05:00
dengwei1
c3bab7b6df pstar: input touch stm fix issue
input touch stm
fix issue

Change-Id: I9a4a67acc176ea1a283c254f7569ee7b61ded6e2
Signed-off-by: dengwei1 <dengwei1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1902528
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2021-03-16 03:44:20 -05:00
Konstantin Makariev
37af4acd77 fixup! (CR) stmicro_mmi: bug fixes and new features
Fixing up leftovers

Mot-CRs-fixed: (CR)

Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Change-Id: I559bd6ec3595eec0168af4efaa0743ef2160463a
Reviewed-on: https://gerrit.mot.com/1902234
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Ling Jin <lingjin@motorola.com>
Submit-Approved: Jira Key
2021-03-15 21:27:38 -05:00
Konstantin Makariev
c606c2f274 stmicro_mmi: bug fixes and new features
Includes the following fixes:
 * max coordinates values handling
 * invalid preprocessor statements
 * proper interrupt setup on FW update

And following features have been added:
 * option to flip coordinates
 * suspend/resume pin and power control

Change-Id: Id65bababf1daad807aa1b7a56bd457512bcd1b97
Signed-off-by: Konstantin Makariev <hcv867@motorola.com>
Reviewed-on: https://gerrit.mot.com/1896934
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key
2021-03-15 18:07:59 -05:00
dengwei1
e6256d0876 pstar: input touch fix disable irq panic
input touch
fix disable irq issue

Change-Id: I401c2d24099f92fa91b8eae1d6ca917fdd9610c1
Signed-off-by: dengwei1 <dengwei1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1901003
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
2021-03-15 06:55:03 -05:00
yanyh2
6478fd427c Get the profile id from device tree
Get the battery profile id via looking up from a profile id
and battery serial number mapping table in device tree, so
each product can specify the supported battery profile id and
serial number mapping table by its own in device tree.

Change-Id: Ide3a5b73e5500c47e1afca2122d6ef082982875d
Signed-off-by: yanyh2 <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1899502
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wentao Xu <xuwt2@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
2021-03-12 04:12:30 -06:00
yanyh2
c1db62c7c9 Add new platfrom driver to support smb charger
Add a new platform driver to support the Qualcomm SMB charger
with multi-battery support.

Change-Id: I71c813172825c793ddc1a0e5a921e6bbe6e5839c
Signed-off-by: yanyh2 <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1896697
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wentao Xu <xuwt2@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
2021-03-12 04:12:25 -06:00
yanyh2
895141dc71 Add change to be more compatible
1. Use common wakeup source APIs
2. Add combo_health and combo_temp as combo property of
   mmi_battery power supply.
3. Correct the initial value of battery status when
   calculate the battery combo status.
4. Change the driver name to be constant for compatibles.
5. Export the including path for header file in Kbuild
6. Update the README for more platform driver support.

Change-Id: I0f3403c1e622aa35ccbf753d6c30142b16655752
Signed-off-by: yanyh2 <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1896694
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wentao Xu <xuwt2@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
2021-03-12 04:12:19 -06:00
linyx10
b6e5896db6 Reorganize files to meet compilation mechanism on enabled GKI products.
On enable GKI products, there will use Qcom latest dlkm compile file 
(device/qcom/common/dlkm/AndroidKernelModule.mk) to build kernel driver module, 
and it requires all files of the current target driver module to be in the same 
hierarchy path. Otherwise, when compile this module, a file will can not find 
other local header files that under the different hierarchy path.

Change-Id: I09cfc7bd4539fb3ba8d654b240493d8a11066bee
Signed-off-by: linyx10 <linyx10@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1884805
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Binsheng Que <quebs2@motorola.com>
Reviewed-by: Zhenxin Xi <xizx@motorola.com>
Submit-Approved: Jira Key
2021-03-11 00:12:54 -06:00
yangjq
f7d80ee51a aw8695: Fix compilation error of aw8695 for android R
To include the header file, change $(TOP) to $(ANDROID_BUILD_TOP);
Add function do_gettimeofday();

Change-Id: I6e6db974bf11f5bfd294702e48a32cd7facf5c48
Signed-off-by: yangjq <yangjq@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1893925
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Zhenxin Xi <xizx@motorola.com>
Submit-Approved: Jira Key
2021-03-08 01:04:20 -06:00
linyx10
0014e0a8e3 Make Trustonic TEE driver module compatible with kernel 5.4.
The paths and interfaces for qcom scm call on kernel 4.x and kernel 5.x are
different, considering that different platform use different kernels, so
workaround here for compatibility.

Change-Id: I1a52e58be740799587a8ec924a5fd76d8f69a018
Signed-off-by: linyx10 <linyx10@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1885962
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jefferson Rodrigo Capovilla <jeffecap@motorola.com>
Reviewed-by: Binsheng Que <quebs2@motorola.com>
Reviewed-by: Zhenxin Xi <xizx@motorola.com>
Submit-Approved: Jira Key
2021-03-07 21:33:33 -06:00
xuwei9
c866fdef4f mmi_parallel_charger:enable parallel charger at R
R platform use qpnp-smbcharger-mmi dlkm
remove some power supply property etc duplicate
code changes.

Change-Id: I8234a56d532e0520c4e09ed90c88927375880e62
Reviewed-on: https://gerrit.mot.com/1893698
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Submit-Approved: Jira Key
2021-03-05 00:12:39 -06:00
chailu1
a2889ddc4f charge: Config charge rate for internal FG product
Set charge rate for use internal FG charge pump
product.

Change-Id: Ia7a9bd8f89f3ff81f183534a9b3b1c58d6b3a393
Signed-off-by: chailu1 <chailu1@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1718330
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Haijian Ma <mahj8@motorola.com>
Reviewed-by: Hujun Liao <liaohj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893613
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
2021-03-05 00:10:42 -06:00
chailu1
0204dc4652 Charge: Config step first current comp for CP
Config step first current comp for different products.
If not define at dts, default is 300mA.

Change-Id: Iad22e6dfce8ec99d4d12d71287466526247bcfc6
Reviewed-on: https://gerrit.mot.com/1663791
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-by: Haijian Ma <mahj8@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893610
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
2021-03-05 00:09:59 -06:00
chailu1
60d2e7a6f1 Charge: config min tuning current
Config min tuning current by different product
If not define at dts,default is 2000 mA.

Change-Id: If1e2088d1d44d86d7f34d5cf8000c68f11124d72
Reviewed-on: https://gerrit.mot.com/1648416
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wentao Xu <xuwt2@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-by: Haijian Ma <mahj8@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893609
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
2021-03-05 00:09:19 -06:00
chailu1
43f721e262 Charge: Clear err flag before start CP
After charge pump working will check err flag, so
clear err flag before start charge pump to avoid conflict.

Change-Id: I7dc46ccf31db7d08d45874c956c28eceb697af0b
Reviewed-on: https://gerrit.mot.com/1644934
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wentao Xu <xuwt2@motorola.com>
Reviewed-by: Haijian Ma <mahj8@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893608
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
2021-03-05 00:09:14 -06:00
xuwt2
74fb58d83a mmi_parallel_charger: Add Turbo_30w power level
Add Turbo_30w power level, it is designed to display
"TurboPower 30 connected" on UI when a 27W moto charger
was connected.

Change-Id: I64a8760d0d3428df163b860a804e7cfbe1d8e446
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1649366
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Ryan Lattrel <ryanl@motorola.com>
Reviewed-by: Haijian Ma <mahj8@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893607
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wentao Xu <xuwt2@motorola.com>
2021-03-05 00:08:40 -06:00
chailu1
a649fcd603 charge:notify smb5 while charge pump start working
While charge pump start working,notify smb5 side to
not control PD module.

Change-Id: I51e90a8c3d215e8aba9da893ceb519d76dba1360
Signed-off-by: chailu1 <chailu1@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1609380
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Haijian Ma <mahj8@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893606
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
2021-03-05 00:08:29 -06:00
mahj8
97307e00e8 dlkm: no need rerun aicl for odessa
odessa don't need to rerun aicl for PMIC
when switch to PMIC charging

Change-Id: I87e74f3d64b7ecf163075Montana9fb056d20dc4583d
Signed-off-by: mahj8 <mahj8@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1536606
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wentao Xu <xuwt2@motorola.com>
Reviewed-by: Lu Chai <chailu1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893605
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
2021-03-05 00:07:57 -06:00
Haijian Ma
d4d2b6dc98 dlkm: add enable CP api
add enable CP api for ESR.
disable all CP before ESR and switch to PMIC
enable all CP after ESR

Change-Id: If7b2a60eec763f578b81ecd65844f79d3fa94044
Signed-off-by: Haijian Ma <mahj8@motorola.com>
Reviewed-on: https://gerrit.mot.com/1526649
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wentao Xu <xuwt2@motorola.com>
Reviewed-by: Lu Chai <chailu1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893604
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
2021-03-05 00:07:49 -06:00
xuwt2
47dfcad001 mmi_parallel_charger: set charge_control_limit as writeable
set battery psy "charge_control_limit" sysfs as wirteable
to resolve below dac_override denial.

Denial:
W thermal-engine: type=1400 audit(0.0:11): avc: denied { dac_override } for capability=1 scontext=u:r:thermal-engine:s0 tcontext=u:r:thermal-engine:s0 tclass=capability permissive=0

Error:

E ThermalEngine: open/sys/class/power_supply/battery/charge_control_limit failed13
E ThermalEngine: Unable to init battery charging mitigation to 0

Change-Id: I593eda9bbeeb4853a2a4586dd7173fd04b4c54d6
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1483710
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893602
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wentao Xu <xuwt2@motorola.com>
2021-03-05 00:07:45 -06:00
xuwt2
14fc999c8e mmi_parallel_charger: UI support for 45W charger
when User attaches a 45W charger, the UI : 45W Hyper charging
In kernel space, driver module report "Hyper" to user space
when the 45w charger adapter connected
and report "Super" to user space when the 27w charger connected
/sys/class/power_supply/battery/charger_rate

Change-Id: I54041e6289fcea3808c1270bc70f2022c8d840cf
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1450586
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893600
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
2021-03-05 00:07:03 -06:00
xuwt2
f75f5600aa fg: soc report 99% lasted for long time
In defender Project, there are two fuel gauge(bq27426, qpnp-qg),
sometimes, the soc 99% lasted for long time after recharging.
the battery status was NOT_CHARGING, because the current has been
terminated.
in that case, force it report 100%

Change-Id: I9b851ac7a7e3776730be386420ea974c15cbe321
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1443240
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893598
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
2021-03-05 00:05:41 -06:00
xuwt2
8563878dbe mmi_pl_chg: Add mmi_cycle_count to calculate batt age
-1, Add mmi_cycle_count func to caculate battery cycle count
-2, enable battery psy charge_full and charge_full_design

Change-Id: Ib8f60b6c8eb5940b8ef0e87c2328fb230cdbbb65
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1442066
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893587
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
2021-03-05 00:04:29 -06:00
xuwt2
1e929909ab mmi_parallel_charger: Add factory mode detect
Add factory mode detect
force stop charging under factory mode

Change-Id: I84437d385971a5f62f0f2314e77da5b82d2966fd
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1439687
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893585
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
2021-03-05 00:03:52 -06:00
xuwt2
7b0ac125e1 mmi_pl_chg: clear pmic limit after remove pd power
the pmic current would be limit when 45w pd charger connect,
and must clear the pmic limit setting after PD power removed.

Change-Id: I814e2825ca29c0975542bda0dcc72f6571ea437a
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1439744
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893582
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
2021-03-05 00:03:48 -06:00
xuwt2
4e2a69037b mmi_parallel_charger: "battery" psy update PROP_STATUS
Under the parallel charging framework, the battery status should be
determined by all charging IC status, and not only from pmic charging

Change-Id: Idc85e8b96c1ff854f42f321e8e7b7a4c5ec55f6c
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1435998
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893580
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
2021-03-05 00:03:44 -06:00
xuwt2
5bd7a01df9 mmi_parallel_charger: optimize 45w charger policy
-1, define new variables, sys_therm_cooling, batt_therm_cooling
sys_therm_cooling: response the system thermal throttle request.
batt_therm_cooling: independent trigger battery thermal throttle
base on battery safty requirement.
-2, select the right pd power to request PD adapter,
PD target power = min(req pd power, sys therm cooling pd power,
	batt therm cooling pd power).
-3, define ignore_hysteresis_degc.
-4, take POWER_SUPPLY_PROP_CP_STATUS1 replace PROP_STATUS

Change-Id: I98ed508d2a4d07fa7c14fdaa2307e917fbbaccb1
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1435405
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893579
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
2021-03-05 00:02:42 -06:00
xuwt2
3e1fee02e6 optimize the charging logic in thermal mitigation process
-1, clear thermal mitigation flag in SM_QUITE and SM_ENTRY
-2, recovery charger power after quiting thermal mitigation

Change-Id: I1e77f3e443ece14c9b309057d50d433b657e2e66
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1430164
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Tao Sun <suntao2@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893578
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
2021-03-05 00:02:04 -06:00
xuwt2
9a88b76a90 Improve the PD charging performance in high temperature
-1, define a last chrg step flag.
-2, Disable charger pump IC at PM_STATE_ENTRY.
-3, Add second search cycle in mmi_find_chrg_step
-4, clear the batt_curr_roof and pd_constant_power_cnt
when switch the state machine work

Change-Id: I1156b8168c387ae2edf88052e9251302ef899ae1
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1429346
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893575
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
2021-03-05 00:01:42 -06:00
xuwt2
f1c2a3ab26 mmi_paralel_charger: Enhance the compatibility of PD charger
-1, Set the initial PD current to 2A.
-2, filter out the wrong PD request power for selecting PD charger.
-3, clear the pps result history after error pd result handing
-4, detect the pd constant power state, and avoid to excessive
boost vbus

Change-Id: I158a68c2907af42c07cd408ce162b528b3e39f10
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1428520
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893572
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
2021-03-05 00:01:08 -06:00
xuwt2
cf486f79c3 mmi_parallel_charger: enhance the stability of sm work
Under certain condition, the PD adapter would be instability,
and the sm work who responsible for the entire charging policy
might exited abnormally.
improve the synchronous processing.

Change-Id: I87bb51a4b69178f9eb40d6519328975203027c7e
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1427554
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893556
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
2021-03-05 00:00:39 -06:00
xuwt2
1a24421fc8 mmi_pl_chrg: improve the chrg recovery handling
Redefine the charger device error type,
In some case, the output of PD adapter is not stable,
It would cause the UCP or OCP occurs on the bq2597x,
Add a recovery handling to response to this issue.

Change-Id: I9350df26252483b5c9010c9ef27d0364b59d57b2
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1427195
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893555
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
2021-03-05 00:00:01 -06:00
xuwt2
a2f329a62a mmi_chrg_manager: optimize thermal mitigation logic
-1, optimize thremal logic
-2, force pmic charging when the battery capacity is high(upper 90%)

Change-Id: Ic8b6a58decf4903b757c1554efe587100b69236e
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1413367
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893553
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
2021-03-04 23:59:29 -06:00
xuwt2
312d45b3df mmi_pl_chrg: create some sysfs node for setting mmi_params
factory_charge_upper
factory_image_mode
force_demo_mode
force_max_chrg_temp

Change-Id: I4e40acf9a628becMontana3ca70652659b0b0b459be1
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1408893
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Haijian Ma <mahj8@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893551
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
2021-03-04 23:59:04 -06:00
xuwt2
3318b25022 mmi_parallel_charger: optimize temp zone structure
-1, set temp_c as signed constant
-2, add conditional judgment to prevent invalid temp zone

Change-Id: I7ed0fe09034c5669f1538954ebf871e1ed7cf0e7
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1408609
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893549
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
2021-03-04 23:58:12 -06:00
xuwt2
bcb5ddfdc9 mmi_parallel_charger: Optimize 40w charging logc, 1.0
-1, change the 40w charger cooling policy
-2, change the 40w charger thermal mitigaion policy

Change-Id: I248e5b01c748e5791d28dec48eede859e571e931
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1404488
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893548
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
2021-03-04 23:57:38 -06:00
xuwt2
df4d91f376 mmi_parallel_charger: Optimize 40w charging policy
-1, Add chrg ucp and ocp detection
-2, Add chrg_policy_error_recovery policy
-3, Add chrg_dev_init
-4, change charger thermal cooling policy,
remove THERMAL_COOLING chrg step, add thermal cooling process
into CC loop and CV loop, that to avoid miss chrg step in cooling

Change-Id: I57d66af338505c5ff9fd711de8b650afdb4a4027
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1389618
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893545
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
2021-03-04 23:56:58 -06:00
xuwt2
a0200f3340 mmi_parallel_charger: Create Heartbeat work
Create Heartbeat work to listern battery && charger status
-1, check charger rate
-2, add mmi_power_supply_changed to report status
-3, register alarm to wake up heartbeat
-4, register pm suspend and resume

Change-Id: Ic4b4d95453fa9e4a2adeaaac48b0705e8726e3e4
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1385370
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893544
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
2021-03-04 23:56:30 -06:00
xuwt2
e778e4a2b0 DLKM: mmi_parallel_charger
upload the code of mmi_parallel_charger
this is the original release

Change-Id: Iae012a72e3c2c177d48154b9215eda54ab6b70a6
Signed-off-by: xuwt2 <xuwt2@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1378406
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1893536
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
2021-03-04 23:55:52 -06:00