bring up sm5602 fg for battery 1st and 2nd source profile matching. Change-Id: Ib7619ca4d5c0326963efbf62d084fd2a7c300023 Signed-off-by: xieqiong2 <xieqiong2@lenovo.com> Reviewed-on: https://gerrit.mot.com/2179198 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Wang Wang <wangwang1@lenovo.com> Submit-Approved: Jira Key
285 lines
6.4 KiB
Devicetree
285 lines
6.4 KiB
Devicetree
/* 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.
|
|
*/
|
|
#include <dt-bindings/iio/qcom,spmi-vadc.h>
|
|
&pm6125_vadc {
|
|
gpio6_div3{
|
|
reg = <ADC_GPIO3_DIV3>;
|
|
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;
|
|
power-source = <1>;
|
|
};
|
|
};
|
|
};
|
|
|
|
&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"
|
|
qcom,lut-patterns = <0 0 0 14 28 42 56 70 84 100
|
|
100 84 70 56 42 28 14 0 0 0>;
|
|
lpg@1 {
|
|
qcom,lpg-chan-id = <1>;
|
|
qcom,ramp-step-ms = <200>;
|
|
qcom,ramp-low-index = <0>;
|
|
qcom,ramp-high-index = <19>;
|
|
qcom,ramp-pattern-repeat;
|
|
qcom,lpg-sdam-base = <0x48>;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
|
|
&tlmm {
|
|
sgm4154x_gpio_pins: sgm4154x_gpio_pins {
|
|
mux {
|
|
pins = "gpio96";
|
|
function = "gpio";
|
|
};
|
|
|
|
config {
|
|
pins = "gpio96";
|
|
drive-strength = <2>;
|
|
bias-pull-up;
|
|
input-enable;
|
|
};
|
|
};
|
|
};
|
|
|
|
//bq2589x
|
|
&tlmm {
|
|
bq2589x_irq: bq2589x_irq {
|
|
mux {
|
|
pins = "gpio96";
|
|
function = "gpio";
|
|
};
|
|
|
|
config {
|
|
pins = "gpio96";
|
|
drive-strength = <2>;
|
|
bias-pull-up;
|
|
input-enable;
|
|
};
|
|
};
|
|
};
|
|
|
|
&qupv3_se1_i2c {
|
|
status = "okay";
|
|
|
|
sgm4154x: sgm4154x@3B {
|
|
status = "okay";
|
|
compatible = "sgm,sgm41542";
|
|
reg = <0x3B>;
|
|
pinctrl-names = "default";
|
|
pinctrl-0 = <&sgm4154x_gpio_pins &gpio6_adc_default>;
|
|
|
|
io-channels = <&pm6125_vadc ADC_GPIO3_DIV3>;
|
|
io-channel-names = "gpio3_div3";
|
|
|
|
interrupt-parent = <&tlmm>;
|
|
interrupts = <96 0>; //irq num base on hardware design
|
|
sgm,irq-gpio = <&tlmm 96 0>; //irq num base on hardware design
|
|
sgm,chg-en-gpio = <&tlmm 36 0>; //gpio num base on hardware design 1.MTK parent node name is pio 2.QUALCOMM parent node name is tlmm or other
|
|
|
|
dpdm-supply = <&usb2_phy0>;
|
|
mmi,qc3-support;
|
|
|
|
/* 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@6A {
|
|
status = "okay";
|
|
compatible = "ti,bq2589x-1";
|
|
reg = <0x6A>;
|
|
|
|
pinctrl-names = "default";
|
|
//pinctrl-0 = <&bq2589x_irq>;
|
|
pinctrl-0 = <&bq2589x_irq &gpio6_adc_default>;
|
|
io-channels = <&pm6125_vadc ADC_GPIO3_DIV3>;
|
|
io-channel-names = "gpio3_div3";
|
|
|
|
interrupt-parent = <&tlmm>;
|
|
interrupts = <96 0>;
|
|
bq2589x_irq-gpio = <&tlmm 96 0>;
|
|
bq2589x_en-gpio = <&tlmm 36 0>;
|
|
dpdm-supply = <&usb2_phy0>;
|
|
|
|
mmi,qc3-support;
|
|
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 = <4450>;
|
|
ti,bq2589x,charge-current = <3000>;
|
|
ti,bq2589x,term-current = <210>;
|
|
ti,bq2589x,enable-auto-dpdm;
|
|
ti,bq2589x,enable-termination;
|
|
ti,bq2589x,enable-ico;
|
|
ti,bq2589x,use-absolute-vindpm;
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
&qupv3_se0_i2c {
|
|
status = "okay";
|
|
|
|
cw2217@64 {
|
|
compatible = "cellwise,cw2217";
|
|
reg = <0x64>;
|
|
status = "okay";
|
|
|
|
sense_r_mohm = <5>;
|
|
df-serialnum = "SB18D24973";
|
|
#include "bat_setting/CW_nd50-atl-5000mah.dtsi"
|
|
#include "bat_setting/CW_nd50-jiade-5000mah.dtsi"
|
|
};
|
|
|
|
|
|
sm5602@71 {
|
|
compatible = "sm,sm5602";
|
|
reg = <0x71>;
|
|
status = "okay";
|
|
//interrupt-parent = <&tlmm>;
|
|
//interrupts = <105 2>;
|
|
//qcom,irq-gpio = <&tlmm 105 0x0>;
|
|
|
|
sm,en_temp_ex;
|
|
//sm,en_temp_in;
|
|
sm,en_batt_det;
|
|
//sm,iocv_man_mode;
|
|
sm,misc = <0x0800>;
|
|
sm,aging_ctrl = <0x0125>;
|
|
sm,cycle_cfg = <0x7000>;
|
|
sm,rsns = <0>;
|
|
sm,fg_irq_set = <0x07FF>;
|
|
sm,low_soc1 = <1>;
|
|
sm,low_soc2 = <15>;
|
|
sm,v_l_alarm = <3400>;
|
|
sm,v_h_alarm = <4450>;
|
|
sm,battery_table_num = <0>;
|
|
sm,param_version = <2>;
|
|
sm,t_l_alarm_in = <54>;
|
|
sm,t_h_alarm_in = <1>;
|
|
sm,t_l_alarm_ex = <0xD3D8>;
|
|
sm,t_h_alarm_ex = <0x9245>;
|
|
df-serialnum = "SB18D24973";
|
|
#include "bat_setting/SM5602_nd50-atl-5000mah.dtsi"
|
|
#include "bat_setting/SM5602_nd50-jiade-5000mah.dtsi"
|
|
};
|
|
};
|
|
|
|
|
|
|
|
&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 = <18000>;
|
|
};
|
|
|
|
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,otg-cl-ua = <1200000>;
|
|
mmi,df-serialnum = "SB18D24973";
|
|
mmi,mmi-temp-zones = <0 4200 1000 0>,
|
|
<10 4250 2500 1000>,
|
|
<15 0 2500 2500>,
|
|
<45 0 4000 4000>,
|
|
<60 4200 4000 0>;
|
|
mmi,thermal-mitigation = <3500000 3000000
|
|
2800000 2500000
|
|
2000000 1500000
|
|
1200000 900000
|
|
600000 300000>;
|
|
};
|
|
};
|
|
|
|
/*
|
|
&usb0 {
|
|
extcon = <&eud>,<&mmi_discrete_charger>;
|
|
};
|
|
*/
|