arm/dts: config discrete charging dtsi

config discrete charging dtsi
for cyprus 5G JP and milan

Change-Id: I2433df81559b5a9426b4912eeeb218cdf79c36e4
Signed-off-by: mahj8 <mahj8@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2071095
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Tested-by: Jira Key
Submit-Approved: Jira Key
This commit is contained in:
mahj8 2021-09-21 11:54:12 +08:00 • committed by panyq6
commit ec7abd00c9
3 changed files with 101 additions and 86 deletions

View file

@ -23,6 +23,7 @@
#include "cypfr-touchscreen.dtsi"
#include "camera/blair-camera-sensor-mot-cypfr-overlay.dtsi"
#include "rt9426a.dtsi"
#include "discrete_charging.dtsi"
&wcd937x_codec {
cdc-vdd-rxtx-supply = <&L9A>;

View file

@ -14,6 +14,7 @@
#include "tcpc_config.dtsi"
#include "sgm7220.dtsi"
#include "rt9426a.dtsi"
#include "discrete_charging.dtsi"
&usb0 {
qcom,force-adb-enable;
@ -29,46 +30,6 @@
};
};
&pm6125_vadc {
gpio6_div3{
reg = <ADC5_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;
};
};
};
&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>;
@ -78,49 +39,3 @@
};
};
&qupv3_se8_i2c {
status = "okay";
sgm4154x: sgm4154x@3B {
status = "okay";
compatible = "sgm,sgm41542";
reg = <0x3B>;
pinctrl-names = "default";
pinctrl-0 = <&gpio6_adc_default>;
io-channels = <&pm6125_vadc ADC5_GPIO3_DIV3>;
io-channel-names = "gpio3_div3";
interrupt-parent = <&tlmm>;
interrupts = <12 0>; //irq num base on hardware design
sgm,irq-gpio = <&tlmm 12 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
/* 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>;
};
};

View file

@ -0,0 +1,99 @@
/* 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 = <ADC5_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;
};
};
};
&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";
};
};
};
&qupv3_se8_i2c {
status = "okay";
sgm4154x: sgm4154x@3B {
status = "okay";
compatible = "sgm,sgm41542";
reg = <0x3B>;
pinctrl-names = "default";
pinctrl-0 = <&gpio6_adc_default>;
io-channels = <&pm6125_vadc ADC5_GPIO3_DIV3>;
io-channel-names = "gpio3_div3";
interrupt-parent = <&tlmm>;
interrupts = <12 0>; //irq num base on hardware design
sgm,irq-gpio = <&tlmm 12 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
/* 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>;
};
};