Add support for Xiaomi 12T Pro / Redmi K50 Ultra (diting|L12)

Change-Id: Ib5dda10332ee62c491682c1ec005dec1ec7c88a1
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
This commit is contained in:
Jens Reidel
2024-05-26 03:32:22 +02:00
committed by Arian
parent b9dcc1755a
commit a6421cd97b
5 changed files with 741 additions and 1 deletions

View File

@@ -333,7 +333,8 @@ dtbo-$(CONFIG_ARCH_CAPE) += cape-mtp-pm8008-overlay.dtbo \
mayfly-sm8475-pm8008-overlay.dtbo \
mondrian-sm8475-pm8008-overlay.dtbo \
marble-sm7475-pm8008-overlay.dtbo \
zizhan-sm8475-pm8008-overlay.dtbo
zizhan-sm8475-pm8008-overlay.dtbo \
diting-sm8475-pm8008-overlay.dtbo
cape-mtp-pm8008-overlay.dtbo-base := cape.dtb cape-v2.dtb capep.dtb
cape-mtp-120fps-pm8008-overlay.dtbo-base := cape.dtb cape-v2.dtb capep.dtb
@@ -373,6 +374,7 @@ mayfly-sm8475-pm8008-overlay.dtbo-base := cape.dtb cape-v2.dtb capep.dtb
mondrian-sm8475-pm8008-overlay.dtbo-base := cape.dtb cape-v2.dtb capep.dtb
marble-sm7475-pm8008-overlay.dtbo-base := ukee.dtb
zizhan-sm8475-pm8008-overlay.dtbo-base := cape.dtb cape-v2.dtb capep.dtb
diting-sm8475-pm8008-overlay.dtbo-base := cape.dtb cape-v2.dtb capep.dtb
else
dtb-$(CONFIG_ARCH_CAPE) += cape-mtp-pm8008.dtb \

111
qcom/diting-pinctrl.dtsi Executable file
View File

@@ -0,0 +1,111 @@
/*for unicorn pinctrl */
&tlmm {
cirrus_reset_default_0: cirrus_reset_default_0 {
mux {
pins = "gpio3";
function = "gpio";
};
config {
pins = "gpio3";
drive-strength = <16>; /* 16 mA */
bias-disable;
output-high;
};
};
cirrus_reset_default_3: cirrus_reset_default_3 {
mux {
pins = "gpio1";
function = "gpio";
};
config {
pins = "gpio1";
drive-strength = <16>; /* 16 mA */
bias-disable;
output-high;
};
};
cirrus_irq_default {
cirrus_irq_default_0: cirrus_irq_default_0 {
mux {
pins = "gpio63";
function = "gpio";
};
config {
pins = "gpio63";
drive-strength = <2>;
input-enable;
bias-pull-up;
};
};
cirrus_irq_default_3: cirrus_irq_default_3 {
mux {
pins = "gpio88";
function = "gpio";
};
config {
pins = "gpio88";
drive-strength = <2>;
input-enable;
bias-pull-up;
};
};
};
mi_ts_spi_active: mi_ts_spi_active {
mux {
pins = "gpio16", "gpio17", "gpio18";
function = "qup4";
};
config {
pins = "gpio16", "gpio17", "gpio18";
drive-strength = <6>;
bias-disable;
};
};
mi_ts_spi_sleep: mi_ts_spi_sleep {
mux {
pins = "gpio16", "gpio17", "gpio18";
function = "gpio";
};
config {
pins = "gpio16", "gpio17", "gpio18";
drive-strength = <6>;
bias-disable;
};
};
mi_ts_cs_active: mi_ts_cs_active {
mux {
pins = "gpio19";
function = "qup4";
};
config {
pins = "gpio19";
drive-strength = <6>;
bias-pull-up;
};
};
mi_ts_cs_suspend: mi_ts_cs_suspend {
mux {
pins = "gpio19";
function = "gpio";
};
config {
pins = "gpio19";
drive-strength = <6>;
bias-pull-up;
};
};
};

View File

@@ -0,0 +1,14 @@
/dts-v1/;
/plugin/;
#include "diting-sm8475.dtsi"
#include "diting-wl2866d.dtsi"
/ {
model = "Diting based on Qualcomm Technologies, Inc SM8475";
compatible = "qcom,cape-mtp", "qcom,cape", "qcom,mtp";
qcom,msm-id = <530 0x10000>, <531 0x10000>, <540 0x10000>;
qcom,board-id = <0x10008 0>;
xiaomi,miboard-id = <0xA 0>;
};

593
qcom/diting-sm8475.dtsi Executable file
View File

@@ -0,0 +1,593 @@
/*
this file is for attribution only of unicorn
And public attribution of xiaomi platforms(like K2 and so and)
*/
#include "diting-pinctrl.dtsi"
#include "xiaomi-sm8475-common.dtsi"
&soc {
xiaomi_touch {
compatible = "xiaomi-touch";
status = "ok";
touch,name = "xiaomi-touch";
};
thermal_message: thermal-message {
board-sensor = "VIRTUAL-SENSOR0";
};
};
&qupv3_se4_spi {
status = "ok";
qcom,rt;
pinctrl-0 = <&mi_ts_spi_active &mi_ts_cs_active>;
pinctrl-1 = <&mi_ts_spi_sleep &mi_ts_cs_suspend>;
xiaomi_touch@0 {
status = "ok";
compatible = "xiaomi,l12-spi";
reg = <0>;
spi-max-frequency = <12000000>;
interrupt-parent = <&tlmm>;
interrupts = <21 0x2008>;
//goodix,avdd-name = "avdd";
//avdd-supply = <&L7C>;
pinctrl-names = "pmx_ts_active", "pmx_ts_suspend";
pinctrl-0 = <&mi_ts_active>;
pinctrl-1 = <&ts_int_suspend &ts_reset_suspend>;
goodix,avdd-gpio = <&tlmm 71 0x0>;
goodix,iovdd-name = "vdd";
vdd-supply = <&L2C>;
goodix,irq-gpio = <&tlmm 21 0x2008>;
goodix,reset-gpio = <&tlmm 20 0x00>;
goodix,irq-flags = <2>;
goodix,panel-max-x = <12200>;
goodix,panel-max-y = <27120>;
goodix,panel-max-w = <255>;
goodix,panel-max-p = <4096>;
goodix,firmware-name = "goodix_firmware_l12";
goodix,config-name = "goodix_cfg_group_l12";
goodix,touch-expert-array = <2 3 2 2
4 3 3 2
3 3 4 2>;
fts,avdd-gpio = <&tlmm 71 0x0>;
//avdd-supply = <&L3C>;
//vdd-supply = <&L2C>;
/*panel = <&dsi_k8_42_02_0a_dsc_cmd>;*/
//fts,pwr-reg-name = "avdd";
fts,bus-reg-name = "vdd";
fts,irq-gpio = <&tlmm 21 0x2008>;
fts,irq-gpio-name = "fts_irq";
fts,reset-gpio-enable;
fts,reset-gpio = <&tlmm 20 0x00>;
fts,reset-gpio-name = "fts_rst";
fts,irq-flags = <0x2008>;
fts,x-max = <12200>;
fts,y-max = <27120>;
//fts,swap-y;
//fts,swap-x;
fts,support-fod = <1>;
fts,fod-lx = <4960>;
fts,fod-ly = <23300>;
fts,fod-x-size = <2280>;
fts,fod-y-size = <2280>;
//spi-max-frequency = <12000000>;
fts,default-fw-name = "st_fts_l12.ftb";
//fts,htp-fw-name = "st_fts_l10_thp.ftb";
fts,non-curved-display = <1>;
fts,config-array-size = <1>;
fts,support-super-resolution = <1>;
fts,touch-follow-performance-def = <3>;
fts,touch-tap-sensitivity-def = <4>;
fts,touch-aim-sensitivity-def = <3>;
fts,touch-tap-stability-def = <3>;
fts,cornerfilter-area-step1 = <112>;
fts,cornerfilter-area-step2 = <190>;
fts,cornerfilter-area-step3 = <280>;
fts,touch-deadzone-filter-ver = <2 0 0 0 0 0 0 0
2 1 0 0 0 0 0 0
2 2 0 0 0 2711 0 0
2 3 1219 0 1219 2711 0 0>;
fts,touch-deadzone-filter-hor = <2 0 0 0 1219 0 0 0
2 1 0 2711 1219 2711 0 0
2 2 0 0 0 2711 0 0
2 3 1219 0 1219 2711 0 0>;
fts,touch-edgezone-filter-ver = <1 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0
1 2 0 0 42 2711 0 0
1 3 1177 0 1219 2711 0 0>;
fts,touch-edgezone-filter-hor = <1 0 0 0 1219 42 0 0
1 1 0 2669 1219 2711 0 0
1 2 0 0 42 2711 0 0
1 3 1177 0 1219 2711 0 0>;
fts,touch-cornerzone-filter-ver = <0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
0 2 0 2372 169 2711 0 0
0 3 1050 2372 1219 2711 0 0>;
fts,touch-cornerzone-filter-hor1 = <0 0 0 0 0 0 0 0
0 1 0 0 190 190 0 0
0 2 0 2521 190 2711 0 0
0 3 0 0 0 0 0 0>;
fts,touch-cornerzone-filter-hor2 = <0 0 1029 0 1219 190 0 0
0 1 0 0 0 0 0 0
0 2 0 0 0 0 0 0
0 3 1029 2521 1219 2711 0 0>;
fts,touch-normal-edgezone-filter-hor = <1 0 0 0 1219 40 0 0
1 1 0 2671 1219 2711 0 0
1 2 0 0 40 2711 0 0
1 3 1179 0 1219 2711 0 0>;
fts,touch-normal-cornerzone-filter-hor1 = <0 0 0 0 0 0 0 0
0 1 0 0 190 190 0 0
0 2 0 2521 190 2711 0 0
0 3 0 0 0 0 0 0>;
fts,touch-normal-cornerzone-filter-hor2 = <0 0 1029 0 1219 190 0 0
0 1 0 0 0 0 0 0
0 2 0 0 0 0 0 0
0 3 1029 2521 1219 2711 0 0>;
fts,touch-follow-performance = <10 15 1
8 15 1
6 15 1
4 15 1
2 15 1>;
fts,touch-tap-sensitivity = <160 150 140 130 100>;
fts,touch-aim-sensitivity = <12 10 8 6 4>;
fts,touch-tap-stability = <10 14 18 20 26>;
fts,touch-expert-array = <6 15 1 130 8 18
2 15 1 130 5 18
4 15 1 130 4 18>;
fts,cfg_0 {
fts,tp-vendor = <0x38>;
fts,fw-name = "st_fts_l12.ftb";
fts,limit-name = "stm_fts_production_limits.csv";
};
};
};
&tlmm {
mi_ts_active: mi_ts_active {
mux {
pins = "gpio21", "gpio20";
function = "gpio";
};
config {
pins = "gpio21", "gpio20";
drive-strength = <8>;
bias-pull-up;
};
};
/* RCV HANDSET CTL */
rcv_gpio_high: rcv_gpio_high {
mux {
pins = "gpio52";
function = "gpio";
};
config {
pins = "gpio52";
drive-strength = <2>;
bias-pull-up;
output-high;
};
};
rcv_gpio_low: rcv_gpio_low {
mux {
pins = "gpio52";
function = "gpio";
};
config {
pins = "gpio52";
drive-strength = <2>;
bias-disable;
output-low;
};
};
tert_tdm_din_active: tert_tdm_din_active {
mux {
pins = "gpio122";
function = "mi2s2_data0";
};
config {
pins = "gpio122";
drive-strength = <0x02>;
bias-disable;
};
};
tert_tdm_dout_active: tert_tdm_dout_active {
mux {
pins = "gpio124";
function = "mi2s2_data1";
};
config {
pins = "gpio124";
drive-strength = <0x02>;
bias-disable;
};
};
tert_tdm_clk_active: tert_tdm_clk_active {
mux {
pins = "gpio121";
function = "mi2s2_sck";
};
config {
pins = "gpio121";
drive-strength = <0x02>;
bias-disable;
output-low;
};
};
tert_tdm_ws_active: tert_tdm_ws_active {
mux {
pins = "gpio123";
function = "mi2s2_ws";
};
config {
pins = "gpio123";
drive-strength = <0x02>;
bias-disable;
output-low;
};
};
};
&qupv3_se15_i2c {
status = "ok";
cs35l41_0: cs35l41@40 {
status = "ok";
compatible = "cirrus,cs35l41";
reset-gpios = <&tlmm 3 0>;
reg = <0x40>;
interrupt-parent = <&tlmm>;
interrupts = <63 0x2008>;
pinctrl-names = "default";
pinctrl-0 = <&cirrus_reset_default_0 &cirrus_irq_default_0>;
cirrus,temp-warn_threshold = <3>;
cirrus,boost-peak-milliamp = <4000>;
cirrus,boost-ind-nanohenry = <1000>;
cirrus,boost-cap-microfarad = <15>;
cirrus,asp-sdout-hiz = <3>;
cirrus,right-channel-amp;
sound-name-prefix = "B";
cirrus,fast-switch = "B-music.txt", "B-handfree.txt";
cirrus,gpio-config2 {
cirrus,gpio-src-select = <0x4>;
cirrus,gpio-output-enable;
};
};
cs35l41_3: cs35l41@42 {
status = "ok";
compatible = "cirrus,cs35l41";
reset-gpios = <&tlmm 1 0>;
spk-sw-gpios = <&tlmm 52 0>;
reg = <0x42>;
interrupt-parent = <&tlmm>;
interrupts = <88 0x2008>;
pinctrl-names = "default", "rcv_gpio_high", "rcv_gpio_low";
pinctrl-0 = <&cirrus_reset_default_3 &cirrus_irq_default_3>;
pinctrl-1 = <&rcv_gpio_high>;
pinctrl-2 = <&rcv_gpio_low>;
cirrus,temp-warn_threshold = <3>;
cirrus,boost-peak-milliamp = <4000>;
cirrus,boost-ind-nanohenry = <1000>;
cirrus,boost-cap-microfarad = <15>;
cirrus,asp-sdout-hiz = <3>;
sound-name-prefix = "T";
cirrus,fast-switch = "T-music.txt", "T-handset.txt", "T-handfree.txt";
cirrus,gpio-config2 {
cirrus,gpio-src-select = <0x4>;
cirrus,gpio-output-enable;
};
};
};
&battery_charger {
qcom,shutdown-voltage = <3350>;
};
&nxp_eusb2_repeater {
qcom,param-override-seq = /* override value offset */
<0x50 0x06
0x00 0x07
0x63 0x08>;
qcom,param-override-seq-host =
<0x40 0x06
0x22 0x07
0x63 0x08
0x03 0x0A>;
};
&soc {
fingerprint_goodix {
compatible = "goodix,fingerprint";
l1c_vdd-supply = <&L1C>;
l3c_vdd-supply = <&L3C>;
goodix,gpio-reset = <&tlmm 41 0x0>;
goodix,gpio-irq = <&tlmm 40 0x0>;
status = "ok";
};
};
&L1C {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
qcom,init-voltage = <1800000>;
};
&L3C {
regulator-boot-on;
regulator-always-on;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
qcom,init-voltage = <3300000>;
};
&qseecom_ta_mem {
size = <0x0 0x2000000>;
};
&qseecom_mem {
size = <0x0 0x2400000>;
};
&pmk8350_vadc {
pinctrl-names = "default";
pinctrl-0 = <&pm8350_rear_tof_therm_default>;
pm8350_msm_therm {
reg = <PM8350_ADC7_AMUX_THM1_100K_PU>;
label = "pm8350_msm_therm";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
pm8350_flash_therm {
reg = <PM8350_ADC7_AMUX_THM2_100K_PU>;
label = "pm8350_flash_therm";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
pm8350_hot_pocket_therm {
reg = <PM8350_ADC7_AMUX_THM3_100K_PU>;
label = "pm8350_hot_pocket_therm";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
pm8350_charger0_therm {
reg = <PM8350B_ADC7_GPIO4_100K_PU>;
label = "pm8350_charger0_therm";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
pa_therm0 {
reg = <PMR735A_ADC7_GPIO1_100K_PU>;
label = "pa_therm0";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
pa_therm1 {
reg = <PMR735A_ADC7_GPIO2_100K_PU>;
label = "pa_therm1";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
wifi_therm {
reg = <PMR735A_ADC7_GPIO3_100K_PU>;
label = "wifi_therm";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
pm8350b_usb_conn_therm {
reg = <PM8350B_ADC7_AMUX_THM4_100K_PU>;
label = "pm8350b_usb_conn_therm";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
};
&pmk8350_adc_tm {
io-channels = <&pmk8350_vadc PM8350_ADC7_AMUX_THM1_100K_PU>,
<&pmk8350_vadc PM8350_ADC7_AMUX_THM2_100K_PU>,
<&pmk8350_vadc PM8350_ADC7_AMUX_THM3_100K_PU>,
<&pmk8350_vadc PM8350B_ADC7_GPIO4_100K_PU>,
<&pmk8350_vadc PMR735A_ADC7_GPIO1_100K_PU>,
<&pmk8350_vadc PMR735A_ADC7_GPIO2_100K_PU>,
<&pmk8350_vadc PMR735A_ADC7_GPIO3_100K_PU>,
<&pmk8350_vadc PM8350B_ADC7_AMUX_THM4_100K_PU>;
pm8350_msm_therm {
reg = <PM8350_ADC7_AMUX_THM1_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
pm8350_flash_therm {
reg = <PM8350_ADC7_AMUX_THM2_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
pm8350_hot_pocket_therm {
reg = <PM8350_ADC7_AMUX_THM3_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
pm8350_charger0_therm {
reg = <PM8350B_ADC7_GPIO4_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
pa_therm0 {
reg = <PMR735A_ADC7_GPIO1_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
pa_therm1 {
reg = <PMR735A_ADC7_GPIO2_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
wifi_therm {
reg = <PMR735A_ADC7_GPIO3_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
pm8350b_usb_conn_therm {
reg = <PM8350B_ADC7_AMUX_THM4_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
};
};
&bcl_soc {
status = "disabled";
};
&thermal_zones {
cpu_therm {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "user_space";
thermal-sensors = <&pmk8350_adc_tm PM8350_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 PM8350_ADC7_AMUX_THM2_100K_PU>;
wake-capable-sensor;
trips {
active-config0 {
temperature = <125000>;
hysteresis = <1000>;
type = "passive";
};
};
};
quiet_therm {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "user_space";
thermal-sensors = <&pmk8350_adc_tm PM8350_ADC7_AMUX_THM3_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 PM8350B_ADC7_GPIO4_100K_PU>;
wake-capable-sensor;
trips {
active-config0 {
temperature = <125000>;
hysteresis = <1000>;
type = "passive";
};
};
};
pa_therm0 {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "user_space";
thermal-sensors = <&pmk8350_adc_tm PMR735A_ADC7_GPIO1_100K_PU>;
wake-capable-sensor;
trips {
active-config0 {
temperature = <125000>;
hysteresis = <1000>;
type = "passive";
};
};
};
pa_therm1 {
polling-delay-passive = <0>;
polling-delay = <0>;
thermal-governor = "user_space";
thermal-sensors = <&pmk8350_adc_tm PMR735A_ADC7_GPIO2_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 PMR735A_ADC7_GPIO3_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 PM8350B_ADC7_AMUX_THM4_100K_PU>;
wake-capable-sensor;
trips {
active-config0 {
temperature = <125000>;
hysteresis = <1000>;
type = "passive";
};
};
};
};

20
qcom/diting-wl2866d.dtsi Normal file
View File

@@ -0,0 +1,20 @@
&clock_gcc {
qcom,critical-devices = <&qupv3_se5_i2c>;
};
&qupv3_se5_i2c {
#address-cells = <1>;
#size-cells = <0>;
status = "ok";
wl2866d@28 {
compatible = "xiaomi,wl2866d";
reg = <0x28>;
vin1-supply = <&S12B>;
vin1-voltage-level = <1250000 1250000>;
vin2-supply = <&BOB>;
vin2-voltage-level = <3300000 3300000>;
en-gpio = <&tlmm 44 0>;
avdd2 = /bits/ 8 <0x98>;
status = "ok";
};
};