Add support for Xiaomi 13 Lite/Civi 2 (ziyi|L9S)

Change-Id: Id86bea1147240ebddb2da5fe71166d4e71f46000
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
This commit is contained in:
Jens Reidel
2024-04-02 10:09:14 +02:00
committed by Arian
parent b4fba0b192
commit 764b3e40dd
6 changed files with 1305 additions and 1 deletions

View File

@@ -250,7 +250,8 @@ dtbo-$(CONFIG_ARCH_DIWALI) += diwali-rumi-overlay.dtbo \
diwali-idp-hsp-overlay.dtbo \
diwali-idp-nopmi-overlay.dtbo \
diwali-qrd-nopmi-overlay.dtbo \
diwali-qrd-pm8350b-overlay.dtbo
diwali-qrd-pm8350b-overlay.dtbo \
ziyi-sm7450-overlay.dtbo
diwali-rumi-overlay.dtbo-base := diwali.dtb
diwali-idp-overlay.dtbo-base := diwali.dtb diwalip.dtb diwali-lte.dtb
@@ -262,6 +263,7 @@ diwali-idp-hsp-overlay.dtbo-base := diwali-hsp.dtb diwalip.dtb diwali-lte.dtb
diwali-idp-nopmi-overlay.dtbo-base := diwali.dtb diwalip.dtb diwali-lte.dtb
diwali-qrd-nopmi-overlay.dtbo-base := diwali.dtb diwalip.dtb diwali-lte.dtb
diwali-qrd-pm8350b-overlay.dtbo-base := diwali.dtb diwalip.dtb diwali-lte.dtb
ziyi-sm7450-overlay.dtbo-base := diwali.dtb diwalip.dtb diwali-lte.dtb
else
dtb-$(CONFIG_ARCH_DIWALI) += diwali-rumi.dtb \
diwali-idp.dtb \

422
qcom/l9ds_charger.dtsi Executable file
View File

@@ -0,0 +1,422 @@
#include <dt-bindings/iio/qti_power_supply_iio.h>
#include "ln8000.dtsi"
#include "tcpc_config.dtsi"
&tlmm {
bq25890_int_default: bq25890_int_default {
mux {
pins = "gpio19";
function = "gpio";
};
config {
pins = "gpio19";
drive-strength = <2>; /* 2 mA */
bias-pull-up; /* PULL DOWN */
};
};
bq25890_otg_default: bq25890_otg_default {
mux {
pins = "gpio63";
function = "gpio";
};
config {
pins = "gpio63";
drive-strength = <16>; /* 16 mA */
slew-rate = <1>;
bias-disable;
output-low;
};
};
vbus_ntc_ctrl: vbus_ntc_ctrl {
mux {
pins = "gpio27";
function = "gpio";
};
config {
pins = "gpio27";
drive-strength = <16>; /* 16 mA */
slew-rate = <1>;
bias-disable;
output-low;
};
};
};
&usb2_phy0 {
qcom,param-override-seq =
<0x07 0x6c
0x0D 0x70
0x26 0x74>;
};
&qupv3_se4_i2c {
status = "ok";
#address-cells = <1>;
#size-cells = <0>;
bq25890_main: bq25890@6A {
#io-channel-cells = <1>;
compatible = "ti,bq2589x-charger";
reg = <0x6A>;
interrupt-parent = <&tlmm>;
interrupts = <19 0>;
pinctrl-names = "default";
pinctrl-0 = <&bq25890_int_default &bq25890_otg_default>;
intr-gpio = <&tlmm 19 0>;
otg-gpio = <&tlmm 63 0>;
//usb-switch1 = <&tlmm 24 0>;
//usb-switch2 = <&tlmm 101 0>;
ti,bq2589x,charge-voltage = <4610>;
ti,bq2589x,charge-current = <500>;
ti,bq2589x,term-current = <256>;
//ti,bq2589x,enable-auto-dpdm;
ti,bq2589x,enable-termination;
ti,bq2589x,use-absolute-vindpm;
ti,bq2589x,otg_vol = <5300>;
ti,bq2589x,otg_current = <1800>;
/* usb */
dpdm-supply = <&usb2_phy0>;
};
};
&qupv3_se12_i2c {
status = "ok";
#address-cells = <1>;
#size-cells = <0>;
bq27z561_fg: bq27z561@55 {
#io-channel-cells = <1>;
compatible = "ti,bq27z561";
reg = <0x55>;
bq,shutdown-delay-enable;
bq,soc_decimal_rate = <
0 32
10 30
20 28
30 28
40 28
50 28
60 28
70 28
80 28
90 26
95 10
99 5>;
};
};
&soc {
xm_pd_mngr {
status = "ok";
#io-channel-cells = <1>;
compatible = "xiaomi,pd_cp_manager";
mi,pd-bat-volt-max = <4530>;
mi,pd-bat-curr-max = <12400>;
mi,pd-bus-volt-max = <12000>;
mi,pd-bus-curr-max = <6200>;
mi,pd-non-ffc-bat-volt-max = <4480>;
mi,pd-bus-curr-compensate = <0>;
mi,step-charge-high-vol-curr-max = <4400>;
mi,cell-vol-high-threshold-mv = <4530>;
mi,cell-vol-max-threshold-mv = <4530>;
mi,pd-battery-warm-th = <480>;
mi,cp-sec-enable;
mi,pd-power-max = <67>; /*charge power max : 67W */
mi,therm-level-threshold = <13>;
};
rt17xx_pd: xm_pd_adapter {
status = "ok";
#io-channel-cells = <1>;
compatible = "xiaomi,pd_adapter";
adapter_name = "pd_adapter";
};
xm_battmngr {
status = "ok";
#io-channel-cells = <1>;
compatible = "xiaomi,battmngr";
pinctrl-names = "default";
pinctrl-0 = <&vbus_ntc_ctrl>;
vbus_ctrl_gpio = <&tlmm 27 0>;
/* charger */
xm,fv-max-uv = <4610000>;
xm,fcc-max-ua = <12300000>;
xm,fv-max-design-uv = <11000000>;
xm,icl-max-ua = <6200000>;
xm,step-chg-enable = <1>;
xm,sw-jeita-enable = <1>;
xm,ffc_ieoc_l = <1024000>;
xm,ffc_ieoc_h = <1024000>;
xm,non_ffc_ieoc = <256000>;
xm,non_ffc_cv = <4480000>;
xm,non_ffc_cc = <6000000>;
/* battery */
/* stepchg_jeita */
xm,taper-fcc;
xm,step-chg-normal-ranges = <3000000 4250000 12300000
4251000 4300000 7850000
4301000 4480000 6550000
4481000 4530000 5230000>;
xm,step-chg-high-ranges = <3000000 4200000 12300000
4201000 4250000 7850000
4251000 4480000 6550000
4481000 4530000 5230000>;
xm,cold-step-chg-ranges = <3000000 4200000 950000
4201000 4480000 639000>;
xm,jeita-fcc-ranges = <(-100) 0 950000
1 50 2100000
51 100 3000000
101 150 5230000
151 479 12300000
480 580 2100000>;
xm,jeita-fv-ranges = <(-100) 0 4480000
1 50 4480000
51 100 4480000
101 150 4480000
151 479 4610000
480 580 4480000>;
xm,step-jeita-hysteresis = <20 20>;
xm,jeita-too-hot = <580>;
xm,jeita-too-cold = <(-100)>;
/* thermal */
xm,thermal-mitigation-icl
= <2800000 2700000 2600000 2400000 2200000 2100000 2000000
1800000 1600000 1500000 1400000 1300000 1200000 1100000
950000 750000>;
xm,thermal-mitigation
= <3000000 2800000 2600000 2400000 2200000 2100000 2000000
1800000 1600000 1500000 1400000 1200000 1000000 900000
800000 500000>;
xm,thermal-mitigation-dcp
= <1500000 1500000 1500000 1500000 1500000 1500000 1500000
1500000 1500000 1500000 1500000 1400000 1200000 1100000
1100000 1000000>;
xm,thermal-mitigation-qc2
= <1500000 1500000 1500000 1500000 1450000 1400000 1350000
1300000 1150000 1100000 1000000 900000 850000 750000
650000 500000>;
xm,thermal-mitigation-pd
= <3000000 2800000 2600000 2400000 2200000 2000000 1800000
1600000 1600000 1400000 1200000 1100000 1050000 1000000
950000 500000>;
xm,thermal-mitigation-pd-cp
= <12300000 9900000 8700000 7900000 6500000 5900000 5450000
4950000 3950000 2970000 2570000 2110000 1880000 1480000
490000 290000>;
/* iio */
io-channels = <&ln8000_master PSY_IIO_SC_PRESENT>,
<&ln8000_master PSY_IIO_SC_CHARGING_ENABLED>,
<&ln8000_master PSY_IIO_SC_STATUS>,
<&ln8000_master PSY_IIO_SC_BATTERY_PRESENT>,
<&ln8000_master PSY_IIO_SC_VBUS_PRESENT>,
<&ln8000_master PSY_IIO_SC_BATTERY_VOLTAGE>,
<&ln8000_master PSY_IIO_SC_BATTERY_CURRENT>,
<&ln8000_master PSY_IIO_SC_BATTERY_TEMPERATURE>,
<&ln8000_master PSY_IIO_SC_BUS_VOLTAGE>,
<&ln8000_master PSY_IIO_SC_BUS_CURRENT>,
<&ln8000_master PSY_IIO_SC_BUS_TEMPERATURE>,
<&ln8000_master PSY_IIO_SC_DIE_TEMPERATURE>,
<&ln8000_master PSY_IIO_SC_ALARM_STATUS>,
<&ln8000_master PSY_IIO_SC_FAULT_STATUS>,
<&ln8000_master PSY_IIO_SC_VBUS_ERROR_STATUS>,
<&ln8000_master PSY_IIO_SC_REG_STATUS>,
<&ln8000_slave PSY_IIO_SC_PRESENT>,
<&ln8000_slave PSY_IIO_SC_CHARGING_ENABLED>,
<&ln8000_slave PSY_IIO_SC_STATUS>,
<&ln8000_slave PSY_IIO_SC_BATTERY_PRESENT>,
<&ln8000_slave PSY_IIO_SC_VBUS_PRESENT>,
<&ln8000_slave PSY_IIO_SC_BATTERY_VOLTAGE>,
<&ln8000_slave PSY_IIO_SC_BATTERY_CURRENT>,
<&ln8000_slave PSY_IIO_SC_BATTERY_TEMPERATURE>,
<&ln8000_slave PSY_IIO_SC_BUS_VOLTAGE>,
<&ln8000_slave PSY_IIO_SC_BUS_CURRENT>,
<&ln8000_slave PSY_IIO_SC_BUS_TEMPERATURE>,
<&ln8000_slave PSY_IIO_SC_DIE_TEMPERATURE>,
<&ln8000_slave PSY_IIO_SC_ALARM_STATUS>,
<&ln8000_slave PSY_IIO_SC_FAULT_STATUS>,
<&ln8000_slave PSY_IIO_SC_VBUS_ERROR_STATUS>,
<&ln8000_slave PSY_IIO_SC_REG_STATUS>,
<&bq25890_main PSY_IIO_SYV_CHARGE_PRESENT>,
<&bq25890_main PSY_IIO_SYV_CHARGE_ONLINE>,
<&bq25890_main PSY_IIO_SYV_CHARGE_DONE>,
<&bq25890_main PSY_IIO_SYV_CHAGER_HZ>,
<&bq25890_main PSY_IIO_SYV_INPUT_CURRENT_SETTLED>,
<&bq25890_main PSY_IIO_SYV_INPUT_VOLTAGE_SETTLED>,
<&bq25890_main PSY_IIO_SYV_CHAGER_CURRENT>,
<&bq25890_main PSY_IIO_SYV_CHARGING_ENABLED>,
<&bq25890_main PSY_IIO_SYV_OTG_ENABLE>,
<&bq25890_main PSY_IIO_SYV_CHAGER_TERM>,
<&bq25890_main PSY_IIO_SYV_BATTERY_VOLTAGE_TERM>,
<&bq25890_main PSY_IIO_SYV_CHARGER_STATUS>,
<&bq25890_main PSY_IIO_SYV_CHARGE_TYPE>,
<&bq25890_main PSY_IIO_SYV_CHARGE_USB_TYPE>,
<&bq25890_main PSY_IIO_SYV_BUS_VOLTAGE>,
<&bq25890_main PSY_IIO_SYV_BATTERY_VOLTAGE>,
<&bq25890_main PSY_IIO_SYV_ENABLE_CHAGER_TERM>,
<&bq27z561_fg PSY_IIO_BQFG_PRESENT>,
<&bq27z561_fg PSY_IIO_BQFG_STATUS>,
<&bq27z561_fg PSY_IIO_BQFG_VOLTAGE_NOW>,
<&bq27z561_fg PSY_IIO_BQFG_VOLTAGE_MAX>,
<&bq27z561_fg PSY_IIO_BQFG_CURRENT_NOW>,
<&bq27z561_fg PSY_IIO_BQFG_CAPACITY>,
<&bq27z561_fg PSY_IIO_BQFG_CAPACITY_LEVEL>,
<&bq27z561_fg PSY_IIO_BQFG_TEMP>,
<&bq27z561_fg PSY_IIO_BQFG_CHARGE_FULL>,
<&bq27z561_fg PSY_IIO_BQFG_CHARGE_FULL_DESIGN>,
<&bq27z561_fg PSY_IIO_BQFG_CYCLE_COUNT>,
<&bq27z561_fg PSY_IIO_BQFG_TIME_TO_EMPTY_NOW>,
<&bq27z561_fg PSY_IIO_BQFG_TIME_TO_FULL_NOW>,
<&bq27z561_fg PSY_IIO_BQFG_UPDATE_NOW>,
<&bq27z561_fg PSY_IIO_BQFG_THERM_CURR>,
<&bq27z561_fg PSY_IIO_BQFG_CHIP_OK>,
<&bq27z561_fg PSY_IIO_BQFG_BATTERY_AUTH>,
<&bq27z561_fg PSY_IIO_BQFG_SOC_DECIMAL>,
<&bq27z561_fg PSY_IIO_BQFG_SOC_DECIMAL_RATE>,
<&bq27z561_fg PSY_IIO_BQFG_SOH>,
<&bq27z561_fg PSY_IIO_BQFG_RSOC>,
<&bq27z561_fg PSY_IIO_BQFG_BATTERY_ID>,
<&bq27z561_fg PSY_IIO_BQFG_RESISTANCE_ID>,
<&bq27z561_fg PSY_IIO_BQFG_SHUTDOWN_DELAY>,
<&bq27z561_fg PSY_IIO_BQFG_FASTCHARGE_MODE>,
<&bq27z561_fg PSY_IIO_BQFG_TEMP_MAX>,
<&bq27z561_fg PSY_IIO_BQFG_TIME_OT>,
<&bq27z561_fg PSY_IIO_BQFG_REG_RSOC>,
<&bq27z561_fg PSY_IIO_BQFG_RM>,
<&rt17xx_pd PSY_IIO_RT_PD_ACTIVE>,
<&rt17xx_pd PSY_IIO_RT_PD_CURRENT_MAX>,
<&rt17xx_pd PSY_IIO_RT_PD_VOLTAGE_MIN>,
<&rt17xx_pd PSY_IIO_RT_PD_VOLTAGE_MAX>,
<&rt17xx_pd PSY_IIO_RT_PD_IN_HARD_RESET>,
<&rt17xx_pd PSY_IIO_RT_TYPEC_CC_ORIENTATION>,
<&rt17xx_pd PSY_IIO_RT_TYPEC_MODE>,
<&rt17xx_pd PSY_IIO_RT_PD_USB_SUSPEND_SUPPORTED>,
<&rt17xx_pd PSY_IIO_RT_PD_APDO_VOLT_MAX>,
<&rt17xx_pd PSY_IIO_RT_PD_APDO_CURR_MAX>,
<&rt17xx_pd PSY_IIO_RT_PD_USB_REAL_TYPE>,
<&rt17xx_pd PSY_IIO_RT_TYPEC_ACCESSORY_MODE>,
<&rt17xx_pd PSY_IIO_RT_TYPEC_ADAPTER_ID>,
<&pmk8350_vadc PMK8350_ADC7_AMUX_THM2_100K_PU>,
<&pmk8350_vadc PMK8350_ADC7_AMUX_THM3_100K_PU>;
io-channel-names = "ln_present",
"ln_charging_enabled",
"ln_status",
"ln_battery_present",
"ln_vbus_present",
"ln_battery_voltage",
"ln_battery_current",
"ln_battery_temperature",
"ln_bus_voltage",
"ln_bus_current",
"ln_bus_temperature",
"ln_die_temperature",
"ln_alarm_status",
"ln_fault_status",
"ln_vbus_error_status",
"ln_reg_status",
"ln_present_slave",
"ln_charging_enabled_slave",
"ln_status_slave",
"ln_battery_present_slave",
"ln_vbus_present_slave",
"ln_battery_voltage_slave",
"ln_battery_current_slave",
"ln_battery_temperature_slave",
"ln_bus_voltage_slave",
"ln_bus_current_slave",
"ln_bus_temperature_slave",
"ln_die_temperature_slave",
"ln_alarm_status_slave",
"ln_fault_status_slave",
"ln_vbus_error_status_slave",
"ln_reg_status_slave",
"syv_charge_present",
"syv_charge_online",
"syv_charge_done",
"syv_chager_hz",
"syv_input_current_settled",
"syv_input_voltage_settled",
"syv_charge_current",
"syv_charger_enable",
"syv_otg_enable",
"syv_charger_term",
"syv_batt_voltage_term",
"syv_charger_status",
"syv_charger_type",
"syv_charger_usb_type",
"syv_vbus_voltage",
"syv_vbat_voltage",
"syv_enable_charger_term",
"bqfg_present",
"bqfg_status",
"bqfg_voltage_now",
"bqfg_voltage_max",
"bqfg_current_now",
"bqfg_capacity",
"bqfg_capacity_level",
"bqfg_temp",
"bqfg_charge_full",
"bqfg_charge_full_design",
"bqfg_cycle_count",
"bqfg_time_to_empty_now",
"bqfg_time_to_full_now",
"bqfg_update_now",
"bqfg_therm_curr",
"bqfg_chip_ok",
"bqfg_battery_auth",
"bqfg_soc_decimal",
"bqfg_soc_decimal_rate",
"bqfg_soh",
"bqfg_rsoc",
"bqfg_battery_id",
"bqfg_resistance_id",
"bqfg_shutdown_delay",
"bqfg_fastcharge_mode",
"bqfg_temp_max",
"bqfg_time_ot",
"bqfg_reg_rsoc",
"bqfg_rm",
"rt_pd_active",
"rt_pd_current_max",
"rt_pd_voltage_min",
"rt_pd_voltage_max",
"rt_pd_in_hard_reset",
"rt_typec_cc_orientation",
"rt_typec_mode",
"rt_pd_usb_suspend_supported",
"rt_pd_apdo_volt_max",
"rt_pd_apdo_curr_max",
"rt_pd_usb_real_type",
"rt_typec_accessory_mode",
"rt_typec_adapter_id",
"chg_pump_therm",
"typec_conn_therm";
};
};

91
qcom/ln8000.dtsi Normal file
View File

@@ -0,0 +1,91 @@
&tlmm {
ln8000_int_default: ln8000_int_default {
mux {
pins = "gpio122";
function = "gpio";
};
config {
pins = "gpio122";
drive-strength = <2>; /* 2 mA */
bias-pull-up; /* PULL DOWN */
};
};
ln8000_int2_default: ln8000_int2_default {
mux {
pins = "gpio125";
function = "gpio";
};
config {
pins = "gpio125";
drive-strength = <2>; /* 2 mA */
bias-pull-up; /* PULL DOWN */
};
};
};
&qupv3_se4_i2c {
status = "ok";
#address-cells = <1>;
#size-cells = <0>;
ln8000_master: ln8000-charger@51 {
#io-channel-cells = <1>;
compatible = "lionsemi,ln8000-master";
reg = <0x51>;
interrupt-parent = <&tlmm>;
interrupts = <122 0>;
pinctrl-names = "default";
pinctrl-0 = <&ln8000_int_default>;
ln8000_charger,bat-ovp-threshold = <4710>;
ln8000_charger,bat-ovp-alarm-threshold = <4675>;
ln8000_charger,bus-ovp-threshold = <12800>;
ln8000_charger,bus-ovp-alarm-threshold = <11000>;
ln8000_charger,bus-ocp-threshold = <3750>;
ln8000_charger,bus-ocp-alarm-threshold = <3500>;
ln8000_charger,ntc-alarm-cfg = <226>;
ln8000_charger,tdie-prot-disable;
ln8000_charger,tbus-mon-disable;
ln8000_charger,tbat-mon-disable;
ln8000_charger,iin-ocp-disable;
ln8000_charger,iin-reg-disable;
ln8000_charger,tdie-reg-disable;
ln8000_charger,vbat-reg-disable;
ln8000_charger,revcurr-prot-disable;
};
};
&qupv3_se12_i2c {
status = "ok";
#address-cells = <1>;
#size-cells = <0>;
ln8000_slave: ln8000-charger@51 {
#io-channel-cells = <1>;
compatible = "lionsemi,ln8000-slave";
reg = <0x51>;
interrupt-parent = <&tlmm>;
interrupts = <125 0>;
pinctrl-names = "default";
inctrl-0 = <&ln8000_int2_default>;
ln8000_charger,bat-ovp-threshold = <4710>;
ln8000_charger,bat-ovp-alarm-threshold = <4675>;
ln8000_charger,bus-ovp-threshold = <12800>;
ln8000_charger,bus-ovp-alarm-threshold = <11000>;
ln8000_charger,bus-ocp-threshold = <3750>;
ln8000_charger,bus-ocp-alarm-threshold = <3500>;
ln8000_charger,ntc-alarm-cfg = <226>;
ln8000_charger,tdie-prot-disable;
ln8000_charger,tbus-mon-disable;
ln8000_charger,tbat-mon-disable;
ln8000_charger,iin-ocp-disable;
ln8000_charger,iin-reg-disable;
ln8000_charger,tdie-reg-disable;
ln8000_charger,vbat-reg-disable;
ln8000_charger,revcurr-prot-disable;
};
};

197
qcom/tcpc_config.dtsi Normal file
View File

@@ -0,0 +1,197 @@
/*
* Copyright (c) 2020 Richtek 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 the
* GNU General Public License for more details.
*/
&tlmm {
rt1711h_int_n: rt1711h_int_n {
mux {
pins = "gpio81";
function = "gpio";
};
config {
pins = "gpio81";
drive-strength = <2>;
bias-pull-up;
};
};
};
&qupv3_se4_i2c {
status = "ok";
#address-cells = <1>;
#size-cells = <0>;
rt1711h@4e {
#io-channel-cells = <1>;
compatible = "richtek,rt1711h";
reg = <0x4e>;
tcpc-dual,supported_modes = <0>; /* 0: dfp/ufp, */
/* 1: dfp, 2: ufp */
rt-tcpc,name = "type_c_port0"; /* tcpc_device's name */
rt-tcpc,role_def = <5>; /* 0: Unknown, 1: SNK Only, 2: SRC Only*/
/* 3: DRP, 4: Try.SRC, 5: Try.SNK */
rt-tcpc,rp_level = <1>; /* 0: Default, 1: 1.5, 2: 3.0 */
rt-tcpc,vconn_supply = <1>; /* 0: Never, 1: Always, */
/* 2: EMarkOnly, 3: StartOnly */
rt1711pd,intr_gpio = <&tlmm 81 0x0>;
rt1711pd,intr_gpio_num = <81>;
pinctrl-names = "default";
pinctrl-0 = <&rt1711h_int_n>;
pd-data {
pd,vid = <0x29cf>;
pd,pid = <0x1711>;
pd,source-cap-ext = <0x171129cf 0x00000000 0x00000000
0x00000000 0x00000000 0x02000000>;
pd,mfrs = "RichtekTCPC";
/*
* VSAFE5V = 0, MAX_POWER = 1, CUSTOM = 2,
* MAX_POWER_LV = 0x21, MAX_POWER_LVIC = 0x31
* MAX_POWER_HV = 0x41, MAX_POWER_HVIC = 0x51
*/
pd,charging_policy= <0x31>;
/*
* Fixed 5V, 500 mA <0x00019032>
* Fixed 5V, 1A <0x00019064>
* Fixed 5V, 2A <0x000190c8>
* Fixed 5V, 3A <0x0001912c>
* Fixed 9V, 500 mA <0x0002d032>
* Fixed 9V, 1A <0x0002d064>
* Fixed 9V, 2A <0x0002d0c8>
* Fixed 9V, 3A <0x0002d12c>
* Variable 5-9V, 1A <0x8642d064>
* Variable 5-9V, 2A <0x8642d0c8>
* Variable 5-9V, 3A <0x8642d12c>
* PPS 3V~5.9V, 3A <0xC0761E3C>
*/
pd,source-pdo-size = <1>;
pd,source-pdo-data = <0x00019096>;
pd,sink-pdo-size = <1>;
pd,sink-pdo-data = <0x0001912c>;
/*
* No DP, host + device
* pd,id-vdo-size = <6>;
* pd,id-vdo-data = <0xd14029cf 0x0 0x17110000
0x41800000 0x0 0x21800000>;
* With DP
* pd,id-vdo-size = <6>;
* pd,id-vdo-data = <0xd54029cf 0x0 0x17110000
0x41800000 0x0 0x21800000>;
*/
pd,id-vdo-size = <6>;
pd,id-vdo-data = <0xd14029cf 0x0 0x17110000
0x41800000 0x0 0x21800000>;
bat,nr = <1>;
pd,country_nr = <0>;
bat-info0 {
bat,vid = <0x29cf>;
bat,pid = <0x1711>;
bat,mfrs = "bat1";
bat,design_cap = <3000>;
};
//bat-info1 {
// bat,vid = <0x8abc>;
// bat,pid = <0x5234>;
// bat,mfrs = "bat2";
// bat,design_cap = <4000>;
//};
//country0 {
// pd,country_code = <0x5457>;
// pd,country_len = <2>; /* max len = 26 */
// pd,country_data = <0xff 0xff>;
//};
//country1 {
// pd,country_code = <0x5553>;
// pd,country_len = <3>; /* max len = 26 */
// pd,country_data = <0xf1 0xf2 0xf3>;
//};
};
dpm_caps {
local_dr_power;
local_dr_data;
//local_ext_power;
local_usb_comm;
//local_usb_suspend;
//local_high_cap;
//local_give_back;
local_no_suspend;
local_vconn_supply;
//attemp_discover_cable_dfp;
attemp_enter_dp_mode;
attemp_discover_cable;
attemp_discover_id;
/* 0: disable, 1: prefer_snk, 2: prefer_src */
pr_check = <0>;
//pr_reject_as_source;
//pr_reject_as_sink;
//pr_check_gp_source;
//pr_check_gp_sink;
/* 0: disable, 1: prefer_ufp, 2: prefer_dfp */
dr_check = <0>;
//dr_reject_as_dfp;
//dr_reject_as_ufp;
};
displayport {
/* connection type = "both", "ufp_d", "dfp_d" */
1st_connection = "dfp_d";
2nd_connection = "dfp_d";
signal,dp_v13;
//signal,dp_gen2;
//usbr20_not_used;
typec,receptacle;
ufp_d {
//pin_assignment,mode_a;
//pin_assignment,mode_b;
//pin_assignment,mode_c;
//pin_assignment,mode_d;
//pin_assignment,mode_e;
};
dfp_d {
//pin_assignment,mode_a;
//pin_assignment,mode_b;
pin_assignment,mode_c;
pin_assignment,mode_d;
pin_assignment,mode_e;
//pin_assignment,mode_f;
};
};
};
};
&soc {
rpm: rt-pd-manager {
#io-channel-cells = <1>;
compatible = "richtek,rt-pd-manager";
};
};
&usb0 {
usb-role-switch;
extcon = <&rpm>;
dwc3@a600000 {
usb-role-switch;
dr_mode = "otg";
};
};

View File

@@ -0,0 +1,16 @@
/dts-v1/;
/plugin/;
#include "diwali-idp.dtsi"
#include "ziyi-sm7450.dtsi"
#include "l9ds_charger.dtsi"
/ {
model = "Ziyi based on Qualcomm Technologies, Inc. Diwali IDP";
compatible = "qcom,diwali-idp", "qcom,diwali", "qcom,idp";
qcom,msm-id = <506 0x10000>, <547 0x10000>, <564 0x10000>;
qcom,board-id = <34 0>;
xiaomi,miboard-id = <0x9 0>;
qcom,pmic-id-size = <9>;
qcom,pmic-id = <0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x2E>;
};

576
qcom/ziyi-sm7450.dtsi Executable file
View File

@@ -0,0 +1,576 @@
#include "xiaomi-sm7450-common.dtsi"
&icnss2 {
wlan-en-gpio = <25>;
};
//disable PMK7450 GPIO_1_2_3 to fix the temp value inaccurate
&pmk8350_gpios {
pmk8350_sc8551_therm {
pmk8350_sc8551_therm_default: pmk8350_sc8551_therm_default {
pins = "gpio1";
bias-high-impedance;
};
};
pmk8350_conn_therm {
pmk8350_conn_therm_default: pmk8350_conn_therm_default {
pins = "gpio2";
bias-high-impedance;
};
};
pmk8350_led_l_therm {
pmk8350_led_l_therm_default: pmk8350_led_l_therm_default {
pins = "gpio3";
bias-high-impedance;
};
};
};
&pmk8350_vadc {
pinctrl-names = "default";
//disable PMK7450 GPIO_1_2_3 to fix the temp value inaccurate
pinctrl-0 = <
&pmk8350_sc8551_therm_default
&pmk8350_conn_therm_default
&pmk8350_led_l_therm_default>;
pm7325_quiet_therm {
reg = <PM7325_ADC7_AMUX_THM1_100K_PU>;
label = "pm7325_quiet_therm";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
pm7325_cam_flash_therm {
reg = <PM7325_ADC7_AMUX_THM2_100K_PU>;
label = "pm7325_cam_flash_therm";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
pm7325_skin_msm_therm {
reg = <PM7325_ADC7_AMUX_THM3_100K_PU>;
label = "pm7325_skin_msm_therm";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
pm7325_wide_rfc_therm {
reg = <PM7325_ADC7_AMUX_THM4_100K_PU>;
label = "pm7325_wide_rfc_therm";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
pm7325_4g_pa_therm {
reg = <PM7325_ADC7_AMUX_THM5_100K_PU>;
label = "pm7325_4g_pa_therm";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
pm7325_5g_pa_therm {
reg = <PM7325_ADC7_GPIO3_100K_PU>;
label = "pm7325_5g_pa_therm";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
pmk8350_xo_therm {
reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
label = "pmk8350_xo_therm";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
pmk8350_sc8551_therm {
reg = <PMK8350_ADC7_AMUX_THM2_100K_PU>;
label = "pmk8350_sc8551_therm";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
pmk8350_conn_therm {
reg = <PMK8350_ADC7_AMUX_THM3_100K_PU>;
label = "pmk8350_conn_therm";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
pmk8350_led_l_therm {
reg = <PMK8350_ADC7_AMUX_THM4_100K_PU>;
label = "pmk8350_led_l_therm";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
};
&pmk8350_adc_tm {
io-channels = <&pmk8350_vadc PM7325_ADC7_AMUX_THM1_100K_PU>,
<&pmk8350_vadc PM7325_ADC7_AMUX_THM2_100K_PU>,
<&pmk8350_vadc PM7325_ADC7_AMUX_THM3_100K_PU>,
<&pmk8350_vadc PM7325_ADC7_AMUX_THM4_100K_PU>,
<&pmk8350_vadc PM7325_ADC7_AMUX_THM5_100K_PU>,
<&pmk8350_vadc PM7325_ADC7_GPIO3_100K_PU>,
<&pmk8350_vadc PMK8350_ADC7_AMUX_THM1_100K_PU>,
<&pmk8350_vadc PMK8350_ADC7_AMUX_THM2_100K_PU>;
pm7325_quiet_therm {
reg = <PM7325_ADC7_AMUX_THM1_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
pm7325_cam_flash_therm {
reg = <PM7325_ADC7_AMUX_THM2_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
pm7325_skin_msm_therm {
reg = <PM7325_ADC7_AMUX_THM3_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
pm7325_wide_rfc_therm {
reg = <PM7325_ADC7_AMUX_THM4_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
pm7325_4g_pa_therm {
reg = <PM7325_ADC7_AMUX_THM5_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
pm7325_5g_pa_therm {
reg = <PM7325_ADC7_GPIO3_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
pmk8350_xo_therm {
reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
pmk8350_sc8551_therm {
reg = <PMK8350_ADC7_AMUX_THM2_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
};
&pmk8350 {
pmk8350_adc_tm_iio: adc_tm_e {
compatible = "qcom,adc-tm7-iio";
reg = <0x3400>;
#thermal-sensor-cells = <1>;
#address-cells = <1>;
#size-cells = <0>;
io-channels = <&pmk8350_vadc PMK8350_ADC7_AMUX_THM3_100K_PU>,
<&pmk8350_vadc PMK8350_ADC7_AMUX_THM4_100K_PU>;
pmk8350_conn_therm {
reg = <PMK8350_ADC7_AMUX_THM3_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
pmk8350_led_l_therm {
reg = <PMK8350_ADC7_AMUX_THM4_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
};
};
&thermal_zones {
quiet_therm {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "user_space";
thermal-sensors = <&pmk8350_adc_tm PM7325_ADC7_AMUX_THM1_100K_PU>;
wake-capable-sensor;
trips {
active-config0 {
temperature = <125000>;
hysteresis = <1000>;
type = "passive";
};
};
};
flash_therm {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "user_space";
thermal-sensors = <&pmk8350_adc_tm PM7325_ADC7_AMUX_THM2_100K_PU>;
wake-capable-sensor;
trips {
active-config0 {
temperature = <125000>;
hysteresis = <1000>;
type = "passive";
};
};
};
cpu_therm {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "user_space";
thermal-sensors = <&pmk8350_adc_tm PM7325_ADC7_AMUX_THM3_100K_PU>;
wake-capable-sensor;
trips {
active-config0 {
temperature = <125000>;
hysteresis = <1000>;
type = "passive";
};
};
};
wifi_therm {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "user_space";
thermal-sensors = <&pmk8350_adc_tm PM7325_ADC7_AMUX_THM4_100K_PU>;
wake-capable-sensor;
trips {
active-config0 {
temperature = <125000>;
hysteresis = <1000>;
type = "passive";
};
};
};
pa_4gtherm {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "user_space";
thermal-sensors = <&pmk8350_adc_tm PM7325_ADC7_AMUX_THM5_100K_PU>;
wake-capable-sensor;
trips {
active-config0 {
temperature = <125000>;
hysteresis = <1000>;
type = "passive";
};
};
};
modem1_pa0 {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "user_space";
thermal-sensors = <&pmk8350_adc_tm PM7325_ADC7_GPIO3_100K_PU>;
wake-capable-sensor;
trips {
active-config0 {
temperature = <125000>;
hysteresis = <1000>;
type = "passive";
};
};
};
xo_therm {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "user_space";
thermal-sensors = <&pmk8350_adc_tm PMK8350_ADC7_AMUX_THM1_100K_PU>;
wake-capable-sensor;
trips {
active-config0 {
temperature = <125000>;
hysteresis = <1000>;
type = "passive";
};
};
};
charger_therm0 {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "user_space";
thermal-sensors = <&pmk8350_adc_tm PMK8350_ADC7_AMUX_THM2_100K_PU>;
wake-capable-sensor;
trips {
active-config0 {
temperature = <125000>;
hysteresis = <1000>;
type = "passive";
};
};
};
conn_therm {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "user_space";
thermal-sensors = <&pmk8350_adc_tm_iio PMK8350_ADC7_AMUX_THM3_100K_PU>;
wake-capable-sensor;
trips {
active-config0 {
temperature = <125000>;
hysteresis = <1000>;
type = "passive";
};
};
};
led_l_therm {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "user_space";
thermal-sensors = <&pmk8350_adc_tm_iio PMK8350_ADC7_AMUX_THM4_100K_PU>;
wake-capable-sensor;
trips {
active-config0 {
temperature = <125000>;
hysteresis = <1000>;
type = "passive";
};
};
};
};
&soc {
xiaomi_touch {
compatible = "xiaomi-touch";
status = "ok";
touch,name = "xiaomi-touch";
};
};
&qupv3_se0_spi {
status = "ok";
qcom,rt;
pinctrl-1 = <&qupv3_se0_spi_sleep &qupv3_se0_spi_sleep_cs>;
synaptics_tcm@0 {
compatible = "synaptics,tcm-spi";
reg = <0>;
spi-max-frequency = <5000000>;
interrupt-parent = <&tlmm>;
interrupts = <51 0x2808>;
synaptics,avdd-name = "avdd";
avdd-supply = <&L11C>;
synaptics,iovdd-name = "iovdd";
iovdd-supply = <&L2C>;
synaptics,irq-gpio = <&tlmm 51 0x2808>;
synaptics,reset-gpio = <&tlmm 126 0x00>;
synaptics,irq-on-state = <0>;
synaptics,spi-mode = <0>;
synaptics,byte-delay-us = <0>;
synaptics,block-delay-us = <0>;
synaptics,power-delay-ms = <200>;
synaptics,reset-delay-ms = <200>;
synaptics,ubl-max-freq = <5000000>;
synaptics,ubl-byte-delay-us = <20>;
pinctrl-names = "default";
pinctrl-0 = <&syna_reset_gpio_default>;
synaptics,game-mode-array =
<1 0 0 0 0>; /* MAX MIN DEF SET GET */
synaptics,active-mode-array =
<1 0 0 0 0>; /* MAX MIN DEF SET GET */
synaptics,up-threshold-array =
<4 0 2 0 0>; /* MAX MIN DEF SET GET */
synaptics,tolerance-array =
<4 0 2 0 0>; /* MAX MIN DEF SET GET */
synaptics,edge-filter-array =
<3 0 2 2 2>; /* MAX MIN DEF SET GET */
synaptics,panel-orien-array =
<3 0 0 0 0>; /* MAX MIN DEF SET GET */
synaptics,report-rate-array =
<4 0 2 0 0>; /* MAX MIN DEF SET GET */
synaptics,cornerfilter-area-step-array = <0 100 170 250>; /* step 0 to step 3 */
synaptics,cornerzone-filter-hor1-array =
/* B0:Type, B1:pos, B2:x0, B3:y0, B4:x1, B5:y1, B6:reserved, B7: reserved */
<0 0 0 0 170 170 0 0>,
<0 1 0 0 0 0 0 0>,
<0 2 0 2229 170 2399 0 0>,
<0 3 0 0 0 0 0 0>;
synaptics,cornerzone-filter-hor2-array =
/* B0:Type, B1:pos, B2:x0, B3:y0, B4:x1, B5:y1, B6:reserved, B7: reserved */
<0 0 0 0 0 0 0 0>,
<0 1 909 0 1079 170 0 0>,
<0 2 0 0 0 0 0 0>,
<0 3 909 2229 1079 2399 0 0>;
synaptics,cornerzone-filter-ver-array =
/* B0:Type, B1:pos, B2:x0, B3:y0, B4:x1, B5:y1, B6:reserved, B7: reserved */
<0 0 0 0 0 0 0 0>,
<0 1 0 0 0 0 0 0>,
<0 2 0 2099 150 2399 0 0>,
<0 3 929 2099 1079 2399 0 0>;
synaptics,deadzone-filter-hor-array =
/* B0:Type, B1:pos, B2:x0, B3:y0, B4:x1, B5:y1, B6:reserved, B7: reserved */
<2 0 0 0 1079 0 0 0>,
<2 1 0 2399 1079 2399 0 0>,
<2 2 0 0 0 0 0 0>,
<2 3 0 0 0 0 0 0>;
synaptics,deadzone-filter-ver-array =
/* B0:Type, B1:pos, B2:x0, B3:y0, B4:x1, B5:y1, B6:reserved, B7: reserved */
<2 0 0 0 0 0 0 0>,
<2 1 0 0 0 0 0 0>,
<2 2 0 0 0 2399 0 0>,
<2 3 1079 0 1079 2399 0 0>;
synaptics,edgezone-filter-hor-array =
/* B0:Type, B1:pos, B2:x0, B3:y0, B4:x1, B5:y1, B6:reserved, B7: reserved */
<1 0 0 0 1079 40 0 0>,
<1 1 0 2359 1079 2399 0 0>,
<1 2 0 0 40 2399 0 0>,
<1 3 1039 0 1079 2399 0 0>;
synaptics,edgezone-filter-ver-array =
/* B0:Type, B1:pos, B2:x0, B3:y0, B4:x1, B5:y1, B6:reserved, B7: reserved */
<1 0 0 0 0 0 0 0>,
<1 1 0 0 0 0 0 0>,
<1 2 0 0 40 2399 0 0>,
<1 3 1039 0 1079 2399 0 0>;
synaptics,panel-display-resolution = <1079 2399>; /* X Y*/
};
};
&tlmm {
qupv3_se0_spi_sleep: qupv3_se0_spi_sleep {
mux {
pins = "gpio0", "gpio1",
"gpio2";
function = "gpio";
};
config {
pins = "gpio0", "gpio1",
"gpio2";
drive-strength = <6>;
bias-disable;
};
};
qupv3_se0_spi_sleep_cs: qupv3_se0_spi_sleep_cs {
mux {
pins = "gpio3";
function = "gpio";
};
config {
pins = "gpio3";
drive-strength = <6>;
bias-disable;
output-high;
};
};
syna_reset_gpio_default: syna_reset_gpio_default {
mux {
pins = "gpio126";
function = "gpio";
};
config {
pins = "gpio126";
drive-strength = <2>;
bias-disable;
output-low;
};
};
};
&qupv3_se11_spi {
status = "ok";
ir-spi@0 {
compatible = "ir-spi";
reg = <0>;
spi-max-frequency = <19200000>;
status = "ok";
};
};
&qupv3_se3_i2c {
status = "ok";
aw2033@45 {
compatible = "awinic,aw2033_led";
reg = <0x45>;
status = "okay";
aw2033,red {
aw2033,name = "red";
aw2033,id = <0>;
aw2033,imax = <2>;
aw2033,led-current = <3>;
aw2033,max-brightness = <255>;
aw2033,rise-time-ms = <6>;
aw2033,hold-time-ms = <0>;
aw2033,fall-time-ms = <6>;
aw2033,off-time-ms = <4>;
};
aw2033,green {
aw2033,name = "green";
aw2033,id = <1>;
aw2033,imax = <2>;
aw2033,led-current = <3>;
aw2033,max-brightness = <255>;
aw2033,rise-time-ms = <6>;
aw2033,hold-time-ms = <0>;
aw2033,fall-time-ms = <6>;
aw2033,off-time-ms = <4>;
};
aw2033,blue {
aw2033,name = "blue";
aw2033,id = <2>;
aw2033,imax = <2>;
aw2033,led-current = <3>;
aw2033,max-brightness = <255>;
aw2033,rise-time-ms = <6>;
aw2033,hold-time-ms = <0>;
aw2033,fall-time-ms = <6>;
aw2033,off-time-ms = <4>;
};
};
};
&soc {
fingerprint_goodix {
status = "ok";
compatible = "goodix,fingerprint";
l11c_vdd-supply = <&L3C>;
goodix,gpio-reset = <&tlmm 141 0x0>;
goodix,gpio-irq = <&tlmm 43 0x0>;
};
};
&L3C {
regulator-boot-on;
regulator-always-on;
regulator-min-microvolt = <3200000>;
regulator-max-microvolt = <3200000>;
qcom,init-voltage = <3200000>;
};
&qseecom_mem {
size = <0x0 0x3000000>;
};
&qseecom_ta_mem {
size = <0x0 0x2000000>;
};