From 5d758e1bcbeb9ad8b6568da0aa88be3ea9dbb502 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 9 Oct 2022 03:23:48 +0200 Subject: [PATCH] Include cust.dtsi, don't run python2 drvgen Instead of running mediatek's python2 drvgen script to generate the cust.dtsi file, include the generated file. Related: https://wiki.postmarketos.org/wiki/Porting_to_a_new_device#Removing_python2_dependency --- arch/arm/Makefile | 2 +- arch/arm/boot/dts/k400/cust.dtsi | 314 +++++++++++++++++++++++++++++++ 2 files changed, 315 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/k400/cust.dtsi diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 7d938748..00f7c70c 100755 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -309,7 +309,7 @@ MTK_PROJECT := $(CONFIG_ARCH_MTK_PROJECT:"%"=%) export MTK_PLATFORM MTK_PROJECT MTK_TARGET_PROJECT KBUILD_CPPFLAGS += -I$(srctree)/drivers/misc/mediatek/include/mt-plat/$(MTK_PLATFORM)/include KBUILD_CPPFLAGS += -I$(srctree)/arch/arm/mach-mediatek/include/ --include $(srctree)/scripts/drvgen/drvgen.mk +#-include $(srctree)/scripts/drvgen/drvgen.mk archprepare: $(DRVGEN_FILE_LIST) dtbs: $(DRVGEN_FILE_LIST) diff --git a/arch/arm/boot/dts/k400/cust.dtsi b/arch/arm/boot/dts/k400/cust.dtsi new file mode 100644 index 00000000..f2b53580 --- /dev/null +++ b/arch/arm/boot/dts/k400/cust.dtsi @@ -0,0 +1,314 @@ +/* + * Generated by MTK SP Drv_CodeGen Version 03.13.6 for MT6580. Copyright MediaTek Inc. (C) 2013. + * Sun Oct 9 01:14:45 2022 + * Do Not Modify the File. + */ + +/************************* + * I2C DTSI File +*************************/ + +&i2c0 { + #address-cells = <1>; + #size-cells = <0>; + camera_main_mtk:camera_main@36 { + compatible = "mediatek,camera_main"; + reg = <0x36>; + status = "okay"; + }; + camera_main_af_mtk:camera_main_af@18 { + compatible = "mediatek,camera_main_af"; + reg = <0x18>; + status = "okay"; + }; + camera_sub_mtk:camera_sub@21 { + compatible = "mediatek,camera_sub"; + reg = <0x21>; + status = "okay"; + }; +}; + +&i2c1 { + #address-cells = <1>; + #size-cells = <0>; + cap_touch_mtk:cap_touch@38 { + compatible = "mediatek,cap_touch"; + reg = <0x38>; + status = "okay"; + }; + ext_buck_mtk:ext_buck@60 { + compatible = "mediatek,ext_buck"; + reg = <0x60>; + status = "okay"; + }; +}; + +&i2c2 { + #address-cells = <1>; + #size-cells = <0>; + strobe_main_mtk:strobe_main@63 { + compatible = "mediatek,strobe_main"; + reg = <0x63>; + status = "okay"; + }; + msensor_mtk:msensor@0c { + compatible = "mediatek,msensor"; + reg = <0x0c>; + status = "okay"; + }; + gsensor_mtk:gsensor@0e { + compatible = "mediatek,gsensor"; + reg = <0x0e>; + status = "okay"; + }; + gyro_mtk:gyro@69 { + compatible = "mediatek,gyro"; + reg = <0x69>; + status = "okay"; + }; + alsps_mtk:alsps@23 { + compatible = "mediatek,alsps"; + reg = <0x23>; + status = "okay"; + }; +}; + + + +#include +#include + +/************************* + * EINT DTSI File +*************************/ + +&accdet { + interrupt-parent = <&eintc>; + interrupts = <17 IRQ_TYPE_LEVEL_LOW>; + debounce = <17 256000>; + status = "okay"; +}; +&mhall { + interrupt-parent = <&eintc>; + interrupts = <18 IRQ_TYPE_LEVEL_LOW>; + debounce = <18 16000>; + status = "okay"; +}; +&touch { + interrupt-parent = <&eintc>; + interrupts = <20 IRQ_TYPE_EDGE_FALLING>; + debounce = <20 0>; + status = "okay"; +}; +&alsps_mtk { + interrupt-parent = <&eintc>; + interrupts = <6 IRQ_TYPE_LEVEL_LOW>; + debounce = <6 0>; + status = "okay"; +}; +&gyro { + interrupt-parent = <&eintc>; + interrupts = <8 IRQ_TYPE_LEVEL_LOW>; + debounce = <8 0>; + status = "okay"; +}; +&dsi_te { + interrupt-parent = <&eintc>; + interrupts = <68 IRQ_TYPE_EDGE_RISING>; + debounce = <68 0>; + status = "okay"; +}; + + +/******************** + * GPIO USAGE MAPPING DTSI File +****************/ + +&gpio_usage_mapping { + GPIO_SIM1_SCLK = <22>; + GPIO_SIM1_SIO = <23>; + GPIO_SIM2_SIO = <24>; + GPIO_SIM2_SCLK = <25>; +}; + + +&eintc { +}; + + +/************************* + * PMIC DTSI File +*************************/ + +&mt_pmic_vmc_ldo_reg { + regulator-name = "vmc"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; +&mt_pmic_vmch_ldo_reg { + regulator-name = "vmch"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; +&mt_pmic_vemc_3v3_ldo_reg { + regulator-name = "vemc_3v3"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; +&mt_pmic_vgp1_ldo_reg { + regulator-name = "vgp1"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; +&mt_pmic_vgp2_ldo_reg { + regulator-name = "vgp2"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; +&mt_pmic_vgp3_ldo_reg { + regulator-name = "vgp3"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; +&mt_pmic_vcn_1v8_ldo_reg { + regulator-name = "vcn_1v8"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; +&mt_pmic_vsim1_ldo_reg { + regulator-name = "vsim1"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; +&mt_pmic_vsim2_ldo_reg { + regulator-name = "vsim2"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; +&mt_pmic_vcamaf_ldo_reg { + regulator-name = "vcamaf"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; +&mt_pmic_vibr_ldo_reg { + regulator-name = "vibr"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; +&mt_pmic_vm_ldo_reg { + regulator-name = "vm"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; +&mt_pmic_vrf18_ldo_reg { + regulator-name = "vrf18"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; +&mt_pmic_vcamd_ldo_reg { + regulator-name = "vcamd"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; +&mt_pmic_vcanio_ldo_reg { + regulator-name = "vcanio"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; +&mt_pmic_vcama_ldo_reg { + regulator-name = "vcama"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; +&mt_pmic_vcn33_ldo_reg { + regulator-name = "vcn33"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; +&mt_pmic_vcn28_ldo_reg { + regulator-name = "vcn28"; + regulator-default-on = <0>; /* 0:skip, 1: off, 2:on */ + status = "okay"; +}; + +&kd_camera_hw1 { + vcamd-supply = <&mt_pmic_vgp3_ldo_reg>; + + vcamaf-supply = <&mt_pmic_vcamaf_ldo_reg>; + + vcamd_main2-supply = <&mt_pmic_vcamd_ldo_reg>; + vcamd_sub-supply = <&mt_pmic_vcamd_ldo_reg>; + + vcamio-supply = <&mt_pmic_vcanio_ldo_reg>; + vcamio_main2-supply = <&mt_pmic_vcanio_ldo_reg>; + vcamio_sub-supply = <&mt_pmic_vcanio_ldo_reg>; + + vcama-supply = <&mt_pmic_vcama_ldo_reg>; + vcama_main2-supply = <&mt_pmic_vcama_ldo_reg>; + vcama_sub-supply = <&mt_pmic_vcama_ldo_reg>; + + status = "okay"; +}; + +&touch { + vtouch-supply = <&mt_pmic_vgp1_ldo_reg>; + status = "okay"; +}; + + +/******************************************** + *ADC DTSI File +********************************************/ + +&auxadc { + adc_channel@ { + compatible = "mediatek,adc_channel"; + mediatek,temperature0 = <0>; + mediatek,temperature1 = <1>; + mediatek,lcm_voltage = <12>; + status = "okay"; + }; +}; + + +/********************************************** + *CLK_BUF DTSI File +********************************************/ + +&rf_clock_buffer_ctrl { + mediatek,clkbuf-quantity = <4>; + mediatek,clkbuf-config = <2 2 1 1>; + status = "okay"; +}; + + +/********************************************** + *Keypad DTSI File +********************************************/ + +&keypad{ + mediatek,kpd-key-debounce = <1024>; + mediatek,kpd-sw-pwrkey = <116>; + mediatek,kpd-hw-pwrkey = <8>; + mediatek,kpd-use-extend-type = <0>; + /*HW Keycode [0~71] -> Linux Keycode*/ + mediatek,kpd-hw-map-num = <72>; + mediatek,kpd-hw-init-map = <115 114 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 >; + mediatek,kpd-pwrkey-eint-gpio = <0>; + mediatek,kpd-pwkey-gpio-din = <0>; + mediatek,kpd-hw-dl-key0 = <0>; + mediatek,kpd-hw-dl-key1 = <1>; + mediatek,kpd-hw-dl-key2 = <8>; + mediatek,kpd-hw-recovery-key = <0>; + mediatek,kpd-hw-factory-key = <1>; + status = "okay"; +}; + + -- 2.34.1