From 2607e05f2bc19cbe3aac957a9acfec4f8a10d27e Mon Sep 17 00:00:00 2001 From: fewtarius Date: Thu, 27 Jul 2023 13:47:31 +0000 Subject: [PATCH 1/7] Fix powerstate / usb autosuspend bugs. --- packages/sysutils/powerstate/sources/powerstate.sh | 2 +- projects/PC/devices/AMD64/options | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sysutils/powerstate/sources/powerstate.sh b/packages/sysutils/powerstate/sources/powerstate.sh index 4e9a044b7..9b4fd4036 100755 --- a/packages/sysutils/powerstate/sources/powerstate.sh +++ b/packages/sysutils/powerstate/sources/powerstate.sh @@ -49,7 +49,7 @@ do gpu_performance_level auto pcie_aspm_policy default wake_events disabled - runtime_power_management on + runtime_power_management off /usr/bin/wifictl setpowersave ;; esac diff --git a/projects/PC/devices/AMD64/options b/projects/PC/devices/AMD64/options index ecf7c93e7..80cdcd3a7 100644 --- a/projects/PC/devices/AMD64/options +++ b/projects/PC/devices/AMD64/options @@ -12,7 +12,7 @@ esac # kernel command line - EXTRA_CMDLINE="quiet console=tty0 ssh consoleblank=0 systemd.show_status=0 loglevel=0 panic=20 intel_pstate=active amd_pstate=active amd_pstate.shared_mem=1 amdgpu.dpm=1 usbcore.autosuspend=5" + EXTRA_CMDLINE="quiet console=tty0 ssh consoleblank=0 systemd.show_status=0 loglevel=0 panic=20 intel_pstate=active amd_pstate=active amd_pstate.shared_mem=1 amdgpu.dpm=1" # Partition label PARTITION_TABLE="msdos" From 038f05985b99efcee4a63c32bf8e8f059b22a7ad Mon Sep 17 00:00:00 2001 From: fewtarius Date: Thu, 27 Jul 2023 13:52:57 +0000 Subject: [PATCH 2/7] Fix oops. --- packages/sysutils/powerstate/sources/powerstate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sysutils/powerstate/sources/powerstate.sh b/packages/sysutils/powerstate/sources/powerstate.sh index 9b4fd4036..4e9a044b7 100755 --- a/packages/sysutils/powerstate/sources/powerstate.sh +++ b/packages/sysutils/powerstate/sources/powerstate.sh @@ -49,7 +49,7 @@ do gpu_performance_level auto pcie_aspm_policy default wake_events disabled - runtime_power_management off + runtime_power_management on /usr/bin/wifictl setpowersave ;; esac From d521cb4a69dc3a134b1c97613a2ecfcd1714c377 Mon Sep 17 00:00:00 2001 From: mason Date: Thu, 27 Jul 2023 13:56:13 +0000 Subject: [PATCH 3/7] Bump kernel to 6.4.7 & 6.1.42 on support devices --- packages/kernel/linux/package.mk | 2 +- projects/Amlogic/packages/linux/package.mk | 2 +- projects/Rockchip/packages/linux/package.mk | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/kernel/linux/package.mk b/packages/kernel/linux/package.mk index b1eb4291f..bb862e894 100644 --- a/packages/kernel/linux/package.mk +++ b/packages/kernel/linux/package.mk @@ -4,7 +4,7 @@ PKG_NAME="linux" PKG_LICENSE="GPL" -PKG_VERSION="6.4.6" +PKG_VERSION="6.4.7" PKG_URL="https://www.kernel.org/pub/linux/kernel/v6.x/${PKG_NAME}-${PKG_VERSION}.tar.xz" PKG_SITE="http://www.kernel.org" PKG_DEPENDS_HOST="ccache:host rsync:host openssl:host" diff --git a/projects/Amlogic/packages/linux/package.mk b/projects/Amlogic/packages/linux/package.mk index 9181cfb4e..59a91236c 100644 --- a/projects/Amlogic/packages/linux/package.mk +++ b/projects/Amlogic/packages/linux/package.mk @@ -19,7 +19,7 @@ PKG_PATCH_DIRS+="${DEVICE}" case ${DEVICE} in S922X*) - PKG_VERSION="6.1.41" + PKG_VERSION="6.1.42" PKG_URL="https://www.kernel.org/pub/linux/kernel/v6.x/${PKG_NAME}-${PKG_VERSION}.tar.xz" ;; esac diff --git a/projects/Rockchip/packages/linux/package.mk b/projects/Rockchip/packages/linux/package.mk index 4094e9b2b..37286cd8b 100644 --- a/projects/Rockchip/packages/linux/package.mk +++ b/projects/Rockchip/packages/linux/package.mk @@ -37,7 +37,7 @@ case ${DEVICE} in PKG_GIT_CLONE_BRANCH="main" ;; RK33*) - PKG_VERSION="6.1.41" + PKG_VERSION="6.1.42" PKG_URL="https://www.kernel.org/pub/linux/kernel/v6.x/${PKG_NAME}-${PKG_VERSION}.tar.xz" ;; esac From 7147535e60caf51c1cc1255a8ef170f4e6bfd2f0 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Thu, 27 Jul 2023 14:00:09 +0000 Subject: [PATCH 4/7] Drop merged skip irq patch. --- .../AMD64/004-revert-skip-irq-override.patch | 150 ------------------ 1 file changed, 150 deletions(-) delete mode 100644 packages/kernel/linux/patches/AMD64/004-revert-skip-irq-override.patch diff --git a/packages/kernel/linux/patches/AMD64/004-revert-skip-irq-override.patch b/packages/kernel/linux/patches/AMD64/004-revert-skip-irq-override.patch deleted file mode 100644 index 82723a663..000000000 --- a/packages/kernel/linux/patches/AMD64/004-revert-skip-irq-override.patch +++ /dev/null @@ -1,150 +0,0 @@ -From: Mario Limonciello @ 2023-06-01 22:11 UTC (permalink / raw) - To: linux-acpi, rafael - Cc: linux-kernel, Mario Limonciello, ofenfisch, wse, adam.niederer, - adrian, jirislaby, Renjith.Pananchikkal, anson.tsao, - Richard.Gong, Chuanhong Guo, evilsnoo, ruinairas1992, nmschulte - -commit 9946e39fe8d0 ("ACPI: resource: skip IRQ override on -AMD Zen platforms") attempted to overhaul the override logic so it -didn't apply on X86 AMD Zen systems. This was intentional so that -systems would prefer DSDT values instead of default MADT value for -IRQ 1 on Ryzen 6000 systems which typically uses ActiveLow for IRQ1. - -This turned out to be a bad assumption because several vendors -add Interrupt Source Override but don't fix the DSDT. A pile of -quirks was collecting that proved this wasn't sustaintable. - -Furthermore some vendors have used ActiveHigh for IRQ1. -To solve this problem revert the following commits: -* commit 17bb7046e7ce ("ACPI: resource: Do IRQ override on all TongFang -GMxRGxx") -* commit f3cb9b740869 ("ACPI: resource: do IRQ override on Lenovo 14ALC7") -* commit bfcdf58380b1 ("ACPI: resource: do IRQ override on LENOVO IdeaPad") -* commit 7592b79ba4a9 ("ACPI: resource: do IRQ override on XMG Core 15") -* commit 9946e39fe8d0 ("ACPI: resource: skip IRQ override on AMD Zen -platforms") - -Cc: ofenfisch@googlemail.com -Cc: wse@tuxedocomputers.com -Cc: adam.niederer@gmail.com -Cc: adrian@freund.io -Cc: jirislaby@kernel.org -Cc: Renjith.Pananchikkal@amd.com -Cc: anson.tsao@amd.com -Cc: Richard.Gong@amd.com -Cc: Chuanhong Guo -Reported-by: evilsnoo@proton.me -Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217394 -Reported-by: ruinairas1992@gmail.com -Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217406 -Reported-by: nmschulte@gmail.com -Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217336 -Signed-off-by: Mario Limonciello ---- -v2->v3: - * Adjust to drop heuristics entirely - * Drop tested tags - * Add more links and people to Cc - * Drop Fixes tag as this got a lot more risky -v1->v2: - * Rebase on 71a485624c4c ("ACPI: resource: Add IRQ override quirk for LG UltraPC 17U70P") - * Pick up tag - -Rafael, -Please hold off on picking this up until the majority of those on CC -have tested it on hardware they have and reported results. - -Everyone else, -Please test. If you have problems with this applied, please share -an acpidump and dmesg either on a bug or to me privately. ---- - drivers/acpi/resource.c | 60 ----------------------------------------- - 1 file changed, 60 deletions(-) - -diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c -index 0800a9d77558..1dd8d5aebf67 100644 ---- a/drivers/acpi/resource.c -+++ b/drivers/acpi/resource.c -@@ -470,52 +470,6 @@ static const struct dmi_system_id asus_laptop[] = { - { } - }; - --static const struct dmi_system_id lenovo_laptop[] = { -- { -- .ident = "LENOVO IdeaPad Flex 5 14ALC7", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), -- DMI_MATCH(DMI_PRODUCT_NAME, "82R9"), -- }, -- }, -- { -- .ident = "LENOVO IdeaPad Flex 5 16ALC7", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), -- DMI_MATCH(DMI_PRODUCT_NAME, "82RA"), -- }, -- }, -- { } --}; -- --static const struct dmi_system_id tongfang_gm_rg[] = { -- { -- .ident = "TongFang GMxRGxx/XMG CORE 15 (M22)/TUXEDO Stellaris 15 Gen4 AMD", -- .matches = { -- DMI_MATCH(DMI_BOARD_NAME, "GMxRGxx"), -- }, -- }, -- { } --}; -- --static const struct dmi_system_id maingear_laptop[] = { -- { -- .ident = "MAINGEAR Vector Pro 2 15", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Micro Electronics Inc"), -- DMI_MATCH(DMI_PRODUCT_NAME, "MG-VCP2-15A3070T"), -- } -- }, -- { -- .ident = "MAINGEAR Vector Pro 2 17", -- .matches = { -- DMI_MATCH(DMI_SYS_VENDOR, "Micro Electronics Inc"), -- DMI_MATCH(DMI_PRODUCT_NAME, "MG-VCP2-17A3070T"), -- }, -- }, -- { } --}; -- - static const struct dmi_system_id lg_laptop[] = { - { - .ident = "LG Electronics 17U70P", -@@ -539,10 +493,6 @@ struct irq_override_cmp { - static const struct irq_override_cmp override_table[] = { - { medion_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false }, - { asus_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false }, -- { lenovo_laptop, 6, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true }, -- { lenovo_laptop, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true }, -- { tongfang_gm_rg, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true }, -- { maingear_laptop, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true }, - { lg_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false }, - }; - -@@ -562,16 +512,6 @@ static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity, - return entry->override; - } - --#ifdef CONFIG_X86 -- /* -- * IRQ override isn't needed on modern AMD Zen systems and -- * this override breaks active low IRQs on AMD Ryzen 6000 and -- * newer systems. Skip it. -- */ -- if (boot_cpu_has(X86_FEATURE_ZEN)) -- return false; --#endif -- - return true; - } - --- -2.34.1 From 93c5cfc6102fcf160809abe29877c1611b46c222 Mon Sep 17 00:00:00 2001 From: fewtarius Date: Thu, 27 Jul 2023 14:01:32 +0000 Subject: [PATCH 5/7] Drop merged ASUS patch. --- ...asus-ally-cs35l41-6.3-with-asus-keys.patch | 71 ------------------- 1 file changed, 71 deletions(-) diff --git a/packages/kernel/linux/patches/AMD64/007-asus-ally-cs35l41-6.3-with-asus-keys.patch b/packages/kernel/linux/patches/AMD64/007-asus-ally-cs35l41-6.3-with-asus-keys.patch index 7e2473ea6..7593c0d2b 100644 --- a/packages/kernel/linux/patches/AMD64/007-asus-ally-cs35l41-6.3-with-asus-keys.patch +++ b/packages/kernel/linux/patches/AMD64/007-asus-ally-cs35l41-6.3-with-asus-keys.patch @@ -36,74 +36,3 @@ index c2e9b6d1fd7d..cd6efa46a2bd 100644 #define USB_DEVICE_ID_ASUSTEK_ROG_CLAYMORE_II_KEYBOARD 0x196b #define USB_DEVICE_ID_ASUSTEK_FX503VD_KEYBOARD 0x1869 -diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c -index f70d6a33421d..068a30c0ff4d 100644 ---- a/sound/pci/hda/patch_realtek.c -+++ b/sound/pci/hda/patch_realtek.c -@@ -7118,6 +7118,10 @@ enum { - ALC294_FIXUP_ASUS_DUAL_SPK, - ALC285_FIXUP_THINKPAD_X1_GEN7, - ALC285_FIXUP_THINKPAD_HEADSET_JACK, -+ ALC294_FIXUP_ASUS_ALLY, -+ ALC294_FIXUP_ASUS_ALLY_PINS, -+ ALC294_FIXUP_ASUS_ALLY_VERBS, -+ ALC294_FIXUP_ASUS_ALLY_SPEAKER, - ALC294_FIXUP_ASUS_HPE, - ALC294_FIXUP_ASUS_COEF_1B, - ALC294_FIXUP_ASUS_GX502_HP, -@@ -8414,6 +8418,47 @@ static const struct hda_fixup alc269_fixups[] = { - .chained = true, - .chain_id = ALC294_FIXUP_SPK2_TO_DAC1 - }, -+ [ALC294_FIXUP_ASUS_ALLY] = { -+ .type = HDA_FIXUP_FUNC, -+ .v.func = cs35l41_fixup_i2c_two, -+ .chained = true, -+ .chain_id = ALC294_FIXUP_ASUS_ALLY_PINS -+ }, -+ [ALC294_FIXUP_ASUS_ALLY_PINS] = { -+ .type = HDA_FIXUP_PINS, -+ .v.pins = (const struct hda_pintbl[]) { -+ { 0x19, 0x03a11050 }, -+ { 0x1a, 0x03a11C30 }, -+ { 0x21, 0x03211420 }, -+ { } -+ }, -+ .chained = true, -+ .chain_id = ALC294_FIXUP_ASUS_ALLY_VERBS -+ }, -+ [ALC294_FIXUP_ASUS_ALLY_VERBS] = { -+ .type = HDA_FIXUP_VERBS, -+ .v.verbs = (const struct hda_verb[]) { -+ { 0x20, AC_VERB_SET_COEF_INDEX, 0x45 }, -+ { 0x20, AC_VERB_SET_PROC_COEF, 0x5089 }, -+ { 0x20, AC_VERB_SET_COEF_INDEX, 0x46 }, -+ { 0x20, AC_VERB_SET_PROC_COEF, 0x0004 }, -+ { 0x20, AC_VERB_SET_COEF_INDEX, 0x47 }, -+ { 0x20, AC_VERB_SET_PROC_COEF, 0xA47A }, -+ { 0x20, AC_VERB_SET_COEF_INDEX, 0x49 }, -+ { 0x20, AC_VERB_SET_PROC_COEF, 0x0049}, -+ { 0x20, AC_VERB_SET_COEF_INDEX, 0x4A }, -+ { 0x20, AC_VERB_SET_PROC_COEF, 0x201B }, -+ { 0x20, AC_VERB_SET_COEF_INDEX, 0x6B }, -+ { 0x20, AC_VERB_SET_PROC_COEF, 0x4278}, -+ { } -+ }, -+ .chained = true, -+ .chain_id = ALC294_FIXUP_ASUS_ALLY_SPEAKER -+ }, -+ [ALC294_FIXUP_ASUS_ALLY_SPEAKER] = { -+ .type = HDA_FIXUP_FUNC, -+ .v.func = alc285_fixup_speaker2_to_dac1, -+ }, - [ALC285_FIXUP_THINKPAD_X1_GEN7] = { - .type = HDA_FIXUP_FUNC, - .v.func = alc285_fixup_thinkpad_x1_gen7, -@@ -9558,6 +9603,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { - SND_PCI_QUIRK(0x10ec, 0x1252, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), - SND_PCI_QUIRK(0x10ec, 0x1254, "Intel Reference board", ALC295_FIXUP_CHROME_BOOK), - SND_PCI_QUIRK(0x10f7, 0x8338, "Panasonic CF-SZ6", ALC269_FIXUP_HEADSET_MODE), -+ SND_PCI_QUIRK(0x1043, 0x17F3, "ROG Ally RC71L_RC71L", ALC294_FIXUP_ASUS_ALLY), - SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC), - SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP), - SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP), From cddecc5099a56ab9b5c919554b172c3da5995dee Mon Sep 17 00:00:00 2001 From: mason Date: Thu, 27 Jul 2023 14:13:53 +0000 Subject: [PATCH 6/7] Rename RK3399 kernel to be more inline with standards, hide moonlight S922X --- packages/ui/emulationstation/package.mk | 7 +- projects/Rockchip/devices/RK3399/options | 2 +- .../patches/RK3399/000-rk3399-devices.patch | 1568 ++++++++++++++++- 3 files changed, 1526 insertions(+), 51 deletions(-) diff --git a/packages/ui/emulationstation/package.mk b/packages/ui/emulationstation/package.mk index b128dbcab..99f75417b 100644 --- a/packages/ui/emulationstation/package.mk +++ b/packages/ui/emulationstation/package.mk @@ -3,7 +3,7 @@ # Copyright (C) 2020-present Fewtarius PKG_NAME="emulationstation" -PKG_VERSION="9e42208" +PKG_VERSION="e79f16f231795523fdb4752726a2b2d5c3ee51d3" PKG_GIT_CLONE_BRANCH="main" PKG_REV="1" PKG_ARCH="any" @@ -17,12 +17,11 @@ PKG_BUILD_FLAGS="-gold" GET_HANDLER_SUPPORT="git" PKG_PATCH_DIRS+="${DEVICE}" -if [ ! "${OPENGL}" = "no" ]; then +if [[ "${OPENGL_SUPPORT}" = "yes" ]] && [[ ! "${DEVICE}" = "S922X" ]]; then PKG_DEPENDS_TARGET+=" ${OPENGL} glu" PKG_CMAKE_OPTS_TARGET+=" -DGL=1" -fi -if [ ! "${OPENGLES_SUPPORT}" = no ]; then +elif [ "${OPENGLES_SUPPORT}" = "yes" ]; then PKG_DEPENDS_TARGET+=" ${OPENGLES}" PKG_CMAKE_OPTS_TARGET+=" -DGLES2=1" fi diff --git a/projects/Rockchip/devices/RK3399/options b/projects/Rockchip/devices/RK3399/options index 2e2eae135..7bc6ad223 100644 --- a/projects/Rockchip/devices/RK3399/options +++ b/projects/Rockchip/devices/RK3399/options @@ -30,7 +30,7 @@ KERNEL_TARGET="Image" BOOTLOADER="u-boot" PARTITION_TABLE="msdos" - DEVICE_DTB=("rk3399-rg552-linux") + DEVICE_DTB=("rk3399-anbernic-rg552") UBOOT_DTB="${DEVICE_DTB[0]}" UBOOT_CONFIG="evb-rk3399_defconfig" PKG_SOC="rk3399" diff --git a/projects/Rockchip/packages/linux/patches/RK3399/000-rk3399-devices.patch b/projects/Rockchip/packages/linux/patches/RK3399/000-rk3399-devices.patch index eeb6cc406..9dc92a114 100644 --- a/projects/Rockchip/packages/linux/patches/RK3399/000-rk3399-devices.patch +++ b/projects/Rockchip/packages/linux/patches/RK3399/000-rk3399-devices.patch @@ -1,7 +1,7 @@ diff -rupN linux.orig/Makefile linux/Makefile ---- linux.orig/Makefile 2023-07-24 16:56:41.000000000 +0000 -+++ linux/Makefile 2023-07-26 14:27:49.537460386 +0000 -@@ -814,6 +814,8 @@ KBUILD_CFLAGS += $(call cc-disable-warni +--- linux.orig/Makefile 2023-06-23 03:53:37.552116029 +0000 ++++ linux/Makefile 2023-07-22 17:35:56.978930533 +0000 +@@ -826,6 +826,8 @@ KBUILD_CFLAGS += $(call cc-disable-warni KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation) KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow) KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) @@ -10,7 +10,7 @@ diff -rupN linux.orig/Makefile linux/Makefile ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE KBUILD_CFLAGS += -O2 -@@ -1069,7 +1071,7 @@ endif +@@ -1075,7 +1077,7 @@ endif KBUILD_CFLAGS += -Werror=date-time # enforce correct pointer usage @@ -20,20 +20,1497 @@ diff -rupN linux.orig/Makefile linux/Makefile # Require designated initializers for all marked structures KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init) diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/Makefile linux/arch/arm64/boot/dts/rockchip/Makefile ---- linux.orig/arch/arm64/boot/dts/rockchip/Makefile 2023-07-24 16:56:41.000000000 +0000 -+++ linux/arch/arm64/boot/dts/rockchip/Makefile 2023-07-26 14:27:49.537460386 +0000 -@@ -53,6 +53,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-or - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pinebook-pro.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pinephone-pro.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-puma-haikou.dtb -+dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rg552-linux.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc-mezzanine.dtb - dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc-plus.dtb +--- linux.orig/arch/arm64/boot/dts/rockchip/Makefile 2023-06-23 03:53:36.244094795 +0000 ++++ linux/arch/arm64/boot/dts/rockchip/Makefile 2023-07-27 13:59:09.292214719 +0000 +@@ -21,6 +21,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-li + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-orion-r68-meta.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-px5-evb.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3368-r88.dtb ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-anbernic-rg552.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-eaidk-610.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-evb.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-ficus.dtb +diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552-opp.dtsi linux/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552-opp.dtsi +--- linux.orig/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552-opp.dtsi 1970-01-01 00:00:00.000000000 +0000 ++++ linux/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552-opp.dtsi 2023-07-27 12:34:27.790942738 +0000 +@@ -0,0 +1,141 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2016-2017 Fuzhou Rockchip Electronics Co., Ltd ++ * Copyright (C) 2023 BrooksyTech (https://github.com/brooksytech) ++ */ ++ ++/ { ++ cluster0_opp: opp-table-0 { ++ compatible = "operating-points-v2"; ++ opp-shared; ++ ++ opp00 { ++ opp-hz = /bits/ 64 <816000000>; ++ opp-microvolt = <850000>; ++ }; ++ opp01 { ++ opp-hz = /bits/ 64 <1008000000>; ++ opp-microvolt = <925000>; ++ }; ++ opp02 { ++ opp-hz = /bits/ 64 <1200000000>; ++ opp-microvolt = <1000000>; ++ }; ++ opp03 { ++ opp-hz = /bits/ 64 <1416000000>; ++ opp-microvolt = <1125000>; ++ }; ++ opp-04 { ++ opp-hz = /bits/ 64 <1512000000>; ++ opp-microvolt = <1200000>; ++ }; ++ opp-05 { ++ opp-hz = /bits/ 64 <1608000000>; ++ opp-microvolt = <1225000>; ++ }; ++ }; ++ ++ cluster1_opp: opp-table-1 { ++ compatible = "operating-points-v2"; ++ opp-shared; ++ ++ opp00 { ++ opp-hz = /bits/ 64 <816000000>; ++ opp-microvolt = <825000>; ++ }; ++ opp01 { ++ opp-hz = /bits/ 64 <1008000000>; ++ opp-microvolt = <875000>; ++ }; ++ opp02 { ++ opp-hz = /bits/ 64 <1200000000>; ++ opp-microvolt = <950000>; ++ }; ++ opp03 { ++ opp-hz = /bits/ 64 <1416000000>; ++ opp-microvolt = <1025000>; ++ }; ++ opp04 { ++ opp-hz = /bits/ 64 <1608000000>; ++ opp-microvolt = <1100000>; ++ }; ++ opp05 { ++ opp-hz = /bits/ 64 <1800000000>; ++ opp-microvolt = <1200000>; ++ }; ++ opp-06 { ++ opp-hz = /bits/ 64 <1992000000>; ++ opp-microvolt = <1250000>; ++ }; ++ opp-07 { ++ opp-hz = /bits/ 64 <2088000000>; ++ opp-microvolt = <1250000>; ++ }; ++ }; ++ ++ gpu_opp_table: opp-table-2 { ++ compatible = "operating-points-v2"; ++ ++ opp00 { ++ opp-hz = /bits/ 64 <500000000>; ++ opp-microvolt = <875000>; ++ }; ++ opp01 { ++ opp-hz = /bits/ 64 <600000000>; ++ opp-microvolt = <925000>; ++ }; ++ opp02 { ++ opp-hz = /bits/ 64 <800000000>; ++ opp-microvolt = <1100000>; ++ }; ++ opp03 { ++ opp-hz = /bits/ 64 <900000000>; ++ opp-microvolt = <1150000>; ++ }; ++ }; ++ ++ dmc_opp_table: opp-table-3 { ++ compatible = "operating-points-v2"; ++ ++ opp00 { ++ opp-hz = /bits/ 64 <666000000>; ++ opp-microvolt = <900000>; ++ }; ++ opp01 { ++ opp-hz = /bits/ 64 <856000000>; ++ opp-microvolt = <900000>; ++ }; ++ }; ++}; ++ ++&cpu_l0 { ++ operating-points-v2 = <&cluster0_opp>; ++}; ++ ++&cpu_l1 { ++ operating-points-v2 = <&cluster0_opp>; ++}; ++ ++&cpu_l2 { ++ operating-points-v2 = <&cluster0_opp>; ++}; ++ ++&cpu_l3 { ++ operating-points-v2 = <&cluster0_opp>; ++}; ++ ++&cpu_b0 { ++ operating-points-v2 = <&cluster1_opp>; ++}; ++ ++&cpu_b1 { ++ operating-points-v2 = <&cluster1_opp>; ++}; ++ ++&dmc { ++ operating-points-v2 = <&dmc_opp_table>; ++}; ++ ++&gpu { ++ operating-points-v2 = <&gpu_opp_table>; ++}; +diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts linux/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts +--- linux.orig/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts 1970-01-01 00:00:00.000000000 +0000 ++++ linux/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts 2023-07-27 13:51:07.753940750 +0000 +@@ -0,0 +1,1328 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd. ++ * Copyright (c) 2018 Akash Gajjar ++ * Copyright (c) 2022 Maya Matuszczyk ++ * Copyright (C) 2023 BrooksyTech (https://github.com/brooksytech) ++ */ ++ ++ ++/dts-v1/; ++#include ++#include ++#include ++#include "rk3399.dtsi" ++#include "rk3399-anbernic-rg552-opp.dtsi" ++ ++/ { ++ model = "Anbernic RG552"; ++ compatible = "anbernic,rg552", "rockchip,rk3399"; ++ ++ aliases { ++ mmc0 = &sdio0; ++ mmc1 = &sdmmc; ++ mmc2 = &sdhci; ++ }; ++ ++ chosen { ++ stdout-path = "serial2:1500000n8"; ++ }; ++ ++ volume-keys { ++ compatible = "gpio-keys"; ++ autorepeat; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vol_pwr_btn>; ++ ++ sw1 { ++ label = "BTN VOL+"; ++ linux,code = ; ++ gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_LOW>; ++ }; ++ sw2 { ++ label = "BTN VOL-"; ++ linux,code = ; ++ gpios = <&gpio3 RK_PB6 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ power-btn { ++ compatible = "gpio-keys"; ++ autorepeat; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwr_btn>; ++ ++ sw1 { ++ debounce-interval = <100>; ++ gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>; ++ label = "BTN PWR"; ++ linux,code = ; ++ wakeup-source; ++ }; ++ }; ++ ++ adc-keys { ++ compatible = "adc-keys"; ++ io-channels = <&saradc 1>; ++ io-channel-names = "buttons"; ++ keyup-threshold-microvolt = <1800000>; ++ poll-interval = <100>; ++ ++ home-key { ++ linux,code = ; ++ label = "F Button"; ++ press-threshold-microvolt = <1750>; ++ }; ++ }; ++ ++ joypad: singleadc-joypad { ++ compatible = "singleadc-joypad"; ++ ++ pwms = <&pwm3 0 200000000 0>; ++ pwm-names = "enable"; ++ rumble-boost-weak = <0x0000>; ++ rumble-boost-strong = <0x0000>; ++ ++ joypad-name = "retrogame_joypad"; ++ joypad-product = <0x1101>; ++ joypad-revision = <0x0200>; ++ ++ status = "okay"; ++ ++ /* gpio pincontrol setup */ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&btn_pins>; ++ ++ /* Analog mux define */ ++ io-channel-names = "amux_adc"; ++ io-channels = <&saradc 4>; ++ ++ /* adc mux channel count */ ++ amux-count = <4>; ++ /* adc mux select(a,b) gpio */ ++ amux-a-gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_LOW>; ++ amux-b-gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_LOW>; ++ /* adc mux enable gpio */ ++ amux-en-gpios = <&gpio1 RK_PA4 GPIO_ACTIVE_LOW>; ++ ++ /* adc calculate scale */ ++ button-adc-scale = <2>; ++ ++ /* adc deadzone range */ ++ button-adc-deadzone = <64>; ++ ++ /* ++ specifies fuzz value that is used to filter noise from ++ the event stream. ++ */ ++ button-adc-fuzz = <32>; ++ button-adc-flat = <32>; ++ ++ /* ++ Analog Stick data tuning value(precent) ++ p = positive direction, n = negative direction ++ report value = (real_adc_data * tuning_value) / 100 ++ */ ++ abs_x-p-tuning = <300>; ++ abs_x-n-tuning = <300>; ++ ++ abs_y-p-tuning = <300>; ++ abs_y-n-tuning = <300>; ++ ++ abs_rx-p-tuning = <300>; ++ abs_rx-n-tuning = <300>; ++ ++ abs_ry-p-tuning = <300>; ++ abs_ry-n-tuning = <300>; ++ ++ /* poll device interval (ms), adc read interval */ ++ poll-interval = <10>; ++ ++ /* required for RG552(invert) */ ++ invert-absx; ++ invert-absy; ++ ++ /* gpio button auto repeat set value : default disable */ ++ /* ++ autorepeat; ++ */ ++ sw1 { ++ gpios = <&gpio3 RK_PA0 GPIO_ACTIVE_LOW>; ++ label = "GPIO DPAD-UP"; ++ linux,code = ; ++ }; ++ sw2 { ++ gpios = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>; ++ label = "GPIO DPAD-DOWN"; ++ linux,code = ; ++ }; ++ sw3 { ++ gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_LOW>; ++ label = "GPIO DPAD-LEFT"; ++ linux,code = ; ++ }; ++ sw4 { ++ gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_LOW>; ++ label = "GPIO DPAD-RIGHT"; ++ linux,code = ; ++ }; ++ sw5 { ++ gpios = <&gpio3 RK_PA6 GPIO_ACTIVE_LOW>; ++ label = "GPIO KEY BTN-A"; ++ linux,code = ; ++ }; ++ sw6 { ++ gpios = <&gpio3 RK_PA7 GPIO_ACTIVE_LOW>; ++ label = "GPIO BTN-B"; ++ linux,code = ; ++ }; ++ sw7 { ++ gpios = <&gpio3 RK_PA4 GPIO_ACTIVE_LOW>; ++ label = "GPIO BTN-X"; ++ linux,code = ; ++ }; ++ sw8 { ++ gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_LOW>; ++ label = "GPIO BTN-Y"; ++ linux,code = ; ++ }; ++ sw9 { ++ gpios = <&gpio3 RK_PB1 GPIO_ACTIVE_LOW>; ++ label = "GPIO BTN_SELECT"; ++ linux,code = ; ++ }; ++ sw10 { ++ gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>; ++ label = "GPIO BTN_START"; ++ linux,code = ; ++ }; ++ sw11 { ++ gpios = <&gpio3 RK_PC0 GPIO_ACTIVE_LOW>; ++ label = "GPIO BTN_F"; ++ linux,code = ; ++ }; ++ sw12 { ++ gpios = <&gpio3 RK_PD0 GPIO_ACTIVE_LOW>; ++ label = "GPIO BTN_TL"; ++ linux,code = ; ++ }; ++ sw13 { ++ gpios = <&gpio3 RK_PD2 GPIO_ACTIVE_LOW>; ++ label = "GPIO BTN_TR"; ++ linux,code = ; ++ }; ++ sw14 { ++ gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_LOW>; ++ label = "GPIO BTN_TL2"; ++ linux,code = ; ++ }; ++ sw15 { ++ gpios = <&gpio3 RK_PD3 GPIO_ACTIVE_LOW>; ++ label = "GPIO BTN_TR2"; ++ linux,code = ; ++ }; ++ sw16 { ++ gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_LOW>; ++ label = "GPIO BTN_THUMBL"; ++ linux,code = ; ++ }; ++ sw17 { ++ gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_LOW>; ++ label = "GPIO BTN_THUMBR"; ++ linux,code = ; ++ }; ++ }; ++ ++ leds: gpio-leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 =<&leds_gpio>; ++ ++ led@1 { ++ gpios = <&gpio1 RK_PC4 GPIO_ACTIVE_HIGH>; ++ label = "battery_green"; ++ default-state= "on"; ++ }; ++ ++ led@2 { ++ gpios = <&gpio3 RK_PD5 GPIO_ACTIVE_HIGH>; ++ label = "battery_red"; ++ }; ++ ++ }; ++ ++ es8316-sound { ++ compatible = "simple-audio-card"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&hp_det_pin>; ++ simple-audio-card,name = "rockchip,es8316-codec"; ++ simple-audio-card,format = "i2s"; ++ simple-audio-card,mclk-fs = <256>; ++ ++ simple-audio-card,widgets = ++ "Microphone", "Mic Jack", ++ "Headphone", "Headphones", ++ "Speaker", "Speaker"; ++ simple-audio-card,routing = ++ "MIC1", "Mic Jack", ++ "Headphones", "HPOL", ++ "Headphones", "HPOR", ++ "Speaker Amplifier INL", "HPOL", ++ "Speaker Amplifier INR", "HPOR", ++ "Speaker", "Speaker Amplifier OUTL", ++ "Speaker", "Speaker Amplifier OUTR"; ++ ++ simple-audio-card,hp-det-gpio = <&gpio0 RK_PB0 GPIO_ACTIVE_HIGH>; ++ simple-audio-card,aux-devs = <&speaker_amp>; ++ simple-audio-card,pin-switches = "Speaker"; ++ ++ simple-audio-card,cpu { ++ sound-dai = <&i2s1>; ++ }; ++ ++ simple-audio-card,codec { ++ sound-dai = <&es8316>; ++ }; ++ }; ++ ++ speaker_amp: speaker-amplifier { ++ compatible = "simple-audio-amplifier"; ++ enable-gpios = <&gpio1 RK_PC5 GPIO_ACTIVE_HIGH>; ++ sound-name-prefix = "Speaker Amplifier"; ++ VCC-supply = <&vcc5v0_sys>; ++ }; ++ ++ hdmi-sound { ++ status = "okay"; ++ }; ++ ++ fan: pwm-fan { ++ compatible = "pwm-fan"; ++ pwms = <&pwm1 0 10000 1>; ++ #cooling-cells = <2>; ++ cooling-levels = <80 140 200 255>; ++ fan-supply = <&vcc5v0_sys>; ++ }; ++ ++ backlight: backlight { ++ status = "okay"; ++ compatible = "pwm-backlight"; ++ pwms = <&pwm0 0 25000 0>; ++ brightness-levels = < ++ 0 1 2 3 4 5 6 7 ++ 8 9 10 11 12 13 14 15 ++ 16 17 18 19 20 21 22 23 ++ 24 25 26 27 28 29 30 31 ++ 32 33 34 35 36 37 38 39 ++ 40 41 42 43 44 45 46 47 ++ 48 49 50 51 52 53 54 55 ++ 56 57 58 59 60 61 62 63 ++ 64 65 66 67 68 69 70 71 ++ 72 73 74 75 76 77 78 79 ++ 80 81 82 83 84 85 86 87 ++ 88 89 90 91 92 93 94 95 ++ 96 97 98 99 100 101 102 103 ++ 104 105 106 107 108 109 110 111 ++ 112 113 114 115 116 117 118 119 ++ 120 121 122 123 124 125 126 127 ++ 128 129 130 131 132 133 134 135 ++ 136 137 138 139 140 141 142 143 ++ 144 145 146 147 148 149 150 151 ++ 152 153 154 155 156 157 158 159 ++ 160 161 162 163 164 165 166 167 ++ 168 169 170 171 172 173 174 175 ++ 176 177 178 179 180 181 182 183 ++ 184 185 186 187 188 189 190 191 ++ 192 193 194 195 196 197 198 199 ++ 200 201 202 203 204 205 206 207 ++ 208 209 210 211 212 213 214 215 ++ 216 217 218 219 220 221 222 223 ++ 224 225 226 227 228 229 230 231 ++ 232 233 234 235 236 237 238 239 ++ 240 241 242 243 244 245 246 247 ++ 248 249 250 251 252 253 254 255>; ++ default-brightness-level = <200>; ++ }; ++ ++ bat: battery { ++ compatible = "simple-battery"; ++ charge-full-design-microamp-hours = <6400000>; ++ voltage-max-design-microvolt = <4350000>; ++ voltage-min-design-microvolt = <3400000>; ++ }; ++ ++ mains_charger: dc-charger { ++ compatible = "gpio-charger"; ++ charger-type = "mains"; ++ gpios = <&gpio4 RK_PD0 GPIO_ACTIVE_LOW>; ++ ++ /* Also triggered by USB charger */ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&dc_det_pin>; ++ }; ++ ++ xin32k: xin32k { ++ compatible = "fixed-clock"; ++ clock-frequency = <32768>; ++ clock-output-names = "xin32k"; ++ #clock-cells = <0>; ++ }; ++ ++ clkin_gmac: external-gmac-clock { ++ compatible = "fixed-clock"; ++ clock-frequency = <125000000>; ++ clock-output-names = "clkin_gmac"; ++ #clock-cells = <0>; ++ }; ++ ++ vcc12v_dcin: vcc12v-dcin { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc12v_dcin"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <12000000>; ++ regulator-max-microvolt = <12000000>; ++ }; ++ ++ vcc_sys: vcc-sys { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc_sys"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-always-on; ++ vin-supply = <&vcc12v_dcin>; ++ }; ++ ++ vcc3v3_sys: vcc3v3-sys { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3_sys"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ vin-supply = <&vcc5v0_sys>; ++ }; ++ ++ vcc3v0_sd: vcc3v0-sd { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdmmc0_pwr_h>; ++ regulator-name = "vcc3v0_sd"; ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ vin-supply = <&vcc3v3_sys>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc5v0_host: vcc5v0-host-regulator { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc5v0_host_en>; ++ regulator-name = "vcc5v0_host"; ++ regulator-always-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&vcc5v0_usb>; ++ }; ++ ++ vcc5v0_typec: vcc5v0-typec-regulator { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc5v0_typec_en>; ++ regulator-name = "vcc5v0_typec"; ++ regulator-always-on; ++ vin-supply = <&vcc5v0_usb>; ++ }; ++ ++ vcc5v0_sys: vcc5v0-sys { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_sys"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&vcc12v_dcin>; ++ }; ++ ++ vcc5v0_usb: vcc5v0-usb { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_usb"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ vin-supply = <&vcc12v_dcin>; ++ }; ++ ++ vdd_log: vdd-log { ++ compatible = "pwm-regulator"; ++ pwms = <&pwm2 0 25000 1>; ++ regulator-name = "vdd_log"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <800000>; ++ regulator-max-microvolt = <1700000>; ++ vin-supply = <&vcc5v0_sys>; ++ }; ++ ++ vcc5v5_lcd: vcc5v5-lcd { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio4 RK_PD3 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc5v5_lcd_en>; ++ regulator-name = "vcc5v5_lcd"; ++ regulator-min-microvolt = <5500000>; ++ regulator-max-microvolt = <5500000>; ++ vin-supply = <&vcc5v0_sys>; ++ }; ++ ++ vcc5v5_neg_lcd: vcc5v5-neg-lcd { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc5v5_neg_lcd_en>; ++ regulator-name = "vcc5v5_neg_lcd"; ++ /* ++ * technically negative ++ */ ++ regulator-min-microvolt = <5500000>; ++ regulator-max-microvolt = <5500000>; ++ vin-supply = <&vcc5v0_sys>; ++ }; ++ ++ vcc_wifi: vcc-wifi-regulator { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio3 RK_PC1 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&wifi_pwr>; ++ regulator-name = "wifi_enable"; ++ regulator-always-on; ++ regulator-boot-on; ++ }; ++}; ++ ++&dmc { ++ status = "okay"; ++ center-supply = <&vdd_center>; ++ operating-points-v2 = <&dmc_opp_table>; ++ ++ rockchip,pd-idle-ns = <160>; ++ rockchip,sr-idle-ns = <10240>; ++ rockchip,sr-mc-gate-idle-ns = <40960>; ++ rockchip,srpd-lite-idle-ns = <61440>; ++ rockchip,standby-idle-ns = <81920>; ++ ++ rockchip,lpddr4_odt_dis_freq = <666000000>; ++ ++ rockchip,srpd-lite-idle-dis-freq-hz = <0>; ++ rockchip,standby-idle-dis-freq-hz = <928000000>; ++ rockchip,sr-mc-gate-idle-dis-freq-hz = <800000000>; ++ rockchip,pd-idle-dis-freq-hz = <800000000>; ++ rockchip,sr-idle-dis-freq-hz = <800000000>; ++}; ++ ++&dfi { ++ status = "okay"; ++}; ++ ++&cpu_thermal { ++ trips { ++ cpu_warm: cpu_warm { ++ temperature = <50000>; ++ hysteresis = <2000>; ++ type = "active"; ++ }; ++ ++ cpu_hot: cpu_hot { ++ temperature = <55000>; ++ hysteresis = <2000>; ++ type = "active"; ++ }; ++ ++ cpu_scalding: cpu_scalding { ++ temperature = <65000>; ++ hysteresis = <5000>; ++ type = "active"; ++ }; ++ }; ++ ++ cooling-maps { ++ map1 { ++ trip = <&cpu_warm>; ++ cooling-device = <&fan THERMAL_NO_LIMIT 1>; ++ }; ++ ++ map2 { ++ trip = <&cpu_hot>; ++ cooling-device = <&fan THERMAL_NO_LIMIT 1>; ++ }; ++ ++ map3 { ++ trip = <&cpu_scalding>; ++ cooling-device = <&fan 2 THERMAL_NO_LIMIT>; ++ }; ++ }; ++}; ++ ++&cpu_l0 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_l1 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_l2 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_l3 { ++ cpu-supply = <&vdd_cpu_l>; ++}; ++ ++&cpu_b0 { ++ cpu-supply = <&vdd_cpu_b>; ++}; ++ ++&cpu_b1 { ++ cpu-supply = <&vdd_cpu_b>; ++}; ++ ++&saradc { ++ status = "okay"; ++}; ++ ++&sdio0 { ++ clock-frequency = <150000000>; ++ clock-freq-min-max = <100000 150000000>; ++ supports-sd; ++ no-sdio; ++ bus-width = <4>; ++ disable-wp; ++ cap-sd-highspeed; ++ cap-sdio-irq; ++ keep-power-in-suspend; ++ card-detect-delay = <800>; ++ cd-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_LOW>; /*[> CD GPIO <]*/ ++ num-slots = <1>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdio0_clk &sdio0_cmd &sdio0_cd &sdio0_bus4>; ++ sd-uhs-sdr104; ++ vqmmc-supply = <&vcc3v0_touch>; ++ //vqmmc-supply = <&vcc_sdio>; ++ status = "okay"; ++}; ++ ++&sdmmc { ++ bus-width = <4>; ++ cap-sd-highspeed; ++ cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; ++ disable-wp; ++ max-frequency = <150000000>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>; ++ vmmc-supply = <&vcc3v0_sd>; ++ vqmmc-supply = <&vcc_sdio>; ++ status = "okay"; ++}; ++ ++&emmc_phy { ++ status = "okay"; ++}; ++ ++&gpu { ++ mali-supply = <&vdd_gpu>; ++ status = "okay"; ++}; ++ ++&pwm0 { ++ status = "okay"; ++}; ++ ++&pwm1 { ++ status = "okay"; ++}; ++ ++&pwm2 { ++ status = "okay"; ++ pinctrl-names = "active"; ++ pinctrl-0 = <&pwm2_pin_pull_down>; ++}; ++ ++&pwm3 { ++ status = "okay"; ++ label = "rumble-pwm"; ++}; ++ ++&saradc { ++ vref-supply = <&vcc_1v8>; ++ status = "okay"; ++}; ++ ++&sdhci { ++ assigned-clock-rates = <150000000>; ++ ++ bus-width = <8>; ++ mmc-hs400-1_8v; ++ mmc-hs400-enhanced-strobe; ++ non-removable; ++ ++ status = "okay"; ++}; ++ ++&hdmi { ++ ddc-i2c-bus = <&i2c3>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&hdmi_cec>; ++ status = "okay"; ++}; ++ ++&mipi_dsi { ++ status = "okay"; ++ clock-master; ++ ++ ports { ++ mipi_out: port@1 { ++ #address-cells = <0>; ++ #size-cells = <0>; ++ reg = <1>; ++ ++ mipi_out_panel: endpoint { ++ remote-endpoint = <&mipi_in_panel>; ++ }; ++ }; ++ }; ++ ++ panel@0 { ++ reg = <0>; ++ compatible = "sharp,ls054b3sx01"; ++ backlight = <&backlight>; ++ rotation = <270>; ++ ++ iovcc-supply = <&vcc1v8_dvp>; ++ vsp-supply = <&vcc5v5_lcd>; ++ vsn-supply = <&vcc5v5_neg_lcd>; ++ ++ reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_HIGH>; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&lcd_reset_gpio>; ++ ++ port { ++ mipi_in_panel: endpoint { ++ remote-endpoint = <&mipi_out_panel>; ++ }; ++ }; ++ }; ++}; ++ ++&i2c0 { ++ clock-frequency = <400000>; ++ i2c-scl-rising-time-ns = <168>; ++ i2c-scl-falling-time-ns = <4>; ++ status = "okay"; ++ ++ rk808: pmic@1b { ++ compatible = "rockchip,rk808"; ++ reg = <0x1b>; ++ interrupt-parent = <&gpio3>; ++ interrupts = <10 IRQ_TYPE_LEVEL_LOW>; ++ #clock-cells = <1>; ++ clock-output-names = "rk808-clkout1", "rk808-clkout2"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pmic_int_l>; ++ rockchip,system-power-controller; ++ wakeup-source; ++ ++ vcc1-supply = <&vcc5v0_sys>; ++ vcc2-supply = <&vcc5v0_sys>; ++ vcc3-supply = <&vcc5v0_sys>; ++ vcc4-supply = <&vcc5v0_sys>; ++ vcc6-supply = <&vcc5v0_sys>; ++ vcc7-supply = <&vcc5v0_sys>; ++ vcc8-supply = <&vcc3v3_sys>; ++ vcc9-supply = <&vcc5v0_sys>; ++ vcc10-supply = <&vcc5v0_sys>; ++ vcc11-supply = <&vcc5v0_sys>; ++ vcc12-supply = <&vcc3v3_sys>; ++ vddio-supply = <&vcca_1v8>; ++ ++ rtc { ++ status = "okay"; ++ }; ++ ++ regulators { ++ vdd_center: DCDC_REG1 { ++ regulator-name = "vdd_center"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ regulator-ramp-delay = <6001>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_cpu_l: DCDC_REG2 { ++ regulator-name = "vdd_cpu_l"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <750000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_ddr: DCDC_REG3 { ++ regulator-name = "vcc_ddr"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ vcc_1v8: DCDC_REG4 { ++ regulator-name = "vcc_1v8"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ vcc1v8_dvp: LDO_REG1 { ++ regulator-name = "vcc1v8_dvp"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc3v0_touch: LDO_REG2 { ++ regulator-name = "vcc3v0_touch"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcca_1v8: LDO_REG3 { ++ regulator-name = "vcca_1v8"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ vcc_sdio: LDO_REG4 { ++ regulator-name = "vcc_sdio"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3300000>; ++ }; ++ }; ++ ++ vcca3v0_codec: LDO_REG5 { ++ regulator-name = "vcca3v0_codec"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_1v5: LDO_REG6 { ++ regulator-name = "vcc_1v5"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1500000>; ++ }; ++ }; ++ ++ vcca1v8_codec: LDO_REG7 { ++ regulator-name = "vcca1v8_codec"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_3v0: LDO_REG8 { ++ regulator-name = "vcc_3v0"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3000000>; ++ }; ++ }; ++ ++ vcc3v3_s3: vcc_lan: SWITCH_REG1 { ++ regulator-name = "vcc3v3_s3"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc3v3_s0: SWITCH_REG2 { ++ regulator-name = "vcc3v3_s0"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ }; ++ }; ++ ++ vdd_cpu_b: regulator@40 { ++ compatible = "silergy,syr827"; ++ reg = <0x40>; ++ fcs,suspend-voltage-selector = <1>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vsel1_pin>; ++ regulator-name = "vdd_cpu_b"; ++ regulator-min-microvolt = <712500>; ++ regulator-max-microvolt = <1500000>; ++ regulator-ramp-delay = <1000>; ++ regulator-always-on; ++ regulator-boot-on; ++ vin-supply = <&vcc5v0_sys>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vdd_gpu: regulator@41 { ++ compatible = "silergy,syr828"; ++ reg = <0x41>; ++ fcs,suspend-voltage-selector = <1>; ++ vsel-gpios = <&gpio1 RK_PB6 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vsel2_pin>; ++ regulator-name = "vdd_gpu"; ++ regulator-min-microvolt = <712500>; ++ regulator-max-microvolt = <1500000>; ++ regulator-ramp-delay = <1000>; ++ regulator-always-on; ++ regulator-boot-on; ++ vin-supply = <&vcc5v0_sys>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ cw2015@62 { ++ compatible = "cellwise,cw2015"; ++ reg = <0x62>; ++ cellwise,battery-profile = /bits/ 8 < ++ 0x15 0x7E 0x66 0x5B 0x58 0x55 0x51 0x4D ++ 0x4A 0x47 0x44 0x47 0x4D 0x46 0x32 0x27 ++ 0x1F 0x1A 0x15 0x16 0x21 0x30 0x3F 0x4A ++ 0x46 0x5C 0x0C 0x29 0x19 0x31 0x59 0x74 ++ 0x7B 0x7D 0x81 0x82 0x3F 0x1A 0x58 0x22 ++ 0x06 0x42 0x2B 0x63 0x89 0x93 0x94 0x3C ++ 0x57 0x7D 0x93 0xAE 0x80 0xC2 0xD2 0xCB ++ 0x2F 0x00 0x64 0xA5 0xB5 0x1F 0xB0 0x11 ++ >; ++ cellwise,monitor-interval-ms = <5000>; ++ monitored-battery = <&bat>; ++ power-supplies = <&mains_charger>, <&fusb0>; ++ }; ++ ++}; ++ ++&i2c1 { ++ clock-frequency = <100000>; ++ i2c-scl-rising-time-ns = <168>; ++ i2c-scl-falling-time-ns = <4>; ++ status = "okay"; ++ ++ es8316: es8316@11 { ++ compatible = "everest,es8316"; ++ reg = <0x11>; ++ clocks = <&cru SCLK_I2S_8CH_OUT>; ++ clock-names = "mclk"; ++ #sound-dai-cells = <0>; ++ }; ++}; ++ ++&i2c3 { ++ i2c-scl-rising-time-ns = <450>; ++ i2c-scl-falling-time-ns = <15>; ++ status = "okay"; ++}; ++ ++&i2c4 { ++ i2c-scl-rising-time-ns = <600>; ++ i2c-scl-falling-time-ns = <20>; ++ status = "okay"; ++ ++ gt9xx: gt9xx@14 { ++ compatible = "goodix,gt927"; ++ reg = <0x14>; ++ irq-gpios = <&gpio3 RK_PD7 GPIO_ACTIVE_HIGH>; ++ reset-gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_HIGH>; ++ touchscreen-size-x = <1152>; ++ touchscreen-size-y = <1920>; ++ touchscreen-inverted-x; ++ touchscreen-inverted-y; ++ interrupt-parent = <&gpio3>; ++ interrupts = ; ++ AVDD28-supply = <&vcc3v0_touch>; ++ VDDIO-supply = <&vcc3v0_touch>; ++ }; ++ ++ fusb0: typec-portc@22 { ++ compatible = "fcs,fusb302"; ++ status = "okay"; ++ reg = <0x22>; ++ interrupt-parent = <&gpio1>; ++ interrupts = ; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&fusb0_int>; ++ vbus-supply = <&vcc5v0_typec>; ++ ++ connector { ++ compatible = "usb-c-connector"; ++ data-role = "dual"; ++ label = "USB-C"; ++ op-sink-microwatt = <1000000>; ++ power-role = "dual"; ++ sink-pdos = ++ ; ++ source-pdos = ++ ; ++ try-power-role = "sink"; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ port@0 { ++ reg = <0>; ++ ++ usbc_hs: endpoint { ++ remote-endpoint = <&u2phy0_typec_hs>; ++ }; ++ }; ++ ++ port@1 { ++ reg = <1>; ++ ++ usbc_ss: endpoint { ++ remote-endpoint = <&tcphy0_typec_ss>; ++ }; ++ }; ++ }; ++ }; ++ }; ++}; ++ ++&i2s1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2s_8ch_mclk_pin>, <&i2s1_2ch_bus>; ++ rockchip,capture-channels = <8>; ++ rockchip,playback-channels = <8>; ++ status = "okay"; ++}; ++ ++&i2s2 { ++ status = "okay"; ++}; ++ ++&io_domains { ++ status = "okay"; ++ ++ bt656-supply = <&vcc1v8_dvp>; ++ audio-supply = <&vcca3v0_codec>; ++ sdmmc-supply = <&vcc_sdio>; ++ gpio1830-supply = <&vcc_3v0>; ++}; ++ ++&pmu_io_domains { ++ pmu1830-supply = <&vcc_3v0>; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ dc-charger { ++ dc_det_pin: dc-det-pin { ++ rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ es8316 { ++ hp_det_pin: hp-det-pin { ++ rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ i2s1 { ++ i2s_8ch_mclk_pin: i2s-8ch-mclk-pin { ++ rockchip,pins = <4 RK_PA0 1 &pcfg_pull_none>; ++ }; ++ }; ++ ++ fusb302x { ++ fusb0_int: fusb0-int { ++ rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ pmic { ++ pmic_int_l: pmic-int-l { ++ rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ ++ vsel1_pin: vsel1-pin { ++ rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ ++ vsel2_pin: vsel2-pin { ++ rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>; ++ }; ++ }; ++ ++ sdcard { ++ sdmmc0_pwr_h: sdmmc0-pwr-h { ++ rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ }; ++ ++ usb-typec { ++ vcc5v0_typec_en: vcc5v0_typec_en { ++ rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ usb2 { ++ vcc5v0_host_en: vcc5v0-host-en { ++ rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ gpio-leds { ++ leds_gpio: leds-gpio { ++ rockchip,pins = ++ <1 RK_PC4 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++ ++ lcd-panel { ++ lcd_reset_gpio: lcd-reset-gpio { ++ rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ vcc5v5_lcd_en: vcc5v5-lcd-en { ++ rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ ++ vcc5v5_neg_lcd_en: vcc5v5-neg-lcd-en { ++ rockchip,pins = <0 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ wifi { ++ wifi_pwr: wifi-pwr-en { ++ rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ ++ btns { ++ btn_pins: btn-pins { ++ rockchip,pins = ++ <3 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PD1 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PB3 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PC0 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ vol_pwr_btn: vol-pwr-btn { ++ rockchip,pins = ++ <3 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>, ++ <3 RK_PB6 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ pwr_btn: pwr-btn { ++ rockchip,pins = ++ <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>; ++ }; ++ }; ++}; ++ ++&tcphy0 { ++ status = "okay"; ++}; ++ ++&tcphy0_usb3 { ++ port { ++ tcphy0_typec_ss: endpoint { ++ remote-endpoint = <&usbc_ss>; ++ }; ++ }; ++}; ++ ++&tcphy1 { ++ status = "okay"; ++}; ++ ++&tsadc { ++ /* tshut mode 0:CRU 1:GPIO */ ++ rockchip,hw-tshut-mode = <1>; ++ /* tshut polarity 0:LOW 1:HIGH */ ++ rockchip,hw-tshut-polarity = <1>; ++ status = "okay"; ++}; ++ ++&u2phy0 { ++ status = "okay"; ++ ++ u2phy0_otg: otg-port { ++ status = "okay"; ++ }; ++ ++ u2phy0_host: host-port { ++ phy-supply = <&vcc5v0_host>; ++ status = "okay"; ++ }; ++ ++ port { ++ u2phy0_typec_hs: endpoint { ++ remote-endpoint = <&usbc_hs>; ++ }; ++ }; ++}; ++ ++&u2phy1 { ++ status = "okay"; ++ ++ u2phy1_otg: otg-port { ++ status = "okay"; ++ }; ++ ++ u2phy1_host: host-port { ++ phy-supply = <&vcc5v0_host>; ++ status = "okay"; ++ }; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>; ++ status = "okay"; ++}; ++ ++&uart2 { ++ status = "okay"; ++}; ++ ++&usb_host0_ehci { ++ status = "okay"; ++}; ++ ++&usb_host0_ohci { ++ status = "okay"; ++}; ++ ++&usb_host1_ehci { ++ status = "okay"; ++}; ++ ++&usb_host1_ohci { ++ status = "okay"; ++}; ++ ++&usbdrd3_0 { ++ status = "okay"; ++}; ++ ++&usbdrd_dwc3_0 { ++ status = "okay"; ++ dr_mode = "host"; ++}; ++ ++&usbdrd3_1 { ++ status = "okay"; ++}; ++ ++&usbdrd_dwc3_1 { ++ status = "okay"; ++ dr_mode = "host"; ++}; ++ ++&vopb { ++ status = "okay"; ++}; ++ ++&vopb_mmu { ++ status = "okay"; ++}; ++ ++&vopl { ++ status = "okay"; ++}; ++ ++&vopl_mmu { ++ status = "okay"; ++}; diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-rg552-linux.dts linux/arch/arm64/boot/dts/rockchip/rk3399-rg552-linux.dts --- linux.orig/arch/arm64/boot/dts/rockchip/rk3399-rg552-linux.dts 1970-01-01 00:00:00.000000000 +0000 -+++ linux/arch/arm64/boot/dts/rockchip/rk3399-rg552-linux.dts 2023-07-26 14:27:49.537460386 +0000 -@@ -0,0 +1,1334 @@ ++++ linux/arch/arm64/boot/dts/rockchip/rk3399-rg552-linux.dts 2023-07-25 20:07:51.652630111 +0000 +@@ -0,0 +1,1333 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd. @@ -657,7 +2134,6 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-rg552-linux.dts linux/ + pinctrl-names = "default"; + pinctrl-0 = <&sdio0_clk &sdio0_cmd &sdio0_cd &sdio0_bus4>; + sd-uhs-sdr104; -+// vqmmc-supply = <&vcc3v0_touch>; + vqmmc-supply = <&vcc_sdio>; + status = "okay"; +}; @@ -1370,7 +2846,7 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-rg552-linux.dts linux/ +}; diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-rg552-opp.dtsi linux/arch/arm64/boot/dts/rockchip/rk3399-rg552-opp.dtsi --- linux.orig/arch/arm64/boot/dts/rockchip/rk3399-rg552-opp.dtsi 1970-01-01 00:00:00.000000000 +0000 -+++ linux/arch/arm64/boot/dts/rockchip/rk3399-rg552-opp.dtsi 2023-07-26 14:27:49.537460386 +0000 ++++ linux/arch/arm64/boot/dts/rockchip/rk3399-rg552-opp.dtsi 2023-07-22 17:35:53.870832792 +0000 @@ -0,0 +1,141 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* @@ -1514,9 +2990,9 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-rg552-opp.dtsi linux/a + operating-points-v2 = <&gpu_opp_table>; +}; diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399.dtsi linux/arch/arm64/boot/dts/rockchip/rk3399.dtsi ---- linux.orig/arch/arm64/boot/dts/rockchip/rk3399.dtsi 2023-07-24 16:56:41.000000000 +0000 -+++ linux/arch/arm64/boot/dts/rockchip/rk3399.dtsi 2023-07-26 14:27:49.537460386 +0000 -@@ -1489,7 +1489,7 @@ +--- linux.orig/arch/arm64/boot/dts/rockchip/rk3399.dtsi 2023-06-23 03:53:36.256094988 +0000 ++++ linux/arch/arm64/boot/dts/rockchip/rk3399.dtsi 2023-07-24 20:00:14.430068009 +0000 +@@ -1469,7 +1469,7 @@ <1000000000>, <150000000>, <75000000>, <37500000>, @@ -1526,8 +3002,8 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399.dtsi linux/arch/arm64/ <100000000>, <50000000>, <400000000>, <400000000>, diff -rupN linux.orig/drivers/gpio/gpio-rockchip.c linux/drivers/gpio/gpio-rockchip.c ---- linux.orig/drivers/gpio/gpio-rockchip.c 2023-07-24 16:56:41.000000000 +0000 -+++ linux/drivers/gpio/gpio-rockchip.c 2023-07-26 14:27:49.537460386 +0000 +--- linux.orig/drivers/gpio/gpio-rockchip.c 2023-07-16 19:38:02.962868756 +0000 ++++ linux/drivers/gpio/gpio-rockchip.c 2023-07-22 17:35:57.766955315 +0000 @@ -335,13 +335,13 @@ static void rockchip_irq_demux(struct ir unsigned long pending; unsigned int irq; @@ -1545,9 +3021,9 @@ diff -rupN linux.orig/drivers/gpio/gpio-rockchip.c linux/drivers/gpio/gpio-rockc /* * Triggering IRQ on both rising and falling edge diff -rupN linux.orig/drivers/gpu/drm/panel/Kconfig linux/drivers/gpu/drm/panel/Kconfig ---- linux.orig/drivers/gpu/drm/panel/Kconfig 2023-07-24 16:56:41.000000000 +0000 -+++ linux/drivers/gpu/drm/panel/Kconfig 2023-07-26 14:27:49.537460386 +0000 -@@ -657,6 +657,15 @@ config DRM_PANEL_SHARP_LS043T1LE01 +--- linux.orig/drivers/gpu/drm/panel/Kconfig 2023-06-23 03:53:39.968155272 +0000 ++++ linux/drivers/gpu/drm/panel/Kconfig 2023-07-25 05:54:31.139292676 +0000 +@@ -588,6 +588,15 @@ config DRM_PANEL_SHARP_LS043T1LE01 Say Y here if you want to enable support for Sharp LS043T1LE01 qHD (540x960) DSI panel as found on the Qualcomm APQ8074 Dragonboard @@ -1564,9 +3040,9 @@ diff -rupN linux.orig/drivers/gpu/drm/panel/Kconfig linux/drivers/gpu/drm/panel/ tristate "Sharp LS060T1SX01 FullHD video mode panel" depends on OF diff -rupN linux.orig/drivers/gpu/drm/panel/Makefile linux/drivers/gpu/drm/panel/Makefile ---- linux.orig/drivers/gpu/drm/panel/Makefile 2023-07-24 16:56:41.000000000 +0000 -+++ linux/drivers/gpu/drm/panel/Makefile 2023-07-26 14:27:49.537460386 +0000 -@@ -66,6 +66,7 @@ obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += +--- linux.orig/drivers/gpu/drm/panel/Makefile 2023-06-23 03:53:39.968155272 +0000 ++++ linux/drivers/gpu/drm/panel/Makefile 2023-07-22 17:35:58.626982361 +0000 +@@ -59,6 +59,7 @@ obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o obj-$(CONFIG_DRM_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o @@ -1576,7 +3052,7 @@ diff -rupN linux.orig/drivers/gpu/drm/panel/Makefile linux/drivers/gpu/drm/panel obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7703) += panel-sitronix-st7703.o diff -rupN linux.orig/drivers/gpu/drm/panel/panel-sharp-ls054b3sx01.c linux/drivers/gpu/drm/panel/panel-sharp-ls054b3sx01.c --- linux.orig/drivers/gpu/drm/panel/panel-sharp-ls054b3sx01.c 1970-01-01 00:00:00.000000000 +0000 -+++ linux/drivers/gpu/drm/panel/panel-sharp-ls054b3sx01.c 2023-07-26 14:27:49.537460386 +0000 ++++ linux/drivers/gpu/drm/panel/panel-sharp-ls054b3sx01.c 2023-07-25 14:36:58.284854285 +0000 @@ -0,0 +1,360 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* @@ -1939,8 +3415,8 @@ diff -rupN linux.orig/drivers/gpu/drm/panel/panel-sharp-ls054b3sx01.c linux/driv +MODULE_DESCRIPTION("Panel driver for Sharp LS054B3SX01 1152x1920 Video Mode DSI Panel"); +MODULE_LICENSE("GPL v2"); diff -rupN linux.orig/drivers/input/Kconfig linux/drivers/input/Kconfig ---- linux.orig/drivers/input/Kconfig 2023-07-24 16:56:41.000000000 +0000 -+++ linux/drivers/input/Kconfig 2023-07-26 14:27:49.537460386 +0000 +--- linux.orig/drivers/input/Kconfig 2023-06-23 03:53:40.600165543 +0000 ++++ linux/drivers/input/Kconfig 2023-07-22 17:35:58.778987141 +0000 @@ -51,6 +51,19 @@ config INPUT_FF_MEMLESS To compile this driver as a module, choose M here: the module will be called ff-memless. @@ -1962,8 +3438,8 @@ diff -rupN linux.orig/drivers/input/Kconfig linux/drivers/input/Kconfig tristate "Sparse keymap support library" help diff -rupN linux.orig/drivers/input/Makefile linux/drivers/input/Makefile ---- linux.orig/drivers/input/Makefile 2023-07-24 16:56:41.000000000 +0000 -+++ linux/drivers/input/Makefile 2023-07-26 14:27:49.537460386 +0000 +--- linux.orig/drivers/input/Makefile 2023-06-23 03:53:40.600165543 +0000 ++++ linux/drivers/input/Makefile 2023-07-22 17:35:58.810988147 +0000 @@ -10,6 +10,7 @@ input-core-y := input.o input-compat.o i input-core-y += touchscreen.o @@ -1974,7 +3450,7 @@ diff -rupN linux.orig/drivers/input/Makefile linux/drivers/input/Makefile obj-$(CONFIG_INPUT_VIVALDIFMAP) += vivaldi-fmap.o diff -rupN linux.orig/drivers/input/input-polldev.c linux/drivers/input/input-polldev.c --- linux.orig/drivers/input/input-polldev.c 1970-01-01 00:00:00.000000000 +0000 -+++ linux/drivers/input/input-polldev.c 2023-07-26 14:27:49.537460386 +0000 ++++ linux/drivers/input/input-polldev.c 2023-07-22 17:35:58.810988147 +0000 @@ -0,0 +1,362 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* @@ -2339,8 +3815,8 @@ diff -rupN linux.orig/drivers/input/input-polldev.c linux/drivers/input/input-po +} +EXPORT_SYMBOL(input_unregister_polled_device); diff -rupN linux.orig/drivers/input/joystick/Kconfig linux/drivers/input/joystick/Kconfig ---- linux.orig/drivers/input/joystick/Kconfig 2023-07-24 16:56:41.000000000 +0000 -+++ linux/drivers/input/joystick/Kconfig 2023-07-26 14:27:49.537460386 +0000 +--- linux.orig/drivers/input/joystick/Kconfig 2023-06-23 03:53:40.604165608 +0000 ++++ linux/drivers/input/joystick/Kconfig 2023-07-22 17:35:58.782987267 +0000 @@ -393,6 +393,12 @@ config JOYSTICK_FSIA6B To compile this driver as a module, choose M here: the module will be called fsia6b. @@ -2355,8 +3831,8 @@ diff -rupN linux.orig/drivers/input/joystick/Kconfig linux/drivers/input/joystic bool "N64 controller" depends on MACH_NINTENDO64 diff -rupN linux.orig/drivers/input/joystick/Makefile linux/drivers/input/joystick/Makefile ---- linux.orig/drivers/input/joystick/Makefile 2023-07-24 16:56:41.000000000 +0000 -+++ linux/drivers/input/joystick/Makefile 2023-07-26 14:27:49.537460386 +0000 +--- linux.orig/drivers/input/joystick/Makefile 2023-06-23 03:53:40.604165608 +0000 ++++ linux/drivers/input/joystick/Makefile 2023-07-22 17:35:58.782987267 +0000 @@ -30,6 +30,7 @@ obj-$(CONFIG_JOYSTICK_PXRC) += pxrc.o obj-$(CONFIG_JOYSTICK_QWIIC) += qwiic-joystick.o obj-$(CONFIG_JOYSTICK_SENSEHAT) += sensehat-joystick.o @@ -2367,7 +3843,7 @@ diff -rupN linux.orig/drivers/input/joystick/Makefile linux/drivers/input/joysti obj-$(CONFIG_JOYSTICK_STINGER) += stinger.o diff -rupN linux.orig/drivers/input/joystick/singleadcjoy.c linux/drivers/input/joystick/singleadcjoy.c --- linux.orig/drivers/input/joystick/singleadcjoy.c 1970-01-01 00:00:00.000000000 +0000 -+++ linux/drivers/input/joystick/singleadcjoy.c 2023-07-26 14:27:49.537460386 +0000 ++++ linux/drivers/input/joystick/singleadcjoy.c 2023-07-22 17:35:58.782987267 +0000 @@ -0,0 +1,1416 @@ +/*----------------------------------------------------------------------------*/ + @@ -3786,9 +5262,9 @@ diff -rupN linux.orig/drivers/input/joystick/singleadcjoy.c linux/drivers/input/ +late_initcall(joypad_init); +module_exit(joypad_exit); diff -rupN linux.orig/drivers/input/touchscreen/goodix.c linux/drivers/input/touchscreen/goodix.c ---- linux.orig/drivers/input/touchscreen/goodix.c 2023-07-24 16:56:41.000000000 +0000 -+++ linux/drivers/input/touchscreen/goodix.c 2023-07-26 14:27:49.537460386 +0000 -@@ -1018,7 +1018,7 @@ retry_get_irq_gpio: +--- linux.orig/drivers/input/touchscreen/goodix.c 2023-06-23 03:53:40.656166453 +0000 ++++ linux/drivers/input/touchscreen/goodix.c 2023-07-22 17:35:58.806988021 +0000 +@@ -1010,7 +1010,7 @@ retry_get_irq_gpio: default: if (ts->gpiod_int && ts->gpiod_rst) { ts->reset_controller_at_probe = true; @@ -3798,8 +5274,8 @@ diff -rupN linux.orig/drivers/input/touchscreen/goodix.c linux/drivers/input/tou } } diff -rupN linux.orig/drivers/power/supply/cw2015_battery.c linux/drivers/power/supply/cw2015_battery.c ---- linux.orig/drivers/power/supply/cw2015_battery.c 2023-07-24 16:56:41.000000000 +0000 -+++ linux/drivers/power/supply/cw2015_battery.c 2023-07-26 14:27:49.537460386 +0000 +--- linux.orig/drivers/power/supply/cw2015_battery.c 2023-06-23 03:53:42.860202281 +0000 ++++ linux/drivers/power/supply/cw2015_battery.c 2023-07-22 17:35:59.927023244 +0000 @@ -553,7 +553,7 @@ static enum power_supply_property cw_bat }; @@ -3811,7 +5287,7 @@ diff -rupN linux.orig/drivers/power/supply/cw2015_battery.c linux/drivers/power/ .num_properties = ARRAY_SIZE(cw_battery_properties), diff -rupN linux.orig/include/linux/input-polldev.h linux/include/linux/input-polldev.h --- linux.orig/include/linux/input-polldev.h 1970-01-01 00:00:00.000000000 +0000 -+++ linux/include/linux/input-polldev.h 2023-07-26 14:27:49.537460386 +0000 ++++ linux/include/linux/input-polldev.h 2023-07-22 17:35:57.254939213 +0000 @@ -0,0 +1,58 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef _INPUT_POLLDEV_H From b78c76f0e1896086e5febeb3bb8a8c892b99ad67 Mon Sep 17 00:00:00 2001 From: mason Date: Thu, 27 Jul 2023 14:22:41 +0000 Subject: [PATCH 7/7] Rename RK3399 kernel to be more inline with standards, hide moonlight S922X --- packages/ui/emulationstation/package.mk | 5 +- .../patches/RK3399/000-rk3399-devices.patch | 1482 ----------------- 2 files changed, 3 insertions(+), 1484 deletions(-) diff --git a/packages/ui/emulationstation/package.mk b/packages/ui/emulationstation/package.mk index 99f75417b..901224839 100644 --- a/packages/ui/emulationstation/package.mk +++ b/packages/ui/emulationstation/package.mk @@ -17,11 +17,12 @@ PKG_BUILD_FLAGS="-gold" GET_HANDLER_SUPPORT="git" PKG_PATCH_DIRS+="${DEVICE}" -if [[ "${OPENGL_SUPPORT}" = "yes" ]] && [[ ! "${DEVICE}" = "S922X" ]]; then +if [ ! "${OPENGL}" = "no" ]; then PKG_DEPENDS_TARGET+=" ${OPENGL} glu" PKG_CMAKE_OPTS_TARGET+=" -DGL=1" +fi -elif [ "${OPENGLES_SUPPORT}" = "yes" ]; then +if [ ! "${OPENGLES_SUPPORT}" = no ]; then PKG_DEPENDS_TARGET+=" ${OPENGLES}" PKG_CMAKE_OPTS_TARGET+=" -DGLES2=1" fi diff --git a/projects/Rockchip/packages/linux/patches/RK3399/000-rk3399-devices.patch b/projects/Rockchip/packages/linux/patches/RK3399/000-rk3399-devices.patch index 9dc92a114..36a9d9d2d 100644 --- a/projects/Rockchip/packages/linux/patches/RK3399/000-rk3399-devices.patch +++ b/projects/Rockchip/packages/linux/patches/RK3399/000-rk3399-devices.patch @@ -1507,1488 +1507,6 @@ diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-anbernic-rg552.dts lin +&vopl_mmu { + status = "okay"; +}; -diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-rg552-linux.dts linux/arch/arm64/boot/dts/rockchip/rk3399-rg552-linux.dts ---- linux.orig/arch/arm64/boot/dts/rockchip/rk3399-rg552-linux.dts 1970-01-01 00:00:00.000000000 +0000 -+++ linux/arch/arm64/boot/dts/rockchip/rk3399-rg552-linux.dts 2023-07-25 20:07:51.652630111 +0000 -@@ -0,0 +1,1333 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd. -+ * Copyright (c) 2018 Akash Gajjar -+ * Copyright (c) 2022 Maya Matuszczyk -+ * Copyright (C) 2023 BrooksyTech (https://github.com/brooksytech) -+ */ -+ -+ -+/dts-v1/; -+#include -+#include -+#include -+#include "rk3399.dtsi" -+#include "rk3399-rg552-opp.dtsi" -+ -+/ { -+ model = "Anbernic RG552"; -+ compatible = "anbernic,rg552", "rockchip,rk3399"; -+ -+ aliases { -+ mmc0 = &sdio0; -+ mmc1 = &sdmmc; -+ mmc2 = &sdhci; -+ }; -+ -+ chosen { -+ stdout-path = "serial2:1500000n8"; -+ }; -+ -+ volume-keys { -+ compatible = "gpio-keys"; -+ autorepeat; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vol_pwr_btn>; -+ -+ sw1 { -+ label = "BTN VOL+"; -+ linux,code = ; -+ gpios = <&gpio3 RK_PB5 GPIO_ACTIVE_LOW>; -+ }; -+ sw2 { -+ label = "BTN VOL-"; -+ linux,code = ; -+ gpios = <&gpio3 RK_PB6 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+ -+ power-btn { -+ compatible = "gpio-keys"; -+ autorepeat; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwr_btn>; -+ -+ sw1 { -+ debounce-interval = <100>; -+ gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>; -+ label = "BTN PWR"; -+ linux,code = ; -+ wakeup-source; -+ }; -+ }; -+ -+ adc-keys { -+ compatible = "adc-keys"; -+ io-channels = <&saradc 1>; -+ io-channel-names = "buttons"; -+ keyup-threshold-microvolt = <1800000>; -+ poll-interval = <100>; -+ -+ home-key { -+ linux,code = ; -+ label = "F Button"; -+ press-threshold-microvolt = <1750>; -+ }; -+ }; -+ -+ joypad: singleadc-joypad { -+ compatible = "singleadc-joypad"; -+ -+ pwms = <&pwm3 0 200000000 0>; -+ pwm-names = "enable"; -+ rumble-boost-weak = <0x0000>; -+ rumble-boost-strong = <0x0000>; -+ -+ joypad-name = "retrogame_joypad"; -+ joypad-product = <0x1101>; -+ joypad-revision = <0x0200>; -+ -+ status = "okay"; -+ -+ /* gpio pincontrol setup */ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&btn_pins>; -+ -+ /* Analog mux define */ -+ io-channel-names = "amux_adc"; -+ io-channels = <&saradc 4>; -+ -+ /* adc mux channel count */ -+ amux-count = <4>; -+ /* adc mux select(a,b) gpio */ -+ amux-a-gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_LOW>; -+ amux-b-gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_LOW>; -+ /* adc mux enable gpio */ -+ amux-en-gpios = <&gpio1 RK_PA4 GPIO_ACTIVE_LOW>; -+ -+ /* adc calculate scale */ -+ button-adc-scale = <2>; -+ -+ /* adc deadzone range */ -+ button-adc-deadzone = <64>; -+ -+ /* -+ specifies fuzz value that is used to filter noise from -+ the event stream. -+ */ -+ button-adc-fuzz = <32>; -+ button-adc-flat = <32>; -+ -+ /* -+ Analog Stick data tuning value(precent) -+ p = positive direction, n = negative direction -+ report value = (real_adc_data * tuning_value) / 100 -+ */ -+ abs_x-p-tuning = <300>; -+ abs_x-n-tuning = <300>; -+ -+ abs_y-p-tuning = <300>; -+ abs_y-n-tuning = <300>; -+ -+ abs_rx-p-tuning = <300>; -+ abs_rx-n-tuning = <300>; -+ -+ abs_ry-p-tuning = <300>; -+ abs_ry-n-tuning = <300>; -+ -+ /* poll device interval (ms), adc read interval */ -+ poll-interval = <10>; -+ -+ /* required for RG552(invert) */ -+ invert-absx; -+ invert-absy; -+ -+ /* gpio button auto repeat set value : default disable */ -+ /* -+ autorepeat; -+ */ -+ sw1 { -+ gpios = <&gpio3 RK_PA0 GPIO_ACTIVE_LOW>; -+ label = "GPIO DPAD-UP"; -+ linux,code = ; -+ }; -+ sw2 { -+ gpios = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>; -+ label = "GPIO DPAD-DOWN"; -+ linux,code = ; -+ }; -+ sw3 { -+ gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_LOW>; -+ label = "GPIO DPAD-LEFT"; -+ linux,code = ; -+ }; -+ sw4 { -+ gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_LOW>; -+ label = "GPIO DPAD-RIGHT"; -+ linux,code = ; -+ }; -+ sw5 { -+ gpios = <&gpio3 RK_PA6 GPIO_ACTIVE_LOW>; -+ label = "GPIO KEY BTN-A"; -+ linux,code = ; -+ }; -+ sw6 { -+ gpios = <&gpio3 RK_PA7 GPIO_ACTIVE_LOW>; -+ label = "GPIO BTN-B"; -+ linux,code = ; -+ }; -+ sw7 { -+ gpios = <&gpio3 RK_PA4 GPIO_ACTIVE_LOW>; -+ label = "GPIO BTN-X"; -+ linux,code = ; -+ }; -+ sw8 { -+ gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_LOW>; -+ label = "GPIO BTN-Y"; -+ linux,code = ; -+ }; -+ sw9 { -+ gpios = <&gpio3 RK_PB1 GPIO_ACTIVE_LOW>; -+ label = "GPIO BTN_SELECT"; -+ linux,code = ; -+ }; -+ sw10 { -+ gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>; -+ label = "GPIO BTN_START"; -+ linux,code = ; -+ }; -+ sw11 { -+ gpios = <&gpio3 RK_PC0 GPIO_ACTIVE_LOW>; -+ label = "GPIO BTN_F"; -+ linux,code = ; -+ }; -+ sw12 { -+ gpios = <&gpio3 RK_PD0 GPIO_ACTIVE_LOW>; -+ label = "GPIO BTN_TL"; -+ linux,code = ; -+ }; -+ sw13 { -+ gpios = <&gpio3 RK_PD2 GPIO_ACTIVE_LOW>; -+ label = "GPIO BTN_TR"; -+ linux,code = ; -+ }; -+ sw14 { -+ gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_LOW>; -+ label = "GPIO BTN_TL2"; -+ linux,code = ; -+ }; -+ sw15 { -+ gpios = <&gpio3 RK_PD3 GPIO_ACTIVE_LOW>; -+ label = "GPIO BTN_TR2"; -+ linux,code = ; -+ }; -+ sw16 { -+ gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_LOW>; -+ label = "GPIO BTN_THUMBL"; -+ linux,code = ; -+ }; -+ sw17 { -+ gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_LOW>; -+ label = "GPIO BTN_THUMBR"; -+ linux,code = ; -+ }; -+ }; -+ -+ leds: gpio-leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 =<&leds_gpio>; -+ -+ led@1 { -+ gpios = <&gpio1 RK_PC4 GPIO_ACTIVE_HIGH>; -+ label = "battery_green"; -+ default-state= "on"; -+ }; -+ -+ led@2 { -+ gpios = <&gpio3 RK_PD5 GPIO_ACTIVE_HIGH>; -+ label = "battery_red"; -+ }; -+ -+ }; -+ -+ es8316-sound { -+ compatible = "simple-audio-card"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&hp_det_pin>; -+ simple-audio-card,name = "rockchip,es8316-codec"; -+ simple-audio-card,format = "i2s"; -+ simple-audio-card,mclk-fs = <256>; -+ -+ simple-audio-card,widgets = -+ "Microphone", "Mic Jack", -+ "Headphone", "Headphones", -+ "Speaker", "Speaker"; -+ simple-audio-card,routing = -+ "MIC1", "Mic Jack", -+ "Headphones", "HPOL", -+ "Headphones", "HPOR", -+ "Speaker Amplifier INL", "HPOL", -+ "Speaker Amplifier INR", "HPOR", -+ "Speaker", "Speaker Amplifier OUTL", -+ "Speaker", "Speaker Amplifier OUTR"; -+ -+ simple-audio-card,hp-det-gpio = <&gpio0 RK_PB0 GPIO_ACTIVE_HIGH>; -+ simple-audio-card,aux-devs = <&speaker_amp>; -+ simple-audio-card,pin-switches = "Speaker"; -+ -+ simple-audio-card,cpu { -+ sound-dai = <&i2s1>; -+ }; -+ -+ simple-audio-card,codec { -+ sound-dai = <&es8316>; -+ }; -+ }; -+ -+ speaker_amp: speaker-amplifier { -+ compatible = "simple-audio-amplifier"; -+ enable-gpios = <&gpio1 RK_PC5 GPIO_ACTIVE_HIGH>; -+ sound-name-prefix = "Speaker Amplifier"; -+ VCC-supply = <&vcc5v0_sys>; -+ }; -+ -+ hdmi-sound { -+ status = "okay"; -+ }; -+ -+ fan: pwm-fan { -+ compatible = "pwm-fan"; -+ pwms = <&pwm1 0 10000 1>; -+ #cooling-cells = <2>; -+ cooling-levels = <80 140 200 255>; -+ fan-supply = <&vcc5v0_sys>; -+ }; -+ -+ backlight: backlight { -+ status = "okay"; -+ compatible = "pwm-backlight"; -+ pwms = <&pwm0 0 25000 0>; -+ brightness-levels = < -+ 0 1 2 3 4 5 6 7 -+ 8 9 10 11 12 13 14 15 -+ 16 17 18 19 20 21 22 23 -+ 24 25 26 27 28 29 30 31 -+ 32 33 34 35 36 37 38 39 -+ 40 41 42 43 44 45 46 47 -+ 48 49 50 51 52 53 54 55 -+ 56 57 58 59 60 61 62 63 -+ 64 65 66 67 68 69 70 71 -+ 72 73 74 75 76 77 78 79 -+ 80 81 82 83 84 85 86 87 -+ 88 89 90 91 92 93 94 95 -+ 96 97 98 99 100 101 102 103 -+ 104 105 106 107 108 109 110 111 -+ 112 113 114 115 116 117 118 119 -+ 120 121 122 123 124 125 126 127 -+ 128 129 130 131 132 133 134 135 -+ 136 137 138 139 140 141 142 143 -+ 144 145 146 147 148 149 150 151 -+ 152 153 154 155 156 157 158 159 -+ 160 161 162 163 164 165 166 167 -+ 168 169 170 171 172 173 174 175 -+ 176 177 178 179 180 181 182 183 -+ 184 185 186 187 188 189 190 191 -+ 192 193 194 195 196 197 198 199 -+ 200 201 202 203 204 205 206 207 -+ 208 209 210 211 212 213 214 215 -+ 216 217 218 219 220 221 222 223 -+ 224 225 226 227 228 229 230 231 -+ 232 233 234 235 236 237 238 239 -+ 240 241 242 243 244 245 246 247 -+ 248 249 250 251 252 253 254 255>; -+ default-brightness-level = <200>; -+ }; -+ -+ bat: battery { -+ compatible = "simple-battery"; -+ charge-full-design-microamp-hours = <6400000>; -+ voltage-max-design-microvolt = <4350000>; -+ voltage-min-design-microvolt = <3400000>; -+ }; -+ -+ mains_charger: dc-charger { -+ compatible = "gpio-charger"; -+ charger-type = "mains"; -+ gpios = <&gpio4 RK_PD0 GPIO_ACTIVE_LOW>; -+ -+ /* Also triggered by USB charger */ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&dc_det_pin>; -+ }; -+ -+ xin32k: xin32k { -+ compatible = "fixed-clock"; -+ clock-frequency = <32768>; -+ clock-output-names = "xin32k"; -+ #clock-cells = <0>; -+ }; -+ -+ clkin_gmac: external-gmac-clock { -+ compatible = "fixed-clock"; -+ clock-frequency = <125000000>; -+ clock-output-names = "clkin_gmac"; -+ #clock-cells = <0>; -+ }; -+ -+ vcc12v_dcin: vcc12v-dcin { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc12v_dcin"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <12000000>; -+ regulator-max-microvolt = <12000000>; -+ }; -+ -+ vcc_sys: vcc-sys { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc_sys"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ regulator-always-on; -+ vin-supply = <&vcc12v_dcin>; -+ }; -+ -+ vcc3v3_sys: vcc3v3-sys { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc3v3_sys"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ vin-supply = <&vcc5v0_sys>; -+ }; -+ -+ vcc3v0_sd: vcc3v0-sd { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdmmc0_pwr_h>; -+ regulator-name = "vcc3v0_sd"; -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ vin-supply = <&vcc3v3_sys>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc5v0_host: vcc5v0-host-regulator { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vcc5v0_host_en>; -+ regulator-name = "vcc5v0_host"; -+ regulator-always-on; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ vin-supply = <&vcc5v0_usb>; -+ }; -+ -+ vcc5v0_typec: vcc5v0-typec-regulator { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vcc5v0_typec_en>; -+ regulator-name = "vcc5v0_typec"; -+ regulator-always-on; -+ vin-supply = <&vcc5v0_usb>; -+ }; -+ -+ vcc5v0_sys: vcc5v0-sys { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc5v0_sys"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ vin-supply = <&vcc12v_dcin>; -+ }; -+ -+ vcc5v0_usb: vcc5v0-usb { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc5v0_usb"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ vin-supply = <&vcc12v_dcin>; -+ }; -+ -+ vdd_log: vdd-log { -+ compatible = "pwm-regulator"; -+ pwms = <&pwm2 0 25000 1>; -+ regulator-name = "vdd_log"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <800000>; -+ regulator-max-microvolt = <1700000>; -+ vin-supply = <&vcc5v0_sys>; -+ }; -+ -+ vcc5v5_lcd: vcc5v5-lcd { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpio = <&gpio4 RK_PD3 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vcc5v5_lcd_en>; -+ regulator-name = "vcc5v5_lcd"; -+ regulator-min-microvolt = <5500000>; -+ regulator-max-microvolt = <5500000>; -+ vin-supply = <&vcc5v0_sys>; -+ }; -+ -+ vcc5v5_neg_lcd: vcc5v5-neg-lcd { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpio = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vcc5v5_neg_lcd_en>; -+ regulator-name = "vcc5v5_neg_lcd"; -+ /* -+ * technically negative -+ */ -+ regulator-min-microvolt = <5500000>; -+ regulator-max-microvolt = <5500000>; -+ vin-supply = <&vcc5v0_sys>; -+ }; -+ -+ vcc_wifi: vcc-wifi-regulator { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpio = <&gpio3 RK_PC1 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&wifi_pwr>; -+ regulator-name = "wifi_enable"; -+ regulator-always-on; -+ regulator-boot-on; -+ }; -+}; -+ -+&dmc { -+ status = "okay"; -+ center-supply = <&vdd_center>; -+ operating-points-v2 = <&dmc_opp_table>; -+ -+ rockchip,pd-idle-ns = <160>; -+ rockchip,sr-idle-ns = <10240>; -+ rockchip,sr-mc-gate-idle-ns = <40960>; -+ rockchip,srpd-lite-idle-ns = <61440>; -+ rockchip,standby-idle-ns = <81920>; -+ -+ rockchip,lpddr4_odt_dis_freq = <666000000>; -+ -+ rockchip,srpd-lite-idle-dis-freq-hz = <0>; -+ rockchip,standby-idle-dis-freq-hz = <928000000>; -+ rockchip,sr-mc-gate-idle-dis-freq-hz = <800000000>; -+ rockchip,pd-idle-dis-freq-hz = <800000000>; -+ rockchip,sr-idle-dis-freq-hz = <800000000>; -+}; -+ -+&dfi { -+ status = "okay"; -+}; -+ -+&cpu_thermal { -+ trips { -+ cpu_warm: cpu_warm { -+ temperature = <50000>; -+ hysteresis = <2000>; -+ type = "active"; -+ }; -+ -+ cpu_hot: cpu_hot { -+ temperature = <55000>; -+ hysteresis = <2000>; -+ type = "active"; -+ }; -+ -+ cpu_scalding: cpu_scalding { -+ temperature = <65000>; -+ hysteresis = <5000>; -+ type = "active"; -+ }; -+ }; -+ -+ cooling-maps { -+ map1 { -+ trip = <&cpu_warm>; -+ cooling-device = <&fan THERMAL_NO_LIMIT 1>; -+ }; -+ -+ map2 { -+ trip = <&cpu_hot>; -+ cooling-device = <&fan THERMAL_NO_LIMIT 1>; -+ }; -+ -+ map3 { -+ trip = <&cpu_scalding>; -+ cooling-device = <&fan 2 THERMAL_NO_LIMIT>; -+ }; -+ }; -+}; -+ -+&cpu_l0 { -+ cpu-supply = <&vdd_cpu_l>; -+}; -+ -+&cpu_l1 { -+ cpu-supply = <&vdd_cpu_l>; -+}; -+ -+&cpu_l2 { -+ cpu-supply = <&vdd_cpu_l>; -+}; -+ -+&cpu_l3 { -+ cpu-supply = <&vdd_cpu_l>; -+}; -+ -+&cpu_b0 { -+ cpu-supply = <&vdd_cpu_b>; -+}; -+ -+&cpu_b1 { -+ cpu-supply = <&vdd_cpu_b>; -+}; -+ -+&saradc { -+ status = "okay"; -+}; -+ -+&sdio0 { -+ clock-frequency = <150000000>; -+ clock-freq-min-max = <100000 150000000>; -+ supports-sd; -+ no-sdio; -+ bus-width = <4>; -+ disable-wp; -+ cap-sd-highspeed; -+ cap-sdio-irq; -+ keep-power-in-suspend; -+ card-detect-delay = <800>; -+ cd-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_LOW>; /*[> CD GPIO <]*/ -+ num-slots = <1>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdio0_clk &sdio0_cmd &sdio0_cd &sdio0_bus4>; -+ sd-uhs-sdr104; -+ vqmmc-supply = <&vcc_sdio>; -+ status = "okay"; -+}; -+ -+&sdmmc { -+ bus-width = <4>; -+ cap-sd-highspeed; -+ cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; -+ disable-wp; -+ max-frequency = <150000000>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>; -+ vmmc-supply = <&vcc3v0_sd>; -+ vqmmc-supply = <&vcc_sdio>; -+ status = "okay"; -+}; -+ -+&emmc_phy { -+ status = "okay"; -+}; -+ -+&gpu { -+ mali-supply = <&vdd_gpu>; -+ status = "okay"; -+}; -+ -+&pwm0 { -+ status = "okay"; -+}; -+ -+&pwm1 { -+ status = "okay"; -+}; -+ -+&pwm2 { -+ status = "okay"; -+ pinctrl-names = "active"; -+ pinctrl-0 = <&pwm2_pin_pull_down>; -+}; -+ -+&pwm3 { -+ status = "okay"; -+ label = "rumble-pwm"; -+}; -+ -+&saradc { -+ vref-supply = <&vcc_1v8>; -+ status = "okay"; -+}; -+ -+&sdhci { -+ assigned-clock-rates = <150000000>; -+ -+ bus-width = <8>; -+ mmc-hs400-1_8v; -+ mmc-hs400-enhanced-strobe; -+ non-removable; -+ -+ status = "okay"; -+}; -+ -+&hdmi { -+ ddc-i2c-bus = <&i2c3>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&hdmi_cec>; -+ status = "okay"; -+}; -+ -+&mipi_dsi { -+ status = "okay"; -+ clock-master; -+ -+ ports { -+ mipi_out: port@1 { -+ #address-cells = <0>; -+ #size-cells = <0>; -+ reg = <1>; -+ -+ mipi_out_panel: endpoint { -+ remote-endpoint = <&mipi_in_panel>; -+ }; -+ }; -+ }; -+ -+ panel@0 { -+ reg = <0>; -+ compatible = "sharp,ls054b3sx01"; -+ backlight = <&backlight>; -+ rotation = <270>; -+ -+ iovcc-supply = <&vcc1v8_dvp>; -+ vsp-supply = <&vcc5v5_lcd>; -+ vsn-supply = <&vcc5v5_neg_lcd>; -+ -+ reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_HIGH>; -+ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&lcd_reset_gpio>; -+ -+ port { -+ mipi_in_panel: endpoint { -+ remote-endpoint = <&mipi_out_panel>; -+ }; -+ }; -+ }; -+}; -+ -+&i2c0 { -+ clock-frequency = <400000>; -+ i2c-scl-rising-time-ns = <168>; -+ i2c-scl-falling-time-ns = <4>; -+ status = "okay"; -+ -+ rk808: pmic@1b { -+ compatible = "rockchip,rk808"; -+ reg = <0x1b>; -+ interrupt-parent = <&gpio3>; -+ interrupts = <10 IRQ_TYPE_LEVEL_LOW>; -+ #clock-cells = <1>; -+ clock-output-names = "rk808-clkout1", "rk808-clkout2"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pmic_int_l>; -+ rockchip,system-power-controller; -+ wakeup-source; -+ -+ vcc1-supply = <&vcc5v0_sys>; -+ vcc2-supply = <&vcc5v0_sys>; -+ vcc3-supply = <&vcc5v0_sys>; -+ vcc4-supply = <&vcc5v0_sys>; -+ vcc6-supply = <&vcc5v0_sys>; -+ vcc7-supply = <&vcc5v0_sys>; -+ vcc8-supply = <&vcc3v3_sys>; -+ vcc9-supply = <&vcc5v0_sys>; -+ vcc10-supply = <&vcc5v0_sys>; -+ vcc11-supply = <&vcc5v0_sys>; -+ vcc12-supply = <&vcc3v3_sys>; -+ vddio-supply = <&vcca_1v8>; -+ -+ rtc { -+ status = "okay"; -+ }; -+ -+ regulators { -+ vdd_center: DCDC_REG1 { -+ regulator-name = "vdd_center"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <900000>; -+ regulator-ramp-delay = <6001>; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdd_cpu_l: DCDC_REG2 { -+ regulator-name = "vdd_cpu_l"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <750000>; -+ regulator-max-microvolt = <1350000>; -+ regulator-ramp-delay = <6001>; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_ddr: DCDC_REG3 { -+ regulator-name = "vcc_ddr"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ }; -+ }; -+ -+ vcc_1v8: DCDC_REG4 { -+ regulator-name = "vcc_1v8"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ vcc1v8_dvp: LDO_REG1 { -+ regulator-name = "vcc1v8_dvp"; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc3v0_touch: LDO_REG2 { -+ regulator-name = "vcc3v0_touch"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcca_1v8: LDO_REG3 { -+ regulator-name = "vcca_1v8"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ vcc_sdio: LDO_REG4 { -+ regulator-name = "vcc_sdio"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <3300000>; -+ }; -+ }; -+ -+ vcca3v0_codec: LDO_REG5 { -+ regulator-name = "vcca3v0_codec"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_1v5: LDO_REG6 { -+ regulator-name = "vcc_1v5"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1500000>; -+ }; -+ }; -+ -+ vcca1v8_codec: LDO_REG7 { -+ regulator-name = "vcca1v8_codec"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_3v0: LDO_REG8 { -+ regulator-name = "vcc_3v0"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <3000000>; -+ }; -+ }; -+ -+ vcc3v3_s3: vcc_lan: SWITCH_REG1 { -+ regulator-name = "vcc3v3_s3"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc3v3_s0: SWITCH_REG2 { -+ regulator-name = "vcc3v3_s0"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ }; -+ }; -+ -+ vdd_cpu_b: regulator@40 { -+ compatible = "silergy,syr827"; -+ reg = <0x40>; -+ fcs,suspend-voltage-selector = <1>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vsel1_pin>; -+ regulator-name = "vdd_cpu_b"; -+ regulator-min-microvolt = <712500>; -+ regulator-max-microvolt = <1500000>; -+ regulator-ramp-delay = <1000>; -+ regulator-always-on; -+ regulator-boot-on; -+ vin-supply = <&vcc5v0_sys>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdd_gpu: regulator@41 { -+ compatible = "silergy,syr828"; -+ reg = <0x41>; -+ fcs,suspend-voltage-selector = <1>; -+ vsel-gpios = <&gpio1 RK_PB6 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vsel2_pin>; -+ regulator-name = "vdd_gpu"; -+ regulator-min-microvolt = <712500>; -+ regulator-max-microvolt = <1500000>; -+ regulator-ramp-delay = <1000>; -+ regulator-always-on; -+ regulator-boot-on; -+ vin-supply = <&vcc5v0_sys>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ cw2015@62 { -+ compatible = "cellwise,cw2015"; -+ reg = <0x62>; -+ cellwise,battery-profile = /bits/ 8 < -+ 0x15 0x7E 0x66 0x5B 0x58 0x55 0x51 0x4D -+ 0x4A 0x47 0x44 0x47 0x4D 0x46 0x32 0x27 -+ 0x1F 0x1A 0x15 0x16 0x21 0x30 0x3F 0x4A -+ 0x46 0x5C 0x0C 0x29 0x19 0x31 0x59 0x74 -+ 0x7B 0x7D 0x81 0x82 0x3F 0x1A 0x58 0x22 -+ 0x06 0x42 0x2B 0x63 0x89 0x93 0x94 0x3C -+ 0x57 0x7D 0x93 0xAE 0x80 0xC2 0xD2 0xCB -+ 0x2F 0x00 0x64 0xA5 0xB5 0x1F 0xB0 0x11 -+ >; -+ cellwise,monitor-interval-ms = <5000>; -+ monitored-battery = <&bat>; -+ power-supplies = <&mains_charger>, <&fusb0>; -+ }; -+ -+}; -+ -+&i2c1 { -+ clock-frequency = <100000>; -+ i2c-scl-rising-time-ns = <168>; -+ i2c-scl-falling-time-ns = <4>; -+ status = "okay"; -+ -+ es8316: es8316@11 { -+ compatible = "everest,es8316"; -+ reg = <0x11>; -+ clocks = <&cru SCLK_I2S_8CH_OUT>; -+ clock-names = "mclk"; -+ #sound-dai-cells = <0>; -+ }; -+}; -+ -+&i2c3 { -+ i2c-scl-rising-time-ns = <450>; -+ i2c-scl-falling-time-ns = <15>; -+ status = "okay"; -+}; -+ -+&i2c4 { -+ i2c-scl-rising-time-ns = <600>; -+ i2c-scl-falling-time-ns = <20>; -+ status = "okay"; -+ -+ gt9xx: gt9xx@14 { -+ compatible = "goodix,gt927"; -+ reg = <0x14>; -+ irq-gpios = <&gpio3 RK_PD7 GPIO_ACTIVE_HIGH>; -+ reset-gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_HIGH>; -+ touchscreen-size-x = <1152>; -+ touchscreen-size-y = <1920>; -+ touchscreen-inverted-x; -+ touchscreen-inverted-y; -+ interrupt-parent = <&gpio3>; -+ interrupts = ; -+ AVDD28-supply = <&vcc3v0_touch>; -+ VDDIO-supply = <&vcc3v0_touch>; -+ }; -+ -+ fusb0: typec-portc@22 { -+ compatible = "fcs,fusb302"; -+ status = "okay"; -+ reg = <0x22>; -+ interrupt-parent = <&gpio1>; -+ interrupts = ; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&fusb0_int>; -+ vbus-supply = <&vcc5v0_typec>; -+ -+ connector { -+ compatible = "usb-c-connector"; -+ data-role = "dual"; -+ label = "USB-C"; -+ op-sink-microwatt = <1000000>; -+ power-role = "dual"; -+ sink-pdos = -+ ; -+ source-pdos = -+ ; -+ try-power-role = "sink"; -+ -+ ports { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ port@0 { -+ reg = <0>; -+ -+ usbc_hs: endpoint { -+ remote-endpoint = <&u2phy0_typec_hs>; -+ }; -+ }; -+ -+ port@1 { -+ reg = <1>; -+ -+ usbc_ss: endpoint { -+ remote-endpoint = <&tcphy0_typec_ss>; -+ }; -+ }; -+ }; -+ }; -+ }; -+}; -+ -+&i2s1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2s_8ch_mclk_pin>, <&i2s1_2ch_bus>; -+ rockchip,capture-channels = <8>; -+ rockchip,playback-channels = <8>; -+ status = "okay"; -+}; -+ -+&i2s2 { -+ status = "okay"; -+}; -+ -+&io_domains { -+ status = "okay"; -+ -+ bt656-supply = <&vcc1v8_dvp>; -+ audio-supply = <&vcca3v0_codec>; -+ sdmmc-supply = <&vcc_sdio>; -+ gpio1830-supply = <&vcc_3v0>; -+}; -+ -+&pmu_io_domains { -+ pmu1830-supply = <&vcc_3v0>; -+ status = "okay"; -+}; -+ -+&pinctrl { -+ dc-charger { -+ dc_det_pin: dc-det-pin { -+ rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ es8316 { -+ hp_det_pin: hp-det-pin { -+ rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ i2s1 { -+ i2s_8ch_mclk_pin: i2s-8ch-mclk-pin { -+ rockchip,pins = <4 RK_PA0 1 &pcfg_pull_none>; -+ }; -+ }; -+ -+ fusb302x { -+ fusb0_int: fusb0-int { -+ rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ pmic { -+ pmic_int_l: pmic-int-l { -+ rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ -+ vsel1_pin: vsel1-pin { -+ rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>; -+ }; -+ -+ vsel2_pin: vsel2-pin { -+ rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>; -+ }; -+ }; -+ -+ sdcard { -+ sdmmc0_pwr_h: sdmmc0-pwr-h { -+ rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ }; -+ -+ sdio-pwrseq { -+ wifi_enable_h: wifi-enable-h { -+ rockchip,pins = <2 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ usb-typec { -+ vcc5v0_typec_en: vcc5v0_typec_en { -+ rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ usb2 { -+ vcc5v0_host_en: vcc5v0-host-en { -+ rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ gpio-leds { -+ leds_gpio: leds-gpio { -+ rockchip,pins = -+ <1 RK_PC4 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ lcd-panel { -+ lcd_reset_gpio: lcd-reset-gpio { -+ rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ vcc5v5_lcd_en: vcc5v5-lcd-en { -+ rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ vcc5v5_neg_lcd_en: vcc5v5-neg-lcd-en { -+ rockchip,pins = <0 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ wifi { -+ wifi_pwr: wifi-pwr-en { -+ rockchip,pins = <3 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ btns { -+ btn_pins: btn-pins { -+ rockchip,pins = -+ <3 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PD1 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PB3 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PC0 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ vol_pwr_btn: vol-pwr-btn { -+ rockchip,pins = -+ <3 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>, -+ <3 RK_PB6 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ pwr_btn: pwr-btn { -+ rockchip,pins = -+ <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+}; -+ -+&tcphy0 { -+ status = "okay"; -+}; -+ -+&tcphy0_usb3 { -+ port { -+ tcphy0_typec_ss: endpoint { -+ remote-endpoint = <&usbc_ss>; -+ }; -+ }; -+}; -+ -+&tcphy1 { -+ status = "okay"; -+}; -+ -+&tsadc { -+ /* tshut mode 0:CRU 1:GPIO */ -+ rockchip,hw-tshut-mode = <1>; -+ /* tshut polarity 0:LOW 1:HIGH */ -+ rockchip,hw-tshut-polarity = <1>; -+ status = "okay"; -+}; -+ -+&u2phy0 { -+ status = "okay"; -+ -+ u2phy0_otg: otg-port { -+ status = "okay"; -+ }; -+ -+ u2phy0_host: host-port { -+ phy-supply = <&vcc5v0_host>; -+ status = "okay"; -+ }; -+ -+ port { -+ u2phy0_typec_hs: endpoint { -+ remote-endpoint = <&usbc_hs>; -+ }; -+ }; -+}; -+ -+&u2phy1 { -+ status = "okay"; -+ -+ u2phy1_otg: otg-port { -+ status = "okay"; -+ }; -+ -+ u2phy1_host: host-port { -+ phy-supply = <&vcc5v0_host>; -+ status = "okay"; -+ }; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>; -+ status = "okay"; -+}; -+ -+&uart2 { -+ status = "okay"; -+}; -+ -+&usb_host0_ehci { -+ status = "okay"; -+}; -+ -+&usb_host0_ohci { -+ status = "okay"; -+}; -+ -+&usb_host1_ehci { -+ status = "okay"; -+}; -+ -+&usb_host1_ohci { -+ status = "okay"; -+}; -+ -+&usbdrd3_0 { -+ status = "okay"; -+}; -+ -+&usbdrd_dwc3_0 { -+ status = "okay"; -+ dr_mode = "host"; -+}; -+ -+&usbdrd3_1 { -+ status = "okay"; -+}; -+ -+&usbdrd_dwc3_1 { -+ status = "okay"; -+ dr_mode = "host"; -+}; -+ -+&vopb { -+ status = "okay"; -+}; -+ -+&vopb_mmu { -+ status = "okay"; -+}; -+ -+&vopl { -+ status = "okay"; -+}; -+ -+&vopl_mmu { -+ status = "okay"; -+}; -diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399-rg552-opp.dtsi linux/arch/arm64/boot/dts/rockchip/rk3399-rg552-opp.dtsi ---- linux.orig/arch/arm64/boot/dts/rockchip/rk3399-rg552-opp.dtsi 1970-01-01 00:00:00.000000000 +0000 -+++ linux/arch/arm64/boot/dts/rockchip/rk3399-rg552-opp.dtsi 2023-07-22 17:35:53.870832792 +0000 -@@ -0,0 +1,141 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * Copyright (c) 2016-2017 Fuzhou Rockchip Electronics Co., Ltd -+ * Copyright (C) 2023 BrooksyTech (https://github.com/brooksytech) -+ */ -+ -+/ { -+ cluster0_opp: opp-table-0 { -+ compatible = "operating-points-v2"; -+ opp-shared; -+ -+ opp00 { -+ opp-hz = /bits/ 64 <816000000>; -+ opp-microvolt = <850000>; -+ }; -+ opp01 { -+ opp-hz = /bits/ 64 <1008000000>; -+ opp-microvolt = <925000>; -+ }; -+ opp02 { -+ opp-hz = /bits/ 64 <1200000000>; -+ opp-microvolt = <1000000>; -+ }; -+ opp03 { -+ opp-hz = /bits/ 64 <1416000000>; -+ opp-microvolt = <1125000>; -+ }; -+ opp-04 { -+ opp-hz = /bits/ 64 <1512000000>; -+ opp-microvolt = <1200000>; -+ }; -+ opp-05 { -+ opp-hz = /bits/ 64 <1608000000>; -+ opp-microvolt = <1225000>; -+ }; -+ }; -+ -+ cluster1_opp: opp-table-1 { -+ compatible = "operating-points-v2"; -+ opp-shared; -+ -+ opp00 { -+ opp-hz = /bits/ 64 <816000000>; -+ opp-microvolt = <825000>; -+ }; -+ opp01 { -+ opp-hz = /bits/ 64 <1008000000>; -+ opp-microvolt = <875000>; -+ }; -+ opp02 { -+ opp-hz = /bits/ 64 <1200000000>; -+ opp-microvolt = <950000>; -+ }; -+ opp03 { -+ opp-hz = /bits/ 64 <1416000000>; -+ opp-microvolt = <1025000>; -+ }; -+ opp04 { -+ opp-hz = /bits/ 64 <1608000000>; -+ opp-microvolt = <1100000>; -+ }; -+ opp05 { -+ opp-hz = /bits/ 64 <1800000000>; -+ opp-microvolt = <1200000>; -+ }; -+ opp-06 { -+ opp-hz = /bits/ 64 <1992000000>; -+ opp-microvolt = <1250000>; -+ }; -+ opp-07 { -+ opp-hz = /bits/ 64 <2088000000>; -+ opp-microvolt = <1250000>; -+ }; -+ }; -+ -+ gpu_opp_table: opp-table-2 { -+ compatible = "operating-points-v2"; -+ -+ opp00 { -+ opp-hz = /bits/ 64 <500000000>; -+ opp-microvolt = <875000>; -+ }; -+ opp01 { -+ opp-hz = /bits/ 64 <600000000>; -+ opp-microvolt = <925000>; -+ }; -+ opp02 { -+ opp-hz = /bits/ 64 <800000000>; -+ opp-microvolt = <1100000>; -+ }; -+ opp03 { -+ opp-hz = /bits/ 64 <900000000>; -+ opp-microvolt = <1150000>; -+ }; -+ }; -+ -+ dmc_opp_table: opp-table-3 { -+ compatible = "operating-points-v2"; -+ -+ opp00 { -+ opp-hz = /bits/ 64 <666000000>; -+ opp-microvolt = <900000>; -+ }; -+ opp01 { -+ opp-hz = /bits/ 64 <856000000>; -+ opp-microvolt = <900000>; -+ }; -+ }; -+}; -+ -+&cpu_l0 { -+ operating-points-v2 = <&cluster0_opp>; -+}; -+ -+&cpu_l1 { -+ operating-points-v2 = <&cluster0_opp>; -+}; -+ -+&cpu_l2 { -+ operating-points-v2 = <&cluster0_opp>; -+}; -+ -+&cpu_l3 { -+ operating-points-v2 = <&cluster0_opp>; -+}; -+ -+&cpu_b0 { -+ operating-points-v2 = <&cluster1_opp>; -+}; -+ -+&cpu_b1 { -+ operating-points-v2 = <&cluster1_opp>; -+}; -+ -+&dmc { -+ operating-points-v2 = <&dmc_opp_table>; -+}; -+ -+&gpu { -+ operating-points-v2 = <&gpu_opp_table>; -+}; diff -rupN linux.orig/arch/arm64/boot/dts/rockchip/rk3399.dtsi linux/arch/arm64/boot/dts/rockchip/rk3399.dtsi --- linux.orig/arch/arm64/boot/dts/rockchip/rk3399.dtsi 2023-06-23 03:53:36.256094988 +0000 +++ linux/arch/arm64/boot/dts/rockchip/rk3399.dtsi 2023-07-24 20:00:14.430068009 +0000