From 7df90a8b762562e47df74f793c764d5bba9564e0 Mon Sep 17 00:00:00 2001 From: huaqin86 Date: Mon, 8 Nov 2021 16:50:32 +0800 Subject: [PATCH] arm/dts: add charger and fg and tcpc dts add charger and fgauge and cc logic and qc logic dts for charging bring up Change-Id: Ie92f6628b000b92336fe94ad2156b353eac710c3 Signed-off-by: huaqin86 Reviewed-on: https://gerrit.mot.com/2109783 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Wei Xu Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- qcom/bat_setting/CW_jd50-atl-5000mah.dtsi | 26 ++ qcom/bat_setting/CW_jd50-scud-5000mah.dtsi | 26 ++ qcom/bat_setting/CW_md50-amperex-5000mah.dtsi | 26 ++ qcom/bat_setting/CW_md50-scud-5000mah.dtsi | 26 ++ qcom/bat_setting/RT_md50-amperex-5000mah.dtsi | 83 +++++ qcom/bat_setting/RT_md50-scud-5000mah.dtsi | 83 +++++ qcom/discrete_charging.dtsi | 334 ++++++++++++++++++ qcom/khaje-rhode-common-overlay.dtsi | 2 + qcom/sgm7220.dtsi | 50 +++ 9 files changed, 656 insertions(+) create mode 100644 qcom/bat_setting/CW_jd50-atl-5000mah.dtsi create mode 100644 qcom/bat_setting/CW_jd50-scud-5000mah.dtsi create mode 100644 qcom/bat_setting/CW_md50-amperex-5000mah.dtsi create mode 100644 qcom/bat_setting/CW_md50-scud-5000mah.dtsi create mode 100644 qcom/bat_setting/RT_md50-amperex-5000mah.dtsi create mode 100644 qcom/bat_setting/RT_md50-scud-5000mah.dtsi create mode 100644 qcom/discrete_charging.dtsi create mode 100644 qcom/sgm7220.dtsi diff --git a/qcom/bat_setting/CW_jd50-atl-5000mah.dtsi b/qcom/bat_setting/CW_jd50-atl-5000mah.dtsi new file mode 100644 index 000000000000..7781533401ec --- /dev/null +++ b/qcom/bat_setting/CW_jd50-atl-5000mah.dtsi @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2021 Motorola Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See http://www.gnu.org/licenses/gpl-2.0.html for more details. + */ +jd50-atl-5000mah { + serialnum = "SB18C77591"; + fcc_design = <4850>; + config_profile_info = [5A 00 00 00 00 00 00 00 + A0 B2 BF CB C3 C2 96 59 + 2F FF FF DB A6 8D 74 60 + 55 52 4D 8D FD DC 02 CF + CF D2 D1 D1 D0 CD C8 CD + C1 C0 C5 AD 95 8A 81 74 + 62 62 73 8F A7 87 5F 62 + 20 00 57 10 02 B0 76 00 + 00 00 64 28 D3 7C 00 00 + 00 00 00 00 00 00 00 44 ]; +}; diff --git a/qcom/bat_setting/CW_jd50-scud-5000mah.dtsi b/qcom/bat_setting/CW_jd50-scud-5000mah.dtsi new file mode 100644 index 000000000000..3695aed76735 --- /dev/null +++ b/qcom/bat_setting/CW_jd50-scud-5000mah.dtsi @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2021 Motorola Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See http://www.gnu.org/licenses/gpl-2.0.html for more details. + */ +jd50-scud-5000mah { + serialnum = "SB18C77226"; + fcc_design = <4850>; + config_profile_info = [5A 00 00 00 00 00 00 00 + A5 B1 B5 CE C3 C2 97 58 + 31 FF FF E3 92 80 63 58 + 4F 4D 4A 86 F0 DC 0D D2 + D2 D1 D1 D1 CF CC BC DC + B0 C3 C8 AA 96 89 80 71 + 68 64 73 8F A3 86 65 60 + 20 00 57 10 02 B0 74 00 + 00 00 64 24 D3 79 00 00 + 00 00 00 00 00 00 00 5F ]; +}; diff --git a/qcom/bat_setting/CW_md50-amperex-5000mah.dtsi b/qcom/bat_setting/CW_md50-amperex-5000mah.dtsi new file mode 100644 index 000000000000..e31fdb606254 --- /dev/null +++ b/qcom/bat_setting/CW_md50-amperex-5000mah.dtsi @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2021 Motorola Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See http://www.gnu.org/licenses/gpl-2.0.html for more details. + */ +md50-amperex-5000mah { + serialnum = "SB18D33989"; + fcc_design = <4700>; + config_profile_info = [5A 00 00 00 00 00 00 00 + A6 B1 B2 CE C1 C1 9E 5F + 36 FF FF F9 BA 92 7F 6B + 60 5D 58 94 E7 DE 9A DC + C2 CA D2 D7 D6 D3 D1 CC + CA C9 CE B8 9C 92 88 81 + 75 71 7F 91 AB 83 71 70 + 20 00 57 10 02 B0 5D 00 + 00 00 64 26 D3 51 00 00 + 00 00 00 00 00 00 00 94 ]; +}; diff --git a/qcom/bat_setting/CW_md50-scud-5000mah.dtsi b/qcom/bat_setting/CW_md50-scud-5000mah.dtsi new file mode 100644 index 000000000000..3c2ba5088fa5 --- /dev/null +++ b/qcom/bat_setting/CW_md50-scud-5000mah.dtsi @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2021 Motorola Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See http://www.gnu.org/licenses/gpl-2.0.html for more details. + */ +md50-scud-5000mah { + serialnum = "SB18D01192"; + fcc_design = <4700>; + config_profile_info = [5A 00 00 00 00 00 00 00 + A1 AE AA CB C1 C4 92 4F + 2D FF FF FF C6 9C 83 6C + 5B 56 4E 9B E5 DE 59 CC + C6 C9 D1 D5 D5 D4 D0 CE + CB C9 CC BB A0 92 8A 82 + 76 71 81 95 AB 7B 7B 75 + 20 00 57 10 02 B0 5B 00 + 00 00 64 26 D3 4F 00 00 + 00 00 00 00 00 00 00 54 ]; +}; diff --git a/qcom/bat_setting/RT_md50-amperex-5000mah.dtsi b/qcom/bat_setting/RT_md50-amperex-5000mah.dtsi new file mode 100644 index 000000000000..b522cf0641b3 --- /dev/null +++ b/qcom/bat_setting/RT_md50-amperex-5000mah.dtsi @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2021 MediaTek Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See http://www.gnu.org/licenses/gpl-2.0.html for more details. + */ +md50-amperex-5000mah { + serialnum = "SB18D33989"; + /* add for aging cv */ + rt,fcc = <4895 4895 4895 4895 4895>; + rt,fg_fc_vth = <0x9e 0x9e 0x9e 0x9e 0x9e>; + rt,fg_extreg_table = [80 80 33 6E B7 E4 58 02 CF 98 61 3A 88 81 00 00 + 80 34 00 00 FB 3E 00 20 FF 08 1D 32 12 05 5A 5A + 00 82 00 02 00 02 00 40 00 40 1F 13 1F 13 04 24 + 64 00 5F 0B 64 00 5F 0B FF 00 00 14 00 00 14 B7 + 15 0E 48 44 9E 4C 05 41 19 05 8D 12 23 32 1F 00 + 13 88 24 82 77 AD 04 73 12 A3 52 68 57 64 25 0F + 20 16 03 04 04 04 00 00 00 00 02 02 02 00 00 FD + FC FA FA FA F9 F9 EE E5 9B 9B 9B EB EB C0 AD 00 + 76 02 E0 48 14 09 00 00 00 00 00 00 00 00 37 73 + 2D 19 05 FB 00 00 B9 36 96 33 0F 07 00 00 0B A9 + 32 32 88 88 32 32 88 88 32 32 88 88 32 32 88 88 + 32 32 88 88 32 32 88 88 32 32 88 88 32 32 88 88 + 32 32 88 88 32 32 88 88 32 32 88 88 32 32 88 88 + 32 32 88 88 32 32 88 88 32 32 88 88 32 32 88 88 ]; + rt,fg_ocv_table0 = <0x0013 0x49C0 0x5000 0x57C1 0x5B7E 0x5C32 0x5CE3 0x5E1B + 0x5F9C 0x6089 0x6162 0x6277 0x6356 0x65CA 0x6820 0x6985 + 0x6AB7 0x6BFF 0x6D46 0x706D 0x1900 0x07C1 0x02E0 0x00BE + 0x002D 0x0041 0x002F 0x0038 0x0050 0x0096 0x007F 0x007C + 0x0092 0x0092 0x0092 0x0092 0x005F 0x0143 0x0013 0xFF80 + 0x0000 0x0200 0x049A 0x0680 0x0E4D 0x17E6 0x281A 0x309A + 0x3600 0x39B3 0x3D33 0x474D 0x4F80 0x5466 0x589A 0x5D1A + 0x6400 0x6900 0x000A 0x0021 0x0059 0x0159 0x05A7 0x03EE + 0x0564 0x0498 0x0330 0x01B5 0x0203 0x020F 0x01C2 0x01C2 + 0x01C2 0x01C2 0x02B3 0x00CB 0x6684 0x0000 0x0000 0x0000 >; + rt,fg_ocv_table1 = <0x0013 0x49C0 0x5000 0x57C1 0x5B7E 0x5C32 0x5CE3 0x5E1B + 0x5F9C 0x6089 0x6162 0x6277 0x6356 0x65CA 0x6820 0x6985 + 0x6AB7 0x6BFF 0x6D46 0x706D 0x1900 0x07C1 0x02E0 0x00BE + 0x002D 0x0041 0x002F 0x0038 0x0050 0x0096 0x007F 0x007C + 0x0092 0x0092 0x0092 0x0092 0x005F 0x0143 0x0013 0xFF80 + 0x0000 0x0200 0x049A 0x0680 0x0E4D 0x17E6 0x281A 0x309A + 0x3600 0x39B3 0x3D33 0x474D 0x4F80 0x5466 0x589A 0x5D1A + 0x6400 0x6900 0x000A 0x0021 0x0059 0x0159 0x05A7 0x03EE + 0x0564 0x0498 0x0330 0x01B5 0x0203 0x020F 0x01C2 0x01C2 + 0x01C2 0x01C2 0x02B3 0x00CB 0x6684 0x0000 0x0000 0x0000 >; + rt,fg_ocv_table2 = <0x0013 0x49C0 0x5000 0x57C1 0x5B7E 0x5C32 0x5CE3 0x5E1B + 0x5F9C 0x6089 0x6162 0x6277 0x6356 0x65CA 0x6820 0x6985 + 0x6AB7 0x6BFF 0x6D46 0x706D 0x1900 0x07C1 0x02E0 0x00BE + 0x002D 0x0041 0x002F 0x0038 0x0050 0x0096 0x007F 0x007C + 0x0092 0x0092 0x0092 0x0092 0x005F 0x0143 0x0013 0xFF80 + 0x0000 0x0200 0x049A 0x0680 0x0E4D 0x17E6 0x281A 0x309A + 0x3600 0x39B3 0x3D33 0x474D 0x4F80 0x5466 0x589A 0x5D1A + 0x6400 0x6900 0x000A 0x0021 0x0059 0x0159 0x05A7 0x03EE + 0x0564 0x0498 0x0330 0x01B5 0x0203 0x020F 0x01C2 0x01C2 + 0x01C2 0x01C2 0x02B3 0x00CB 0x6684 0x0000 0x0000 0x0000 >; + rt,fg_ocv_table3 = <0x0013 0x49C0 0x5000 0x57C1 0x5B7E 0x5C32 0x5CE3 0x5E1B + 0x5F9C 0x6089 0x6162 0x6277 0x6356 0x65CA 0x6820 0x6985 + 0x6AB7 0x6BFF 0x6D46 0x706D 0x1900 0x07C1 0x02E0 0x00BE + 0x002D 0x0041 0x002F 0x0038 0x0050 0x0096 0x007F 0x007C + 0x0092 0x0092 0x0092 0x0092 0x005F 0x0143 0x0013 0xFF80 + 0x0000 0x0200 0x049A 0x0680 0x0E4D 0x17E6 0x281A 0x309A + 0x3600 0x39B3 0x3D33 0x474D 0x4F80 0x5466 0x589A 0x5D1A + 0x6400 0x6900 0x000A 0x0021 0x0059 0x0159 0x05A7 0x03EE + 0x0564 0x0498 0x0330 0x01B5 0x0203 0x020F 0x01C2 0x01C2 + 0x01C2 0x01C2 0x02B3 0x00CB 0x6684 0x0000 0x0000 0x0000 >; + rt,fg_ocv_table4 = <0x0013 0x49C0 0x5000 0x57C1 0x5B7E 0x5C32 0x5CE3 0x5E1B + 0x5F9C 0x6089 0x6162 0x6277 0x6356 0x65CA 0x6820 0x6985 + 0x6AB7 0x6BFF 0x6D46 0x706D 0x1900 0x07C1 0x02E0 0x00BE + 0x002D 0x0041 0x002F 0x0038 0x0050 0x0096 0x007F 0x007C + 0x0092 0x0092 0x0092 0x0092 0x005F 0x0143 0x0013 0xFF80 + 0x0000 0x0200 0x049A 0x0680 0x0E4D 0x17E6 0x281A 0x309A + 0x3600 0x39B3 0x3D33 0x474D 0x4F80 0x5466 0x589A 0x5D1A + 0x6400 0x6900 0x000A 0x0021 0x0059 0x0159 0x05A7 0x03EE + 0x0564 0x0498 0x0330 0x01B5 0x0203 0x020F 0x01C2 0x01C2 + 0x01C2 0x01C2 0x02B3 0x00CB 0x6684 0x0000 0x0000 0x0000 >; +}; + diff --git a/qcom/bat_setting/RT_md50-scud-5000mah.dtsi b/qcom/bat_setting/RT_md50-scud-5000mah.dtsi new file mode 100644 index 000000000000..e08fd2f38610 --- /dev/null +++ b/qcom/bat_setting/RT_md50-scud-5000mah.dtsi @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2021 Motorola Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See http://www.gnu.org/licenses/gpl-2.0.html for more details. + */ +md50-scud-5000mah { + serialnum = "SB18D01192"; + /* add for aging cv */ + rt,fcc = <4815 4815 4815 4815 4815>; + rt,fg_fc_vth = <0x9e 0x9e 0x9e 0x9e 0x9e>; + rt,fg_extreg_table = [80 80 33 6E B7 E4 58 02 CF 98 61 3A 88 81 00 00 + 80 34 00 00 FB 3E 00 20 FF 08 1D 32 12 05 5A 5A + 00 82 00 02 00 02 00 40 00 40 CF 12 CF 12 04 24 + 64 00 5F 0B 64 00 5F 0B FF 00 00 14 00 00 14 B7 + 15 0E 48 44 9E 4C 05 41 19 05 8E 12 23 32 1A 00 + 13 88 24 82 77 AD 04 73 12 A3 52 68 57 64 25 0F + 20 16 03 08 08 08 03 03 03 02 03 03 03 00 00 FC + F9 F2 F2 F2 F0 F0 D7 CA F2 F2 F2 CE CE 9C 81 00 + 76 02 C0 48 14 09 00 00 00 00 00 00 00 00 37 73 + 2D 19 05 FB 00 00 B9 36 96 33 0F 07 00 00 0B A9 + 32 32 88 88 32 32 88 88 32 32 88 88 32 32 88 88 + 32 32 88 88 32 32 88 88 32 32 88 88 32 32 88 88 + 32 32 88 88 32 32 88 88 32 32 88 88 32 32 88 88 + 32 32 88 88 32 32 88 88 32 32 88 88 32 32 88 88 ]; + rt,fg_ocv_table0 = <0x0013 0x4A40 0x5000 0x5796 0x5B50 0x5BE3 0x5CD7 0x5E10 + 0x5FC6 0x60DB 0x619C 0x6292 0x6381 0x6643 0x688B 0x69E8 + 0x6B12 0x6BE2 0x6D20 0x706D 0x1700 0x0796 0x02DE 0x009C + 0x003E 0x0041 0x0036 0x0041 0x0048 0x0085 0x0088 0x008C + 0x008E 0x008E 0x008E 0x005C 0x005C 0x0152 0x0013 0xFF80 + 0x0000 0x0200 0x049A 0x0680 0x0E4D 0x17E6 0x281A 0x309A + 0x3600 0x39B3 0x3D33 0x474D 0x4F80 0x5466 0x589A 0x5D1A + 0x6400 0x6900 0x000B 0x0022 0x0059 0x01A5 0x041B 0x03EB + 0x04BD 0x03EE 0x0394 0x01EC 0x01E1 0x01D5 0x01CC 0x01CC + 0x01CE 0x02C6 0x02C6 0x00C2 0xE7EC 0x0000 0x0000 0x0000 >; + rt,fg_ocv_table1 = <0x0013 0x4A40 0x5000 0x5796 0x5B50 0x5BE3 0x5CD7 0x5E10 + 0x5FC6 0x60DB 0x619C 0x6292 0x6381 0x6643 0x688B 0x69E8 + 0x6B12 0x6BE2 0x6D20 0x706D 0x1700 0x0796 0x02DE 0x009C + 0x003E 0x0041 0x0036 0x0041 0x0048 0x0085 0x0088 0x008C + 0x008E 0x008E 0x008E 0x005C 0x005C 0x0152 0x0013 0xFF80 + 0x0000 0x0200 0x049A 0x0680 0x0E4D 0x17E6 0x281A 0x309A + 0x3600 0x39B3 0x3D33 0x474D 0x4F80 0x5466 0x589A 0x5D1A + 0x6400 0x6900 0x000B 0x0022 0x0059 0x01A5 0x041B 0x03EB + 0x04BD 0x03EE 0x0394 0x01EC 0x01E1 0x01D5 0x01CC 0x01CC + 0x01CE 0x02C6 0x02C6 0x00C2 0xE7EC 0x0000 0x0000 0x0000 >; + rt,fg_ocv_table2 = <0x0013 0x4A40 0x5000 0x5796 0x5B50 0x5BE3 0x5CD7 0x5E10 + 0x5FC6 0x60DB 0x619C 0x6292 0x6381 0x6643 0x688B 0x69E8 + 0x6B12 0x6BE2 0x6D20 0x706D 0x1700 0x0796 0x02DE 0x009C + 0x003E 0x0041 0x0036 0x0041 0x0048 0x0085 0x0088 0x008C + 0x008E 0x008E 0x008E 0x005C 0x005C 0x0152 0x0013 0xFF80 + 0x0000 0x0200 0x049A 0x0680 0x0E4D 0x17E6 0x281A 0x309A + 0x3600 0x39B3 0x3D33 0x474D 0x4F80 0x5466 0x589A 0x5D1A + 0x6400 0x6900 0x000B 0x0022 0x0059 0x01A5 0x041B 0x03EB + 0x04BD 0x03EE 0x0394 0x01EC 0x01E1 0x01D5 0x01CC 0x01CC + 0x01CE 0x02C6 0x02C6 0x00C2 0xE7EC 0x0000 0x0000 0x0000 >; + rt,fg_ocv_table3 = <0x0013 0x4A40 0x5000 0x5796 0x5B50 0x5BE3 0x5CD7 0x5E10 + 0x5FC6 0x60DB 0x619C 0x6292 0x6381 0x6643 0x688B 0x69E8 + 0x6B12 0x6BE2 0x6D20 0x706D 0x1700 0x0796 0x02DE 0x009C + 0x003E 0x0041 0x0036 0x0041 0x0048 0x0085 0x0088 0x008C + 0x008E 0x008E 0x008E 0x005C 0x005C 0x0152 0x0013 0xFF80 + 0x0000 0x0200 0x049A 0x0680 0x0E4D 0x17E6 0x281A 0x309A + 0x3600 0x39B3 0x3D33 0x474D 0x4F80 0x5466 0x589A 0x5D1A + 0x6400 0x6900 0x000B 0x0022 0x0059 0x01A5 0x041B 0x03EB + 0x04BD 0x03EE 0x0394 0x01EC 0x01E1 0x01D5 0x01CC 0x01CC + 0x01CE 0x02C6 0x02C6 0x00C2 0xE7EC 0x0000 0x0000 0x0000 >; + rt,fg_ocv_table4 = <0x0013 0x4A40 0x5000 0x5796 0x5B50 0x5BE3 0x5CD7 0x5E10 + 0x5FC6 0x60DB 0x619C 0x6292 0x6381 0x6643 0x688B 0x69E8 + 0x6B12 0x6BE2 0x6D20 0x706D 0x1700 0x0796 0x02DE 0x009C + 0x003E 0x0041 0x0036 0x0041 0x0048 0x0085 0x0088 0x008C + 0x008E 0x008E 0x008E 0x005C 0x005C 0x0152 0x0013 0xFF80 + 0x0000 0x0200 0x049A 0x0680 0x0E4D 0x17E6 0x281A 0x309A + 0x3600 0x39B3 0x3D33 0x474D 0x4F80 0x5466 0x589A 0x5D1A + 0x6400 0x6900 0x000B 0x0022 0x0059 0x01A5 0x041B 0x03EB + 0x04BD 0x03EE 0x0394 0x01EC 0x01E1 0x01D5 0x01CC 0x01CC + 0x01CE 0x02C6 0x02C6 0x00C2 0xE7EC 0x0000 0x0000 0x0000 >; +}; + diff --git a/qcom/discrete_charging.dtsi b/qcom/discrete_charging.dtsi new file mode 100644 index 000000000000..c72da221193f --- /dev/null +++ b/qcom/discrete_charging.dtsi @@ -0,0 +1,334 @@ +/* Copyright (c) 2021, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ +/*&pm6125_vadc { + gpio6_div3{ + reg = ; + label = "gpio3_div3"; + qcom,pre-scaling = <1 3>; + }; +}; + +&pm6125_gpios { + gpio6_adc{ + gpio6_adc_default:gpio6_adc_default{ + pins = "gpio6"; + function = "normal"; + bias-high-impedance; + }; + }; + + indicator_led { + indicator_led_default: indicator_led_default { + pins = "gpio8"; + function = "func1"; + output-low; + }; + }; +}; + +&soc { + indicator_led { + compatible = "qcom,indicator-pwm-led"; + pinctrl-names = "default"; + pinctrl-0 = <&indicator_led_default>; + indicator_led { + label = "charging"; + led-sources = <0>; + pwms = <&pm6125_pwm 0 1000000>; + linux,default-trigger = "timer"; + }; + }; +}; + +&spmi_bus { + qcom,pm6125@1 { + #address-cells = <1>; + qcom,pwms@b300 { + status = "ok"; + }; + }; +};*/ + + +&qupv3_se0_i2c { + status = "okay"; + + wt6670f@35 { + status = "okay"; + compatible = "mediatek,wt6670f_qc3p"; + reg = <0x35>; + wt6670f-reset-gpio = <&tlmm 84 0x0>; + wt6670f-int-gpio = <&tlmm 103 0x0>; + //wt6670f-i2c-scl-pin = <&tlmm 1 0x0>; + //wt6670f-i2c-sda-pin = <&tlmm 0 0x0>; + + /* + pinctrl-names = "default", + "wt6670_i2c_scl_low", "wt6670_i2c_scl_high", + "wt6670_i2c_sda_low", "wt6670_i2c_sda_high", + "wt6670_i2c"; + */ + // pinctrl-0 = <&wt6670_pins_default>; + //pinctrl-1 = <&wt6670_pins_scl_low>; + //pinctrl-2 = <&wt6670_pins_scl_high>; + // pinctrl-3 = <&wt6670_pins_sda_low>; + //pinctrl-4 = <&wt6670_pins_sda_high>; + //pinctrl-5 = <&wt6670_pins_i2c>; + }; +}; + +&qupv3_se1_i2c { + status = "okay"; + + sgm4154x: sgm4154x@3B { + status = "okay"; + compatible = "sgm,sgm41542"; + reg = <0x3B>; + pinctrl-names = "default"; +//add by zhanghuan +// pinctrl-0 = <&gpio6_adc_default>; +// io-channels = <&pm6125_vadc ADC5_GPIO3_DIV3>; +// io-channel-names = "gpio3_div3"; + + interrupt-parent = <&tlmm>; + interrupts = <105 0>; //irq num base on hardware design + sgm,irq-gpio = <&tlmm 105 0>; //irq num base on hardware design + //sgm,chg-en-gpio = <&tlmm 92 0>; //gpio num base on hardware design 1.MTK parent node name is pio 2.QUALCOMM parent node name is tlmm or other +//add by zhanghuan +// dpdm-supply = <&usb2_phy0>; + + /* sw jeita parameter customer defined*/ + enable_sw_jeita; + jeita_temp_above_t4_cv = <0>; + jeita_temp_t3_to_t4_cv = <4100000>; + jeita_temp_t2_to_t3_cv = <4350000>; + jeita_temp_t1_to_t2_cv = <4350000>; + jeita_temp_t0_to_t1_cv = <0>; + jeita_temp_below_t0_cv = <0>; + + jeita_temp_above_t4_cc_current = <0>; + jeita_temp_t3_to_t4_cc_current = <1000000>; + jeita_temp_t2_to_t3_cc_current = <1250000>; + jeita_temp_t1_to_t2_cc_current = <1000000>; + jeita_temp_below_t0_cc_current = <0>; + + temp_t4_thres = <50>; + temp_t4_thres_minus_x_degree = <48>; + temp_t3_thres = <45>; + temp_t3_thres_minus_x_degree = <45>; + temp_t2_thres = <20>; + temp_t2_thres_plus_x_degree = <15>; + temp_t1_thres = <0>; + temp_t1_thres_plus_x_degree = <0>; + temp_t0_thres = <0>; + temp_t0_thres_plus_x_degree = <2>; + temp_neg_10_thres = <0>; + }; + + bq25890@62 { + status = "okay"; + compatible = "ti,bq2589x-1"; + reg = <0x62>; + + pinctrl-names = "default"; + pinctrl-0 = <&bq2589x_irq>; + bq2589x_irq-gpio = <&tlmm 105 0>; + //bq2589x_en-gpio = <&tlmm 92 0>; + dpdm-supply = <&usb2_phy0>; + + ti,bq2589x,vbus-volt-high-level = <8700>;/* tune adapter to output 9v */ + ti,bq2589x,vbus-volt-low-level = <4400>;/* tune adapter to output 5v */ + ti,bq2589x,vbat-min-volt-to-tuneup = <3000>; + ti,bq2589x,charge-voltage = <4350>; + ti,bq2589x,charge-current = <3250>; + ti,bq2589x,term-current = <256>; + ti,bq2589x,enable-auto-dpdm; + ti,bq2589x,enable-termination; + ti,bq2589x,enable-ico; + ti,bq2589x,use-absolute-vindpm; + }; + + + bq2597x-charger@65 { + compatible = "ti,bq25970-charger"; + reg = <0x65>; + //ti,bq2597x,interrupt_gpios = <&pio 30 0>; + //interrupt-parent = <&pio>; + //interrupts = <2 IRQ_TYPE_EDGE_FALLING 2 0>; + //interrupt-names = "bq2597x_irq"; + + //pinctrl-names = "default_slave"; + //pinctrl-0 = <&bq2597x_int_default_slave>; + interrupt-parent = <&tlmm>; + interrupts = <104 0>; //irq num base on hardware design + bq2597x,irq-gpio = <&tlmm 104 0>; //irq num base on hardware design + + ti,bq2597x,bat-ovp-disable = <0>; + ti,bq2597x,bat-ocp_disable = <0>; + ti,bq2597x,bat-ovp-alarm-disable = <0>; + ti,bq2597x,bus-ocp-disable = <0>; + ti,bq2597x,bus-ovp-alarm-disable = <0>; + ti,bq2597x,bus-ocp-alarm-disable = <0>; + ti,bq2597x,bat-ucp-alarm-disable = <0>; + ti,bq2597x,bat-therm-disable = <0>; + ti,bq2597x,bus-therm-disable = <0>; + + ti,bq2597x,bat-ovp-threshold = <4500>; + ti,bq2597x,bat-ovp-alarm-threshold = <4450>; + ti,bq2597x,bat-ocp-threshold = <8000>; + ti,bq2597x,bat-ocp-alarm-threshold = <7500>; + + ti,bq2597x,bus-ovp-threshold = <12000>; + ti,bq2597x,bus-ovp-alarm-threshold = <11000>; + ti,bq2597x,bus-ocp-threshold = <3750>; + ti,bq2597x,bus-ocp-alarm-threshold = <3500>; + + ti,bq2597x,bat-ucp-alarm-threshold = <2000>; + + ti,bq2597x,bat-therm-threshold = <0x15>; + ti,bq2597x,bus-therm-threshold = <0x15>; + ti,bq2597x,die-therm-threshold = <125>; + + ti,bq2597x,ac-ovp-threshold = <17>; + ti,bq2597x,sense-resistor-mohm = <5>; + }; + + cw2217@64 { + compatible = "cellwise,cw2217"; + reg = <0x64>; + status = "okay"; + + df-serialnum = "SB18D33989"; + #include "bat_setting/CW_md50-scud-5000mah.dtsi" + #include "bat_setting/CW_md50-amperex-5000mah.dtsi" + }; + +}; + +&tlmm { + wt6670_pins_default: wt6670_default_mode { + }; + wt6670_pins_scl_low: wt6670_scl_low { + mux { + pins = "gpio1"; + function = "gpio"; + }; + + config { + pins = "gpio1"; + drive-strength = <2>; + bias-pull-down; + }; + }; + wt6670_pins_scl_high: wt6670_scl_high { + mux { + pins = "gpio1"; + function = "gpio"; + }; + + config { + pins = "gpio1"; + drive-strength = <2>; + bias-pull-up; + output-high; + }; + }; + wt6670_pins_sda_low: wt6670_sda_low { + mux { + pins = "gpio0"; + function = "gpio"; + }; + + config { + pins = "gpio0"; + drive-strength = <2>; + bias-pull-down; + }; + }; + wt6670_pins_sda_high: wt6670_sda_high { + mux { + pins = "gpio0"; + function = "gpio"; + }; + + config { + pins = "gpio0"; + drive-strength = <2>; + bias-pull-up; + output-high; + }; + }; +/* + wt6670_pins_i2c: wt6670_i2c_mode { + pins_cmd_dat { + pinmux = , + ; + }; + }; +*/ +}; + + +&tlmm { + bq2589x_irq: bq2589x_irq { + mux { + pins = "gpio12"; + function = "gpio"; + }; + + config { + pins = "gpio12"; + drive-strength = <2>; + bias-disable; + input-enable; + }; + }; +}; + +&soc { + mmi_charger: mmi,charger { + status = "ok"; + compatible = "mmi,mmi-charger"; + mmi,enable-charging-limit; + mmi,upper-limit-capacity = <65>; + mmi,lower-limit-capacity = <60>; + mmi,heartbeat-interval = <100000>; + mmi,dcp-power-max = <10000>; + mmi,hvdcp-power-max = <15000>; + }; + + mmi_discrete_charger: mmi,discrete-charging { + status = "ok"; + compatible = "mmi,mmi-discrete-charger"; + #io-channel-cells = <1>; + battery-names = "battery"; + supplied-from = "mmi_battery"; + + mmi,chrg-iterm-ma = <243>; + mmi,fg-iterm-ma = <500>; + mmi,max-fv-mv = <4450>; + mmi,max-fcc-ma = <4000>; + mmi,demo-fv-mv = <4000>; + mmi,df-serialnum = "SB18D33989"; + mmi,mmi-temp-zones = <0 4200 970 0>, + <10 4200 2500 970>, + <15 0 2500 2500>, + <45 0 4000 4000>, + <60 4200 2500 0>; + mmi,thermal-mitigation = <4000000 3500000 + 3000000 2500000 + 2000000 1500000 + 1200000 900000 + 600000 300000>; + }; +}; + diff --git a/qcom/khaje-rhode-common-overlay.dtsi b/qcom/khaje-rhode-common-overlay.dtsi index b343e38fa780..560f86c5b9cf 100644 --- a/qcom/khaje-rhode-common-overlay.dtsi +++ b/qcom/khaje-rhode-common-overlay.dtsi @@ -15,6 +15,8 @@ #include "khaje-rhode-display.dtsi" #include "khaje-rhode-fps-overlay_evb.dtsi" #include "khaje-rhode-touchscreen-overlay.dtsi" +#include "sgm7220.dtsi" +#include "discrete_charging.dtsi" &firmware { android { diff --git a/qcom/sgm7220.dtsi b/qcom/sgm7220.dtsi new file mode 100644 index 000000000000..51f41da88267 --- /dev/null +++ b/qcom/sgm7220.dtsi @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 motorola Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR tcpcA PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +&qupv3_se0_i2c { + status = "okay"; + sgm7220: sgm7220@47 { + compatible = "sgm,usb_type_c_sgm7220"; + reg = <0x47>; + status = "okay"; + tcpc-dual,supported_modes = <0>; /* 0: dfp/ufp, */ + /* 1: dfp, 2: ufp */ + sgm7220-tcpc,name = "type_c_port0"; /* tcpc_device's name */ + sgm7220-tcpc,role_def = <5>; /* 0: Unknown, 1: SNK, 2: SRC */ + /* 3: DRP, 4: Try.SRC, 5: Try.SNK */ + sgm7220-tcpc,rp_level = <0>; /* 0: Default, 1: 1.5, 2: 3.0 */ + sgm7220-tcpc,vconn_supply = <0>; /* 0: Never, 1: Always, */ + /* 2: EMarkOnly, 3: StartOnly */ + sgm7220,intr_gpio = <&tlmm 33 0x0>; + sgm7220,intr_gpio_num = <33>; + pinctrl-names = "default"; + pinctrl-0 = <&sgm7220_int_n>; + }; +}; + + +&tlmm { + sgm7220_int_n: sgm7220_int_n { + mux { + pins = "gpio33"; + function = "gpio"; + }; + + config { + pins = "gpio33"; + drive-strength = <2>; + bias-pull-up; + }; + }; +}; +