From ec7abd00c90655280ea9daade787087345afe879 Mon Sep 17 00:00:00 2001 From: mahj8 Date: Tue, 21 Sep 2021 11:54:12 +0800 Subject: [PATCH] arm/dts: config discrete charging dtsi config discrete charging dtsi for cyprus 5G JP and milan Change-Id: I2433df81559b5a9426b4912eeeb218cdf79c36e4 Signed-off-by: mahj8 Reviewed-on: https://gerrit.mot.com/2071095 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Reviewed-by: Huosheng Liao Tested-by: Jira Key Submit-Approved: Jira Key --- qcom/blair-cypfr-common-overlay.dtsi | 1 + qcom/blair-nopmi-milanf-common-overlay.dtsi | 87 +----------------- qcom/discrete_charging.dtsi | 99 +++++++++++++++++++++ 3 files changed, 101 insertions(+), 86 deletions(-) create mode 100644 qcom/discrete_charging.dtsi diff --git a/qcom/blair-cypfr-common-overlay.dtsi b/qcom/blair-cypfr-common-overlay.dtsi index 12a81e7f3867..62806fe0e1cd 100644 --- a/qcom/blair-cypfr-common-overlay.dtsi +++ b/qcom/blair-cypfr-common-overlay.dtsi @@ -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>; diff --git a/qcom/blair-nopmi-milanf-common-overlay.dtsi b/qcom/blair-nopmi-milanf-common-overlay.dtsi index 5d872a938472..b7f775f0432d 100644 --- a/qcom/blair-nopmi-milanf-common-overlay.dtsi +++ b/qcom/blair-nopmi-milanf-common-overlay.dtsi @@ -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 = ; - 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>; - }; -}; diff --git a/qcom/discrete_charging.dtsi b/qcom/discrete_charging.dtsi new file mode 100644 index 000000000000..a1c81a1c6214 --- /dev/null +++ b/qcom/discrete_charging.dtsi @@ -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 = ; + 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>; + }; +};