diff --git a/packages/apps/portmaster/scripts/start_portmaster.sh b/packages/apps/portmaster/scripts/start_portmaster.sh index 519c8cd9f8..fe0b70a841 100644 --- a/packages/apps/portmaster/scripts/start_portmaster.sh +++ b/packages/apps/portmaster/scripts/start_portmaster.sh @@ -75,4 +75,4 @@ fi #Start PortMaster @LIBEGL@ cd /storage/roms/ports/PortMaster -run ./PortMaster.sh 2>/dev/null +./PortMaster.sh 2>/dev/null diff --git a/packages/audio/libmodplug/package.mk b/packages/audio/libmodplug/package.mk index 26651b2503..256b3d3040 100644 --- a/packages/audio/libmodplug/package.mk +++ b/packages/audio/libmodplug/package.mk @@ -12,4 +12,4 @@ PKG_DEPENDS_TARGET="toolchain" PKG_LONGDESC="libmodplug renders mod music files as raw audio data, for playing or conversion." PKG_BUILD_FLAGS="+pic" -PKG_CONFIGURE_OPTS_TARGET="--enable-static --disable-shared" +PKG_CONFIGURE_OPTS_TARGET="--enable-shared --disable-static" diff --git a/packages/devel/hwdata/package.mk b/packages/devel/hwdata/package.mk new file mode 100644 index 0000000000..98732eca70 --- /dev/null +++ b/packages/devel/hwdata/package.mk @@ -0,0 +1,20 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Copyright (C) 2022-present Team LibreELEC (https://libreelec.tv) + +PKG_NAME="hwdata" +PKG_VERSION="0.378" +PKG_SHA256="098ea8db12a50290f4b23f7f521edf9c5bab25935d2740de17e4a487110b40c8" +PKG_LICENSE="GPL-2.0" +PKG_SITE="https://github.com/vcrhonek/hwdata" +PKG_URL="https://github.com/vcrhonek/hwdata/archive/refs/tags/v${PKG_VERSION}.tar.gz" +PKG_DEPENDS_TARGET="toolchain" +PKG_LONGDESC="hwdata contains various hardware identification and configuration data, such as the pci.ids and usb.ids databases" + +pre_configure_target() { +# hwdata fails to build in subdirs + cd ${PKG_BUILD} + rm -rf .${TARGET_NAME} + + sed -i "s&@prefix@|&@prefix@|${PKG_INSTALL}&" Makefile + sed -i "s&prefix=@prefix@&prefix=/usr&" hwdata.pc.in +} diff --git a/packages/emulators/standalone/duckstation-sa/config/RK3566/settings.ini b/packages/emulators/standalone/duckstation-sa/config/RK3566/settings.ini index 40e43a8b23..ccdb6737e5 100644 --- a/packages/emulators/standalone/duckstation-sa/config/RK3566/settings.ini +++ b/packages/emulators/standalone/duckstation-sa/config/RK3566/settings.ini @@ -83,6 +83,7 @@ ShowEnhancements = false DisplayAllFrames = true VSync = false MaxFPS = 0.000000 +Rotation = 0 [Hotkeys] diff --git a/packages/graphics/libdrm/package.mk b/packages/graphics/libdrm/package.mk index 1de8a8b289..88f646f6e8 100644 --- a/packages/graphics/libdrm/package.mk +++ b/packages/graphics/libdrm/package.mk @@ -4,7 +4,7 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) PKG_NAME="libdrm" -PKG_VERSION="2.4.117" +PKG_VERSION="2.4.119" PKG_LICENSE="GPL" PKG_SITE="http://dri.freedesktop.org" PKG_URL="http://dri.freedesktop.org/libdrm/libdrm-${PKG_VERSION}.tar.xz" diff --git a/packages/graphics/mesa/package.mk b/packages/graphics/mesa/package.mk index e8f518868c..2b1a7b09e6 100644 --- a/packages/graphics/mesa/package.mk +++ b/packages/graphics/mesa/package.mk @@ -16,14 +16,8 @@ case ${DEVICE} in PKG_URL="${PKG_SITE}.git" PKG_GIT_CLONE_BRANCH="csf" ;; - RK33*) #Using upstream dev for panfrost - PKG_VERSION="97efa57531b826edf62b00fd4dc26d7568ff941b" - PKG_SITE="https://gitlab.freedesktop.org/mesa/mesa" - PKG_URL="${PKG_SITE}.git" - PKG_PATCH_DIRS+=" panfrost" - ;; *) - PKG_VERSION="23.3.4" + PKG_VERSION="24.0.0" PKG_SITE="http://www.mesa3d.org/" PKG_URL="https://gitlab.freedesktop.org/mesa/mesa/-/archive/mesa-${PKG_VERSION}/mesa-mesa-${PKG_VERSION}.tar.gz" ;; diff --git a/packages/graphics/mesa/patches/panfrost/26811-egl_v1.5.patch b/packages/graphics/mesa/patches/panfrost/26811-egl_v1.5.patch deleted file mode 100644 index 0bc8da5446..0000000000 --- a/packages/graphics/mesa/patches/panfrost/26811-egl_v1.5.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 12254d89fcf3adb27ed5d1191449d06207eb61f1 Mon Sep 17 00:00:00 2001 -From: Urja Rannikko -Date: Sun, 24 Dec 2023 15:54:52 +0200 -Subject: [PATCH] panfrost: Stub implementation of - PIPE_CAP_DEVICE_RESET_STATUS_QUERY - -This enables EGL_EXT_create_context_robustness, which is the only -extension missing from panfrost (on my T760, atleast) to report -EGL version 1.5. Recent kicad (built with wxWidgets EGL canvas) -requires EGL 1.5 to enable acceleration. - -Signed-off-by: Urja Rannikko ---- - src/gallium/drivers/panfrost/pan_context.c | 7 +++++++ - src/gallium/drivers/panfrost/pan_screen.c | 3 +++ - 2 files changed, 10 insertions(+) - -diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c -index e1fed545c4bcf..bfd9de4d23231 100644 ---- a/src/gallium/drivers/panfrost/pan_context.c -+++ b/src/gallium/drivers/panfrost/pan_context.c -@@ -867,6 +867,12 @@ panfrost_fence_server_sync(struct pipe_context *pctx, - close(fd); - } - -+static enum pipe_reset_status -+panfrost_get_device_reset_status(struct pipe_context *pipe) -+{ -+ return PIPE_NO_RESET; -+} -+ - struct pipe_context * - panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags) - { -@@ -883,6 +889,7 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags) - - gallium->create_fence_fd = panfrost_create_fence_fd; - gallium->fence_server_sync = panfrost_fence_server_sync; -+ gallium->get_device_reset_status = panfrost_get_device_reset_status; - - gallium->flush = panfrost_flush; - gallium->clear = panfrost_clear; -diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c -index 876833e799192..2036a63bd2955 100644 ---- a/src/gallium/drivers/panfrost/pan_screen.c -+++ b/src/gallium/drivers/panfrost/pan_screen.c -@@ -369,6 +369,9 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param) - case PIPE_CAP_NATIVE_FENCE_FD: - return 1; - -+ case PIPE_CAP_DEVICE_RESET_STATUS_QUERY: -+ return 1; -+ - default: - return u_pipe_screen_get_param_defaults(screen, param); - } --- -GitLab diff --git a/packages/hardware/quirks/devices/Anbernic RG552/sleep.d/pre/002-freq b/packages/hardware/quirks/devices/Anbernic RG552/sleep.d/pre/002-freq index 64d15b20ed..52d91607ac 100644 --- a/packages/hardware/quirks/devices/Anbernic RG552/sleep.d/pre/002-freq +++ b/packages/hardware/quirks/devices/Anbernic RG552/sleep.d/pre/002-freq @@ -19,10 +19,10 @@ set_dmc_gov powersave set_gpu_gov powersave ### Set max/min freq to lowest available value -echo 600000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq -echo 600000 > /sys/devices/system/cpu/cpufreq/policy4/scaling_min_freq +echo 408000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq +echo 408000 > /sys/devices/system/cpu/cpufreq/policy4/scaling_min_freq echo 200000000 > /sys/devices/platform/ff9a0000.gpu/devfreq/ff9a0000.gpu/min_freq -echo 600000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq -echo 600000 > /sys/devices/system/cpu/cpufreq/policy4/scaling_max_freq +echo 408000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq +echo 408000 > /sys/devices/system/cpu/cpufreq/policy4/scaling_max_freq echo 200000000 > /sys/devices/platform/ff9a0000.gpu/devfreq/ff9a0000.gpu/max_freq diff --git a/packages/hardware/quirks/devices/Hardkernel ODROID-GO-Ultra/001-device_config b/packages/hardware/quirks/devices/Hardkernel ODROID-GO-Ultra/001-device_config index 99e288cba1..09cf47e6a6 100644 --- a/packages/hardware/quirks/devices/Hardkernel ODROID-GO-Ultra/001-device_config +++ b/packages/hardware/quirks/devices/Hardkernel ODROID-GO-Ultra/001-device_config @@ -4,7 +4,7 @@ cat </storage/.config/profile.d/001-device_config DEVICE_FAKE_JACKSENSE="true" -DEVICE_HEADPHONE_DEV="/dev/input/by-path/platform-hp-detect-switch-event" +DEVICE_HEADPHONE_DEV="/dev/input/by-path/platform-gpio-keys-event" DEVICE_VOLUMECTL="true" DEVICE_POWER_LED="false" DEVICE_BRIGHTNESS="128" diff --git a/packages/hardware/quirks/devices/Powkiddy RGB10 Max 3/050-game_configs b/packages/hardware/quirks/devices/Powkiddy RGB10 Max 3/050-game_configs index 50b56be0c0..8fc2c5134d 100755 --- a/packages/hardware/quirks/devices/Powkiddy RGB10 Max 3/050-game_configs +++ b/packages/hardware/quirks/devices/Powkiddy RGB10 Max 3/050-game_configs @@ -12,3 +12,6 @@ if [ ! -d "/storage/.config/gzdoom/" ]; then /vid_defheight=/c\vid_defheight=480; /vid_defwidth=/c\vid_defwidth=640' /storage/.config/gzdoom/gzdoom.ini fi + +#Set Duckstastion SA to rotate +sed -i '/^Rotate =/c\Rotate = 1' /storage/.config/duckstation/settings.ini diff --git a/packages/hardware/quirks/platforms/RK3326/060-game_settings b/packages/hardware/quirks/platforms/RK3326/060-game_settings index 0cf091c89e..ec90c86411 100755 --- a/packages/hardware/quirks/platforms/RK3326/060-game_settings +++ b/packages/hardware/quirks/platforms/RK3326/060-game_settings @@ -5,13 +5,16 @@ . /etc/profile.d/001-functions ### Set the default performance scaling mode for a few systems. -for SYSTEM in dreamcast n64 psp saturn ports psx gba +for SYSTEM in dreamcast n64 ports psp psx saturn gba pcfx cdi do - SETTING=$(get_setting ${SYSTEM}) - if [ -z ${SETTING} ] + CPU_SETTING=$(get_setting ${SYSTEM}.cpugovernor) + if [ -z "${CPU_SETTING}" ] then set_setting ${SYSTEM}.cpugovernor performance + fi + GPU_SETTING=$(get_setting ${SYSTEM}.gpuperf) + if [ -z "${GPU_SETTING}" ] + then set_setting ${SYSTEM}.gpuperf profile_peak fi done - diff --git a/packages/hardware/quirks/platforms/RK3399/060-game_settings b/packages/hardware/quirks/platforms/RK3399/060-game_settings index 3e4126306f..fa5cd7d07b 100755 --- a/packages/hardware/quirks/platforms/RK3399/060-game_settings +++ b/packages/hardware/quirks/platforms/RK3399/060-game_settings @@ -5,22 +5,30 @@ . /etc/profile.d/001-functions ### Set the default performance scaling mode for a few systems. -for SYSTEM in dreamcast gamecube n64 ports ps2 psp saturn +for SYSTEM in dreamcast n64 ports psp psx saturn pcfx cdi do - SETTING=$(get_setting ${SYSTEM}) - if [ -z ${SETTING} ] + CPU_SETTING=$(get_setting ${SYSTEM}.cpugovernor) + if [ -z "${CPU_SETTING}" ] then set_setting ${SYSTEM}.cpugovernor performance + fi + GPU_SETTING=$(get_setting ${SYSTEM}.gpuperf) + if [ -z "${GPU_SETTING}" ] + then set_setting ${SYSTEM}.gpuperf profile_peak fi done for SYSTEM in gb gbc gba snes nes sms gamegear genesis mastersystem sega32x megadrive segacd megacd do - SETTING=$(get_setting ${SYSTEM}) - if [ -z ${SETTING} ] + CPU_SETTING=$(get_setting ${SYSTEM}.cpugovernor) + if [ -z ${CPU_SETTING} ] then set_setting ${SYSTEM}.cpugovernor powersave + fi + GPU_SETTING=$(get_setting ${SYSTEM}.gpuperf) + if [ -z ${GPU_SETTING} ] + then set_setting ${SYSTEM}.gpuperf low fi done diff --git a/packages/hardware/quirks/platforms/RK3566-X55/060-game_settings b/packages/hardware/quirks/platforms/RK3566-X55/060-game_settings index 23b4b938a7..3ac5716ef6 100755 --- a/packages/hardware/quirks/platforms/RK3566-X55/060-game_settings +++ b/packages/hardware/quirks/platforms/RK3566-X55/060-game_settings @@ -11,11 +11,14 @@ echo 400000000 >${GPU_FREQ}/min_freq ### Set the default performance scaling mode for a few systems. for SYSTEM in dreamcast n64 ports psp psx saturn gba pcfx cdi do - SETTING=$(get_setting ${SYSTEM}) - if [ -z "${SETTING}" ] + CPU_SETTING=$(get_setting ${SYSTEM}.cpugovernor) + if [ -z "${CPU_SETTING}" ] then set_setting ${SYSTEM}.cpugovernor performance + fi + GPU_SETTING=$(get_setting ${SYSTEM}.gpuperf) + if [ -z "${GPU_SETTING}" ] + then set_setting ${SYSTEM}.gpuperf profile_peak fi done - diff --git a/packages/hardware/quirks/platforms/RK3566/060-game_settings b/packages/hardware/quirks/platforms/RK3566/060-game_settings index 23b4b938a7..e4193f877d 100755 --- a/packages/hardware/quirks/platforms/RK3566/060-game_settings +++ b/packages/hardware/quirks/platforms/RK3566/060-game_settings @@ -11,10 +11,14 @@ echo 400000000 >${GPU_FREQ}/min_freq ### Set the default performance scaling mode for a few systems. for SYSTEM in dreamcast n64 ports psp psx saturn gba pcfx cdi do - SETTING=$(get_setting ${SYSTEM}) - if [ -z "${SETTING}" ] + CPU_SETTING=$(get_setting ${SYSTEM}.cpugovernor) + if [ -z "${CPU_SETTING}" ] then set_setting ${SYSTEM}.cpugovernor performance + fi + GPU_SETTING=$(get_setting ${SYSTEM}.gpuperf) + if [ -z "${GPU_SETTING}" ] + then set_setting ${SYSTEM}.gpuperf profile_peak fi done diff --git a/packages/hardware/quirks/platforms/RK3399/002-turbo-mode_config b/packages/hardware/quirks/platforms/S922X/002-turbo-mode_config similarity index 100% rename from packages/hardware/quirks/platforms/RK3399/002-turbo-mode_config rename to packages/hardware/quirks/platforms/S922X/002-turbo-mode_config diff --git a/packages/hardware/quirks/platforms/S922X/060-game_settings b/packages/hardware/quirks/platforms/S922X/060-game_settings index 4f6b4a6ddd..ff093dd60c 100755 --- a/packages/hardware/quirks/platforms/S922X/060-game_settings +++ b/packages/hardware/quirks/platforms/S922X/060-game_settings @@ -5,13 +5,16 @@ . /etc/profile.d/001-functions ### Set the default performance scaling mode for a few systems. -for SYSTEM in 3ds dreamcast gamecube n64 ports ps2 psp saturn +for SYSTEM in dreamcast n64 ports psp psx saturn pcfx cdi do - SETTING=$(get_setting ${SYSTEM}) - if [ -z ${SETTING} ] + CPU_SETTING=$(get_setting ${SYSTEM}.cpugovernor) + if [ -z "${CPU_SETTING}" ] then set_setting ${SYSTEM}.cpugovernor performance + fi + GPU_SETTING=$(get_setting ${SYSTEM}.gpuperf) + if [ -z "${GPU_SETTING}" ] + then set_setting ${SYSTEM}.gpuperf profile_peak fi done - diff --git a/packages/jelos/sources/scripts/runemu.sh b/packages/jelos/sources/scripts/runemu.sh index a755afed59..4cc1dd21f4 100755 --- a/packages/jelos/sources/scripts/runemu.sh +++ b/packages/jelos/sources/scripts/runemu.sh @@ -447,7 +447,7 @@ then if [ $? == 0 ] then log $0 "backup saves to the cloud." - run /usr/bin/cloud_backup + /usr/bin/cloud_backup fi fi diff --git a/packages/kernel/linux/package.mk b/packages/kernel/linux/package.mk index e24266c107..4d3f2f8df8 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.6.14" +PKG_VERSION="6.7.3" 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 rdfind:host" diff --git a/packages/kernel/linux/patches/AMD64/002-LegionGO-rotation-quirk.patch b/packages/kernel/linux/patches/AMD64/002-LegionGO-rotation-quirk.patch index f4b8423eb7..1bca49a0a9 100644 --- a/packages/kernel/linux/patches/AMD64/002-LegionGO-rotation-quirk.patch +++ b/packages/kernel/linux/patches/AMD64/002-LegionGO-rotation-quirk.patch @@ -1,17 +1,533 @@ -diff -rupN linux.orig/drivers/gpu/drm/drm_panel_orientation_quirks.c linux/drivers/gpu/drm/drm_panel_orientation_quirks.c ---- linux.orig/drivers/gpu/drm/drm_panel_orientation_quirks.c 2023-11-28 17:20:18.000000000 +0000 -+++ linux/drivers/gpu/drm/drm_panel_orientation_quirks.c 2023-11-30 15:33:54.949480402 +0000 +diff -rupN linux-6.7-rc8.orig/drivers/gpu/drm/drm_panel_orientation_quirks.c linux-6.7-rc8.panel/drivers/gpu/drm/drm_panel_orientation_quirks.c +--- linux-6.7-rc8.orig/drivers/gpu/drm/drm_panel_orientation_quirks.c 2024-01-04 23:15:09.706448784 +0000 ++++ linux-6.7-rc8.panel/drivers/gpu/drm/drm_panel_orientation_quirks.c 2024-01-04 23:20:09.071025713 +0000 @@ -336,6 +336,13 @@ static const struct dmi_system_id orient DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "IdeaPad Duet 3 10IGL5"), }, .driver_data = (void *)&lcd1200x1920_rightside_up, -+ }, { /* Lenovo Legion Go */ ++ }, { /* Lenovo Legion Go */ + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "83E1"), + DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Legion Go 8APU1"), + }, + .driver_data = (void *)&lcd1600x2560_leftside_up, - }, { /* Lenovo Yoga Book X90F / X90L */ + }, { /* Lenovo Legion Go 8APU1 */ .matches = { - DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), +diff -rupN linux-6.7-rc8.orig/drivers/gpu/drm/drm_panel_orientation_quirks.c.orig linux-6.7-rc8.panel/drivers/gpu/drm/drm_panel_orientation_quirks.c.orig +--- linux-6.7-rc8.orig/drivers/gpu/drm/drm_panel_orientation_quirks.c.orig 1970-01-01 00:00:00.000000000 +0000 ++++ linux-6.7-rc8.panel/drivers/gpu/drm/drm_panel_orientation_quirks.c.orig 2024-01-04 23:18:55.450922222 +0000 +@@ -0,0 +1,492 @@ ++/* SPDX-License-Identifier: MIT */ ++/* ++ * drm_panel_orientation_quirks.c -- Quirks for non-normal panel orientation ++ * ++ * Copyright (C) 2017 Hans de Goede ++ * ++ * Note the quirks in this file are shared with fbdev/efifb and as such ++ * must not depend on other drm code. ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#ifdef CONFIG_DMI ++ ++/* ++ * Some x86 clamshell design devices use portrait tablet screens and a display ++ * engine which cannot rotate in hardware, so we need to rotate the fbcon to ++ * compensate. Unfortunately these (cheap) devices also typically have quite ++ * generic DMI data, so we match on a combination of DMI data, screen resolution ++ * and a list of known BIOS dates to avoid false positives. ++ */ ++ ++struct drm_dmi_panel_orientation_data { ++ int width; ++ int height; ++ const char * const *bios_dates; ++ int orientation; ++}; ++ ++static const struct drm_dmi_panel_orientation_data gpd_micropc = { ++ .width = 720, ++ .height = 1280, ++ .bios_dates = (const char * const []){ "04/26/2019", ++ NULL }, ++ .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, ++}; ++ ++static const struct drm_dmi_panel_orientation_data gpd_onemix2s = { ++ .width = 1200, ++ .height = 1920, ++ .bios_dates = (const char * const []){ "05/21/2018", "10/26/2018", ++ "03/04/2019", NULL }, ++ .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, ++}; ++ ++static const struct drm_dmi_panel_orientation_data gpd_pocket = { ++ .width = 1200, ++ .height = 1920, ++ .bios_dates = (const char * const []){ "05/26/2017", "06/28/2017", ++ "07/05/2017", "08/07/2017", NULL }, ++ .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, ++}; ++ ++static const struct drm_dmi_panel_orientation_data gpd_pocket2 = { ++ .width = 1200, ++ .height = 1920, ++ .bios_dates = (const char * const []){ "06/28/2018", "08/28/2018", ++ "12/07/2018", NULL }, ++ .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, ++}; ++ ++static const struct drm_dmi_panel_orientation_data gpd_win = { ++ .width = 720, ++ .height = 1280, ++ .bios_dates = (const char * const []){ ++ "10/25/2016", "11/18/2016", "12/23/2016", "12/26/2016", ++ "02/21/2017", "03/20/2017", "05/25/2017", NULL }, ++ .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, ++}; ++ ++static const struct drm_dmi_panel_orientation_data gpd_win2 = { ++ .width = 720, ++ .height = 1280, ++ .bios_dates = (const char * const []){ ++ "12/07/2017", "05/24/2018", "06/29/2018", NULL }, ++ .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, ++}; ++ ++static const struct drm_dmi_panel_orientation_data itworks_tw891 = { ++ .width = 800, ++ .height = 1280, ++ .bios_dates = (const char * const []){ "10/16/2015", NULL }, ++ .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, ++}; ++ ++static const struct drm_dmi_panel_orientation_data onegx1_pro = { ++ .width = 1200, ++ .height = 1920, ++ .bios_dates = (const char * const []){ "12/17/2020", NULL }, ++ .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, ++}; ++ ++static const struct drm_dmi_panel_orientation_data lcd720x1280_rightside_up = { ++ .width = 720, ++ .height = 1280, ++ .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, ++}; ++ ++static const struct drm_dmi_panel_orientation_data lcd800x1280_leftside_up = { ++ .width = 800, ++ .height = 1280, ++ .orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP, ++}; ++ ++static const struct drm_dmi_panel_orientation_data lcd800x1280_rightside_up = { ++ .width = 800, ++ .height = 1280, ++ .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, ++}; ++ ++static const struct drm_dmi_panel_orientation_data lcd1080x1920_leftside_up = { ++ .width = 1080, ++ .height = 1920, ++ .orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP, ++}; ++ ++static const struct drm_dmi_panel_orientation_data lcd1200x1920_rightside_up = { ++ .width = 1200, ++ .height = 1920, ++ .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, ++}; ++ ++static const struct drm_dmi_panel_orientation_data lcd1280x1920_rightside_up = { ++ .width = 1280, ++ .height = 1920, ++ .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, ++}; ++ ++static const struct drm_dmi_panel_orientation_data lcd1600x2560_leftside_up = { ++ .width = 1600, ++ .height = 2560, ++ .orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP, ++}; ++ ++static const struct drm_dmi_panel_orientation_data lcd1600x2560_rightside_up = { ++ .width = 1600, ++ .height = 2560, ++ .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, ++}; ++ ++static const struct dmi_system_id orientation_data[] = { ++ { /* Acer One 10 (S1003) */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Acer"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "One S1003"), ++ }, ++ .driver_data = (void *)&lcd800x1280_rightside_up, ++ }, { /* Acer Switch V 10 (SW5-017) */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Acer"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "SW5-017"), ++ }, ++ .driver_data = (void *)&lcd800x1280_rightside_up, ++ }, { /* Anbernic Win600 */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Anbernic"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Win600"), ++ }, ++ .driver_data = (void *)&lcd720x1280_rightside_up, ++ }, { /* Asus T100HA */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100HAN"), ++ }, ++ .driver_data = (void *)&lcd800x1280_leftside_up, ++ }, { /* Asus T101HA */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T101HA"), ++ }, ++ .driver_data = (void *)&lcd800x1280_rightside_up, ++ }, { /* Asus T103HAF */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T103HAF"), ++ }, ++ .driver_data = (void *)&lcd800x1280_rightside_up, ++ }, { /* AYA NEO 2021 */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYADEVICE"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "AYA NEO 2021"), ++ }, ++ .driver_data = (void *)&lcd800x1280_rightside_up, ++ }, { /* AYA NEO AIR */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYANEO"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "AIR"), ++ }, ++ .driver_data = (void *)&lcd1080x1920_leftside_up, ++ }, { /* AYA NEO NEXT */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AYANEO"), ++ DMI_MATCH(DMI_BOARD_NAME, "NEXT"), ++ }, ++ .driver_data = (void *)&lcd800x1280_rightside_up, ++ }, { /* Chuwi HiBook (CWI514) */ ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"), ++ DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"), ++ /* Above matches are too generic, add bios-date match */ ++ DMI_MATCH(DMI_BIOS_DATE, "05/07/2016"), ++ }, ++ .driver_data = (void *)&lcd1200x1920_rightside_up, ++ }, { /* Chuwi Hi10 Pro (CWI529) */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Hampoo"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Hi10 pro tablet"), ++ }, ++ .driver_data = (void *)&lcd1200x1920_rightside_up, ++ }, { /* Dynabook K50 */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dynabook Inc."), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "dynabook K50/FR"), ++ }, ++ .driver_data = (void *)&lcd800x1280_leftside_up, ++ }, { /* GPD MicroPC (generic strings, also match on bios date) */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Default string"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"), ++ DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Default string"), ++ DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"), ++ }, ++ .driver_data = (void *)&gpd_micropc, ++ }, { /* GPD MicroPC (later BIOS versions with proper DMI strings) */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "GPD"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "MicroPC"), ++ }, ++ .driver_data = (void *)&lcd720x1280_rightside_up, ++ }, { /* GPD Win Max */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "GPD"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "G1619-01"), ++ }, ++ .driver_data = (void *)&lcd800x1280_rightside_up, ++ }, { /* ++ * GPD Pocket, note that the DMI data is less generic then ++ * it seems, devices with a board-vendor of "AMI Corporation" ++ * are quite rare, as are devices which have both board- *and* ++ * product-id set to "Default String" ++ */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), ++ DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"), ++ DMI_EXACT_MATCH(DMI_BOARD_SERIAL, "Default string"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"), ++ }, ++ .driver_data = (void *)&gpd_pocket, ++ }, { /* GPD Pocket 2 (generic strings, also match on bios date) */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Default string"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"), ++ DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Default string"), ++ DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"), ++ }, ++ .driver_data = (void *)&gpd_pocket2, ++ }, { /* GPD Win (same note on DMI match as GPD Pocket) */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), ++ DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"), ++ DMI_EXACT_MATCH(DMI_BOARD_SERIAL, "Default string"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"), ++ }, ++ .driver_data = (void *)&gpd_win, ++ }, { /* GPD Win 2 (too generic strings, also match on bios date) */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Default string"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"), ++ DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Default string"), ++ DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"), ++ }, ++ .driver_data = (void *)&gpd_win2, ++ }, { /* GPD Win 3 */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "GPD"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "G1618-03") ++ }, ++ .driver_data = (void *)&lcd720x1280_rightside_up, ++ }, { /* I.T.Works TW891 */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "To be filled by O.E.M."), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "TW891"), ++ DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "To be filled by O.E.M."), ++ DMI_EXACT_MATCH(DMI_BOARD_NAME, "TW891"), ++ }, ++ .driver_data = (void *)&itworks_tw891, ++ }, { /* KD Kurio Smart C15200 2-in-1 */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "KD Interactive"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Kurio Smart"), ++ DMI_EXACT_MATCH(DMI_BOARD_NAME, "KDM960BCP"), ++ }, ++ .driver_data = (void *)&lcd800x1280_rightside_up, ++ }, { /* ++ * Lenovo Ideapad Miix 310 laptop, only some production batches ++ * have a portrait screen, the resolution checks makes the quirk ++ * apply only to those batches. ++ */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "80SG"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "MIIX 310-10ICR"), ++ }, ++ .driver_data = (void *)&lcd800x1280_rightside_up, ++ }, { /* Lenovo Ideapad Miix 320 */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "80XF"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 320-10ICR"), ++ }, ++ .driver_data = (void *)&lcd800x1280_rightside_up, ++ }, { /* Lenovo Ideapad D330-10IGM (HD) */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad D330-10IGM"), ++ }, ++ .driver_data = (void *)&lcd800x1280_rightside_up, ++ }, { /* Lenovo Ideapad D330-10IGM (FHD) */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad D330-10IGM"), ++ }, ++ .driver_data = (void *)&lcd1200x1920_rightside_up, ++ }, { /* Lenovo Ideapad D330-10IGL (HD) */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad D330-10IGL"), ++ }, ++ .driver_data = (void *)&lcd800x1280_rightside_up, ++ }, { /* Lenovo IdeaPad Duet 3 10IGL5 */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "IdeaPad Duet 3 10IGL5"), ++ }, ++ .driver_data = (void *)&lcd1200x1920_rightside_up, ++ }, { /* Lenovo Legion Go 8APU1 */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Legion Go 8APU1"), ++ }, ++ .driver_data = (void *)&lcd1600x2560_leftside_up, ++ }, { /* Lenovo Yoga Book X90F / X90L */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "YETI-11"), ++ }, ++ .driver_data = (void *)&lcd1200x1920_rightside_up, ++ }, { /* Lenovo Yoga Book X91F / X91L */ ++ .matches = { ++ /* Non exact match to match F + L versions */ ++ DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X91"), ++ }, ++ .driver_data = (void *)&lcd1200x1920_rightside_up, ++ }, { /* Lenovo Yoga Tablet 2 830F / 830L */ ++ .matches = { ++ /* ++ * Note this also matches the Lenovo Yoga Tablet 2 1050F/L ++ * since that uses the same mainboard. The resolution match ++ * will limit this to only matching on the 830F/L. Neither has ++ * any external video outputs so those are not a concern. ++ */ ++ DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."), ++ DMI_MATCH(DMI_PRODUCT_NAME, "VALLEYVIEW C0 PLATFORM"), ++ DMI_MATCH(DMI_BOARD_NAME, "BYT-T FFD8"), ++ /* Partial match on beginning of BIOS version */ ++ DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21"), ++ }, ++ .driver_data = (void *)&lcd1200x1920_rightside_up, ++ }, { /* Lenovo Yoga Tab 3 X90F */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"), ++ }, ++ .driver_data = (void *)&lcd1600x2560_rightside_up, ++ }, { /* Nanote UMPC-01 */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "RWC CO.,LTD"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "UMPC-01"), ++ }, ++ .driver_data = (void *)&lcd1200x1920_rightside_up, ++ }, { /* OneGX1 Pro */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "SYSTEM_MANUFACTURER"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "SYSTEM_PRODUCT_NAME"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Default string"), ++ }, ++ .driver_data = (void *)&onegx1_pro, ++ }, { /* OneXPlayer */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ONE-NETBOOK TECHNOLOGY CO., LTD."), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "ONE XPLAYER"), ++ }, ++ .driver_data = (void *)&lcd1600x2560_leftside_up, ++ }, { /* Samsung GalaxyBook 10.6 */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Galaxy Book 10.6"), ++ }, ++ .driver_data = (void *)&lcd1280x1920_rightside_up, ++ }, { /* Valve Steam Deck */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Valve"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Jupiter"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "1"), ++ }, ++ .driver_data = (void *)&lcd800x1280_rightside_up, ++ }, { /* VIOS LTH17 */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "VIOS"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "LTH17"), ++ }, ++ .driver_data = (void *)&lcd800x1280_rightside_up, ++ }, { /* One Mix 2S (generic strings, also match on bios date) */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Default string"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Default string"), ++ DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "Default string"), ++ DMI_EXACT_MATCH(DMI_BOARD_NAME, "Default string"), ++ }, ++ .driver_data = (void *)&gpd_onemix2s, ++ }, ++ {} ++}; ++ ++/** ++ * drm_get_panel_orientation_quirk - Check for panel orientation quirks ++ * @width: width in pixels of the panel ++ * @height: height in pixels of the panel ++ * ++ * This function checks for platform specific (e.g. DMI based) quirks ++ * providing info on panel_orientation for systems where this cannot be ++ * probed from the hard-/firm-ware. To avoid false-positive this function ++ * takes the panel resolution as argument and checks that against the ++ * resolution expected by the quirk-table entry. ++ * ++ * Note this function is also used outside of the drm-subsys, by for example ++ * the efifb code. Because of this this function gets compiled into its own ++ * kernel-module when built as a module. ++ * ++ * Returns: ++ * A DRM_MODE_PANEL_ORIENTATION_* value if there is a quirk for this system, ++ * or DRM_MODE_PANEL_ORIENTATION_UNKNOWN if there is no quirk. ++ */ ++int drm_get_panel_orientation_quirk(int width, int height) ++{ ++ const struct dmi_system_id *match; ++ const struct drm_dmi_panel_orientation_data *data; ++ const char *bios_date; ++ int i; ++ ++ for (match = dmi_first_match(orientation_data); ++ match; ++ match = dmi_first_match(match + 1)) { ++ data = match->driver_data; ++ ++ if (data->width != width || ++ data->height != height) ++ continue; ++ ++ if (!data->bios_dates) ++ return data->orientation; ++ ++ bios_date = dmi_get_system_info(DMI_BIOS_DATE); ++ if (!bios_date) ++ continue; ++ ++ i = match_string(data->bios_dates, -1, bios_date); ++ if (i >= 0) ++ return data->orientation; ++ } ++ ++ return DRM_MODE_PANEL_ORIENTATION_UNKNOWN; ++} ++EXPORT_SYMBOL(drm_get_panel_orientation_quirk); ++ ++#else ++ ++/* There are no quirks for non x86 devices yet */ ++int drm_get_panel_orientation_quirk(int width, int height) ++{ ++ return DRM_MODE_PANEL_ORIENTATION_UNKNOWN; ++} ++EXPORT_SYMBOL(drm_get_panel_orientation_quirk); ++ ++#endif ++ ++MODULE_LICENSE("Dual MIT/GPL"); +diff -rupN linux-6.7-rc8.orig/drivers/gpu/drm/drm_panel_orientation_quirks.c.rej linux-6.7-rc8.panel/drivers/gpu/drm/drm_panel_orientation_quirks.c.rej +--- linux-6.7-rc8.orig/drivers/gpu/drm/drm_panel_orientation_quirks.c.rej 1970-01-01 00:00:00.000000000 +0000 ++++ linux-6.7-rc8.panel/drivers/gpu/drm/drm_panel_orientation_quirks.c.rej 2024-01-04 23:18:55.450922222 +0000 +@@ -0,0 +1,16 @@ ++--- drivers/gpu/drm/drm_panel_orientation_quirks.c 2023-11-28 17:20:18.000000000 +0000 +++++ drivers/gpu/drm/drm_panel_orientation_quirks.c 2023-11-30 15:33:54.949480402 +0000 ++@@ -336,6 +336,13 @@ static const struct dmi_system_id orient ++ DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "IdeaPad Duet 3 10IGL5"), ++ }, ++ .driver_data = (void *)&lcd1200x1920_rightside_up, +++ }, { /* Lenovo Legion Go */ +++ .matches = { +++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"), +++ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "83E1"), +++ DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Legion Go 8APU1"), +++ }, +++ .driver_data = (void *)&lcd1600x2560_leftside_up, ++ }, { /* Lenovo Yoga Book X90F / X90L */ ++ .matches = { ++ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), diff --git a/packages/kernel/linux/patches/AMD64/002-display-quirks.patch b/packages/kernel/linux/patches/AMD64/002-display-quirks.patch index 7352a9946f..806f3f6449 100755 --- a/packages/kernel/linux/patches/AMD64/002-display-quirks.patch +++ b/packages/kernel/linux/patches/AMD64/002-display-quirks.patch @@ -1,7 +1,7 @@ -diff -rupN linux.orig/drivers/gpu/drm/drm_panel_orientation_quirks.c linux/drivers/gpu/drm/drm_panel_orientation_quirks.c ---- linux.orig/drivers/gpu/drm/drm_panel_orientation_quirks.c 2023-09-02 07:14:38.000000000 +0000 -+++ linux/drivers/gpu/drm/drm_panel_orientation_quirks.c 2023-09-09 03:24:49.178775423 +0000 -@@ -133,6 +133,12 @@ static const struct drm_dmi_panel_orient +diff -rupN linux-6.6.9.orig/drivers/gpu/drm/drm_panel_orientation_quirks.c linux-6.6.9/drivers/gpu/drm/drm_panel_orientation_quirks.c +--- linux-6.6.9.orig/drivers/gpu/drm/drm_panel_orientation_quirks.c 2024-01-04 00:22:05.545161814 +0000 ++++ linux-6.6.9/drivers/gpu/drm/drm_panel_orientation_quirks.c 2024-01-04 00:23:21.365247268 +0000 +@@ -141,6 +141,12 @@ static const struct drm_dmi_panel_orient .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, }; @@ -14,7 +14,7 @@ diff -rupN linux.orig/drivers/gpu/drm/drm_panel_orientation_quirks.c linux/drive static const struct dmi_system_id orientation_data[] = { { /* Acer One 10 (S1003) */ .matches = { -@@ -170,13 +176,13 @@ static const struct dmi_system_id orient +@@ -178,13 +184,13 @@ static const struct dmi_system_id orient DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T103HAF"), }, .driver_data = (void *)&lcd800x1280_rightside_up, @@ -31,7 +31,7 @@ diff -rupN linux.orig/drivers/gpu/drm/drm_panel_orientation_quirks.c linux/drive .matches = { DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYANEO"), DMI_MATCH(DMI_PRODUCT_NAME, "AIR"), -@@ -188,6 +194,30 @@ static const struct dmi_system_id orient +@@ -196,6 +202,30 @@ static const struct dmi_system_id orient DMI_MATCH(DMI_BOARD_NAME, "NEXT"), }, .driver_data = (void *)&lcd800x1280_rightside_up, @@ -41,7 +41,7 @@ diff -rupN linux.orig/drivers/gpu/drm/drm_panel_orientation_quirks.c linux/drive + DMI_MATCH(DMI_BOARD_NAME, "GEEK"), + }, + .driver_data = (void *)&lcd800x1280_rightside_up, -+ }, { /* AYANEO AYANEO 2 */ ++ }, { /* AYANEO AYANEO 2, 2S */ + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYANEO"), + DMI_MATCH(DMI_PRODUCT_NAME, "AYANEO 2"), diff --git a/packages/network/speedtest-cli/package.mk b/packages/network/speedtest-cli/package.mk new file mode 100644 index 0000000000..d751de0035 --- /dev/null +++ b/packages/network/speedtest-cli/package.mk @@ -0,0 +1,17 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (C) 2024-present JELOS (https://github.com/JustEnoughLinuxOS) + +PKG_NAME="speedtest-cli" +PKG_VERSION="v2.1.3" +PKG_LICENSE="Apache License 2.0" +PKG_SITE="https://github.com/sivel/speedtest-cli" +PKG_URL="${PKG_SITE}/archive/refs/tags/${PKG_VERSION}.tar.gz" +PKG_DEPENDS_TARGET="toolchain" +PKG_LONGDESC="Command line interface for testing internet bandwidth using speedtest.net" +PKG_TOOLCHAIN="manual" + +makeinstall_target() { + mkdir -p ${INSTALL}/usr/bin + cp -rf ${PKG_BUILD}/speedtest.py ${INSTALL}/usr/bin/speedtest-cli + chmod +x ${INSTALL}/usr/bin/speedtest-cli +} diff --git a/packages/ui/emulationstation/sources/es_settings b/packages/ui/emulationstation/sources/es_settings index 3bcde7310c..5ad9131a28 100755 --- a/packages/ui/emulationstation/sources/es_settings +++ b/packages/ui/emulationstation/sources/es_settings @@ -43,4 +43,10 @@ then systemctl import-environment LANGUAGE fi +### Import quirk variables. +for VARIABLE in $(cat /etc/profile.d/999-export | grep _ | sed 's/export//g; s/^\W//g; s/\\//g') +do + systemctl import-environment ${VARIABLE} +done + jslisten set "emulationstation" diff --git a/packages/ui/emulationstation/system.d/emustation.service b/packages/ui/emulationstation/system.d/emustation.service index 1e5e1fbe0a..158686aa3c 100644 --- a/packages/ui/emulationstation/system.d/emustation.service +++ b/packages/ui/emulationstation/system.d/emustation.service @@ -7,7 +7,9 @@ After=jelos-automount.service Environment=XDG_RUNTIME_DIR=/var/run/0-runtime-dir Environment=HOME=/storage Environment=SDL_AUDIODRIVER=pulseaudio -ExecStart=/usr/bin/start_es.sh +ExecStartPre=/usr/bin/es_settings +ExecStart=/usr/bin/emulationstation --log-path /var/log --no-splash +KillMode=process TimeoutStopSec=3 Restart=always RestartSec=2 diff --git a/packages/virtual/network/package.mk b/packages/virtual/network/package.mk index de77b99ef1..4debcfe08d 100644 --- a/packages/virtual/network/package.mk +++ b/packages/virtual/network/package.mk @@ -7,7 +7,7 @@ PKG_VERSION="" PKG_LICENSE="various" PKG_SITE="https://libreelec.tv" PKG_URL="" -PKG_DEPENDS_TARGET="toolchain connman hostapd netbase ethtool openssh iw rsync tailscale avahi miniupnpc nss-mdns bluetool" +PKG_DEPENDS_TARGET="toolchain connman hostapd netbase ethtool openssh iw rsync tailscale avahi miniupnpc nss-mdns bluetool speedtest-cli" PKG_SECTION="virtual" PKG_LONGDESC="Metapackage for various packages to install network support" diff --git a/packages/wayland/compositor/sway/package.mk b/packages/wayland/compositor/sway/package.mk index 7377571644..b956d43ae8 100644 --- a/packages/wayland/compositor/sway/package.mk +++ b/packages/wayland/compositor/sway/package.mk @@ -10,13 +10,15 @@ PKG_URL="https://github.com/swaywm/sway/archive/${PKG_VERSION}.tar.gz" PKG_DEPENDS_TARGET="toolchain wayland wayland-protocols libdrm libxkbcommon libinput cairo pango libjpeg-turbo dbus json-c wlroots gdk-pixbuf swaybg foot bemenu" PKG_LONGDESC="i3-compatible Wayland compositor" +# to enable xwayland package: https://gitlab.freedesktop.org/xorg/lib/libxcb-wm/-/tree/master/icccm?ref_type=heads + PKG_MESON_OPTS_TARGET="-Ddefault-wallpaper=false \ -Dzsh-completions=false \ -Dbash-completions=false \ -Dfish-completions=false \ -Dswaybar=true \ -Dswaynag=true \ - -Dxwayland=enabled \ + -Dxwayland=disabled \ -Dtray=disabled \ -Dgdk-pixbuf=enabled \ -Dman-pages=disabled \ @@ -41,6 +43,3 @@ post_makeinstall_target() { safe_remove ${INSTALL}/usr/share/wayland-sessions } -post_install() { - enable_service sway.service -} diff --git a/packages/wayland/lib/tllist/package.mk b/packages/wayland/lib/tllist/package.mk index 8405d6c0a4..7637302b11 100644 --- a/packages/wayland/lib/tllist/package.mk +++ b/packages/wayland/lib/tllist/package.mk @@ -3,7 +3,7 @@ PKG_NAME="tllist" PKG_VERSION="1.1.0" -PKG_SHA256="0e7b7094a02550dd80b7243bcffc3671550b0f1d8ba625e4dff52517827d5d23" +PKG_SHA256="3f3fe2f7433719cec816c63937a7aa36e566bd317763ef46d11562073ab6361d" PKG_LICENSE="MIT" PKG_SITE="https://codeberg.org/dnkl/tllist" PKG_URL="https://codeberg.org/dnkl/tllist/archive/${PKG_VERSION}.tar.gz" diff --git a/packages/wayland/lib/wlroots/package.mk b/packages/wayland/lib/wlroots/package.mk index ff5e1053d5..ef4b8cc7af 100644 --- a/packages/wayland/lib/wlroots/package.mk +++ b/packages/wayland/lib/wlroots/package.mk @@ -6,7 +6,7 @@ PKG_VERSION="0.16.2" PKG_LICENSE="MIT" PKG_SITE="https://gitlab.freedesktop.org/wlroots/wlroots/" PKG_URL="https://gitlab.freedesktop.org/wlroots/wlroots/-/archive/${PKG_VERSION}/${PKG_NAME}-${PKG_VERSION}.tar.bz2" -PKG_DEPENDS_TARGET="toolchain libinput libxkbcommon pixman libdrm wayland wayland-protocols seatd xwayland" +PKG_DEPENDS_TARGET="toolchain libinput libxkbcommon pixman libdrm wayland wayland-protocols seatd xwayland hwdata libxcb" PKG_LONGDESC="A modular Wayland compositor library" configure_package() { @@ -15,9 +15,9 @@ configure_package() { PKG_DEPENDS_TARGET+=" ${OPENGLES}" fi } - +# to enable xwayland package: https://gitlab.freedesktop.org/xorg/lib/libxcb-wm/-/tree/master/icccm?ref_type=heads PKG_MESON_OPTS_TARGET="-Dxcb-errors=disabled \ - -Dxwayland=enabled \ + -Dxwayland=disabled \ -Dexamples=false \ -Drenderers=gles2" diff --git a/packages/wayland/util/foot/package.mk b/packages/wayland/util/foot/package.mk index 289f2342b3..925702d3f7 100644 --- a/packages/wayland/util/foot/package.mk +++ b/packages/wayland/util/foot/package.mk @@ -17,6 +17,10 @@ PKG_MESON_OPTS_TARGET="-Ddocs=disabled \ -Dterminfo=disabled \ -Ddefault-terminfo=xterm" +pre_configure_target() { + export TARGET_CFLAGS=$(echo "${TARGET_CFLAGS} -Wno-error=switch") +} + post_makeinstall_target(){ # clean up safe_remove ${INSTALL}/usr/share/* diff --git a/packages/x11/lib/libxcb-wm/package.mk b/packages/x11/lib/libxcb-wm/package.mk new file mode 100644 index 0000000000..da2e017fa4 --- /dev/null +++ b/packages/x11/lib/libxcb-wm/package.mk @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv) + +PKG_NAME="libxcb-wm" +PKG_VERSION="0.4.2" + +PKG_LICENSE="OSS" +PKG_SITE="https://wayland.freedesktop.org/" +PKG_URL="https://gitlab.freedesktop.org/xorg/lib/libxcb-wm/-/archive/xcb-util-wm-${PKG_VERSION}/${PKG_NAME}-xcb-util-wm-${PKG_VERSION}.tar.gz" +PKG_DEPENDS_TARGET="toolchain libxcb util-macros xorgproto" +PKG_LONGDESC="Reference implementation of a Wayland compositor" +PKG_TOOLCHAIN="autotools" diff --git a/packages/x11/lib/libxcb-wm/patches/001-build-fix.patch b/packages/x11/lib/libxcb-wm/patches/001-build-fix.patch new file mode 100644 index 0000000000..7b7b712d51 --- /dev/null +++ b/packages/x11/lib/libxcb-wm/patches/001-build-fix.patch @@ -0,0 +1,34 @@ +diff --git a/configure.ac b/configure.ac +index 9551f0c..0fde264 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -7,7 +7,7 @@ AC_CONFIG_SRCDIR([Makefile.am]) + AC_CONFIG_HEADERS([config.h]) + AC_CONFIG_MACRO_DIR([m4]) + AM_INIT_AUTOMAKE([foreign dist-xz]) +- ++LT_INIT + XCB_UTIL_M4_WITH_INCLUDE_PATH + XCB_UTIL_COMMON([1.4], [1.6]) + +diff --git a/ewmh/Makefile.am b/ewmh/Makefile.am +index 488d006..747d042 100644 +--- a/ewmh/Makefile.am ++++ b/ewmh/Makefile.am +@@ -1,4 +1,4 @@ +- ++pkgconfigdir = $(libdir)/pkgconfig + lib_LTLIBRARIES = libxcb-ewmh.la + + nodist_xcbinclude_HEADERS = xcb_ewmh.h +diff --git a/icccm/Makefile.am b/icccm/Makefile.am +index 8dc2680..5b56c14 100644 +--- a/icccm/Makefile.am ++++ b/icccm/Makefile.am +@@ -1,4 +1,4 @@ +- ++pkgconfigdir = $(libdir)/pkgconfig + lib_LTLIBRARIES = libxcb-icccm.la + + xcbinclude_HEADERS = xcb_icccm.h + diff --git a/projects/Amlogic/bootloader/update.sh b/projects/Amlogic/bootloader/update.sh index 4f156d612a..53da44dc07 100755 --- a/projects/Amlogic/bootloader/update.sh +++ b/projects/Amlogic/bootloader/update.sh @@ -116,9 +116,11 @@ fi if [ -f $SYSTEM_ROOT/usr/share/bootloader/${SUBDEVICE}_u-boot ]; then echo "Updating u-boot on: $BOOT_DISK..." dd if=$SYSTEM_ROOT/usr/share/bootloader/${SUBDEVICE}_u-boot of=$BOOT_DISK conv=fsync,notrunc bs=512 seek=1 &>/dev/null - if [ $BOOT_DISK != /dev/mmcblk0 ]; then - echo "Updating u-boot on: /dev/mmcblk0..." - dd if=$SYSTEM_ROOT/usr/share/bootloader/${SUBDEVICE}_u-boot of=/dev/mmcblk0 conv=fsync,notrunc bs=512 seek=1 &>/dev/null + if [ -e /dev/mmcblk0 ]; then + if [ $BOOT_DISK != /dev/mmcblk0 ]; then + echo "Updating u-boot on: /dev/mmcblk0..." + dd if=$SYSTEM_ROOT/usr/share/bootloader/${SUBDEVICE}_u-boot of=/dev/mmcblk0 conv=fsync,notrunc bs=512 seek=1 &>/dev/null + fi fi fi diff --git a/projects/Amlogic/devices/S922X/linux/linux.aarch64.conf b/projects/Amlogic/devices/S922X/linux/linux.aarch64.conf index 781e362da5..0720aa2295 100644 --- a/projects/Amlogic/devices/S922X/linux/linux.aarch64.conf +++ b/projects/Amlogic/devices/S922X/linux/linux.aarch64.conf @@ -1,15 +1,15 @@ - +# # Automatically generated file; DO NOT EDIT. -# Linux/arm64 6.1.38 Kernel Configuration +# Linux/arm64 6.6.15 Kernel Configuration # -CONFIG_CC_VERSION_TEXT="aarch64-libreelec-linux-gnueabi-gcc-12.3.0 (GCC) 12.3.0" +CONFIG_CC_VERSION_TEXT="aarch64-libreelec-linux-gnueabi-gcc-12.3.1 (GCC) 12.3.1 20240103" CONFIG_CC_IS_GCC=y -CONFIG_GCC_VERSION=120300 +CONFIG_GCC_VERSION=120301 CONFIG_CLANG_VERSION=0 CONFIG_AS_IS_GNU=y -CONFIG_AS_VERSION=24000 +CONFIG_AS_VERSION=24100 CONFIG_LD_IS_BFD=y -CONFIG_LD_VERSION=24000 +CONFIG_LD_VERSION=24100 CONFIG_LLD_VERSION=0 CONFIG_CC_CAN_LINK=y CONFIG_CC_CAN_LINK_STATIC=y @@ -57,7 +57,6 @@ CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_GENERIC_IRQ_IPI=y CONFIG_GENERIC_MSI_IRQ=y -CONFIG_GENERIC_MSI_IRQ_DOMAIN=y CONFIG_IRQ_MSI_IOMMU=y CONFIG_IRQ_FORCED_THREADING=y CONFIG_SPARSE_IRQ=y @@ -127,7 +126,6 @@ CONFIG_CPU_ISOLATION=y CONFIG_TREE_RCU=y CONFIG_PREEMPT_RCU=y # CONFIG_RCU_EXPERT is not set -CONFIG_SRCU=y CONFIG_TREE_SRCU=y CONFIG_TASKS_RCU_GENERIC=y CONFIG_TASKS_RCU=y @@ -141,7 +139,6 @@ CONFIG_IKCONFIG_PROC=y # CONFIG_IKHEADERS is not set CONFIG_LOG_BUF_SHIFT=18 CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 -CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 # CONFIG_PRINTK_INDEX is not set CONFIG_GENERIC_SCHED_CLOCK=y @@ -152,6 +149,7 @@ CONFIG_GENERIC_SCHED_CLOCK=y # end of Scheduler features CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y +CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y CONFIG_CC_HAS_INT128=y CONFIG_CC_IMPLICIT_FALLTHROUGH="-Wimplicit-fallthrough=5" CONFIG_GCC11_NO_ARRAY_BOUNDS=y @@ -168,6 +166,7 @@ CONFIG_CGROUP_SCHED=y CONFIG_FAIR_GROUP_SCHED=y CONFIG_CFS_BANDWIDTH=y CONFIG_RT_GROUP_SCHED=y +CONFIG_SCHED_MM_CID=y CONFIG_CGROUP_PIDS=y CONFIG_CGROUP_RDMA=y CONFIG_CGROUP_FREEZER=y @@ -189,7 +188,6 @@ CONFIG_PID_NS=y CONFIG_NET_NS=y # CONFIG_CHECKPOINT_RESTORE is not set CONFIG_SCHED_AUTOGROUP=y -# CONFIG_SYSFS_DEPRECATED is not set CONFIG_RELAY=y CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="@INITRAMFS_SOURCE@" @@ -211,11 +209,13 @@ CONFIG_RD_ZSTD=y # CONFIG_INITRAMFS_COMPRESSION_ZSTD is not set CONFIG_INITRAMFS_COMPRESSION_NONE=y CONFIG_BOOT_CONFIG=y +# CONFIG_BOOT_CONFIG_FORCE is not set # CONFIG_BOOT_CONFIG_EMBED is not set CONFIG_INITRAMFS_PRESERVE_MTIME=y CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_LD_ORPHAN_WARN=y +CONFIG_LD_ORPHAN_WARN_LEVEL="warn" CONFIG_SYSCTL=y CONFIG_HAVE_UID16=y CONFIG_SYSCTL_EXCEPTION_TRACE=y @@ -242,13 +242,14 @@ CONFIG_IO_URING=y CONFIG_ADVISE_SYSCALLS=y CONFIG_MEMBARRIER=y CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_SELFTEST is not set CONFIG_KALLSYMS_ALL=y CONFIG_KALLSYMS_BASE_RELATIVE=y CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y CONFIG_KCMP=y CONFIG_RSEQ=y +CONFIG_CACHESTAT_SYSCALL=y # CONFIG_DEBUG_RSEQ is not set -CONFIG_EMBEDDED=y CONFIG_HAVE_PERF_EVENTS=y # CONFIG_PC104 is not set @@ -261,10 +262,18 @@ CONFIG_PERF_EVENTS=y CONFIG_SYSTEM_DATA_VERIFICATION=y CONFIG_PROFILING=y + +# +# Kexec and crash features +# +# CONFIG_KEXEC is not set +# CONFIG_KEXEC_FILE is not set +# CONFIG_CRASH_DUMP is not set +# end of Kexec and crash features # end of General setup CONFIG_ARM64=y -CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS=y +CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_64BIT=y CONFIG_MMU=y CONFIG_ARM64_PAGE_SHIFT=12 @@ -282,13 +291,13 @@ CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CSUM=y CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y CONFIG_SMP=y CONFIG_KERNEL_MODE_NEON=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_PGTABLE_LEVELS=4 CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_ARCH_PROC_KCORE_TEXT=y +CONFIG_BUILTIN_RETURN_ADDRESS_STRIPS_PAC=y # # Platform selection @@ -310,6 +319,7 @@ CONFIG_ARCH_PROC_KCORE_TEXT=y CONFIG_ARCH_MESON=y # CONFIG_ARCH_MVEBU is not set # CONFIG_ARCH_NXP is not set +# CONFIG_ARCH_MA35 is not set # CONFIG_ARCH_NPCM is not set # CONFIG_ARCH_QCOM is not set # CONFIG_ARCH_REALTEK is not set @@ -317,6 +327,7 @@ CONFIG_ARCH_MESON=y # CONFIG_ARCH_ROCKCHIP is not set # CONFIG_ARCH_SEATTLE is not set # CONFIG_ARCH_INTEL_SOCFPGA is not set +# CONFIG_ARCH_STM32 is not set # CONFIG_ARCH_SYNQUACER is not set # CONFIG_ARCH_TEGRA is not set # CONFIG_ARCH_SPRD is not set @@ -336,6 +347,7 @@ CONFIG_ARCH_MESON=y # # ARM errata workarounds via the alternatives framework # +CONFIG_AMPERE_ERRATUM_AC03_CPU_38=y CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y CONFIG_ARM64_ERRATUM_826319=y CONFIG_ARM64_ERRATUM_827319=y @@ -366,6 +378,10 @@ CONFIG_ARM64_ERRATUM_2054223=y CONFIG_ARM64_ERRATUM_2067961=y CONFIG_ARM64_ERRATUM_2441009=y CONFIG_ARM64_ERRATUM_2457168=y +CONFIG_ARM64_ERRATUM_2645198=y +CONFIG_ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD=y +CONFIG_ARM64_ERRATUM_2966298=y +CONFIG_ARM64_ERRATUM_3117295=y # CONFIG_CAVIUM_ERRATUM_22375 is not set # CONFIG_CAVIUM_ERRATUM_23154 is not set # CONFIG_CAVIUM_ERRATUM_27456 is not set @@ -378,6 +394,7 @@ CONFIG_ARM64_ERRATUM_2457168=y # CONFIG_QCOM_QDF2400_ERRATUM_0065 is not set # CONFIG_QCOM_FALKOR_ERRATUM_E1041 is not set CONFIG_NVIDIA_CARMEL_CNP_ERRATUM=y +CONFIG_ROCKCHIP_ERRATUM_3588001=y # CONFIG_SOCIONEXT_SYNQUACER_PREITS is not set # end of ARM errata workarounds via the alternatives framework @@ -407,11 +424,15 @@ CONFIG_ARCH_SPARSEMEM_ENABLE=y CONFIG_CC_HAVE_SHADOW_CALL_STACK=y # CONFIG_PARAVIRT is not set # CONFIG_PARAVIRT_TIME_ACCOUNTING is not set -# CONFIG_KEXEC is not set -# CONFIG_KEXEC_FILE is not set -# CONFIG_CRASH_DUMP is not set +CONFIG_ARCH_SUPPORTS_KEXEC=y +CONFIG_ARCH_SUPPORTS_KEXEC_FILE=y +CONFIG_ARCH_SUPPORTS_KEXEC_SIG=y +CONFIG_ARCH_SUPPORTS_KEXEC_IMAGE_VERIFY_SIG=y +CONFIG_ARCH_DEFAULT_KEXEC_IMAGE_VERIFY_SIG=y +CONFIG_ARCH_SUPPORTS_CRASH_DUMP=y +CONFIG_TRANS_TABLE=y # CONFIG_XEN is not set -CONFIG_ARCH_FORCE_MAX_ORDER=11 +CONFIG_ARCH_FORCE_MAX_ORDER=10 CONFIG_UNMAP_KERNEL_AT_EL0=y CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY=y CONFIG_RODATA_FULL_DEFAULT_ENABLED=y @@ -430,7 +451,6 @@ CONFIG_ARMV8_DEPRECATED=y # CONFIG_ARM64_HW_AFDBM=y CONFIG_ARM64_PAN=y -CONFIG_AS_HAS_LDAPR=y CONFIG_AS_HAS_LSE_ATOMICS=y CONFIG_ARM64_LSE_ATOMICS=y CONFIG_ARM64_USE_LSE_ATOMICS=y @@ -453,8 +473,9 @@ CONFIG_ARM64_PTR_AUTH=y CONFIG_ARM64_PTR_AUTH_KERNEL=y CONFIG_CC_HAS_BRANCH_PROT_PAC_RET=y CONFIG_CC_HAS_SIGN_RETURN_ADDRESS=y -CONFIG_AS_HAS_PAC=y +CONFIG_AS_HAS_ARMV8_3=y CONFIG_AS_HAS_CFI_NEGATE_RA_STATE=y +CONFIG_AS_HAS_LDAPR=y # end of ARMv8.3 architectural features # @@ -484,7 +505,6 @@ CONFIG_ARM64_EPAN=y CONFIG_ARM64_SVE=y CONFIG_ARM64_SME=y -CONFIG_ARM64_MODULE_PLTS=y CONFIG_ARM64_PSEUDO_NMI=y # CONFIG_ARM64_DEBUG_PRIORITY_MASKING is not set CONFIG_RELOCATABLE=y @@ -492,7 +512,6 @@ CONFIG_RANDOMIZE_BASE=y CONFIG_RANDOMIZE_MODULE_REGION_FULL=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y CONFIG_STACKPROTECTOR_PER_TASK=y -CONFIG_ARCH_NR_GPIO=0 # end of Kernel Features # @@ -508,7 +527,10 @@ CONFIG_CMDLINE="" CONFIG_SUSPEND=y CONFIG_SUSPEND_FREEZER=y # CONFIG_SUSPEND_SKIP_SYNC is not set +CONFIG_HIBERNATE_CALLBACKS=y CONFIG_HIBERNATION=y +CONFIG_HIBERNATION_SNAPSHOT_DEV=y +CONFIG_PM_STD_PARTITION="" CONFIG_PM_SLEEP=y CONFIG_PM_SLEEP_SMP=y # CONFIG_PM_AUTOSLEEP is not set @@ -524,6 +546,7 @@ CONFIG_PM_GENERIC_DOMAINS_OF=y CONFIG_CPU_PM=y # CONFIG_ENERGY_MODEL is not set CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_HIBERNATION_HEADER=y CONFIG_ARCH_SUSPEND_POSSIBLE=y # end of Power management options @@ -582,6 +605,8 @@ CONFIG_HAVE_KVM=y # General architecture-dependent options # CONFIG_ARCH_HAS_SUBPAGE_FAULTS=y +CONFIG_HOTPLUG_CORE_SYNC=y +CONFIG_HOTPLUG_CORE_SYNC_DEAD=y # CONFIG_KPROBES is not set CONFIG_JUMP_LABEL=y # CONFIG_STATIC_KEYS_SELFTEST is not set @@ -609,13 +634,16 @@ CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y CONFIG_HAVE_RSEQ=y CONFIG_HAVE_FUNCTION_ARG_ACCESS_API=y CONFIG_HAVE_HW_BREAKPOINT=y +CONFIG_HAVE_PERF_EVENTS_NMI=y CONFIG_HAVE_PERF_REGS=y CONFIG_HAVE_PERF_USER_STACK_DUMP=y CONFIG_HAVE_ARCH_JUMP_LABEL=y CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE=y CONFIG_MMU_GATHER_TABLE_FREE=y CONFIG_MMU_GATHER_RCU_TABLE_FREE=y +CONFIG_MMU_LAZY_TLB_REFCOUNT=y CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y +CONFIG_ARCH_HAS_NMI_SAFE_THIS_CPU_OPS=y CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y CONFIG_HAVE_CMPXCHG_LOCAL=y CONFIG_HAVE_CMPXCHG_DOUBLE=y @@ -644,6 +672,7 @@ CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y CONFIG_HAVE_ARCH_HUGE_VMAP=y CONFIG_HAVE_ARCH_HUGE_VMALLOC=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y +CONFIG_ARCH_WANT_PMD_MKWRITE=y CONFIG_HAVE_MOD_ARCH_SPECIFIC=y CONFIG_MODULES_USE_ELF_RELA=y CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK=y @@ -690,11 +719,14 @@ CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y CONFIG_HAVE_GCC_PLUGINS=y CONFIG_GCC_PLUGINS=y # CONFIG_GCC_PLUGIN_LATENT_ENTROPY is not set +CONFIG_FUNCTION_ALIGNMENT_4B=y +CONFIG_FUNCTION_ALIGNMENT=4 # end of General architecture-dependent options CONFIG_RT_MUTEXES=y CONFIG_BASE_SMALL=0 CONFIG_MODULES=y +# CONFIG_MODULE_DEBUG is not set # CONFIG_MODULE_FORCE_LOAD is not set CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set @@ -713,6 +745,7 @@ CONFIG_MODULES_TREE_LOOKUP=y CONFIG_BLOCK=y CONFIG_BLOCK_LEGACY_AUTOLOAD=y CONFIG_BLK_CGROUP_RWSTAT=y +CONFIG_BLK_CGROUP_PUNT_BIO=y CONFIG_BLK_DEV_BSG_COMMON=y CONFIG_BLK_DEV_BSGLIB=y CONFIG_BLK_DEV_INTEGRITY=y @@ -754,7 +787,6 @@ CONFIG_EFI_PARTITION=y # CONFIG_CMDLINE_PARTITION is not set # end of Partition Types -CONFIG_BLOCK_COMPAT=y CONFIG_BLK_MQ_PCI=y CONFIG_BLK_PM=y @@ -806,14 +838,15 @@ CONFIG_SWAP=y # # SLAB allocator options # -# CONFIG_SLAB is not set +# CONFIG_SLAB_DEPRECATED is not set CONFIG_SLUB=y -# CONFIG_SLOB is not set +# CONFIG_SLUB_TINY is not set CONFIG_SLAB_MERGE_DEFAULT=y # CONFIG_SLAB_FREELIST_RANDOM is not set # CONFIG_SLAB_FREELIST_HARDENED is not set # CONFIG_SLUB_STATS is not set CONFIG_SLUB_CPU_PARTIAL=y +# CONFIG_RANDOM_KMALLOC_CACHES is not set # end of SLAB allocator options # CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set @@ -828,6 +861,7 @@ CONFIG_MEMORY_ISOLATION=y CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y # CONFIG_MEMORY_HOTPLUG is not set +CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y CONFIG_SPLIT_PTLOCK_CPUS=4 CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y CONFIG_COMPACTION=y @@ -863,13 +897,19 @@ CONFIG_ARCH_HAS_ZONE_DMA_SET=y CONFIG_ZONE_DMA=y CONFIG_ZONE_DMA32=y CONFIG_ARCH_USES_HIGH_VMA_FLAGS=y +CONFIG_ARCH_USES_PG_ARCH_X=y CONFIG_VM_EVENT_COUNTERS=y # CONFIG_PERCPU_STATS is not set # CONFIG_GUP_TEST is not set +# CONFIG_DMAPOOL_TEST is not set CONFIG_ARCH_HAS_PTE_SPECIAL=y +CONFIG_MEMFD_CREATE=y +CONFIG_SECRETMEM=y # CONFIG_ANON_VMA_NAME is not set # CONFIG_USERFAULTFD is not set # CONFIG_LRU_GEN is not set +CONFIG_ARCH_SUPPORTS_PER_VMA_LOCK=y +CONFIG_PER_VMA_LOCK=y CONFIG_LOCK_MM_AND_FIND_VMA=y # @@ -883,6 +923,7 @@ CONFIG_NET=y CONFIG_COMPAT_NETLINK_MESSAGES=y CONFIG_NET_INGRESS=y CONFIG_NET_EGRESS=y +CONFIG_NET_XGRESS=y CONFIG_SKB_EXTENSIONS=y # @@ -989,6 +1030,7 @@ CONFIG_NETFILTER_INGRESS=y CONFIG_NETFILTER_EGRESS=y CONFIG_NETFILTER_NETLINK=m CONFIG_NETFILTER_FAMILY_BRIDGE=y +CONFIG_NETFILTER_BPF_LINK=y # CONFIG_NETFILTER_NETLINK_ACCT is not set # CONFIG_NETFILTER_NETLINK_QUEUE is not set CONFIG_NETFILTER_NETLINK_LOG=m @@ -1133,7 +1175,6 @@ CONFIG_IP_NF_TARGET_MASQUERADE=m # CONFIG_IP_NF_TARGET_NETMAP is not set # CONFIG_IP_NF_TARGET_REDIRECT is not set CONFIG_IP_NF_MANGLE=m -# CONFIG_IP_NF_TARGET_CLUSTERIP is not set # CONFIG_IP_NF_TARGET_ECN is not set # CONFIG_IP_NF_TARGET_TTL is not set # CONFIG_IP_NF_RAW is not set @@ -1203,7 +1244,6 @@ CONFIG_NET_SCHED=y # # Queueing/Scheduling # -# CONFIG_NET_SCH_CBQ is not set # CONFIG_NET_SCH_HTB is not set # CONFIG_NET_SCH_HFSC is not set # CONFIG_NET_SCH_PRIO is not set @@ -1217,7 +1257,6 @@ CONFIG_NET_SCHED=y # CONFIG_NET_SCH_ETF is not set # CONFIG_NET_SCH_TAPRIO is not set # CONFIG_NET_SCH_GRED is not set -# CONFIG_NET_SCH_DSMARK is not set # CONFIG_NET_SCH_NETEM is not set # CONFIG_NET_SCH_DRR is not set # CONFIG_NET_SCH_MQPRIO is not set @@ -1241,8 +1280,6 @@ CONFIG_NET_SCH_FQ_CODEL=y # CONFIG_NET_CLS_ROUTE4 is not set # CONFIG_NET_CLS_FW is not set # CONFIG_NET_CLS_U32 is not set -# CONFIG_NET_CLS_RSVP is not set -# CONFIG_NET_CLS_RSVP6 is not set # CONFIG_NET_CLS_FLOW is not set # CONFIG_NET_CLS_CGROUP is not set # CONFIG_NET_CLS_BPF is not set @@ -1265,6 +1302,7 @@ CONFIG_DNS_RESOLVER=y # CONFIG_QRTR is not set # CONFIG_NET_NCSI is not set CONFIG_PCPU_DEV_REFCNT=y +CONFIG_MAX_SKB_FRAGS=17 CONFIG_RPS=y CONFIG_RFS_ACCEL=y CONFIG_SOCK_RX_QUEUE_MAPPING=y @@ -1293,6 +1331,7 @@ CONFIG_BT_RFCOMM_TTY=y CONFIG_BT_HIDP=m CONFIG_BT_HS=y CONFIG_BT_LE=y +CONFIG_BT_LE_L2CAP_ECRED=y # CONFIG_BT_LEDS is not set # CONFIG_BT_MSFTEXT is not set # CONFIG_BT_AOSPEXT is not set @@ -1309,6 +1348,7 @@ CONFIG_BT_QCA=m CONFIG_BT_MTK=m CONFIG_BT_HCIBTUSB=m # CONFIG_BT_HCIBTUSB_AUTOSUSPEND is not set +CONFIG_BT_HCIBTUSB_POLL_SYNC=y CONFIG_BT_HCIBTUSB_BCM=y # CONFIG_BT_HCIBTUSB_MTK is not set CONFIG_BT_HCIBTUSB_RTL=y @@ -1328,6 +1368,7 @@ CONFIG_BT_HCIUART_QCA=y # CONFIG_BT_HCIUART_AG6XX is not set # CONFIG_BT_HCIUART_MRVL is not set # CONFIG_BT_HCIBCM203X is not set +# CONFIG_BT_HCIBCM4377 is not set # CONFIG_BT_HCIBPA10X is not set # CONFIG_BT_HCIBFUSB is not set # CONFIG_BT_HCIVHCI is not set @@ -1335,6 +1376,7 @@ CONFIG_BT_HCIUART_QCA=y # CONFIG_BT_ATH3K is not set CONFIG_BT_MTKSDIO=m CONFIG_BT_MTKUART=m +# CONFIG_BT_NXPUART is not set # end of Bluetooth device drivers # CONFIG_AF_RXRPC is not set @@ -1404,13 +1446,13 @@ CONFIG_PCIEASPM_DEFAULT=y # CONFIG_PCIEASPM_PERFORMANCE is not set # CONFIG_PCIE_PTM is not set CONFIG_PCI_MSI=y -CONFIG_PCI_MSI_IRQ_DOMAIN=y CONFIG_PCI_QUIRKS=y # CONFIG_PCI_DEBUG is not set # CONFIG_PCI_STUB is not set # CONFIG_PCI_IOV is not set # CONFIG_PCI_PRI is not set # CONFIG_PCI_PASID is not set +# CONFIG_PCI_DYNAMIC_OF_NODES is not set # CONFIG_PCIE_BUS_TUNE_OFF is not set CONFIG_PCIE_BUS_DEFAULT=y # CONFIG_PCIE_BUS_SAFE is not set @@ -1423,36 +1465,36 @@ CONFIG_VGA_ARB_MAX_GPUS=16 # # PCI controller drivers # -# CONFIG_PCI_FTPCI100 is not set -# CONFIG_PCI_HOST_GENERIC is not set -# CONFIG_PCIE_XILINX is not set -# CONFIG_PCI_XGENE is not set # CONFIG_PCIE_ALTERA is not set # CONFIG_PCI_HOST_THUNDER_PEM is not set # CONFIG_PCI_HOST_THUNDER_ECAM is not set +# CONFIG_PCI_FTPCI100 is not set +# CONFIG_PCI_HOST_GENERIC is not set # CONFIG_PCIE_MICROCHIP_HOST is not set +# CONFIG_PCI_XGENE is not set +# CONFIG_PCIE_XILINX is not set # -# DesignWare PCI Core Support +# Cadence-based PCIe controllers # -# CONFIG_PCIE_DW_PLAT_HOST is not set -# CONFIG_PCI_HISI is not set -# CONFIG_PCIE_KIRIN is not set -# CONFIG_PCI_MESON is not set -# CONFIG_PCIE_AL is not set -# end of DesignWare PCI Core Support +# CONFIG_PCIE_CADENCE_PLAT_HOST is not set +# CONFIG_PCI_J721E_HOST is not set +# end of Cadence-based PCIe controllers # -# Mobiveil PCIe Core Support +# DesignWare-based PCIe controllers # -# end of Mobiveil PCIe Core Support +# CONFIG_PCIE_AL is not set +# CONFIG_PCI_MESON is not set +# CONFIG_PCI_HISI is not set +# CONFIG_PCIE_KIRIN is not set +# CONFIG_PCIE_DW_PLAT_HOST is not set +# end of DesignWare-based PCIe controllers # -# Cadence PCIe controllers support +# Mobiveil-based PCIe controllers # -# CONFIG_PCIE_CADENCE_PLAT_HOST is not set -# CONFIG_PCI_J721E_HOST is not set -# end of Cadence PCIe controllers support +# end of Mobiveil-based PCIe controllers # end of PCI controller drivers # @@ -1485,6 +1527,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Firmware loader # CONFIG_FW_LOADER=y +CONFIG_FW_LOADER_DEBUG=y CONFIG_EXTRA_FIRMWARE="" # CONFIG_FW_LOADER_USER_HELPER is not set # CONFIG_FW_LOADER_COMPRESS is not set @@ -1509,6 +1552,7 @@ CONFIG_REGMAP_IRQ=y CONFIG_DMA_SHARED_BUFFER=y # CONFIG_DMA_FENCE_TRACE is not set CONFIG_GENERIC_ARCH_TOPOLOGY=y +# CONFIG_FW_DEVLINK_SYNC_STATE_TIMEOUT is not set # end of Generic Driver Options # @@ -1521,6 +1565,11 @@ CONFIG_GENERIC_ARCH_TOPOLOGY=y # CONFIG_MHI_BUS_EP is not set # end of Bus devices +# +# Cache Drivers +# +# end of Cache Drivers + # CONFIG_CONNECTOR is not set # @@ -1754,7 +1803,6 @@ CONFIG_EEPROM_93CX6=m # CONFIG_MISC_ALCOR_PCI is not set # CONFIG_MISC_RTSX_PCI is not set # CONFIG_MISC_RTSX_USB is not set -# CONFIG_HABANA_AI is not set # CONFIG_UACCE is not set # CONFIG_PVPANIC is not set # CONFIG_GP_PCI1XXXX is not set @@ -1862,7 +1910,6 @@ CONFIG_SATA_MOBILE_LPM_POLICY=0 CONFIG_SATA_AHCI_PLATFORM=m # CONFIG_AHCI_DWC is not set # CONFIG_AHCI_CEVA is not set -# CONFIG_AHCI_QORIQ is not set # CONFIG_SATA_INIC162X is not set # CONFIG_SATA_ACARD_AHCI is not set # CONFIG_SATA_SIL24 is not set @@ -1944,6 +1991,7 @@ CONFIG_ATA_BMDMA=y # CONFIG_PATA_LEGACY is not set CONFIG_MD=y # CONFIG_BLK_DEV_MD is not set +CONFIG_MD_BITMAP_FILE=y # CONFIG_BCACHE is not set # CONFIG_BLK_DEV_DM is not set # CONFIG_TARGET_CORE is not set @@ -1977,6 +2025,7 @@ CONFIG_MACVLAN=m # CONFIG_MACSEC is not set CONFIG_NETCONSOLE=y CONFIG_NETCONSOLE_DYNAMIC=y +# CONFIG_NETCONSOLE_EXTENDED_LOG is not set CONFIG_NETPOLL=y CONFIG_NET_POLL_CONTROLLER=y CONFIG_TUN=y @@ -2019,9 +2068,6 @@ CONFIG_NET_VENDOR_FUNGIBLE=y # CONFIG_NET_VENDOR_HISILICON is not set # CONFIG_NET_VENDOR_HUAWEI is not set # CONFIG_NET_VENDOR_INTEL is not set -CONFIG_NET_VENDOR_WANGXUN=y -# CONFIG_NGBE is not set -# CONFIG_TXGBE is not set # CONFIG_JME is not set CONFIG_NET_VENDOR_ADI=y CONFIG_NET_VENDOR_LITEX=y @@ -2068,7 +2114,6 @@ CONFIG_STMMAC_PLATFORM=y CONFIG_DWMAC_GENERIC=y CONFIG_DWMAC_MESON=y # CONFIG_DWMAC_INTEL_PLAT is not set -# CONFIG_DWMAC_LOONGSON is not set # CONFIG_STMMAC_PCI is not set # CONFIG_NET_VENDOR_SUN is not set # CONFIG_NET_VENDOR_SYNOPSYS is not set @@ -2077,6 +2122,9 @@ CONFIG_DWMAC_MESON=y CONFIG_NET_VENDOR_VERTEXCOM=y # CONFIG_MSE102X is not set # CONFIG_NET_VENDOR_VIA is not set +CONFIG_NET_VENDOR_WANGXUN=y +# CONFIG_NGBE is not set +# CONFIG_TXGBE is not set # CONFIG_NET_VENDOR_WIZNET is not set # CONFIG_NET_VENDOR_XILINX is not set # CONFIG_FDDI is not set @@ -2085,6 +2133,7 @@ CONFIG_PHYLINK=y CONFIG_PHYLIB=y CONFIG_SWPHY=y CONFIG_LED_TRIGGER_PHY=y +CONFIG_PHYLIB_LEDS=y CONFIG_FIXED_PHY=y # CONFIG_SFP is not set @@ -2111,23 +2160,27 @@ CONFIG_AX88796B_PHY=m # CONFIG_LSI_ET1011C_PHY is not set # CONFIG_MARVELL_PHY is not set # CONFIG_MARVELL_10G_PHY is not set +# CONFIG_MARVELL_88Q2XXX_PHY is not set # CONFIG_MARVELL_88X2222_PHY is not set # CONFIG_MAXLINEAR_GPHY is not set # CONFIG_MEDIATEK_GE_PHY is not set # CONFIG_MICREL_PHY is not set +# CONFIG_MICROCHIP_T1S_PHY is not set CONFIG_MICROCHIP_PHY=m # CONFIG_MICROCHIP_T1_PHY is not set # CONFIG_MICROSEMI_PHY is not set # CONFIG_MOTORCOMM_PHY is not set # CONFIG_NATIONAL_PHY is not set +# CONFIG_NXP_CBTX_PHY is not set # CONFIG_NXP_C45_TJA11XX_PHY is not set # CONFIG_NXP_TJA11XX_PHY is not set +# CONFIG_NCN26000_PHY is not set # CONFIG_AT803X_PHY is not set # CONFIG_QSEMI_PHY is not set CONFIG_REALTEK_PHY=y # CONFIG_RENESAS_PHY is not set # CONFIG_ROCKCHIP_PHY is not set -CONFIG_SMSC_PHY=m +CONFIG_SMSC_PHY=y # CONFIG_STE10XP is not set # CONFIG_TERANETICS_PHY is not set # CONFIG_DP83822_PHY is not set @@ -2161,6 +2214,7 @@ CONFIG_MDIO_BITBANG=y # CONFIG_MDIO_BUS_MUX=y CONFIG_MDIO_BUS_MUX_MESON_G12A=y +CONFIG_MDIO_BUS_MUX_MESON_GXL=m CONFIG_MDIO_BUS_MUX_GPIO=y CONFIG_MDIO_BUS_MUX_MULTIPLEXER=y CONFIG_MDIO_BUS_MUX_MMIOREG=y @@ -2178,6 +2232,11 @@ CONFIG_PPP_DEFLATE=m CONFIG_PPP_MPPE=m # CONFIG_PPP_MULTILINK is not set CONFIG_PPPOE=m +# CONFIG_PPPOE_HASH_BITS_1 is not set +# CONFIG_PPPOE_HASH_BITS_2 is not set +CONFIG_PPPOE_HASH_BITS_4=y +# CONFIG_PPPOE_HASH_BITS_8 is not set +CONFIG_PPPOE_HASH_BITS=4 CONFIG_PPP_ASYNC=m CONFIG_PPP_SYNC_TTY=m # CONFIG_SLIP is not set @@ -2295,6 +2354,7 @@ CONFIG_BRCMFMAC_SDIO=y # CONFIG_BRCM_TRACING is not set CONFIG_BRCMDBG=y CONFIG_WLAN_VENDOR_CISCO=y +# CONFIG_AIRO is not set CONFIG_WLAN_VENDOR_INTEL=y # CONFIG_IPW2100 is not set # CONFIG_IPW2200 is not set @@ -2339,6 +2399,7 @@ CONFIG_MT7663S=m # CONFIG_MT7921E is not set # CONFIG_MT7921S is not set # CONFIG_MT7921U is not set +# CONFIG_MT7996E is not set CONFIG_WLAN_VENDOR_MICROCHIP=y # CONFIG_WILC1000_SDIO is not set # CONFIG_WILC1000_SPI is not set @@ -2397,13 +2458,23 @@ CONFIG_RTW88_8822C=m CONFIG_RTW88_8723D=m CONFIG_RTW88_8821C=m CONFIG_RTW88_8822BE=m +# CONFIG_RTW88_8822BS is not set +# CONFIG_RTW88_8822BU is not set CONFIG_RTW88_8822CE=m +# CONFIG_RTW88_8822CS is not set +# CONFIG_RTW88_8822CU is not set CONFIG_RTW88_8723DE=m +# CONFIG_RTW88_8723DS is not set +# CONFIG_RTW88_8723DU is not set CONFIG_RTW88_8821CE=m +# CONFIG_RTW88_8821CS is not set +# CONFIG_RTW88_8821CU is not set # CONFIG_RTW88_DEBUG is not set # CONFIG_RTW88_DEBUGFS is not set CONFIG_RTW89=m +# CONFIG_RTW89_8851BE is not set # CONFIG_RTW89_8852AE is not set +# CONFIG_RTW89_8852BE is not set # CONFIG_RTW89_8852CE is not set CONFIG_WLAN_VENDOR_RSI=y # CONFIG_RSI_91X is not set @@ -2416,8 +2487,8 @@ CONFIG_USB_ZD1201=m CONFIG_ZD1211RW=m # CONFIG_ZD1211RW_DEBUG is not set # CONFIG_WLAN_VENDOR_QUANTENNA is not set -# CONFIG_MAC80211_HWSIM is not set CONFIG_USB_NET_RNDIS_WLAN=m +# CONFIG_MAC80211_HWSIM is not set # CONFIG_VIRT_WIFI is not set # CONFIG_WAN is not set @@ -2613,6 +2684,7 @@ CONFIG_HW_CONSOLE=y CONFIG_VT_HW_CONSOLE_BINDING=y CONFIG_UNIX98_PTYS=y # CONFIG_LEGACY_PTYS is not set +CONFIG_LEGACY_TIOCSTI=y CONFIG_LDISC_AUTOLOAD=y # @@ -2624,12 +2696,14 @@ CONFIG_SERIAL_8250=y # CONFIG_SERIAL_8250_16550A_VARIANTS is not set # CONFIG_SERIAL_8250_FINTEK is not set CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_8250_PCILIB=y CONFIG_SERIAL_8250_PCI=y CONFIG_SERIAL_8250_EXAR=y CONFIG_SERIAL_8250_NR_UARTS=1 CONFIG_SERIAL_8250_RUNTIME_UARTS=0 CONFIG_SERIAL_8250_EXTENDED=y # CONFIG_SERIAL_8250_MANY_PORTS is not set +# CONFIG_SERIAL_8250_PCI1XXXX is not set CONFIG_SERIAL_8250_SHARE_IRQ=y # CONFIG_SERIAL_8250_DETECT_IRQ is not set # CONFIG_SERIAL_8250_RSA is not set @@ -2645,7 +2719,7 @@ CONFIG_SERIAL_OF_PLATFORM=y # # CONFIG_SERIAL_AMBA_PL010 is not set # CONFIG_SERIAL_AMBA_PL011 is not set -# CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST is not set +# CONFIG_SERIAL_EARLYCON_SEMIHOST is not set CONFIG_SERIAL_MESON=y CONFIG_SERIAL_MESON_CONSOLE=y # CONFIG_SERIAL_MAX3100 is not set @@ -2679,6 +2753,7 @@ CONFIG_SERIAL_DEV_CTRL_TTYPORT=y # CONFIG_TTY_PRINTK is not set # CONFIG_VIRTIO_CONSOLE is not set # CONFIG_IPMI_HANDLER is not set +# CONFIG_SSIF_IPMI_BMC is not set # CONFIG_IPMB_DEVICE_INTERFACE is not set CONFIG_HW_RANDOM=y # CONFIG_HW_RANDOM_TIMERIOMEM is not set @@ -2695,8 +2770,6 @@ CONFIG_DEVPORT=y # CONFIG_TCG_TPM is not set # CONFIG_XILLYBUS is not set # CONFIG_XILLYUSB is not set -# CONFIG_RANDOM_TRUST_CPU is not set -# CONFIG_RANDOM_TRUST_BOOTLOADER is not set # end of Character devices # @@ -2761,6 +2834,7 @@ CONFIG_I2C_DESIGNWARE_PLATFORM=y # CONFIG_I2C_EMEV2 is not set CONFIG_I2C_GPIO=y # CONFIG_I2C_GPIO_FAULT_INJECTOR is not set +# CONFIG_I2C_HISI is not set CONFIG_I2C_MESON=y # CONFIG_I2C_NOMADIK is not set # CONFIG_I2C_OCORES is not set @@ -2805,13 +2879,13 @@ CONFIG_SPI_MEM=y # SPI Master Controller Drivers # # CONFIG_SPI_ALTERA is not set +# CONFIG_SPI_AMLOGIC_SPIFC_A1 is not set # CONFIG_SPI_AXI_SPI_ENGINE is not set # CONFIG_SPI_BITBANG is not set # CONFIG_SPI_CADENCE is not set # CONFIG_SPI_CADENCE_QUADSPI is not set # CONFIG_SPI_CADENCE_XSPI is not set # CONFIG_SPI_DESIGNWARE is not set -# CONFIG_SPI_NXP_FLEXSPI is not set # CONFIG_SPI_GPIO is not set # CONFIG_SPI_FSL_SPI is not set CONFIG_SPI_MESON_SPICC=y @@ -2819,11 +2893,12 @@ CONFIG_SPI_MESON_SPIFC=y # CONFIG_SPI_MICROCHIP_CORE is not set # CONFIG_SPI_MICROCHIP_CORE_QSPI is not set # CONFIG_SPI_OC_TINY is not set +# CONFIG_SPI_PCI1XXXX is not set CONFIG_SPI_PL022=y # CONFIG_SPI_PXA2XX is not set -# CONFIG_SPI_ROCKCHIP is not set # CONFIG_SPI_SC18IS602 is not set # CONFIG_SPI_SIFIVE is not set +# CONFIG_SPI_SN_F_OSPI is not set # CONFIG_SPI_MXIC is not set # CONFIG_SPI_THUNDERX is not set # CONFIG_SPI_XCOMM is not set @@ -2894,6 +2969,7 @@ CONFIG_PINCTRL_MESON_AXG_PMX=y CONFIG_PINCTRL_MESON_G12A=y CONFIG_PINCTRL_MESON_A1=y CONFIG_PINCTRL_MESON_S4=y +CONFIG_PINCTRL_AMLOGIC_C3=y # # Renesas pinctrl drivers @@ -2921,6 +2997,7 @@ CONFIG_GPIO_DWAPB=y # CONFIG_GPIO_FTGPIO010 is not set CONFIG_GPIO_GENERIC_PLATFORM=y # CONFIG_GPIO_GRGPIO is not set +# CONFIG_GPIO_HISI is not set # CONFIG_GPIO_HLWD is not set # CONFIG_GPIO_LOGICVC is not set # CONFIG_GPIO_MB86S7X is not set @@ -2936,6 +3013,8 @@ CONFIG_GPIO_GENERIC_PLATFORM=y # I2C GPIO expanders # # CONFIG_GPIO_ADNP is not set +# CONFIG_GPIO_FXL6408 is not set +# CONFIG_GPIO_DS4520 is not set # CONFIG_GPIO_GW_PLD is not set # CONFIG_GPIO_MAX7300 is not set # CONFIG_GPIO_MAX732X is not set @@ -2980,6 +3059,7 @@ CONFIG_GPIO_PCA953X=m # Virtual GPIO drivers # # CONFIG_GPIO_AGGREGATOR is not set +# CONFIG_GPIO_LATCH is not set # CONFIG_GPIO_MOCKUP is not set # CONFIG_GPIO_SIM is not set # end of Virtual GPIO drivers @@ -3002,7 +3082,6 @@ CONFIG_SYSCON_REBOOT_MODE=y CONFIG_POWER_SUPPLY=y # CONFIG_POWER_SUPPLY_DEBUG is not set CONFIG_POWER_SUPPLY_HWMON=y -# CONFIG_PDA_POWER is not set # CONFIG_GENERIC_ADC_BATTERY is not set # CONFIG_IP5XXX_POWER is not set # CONFIG_TEST_POWER is not set @@ -3040,9 +3119,12 @@ CONFIG_CHARGER_RK817=y # CONFIG_BATTERY_GOLDFISH is not set # CONFIG_BATTERY_RT5033 is not set # CONFIG_CHARGER_RT9455 is not set +# CONFIG_CHARGER_RT9467 is not set +# CONFIG_CHARGER_RT9471 is not set # CONFIG_CHARGER_UCS1002 is not set # CONFIG_CHARGER_BD99954 is not set # CONFIG_BATTERY_UG3105 is not set +# CONFIG_FUEL_GAUGE_MM8013 is not set CONFIG_CHARGER_RK818=y CONFIG_HWMON=y # CONFIG_HWMON_DEBUG_CHIP is not set @@ -3089,6 +3171,7 @@ CONFIG_SENSORS_ARM_SCPI=y # CONFIG_SENSORS_G762 is not set CONFIG_SENSORS_GPIO_FAN=m # CONFIG_SENSORS_HIH6130 is not set +# CONFIG_SENSORS_HS3001 is not set # CONFIG_SENSORS_IIO_HWMON is not set # CONFIG_SENSORS_IT87 is not set # CONFIG_SENSORS_JC42 is not set @@ -3114,6 +3197,7 @@ CONFIG_SENSORS_GPIO_FAN=m # CONFIG_SENSORS_MAX31722 is not set # CONFIG_SENSORS_MAX31730 is not set # CONFIG_SENSORS_MAX31760 is not set +# CONFIG_MAX31827 is not set # CONFIG_SENSORS_MAX6620 is not set # CONFIG_SENSORS_MAX6621 is not set # CONFIG_SENSORS_MAX6639 is not set @@ -3121,6 +3205,7 @@ CONFIG_SENSORS_GPIO_FAN=m # CONFIG_SENSORS_MAX6650 is not set # CONFIG_SENSORS_MAX6697 is not set # CONFIG_SENSORS_MAX31790 is not set +# CONFIG_SENSORS_MC34VR500 is not set # CONFIG_SENSORS_MCP3021 is not set # CONFIG_SENSORS_TC654 is not set # CONFIG_SENSORS_TPS23861 is not set @@ -3176,7 +3261,6 @@ CONFIG_SENSORS_PWM_FAN=m # CONFIG_SENSORS_SCH5627 is not set # CONFIG_SENSORS_SCH5636 is not set # CONFIG_SENSORS_STTS751 is not set -# CONFIG_SENSORS_SMM665 is not set # CONFIG_SENSORS_ADC128D818 is not set # CONFIG_SENSORS_ADS7828 is not set # CONFIG_SENSORS_ADS7871 is not set @@ -3247,6 +3331,7 @@ CONFIG_WATCHDOG_OPEN_TIMEOUT=0 # CONFIG_SOFT_WATCHDOG is not set # CONFIG_GPIO_WATCHDOG is not set # CONFIG_XILINX_WATCHDOG is not set +# CONFIG_XILINX_WINDOW_WATCHDOG is not set # CONFIG_ZIIRAVE_WATCHDOG is not set # CONFIG_ARM_SP805_WATCHDOG is not set # CONFIG_ARM_SBSA_WATCHDOG is not set @@ -3300,6 +3385,7 @@ CONFIG_BCMA_DRIVER_PCI=y CONFIG_MFD_CORE=y # CONFIG_MFD_ACT8945A is not set # CONFIG_MFD_AS3711 is not set +# CONFIG_MFD_SMPRO is not set # CONFIG_MFD_AS3722 is not set # CONFIG_PMIC_ADP5520 is not set # CONFIG_MFD_AAT2870_CORE is not set @@ -3308,7 +3394,9 @@ CONFIG_MFD_CORE=y # CONFIG_MFD_BCM590XX is not set # CONFIG_MFD_BD9571MWV is not set # CONFIG_MFD_AXP20X_I2C is not set +# CONFIG_MFD_CS42L43_I2C is not set # CONFIG_MFD_MADERA is not set +# CONFIG_MFD_MAX5970 is not set # CONFIG_PMIC_DA903X is not set # CONFIG_MFD_DA9052_SPI is not set # CONFIG_MFD_DA9052_I2C is not set @@ -3323,8 +3411,6 @@ CONFIG_MFD_CORE=y # CONFIG_MFD_MP2629 is not set # CONFIG_MFD_HI6421_PMIC is not set # CONFIG_MFD_HI6421_SPMI is not set -# CONFIG_HTC_PASIC3 is not set -# CONFIG_HTC_I2CPLD is not set # CONFIG_LPC_ICH is not set # CONFIG_LPC_SCH is not set # CONFIG_MFD_IQS62X is not set @@ -3334,6 +3420,7 @@ CONFIG_MFD_CORE=y # CONFIG_MFD_88PM805 is not set # CONFIG_MFD_88PM860X is not set # CONFIG_MFD_MAX14577 is not set +# CONFIG_MFD_MAX77541 is not set # CONFIG_MFD_MAX77620 is not set # CONFIG_MFD_MAX77650 is not set # CONFIG_MFD_MAX77686 is not set @@ -3361,7 +3448,9 @@ CONFIG_MFD_CORE=y # CONFIG_MFD_RT5033 is not set # CONFIG_MFD_RT5120 is not set # CONFIG_MFD_RC5T583 is not set -CONFIG_MFD_RK808=y +CONFIG_MFD_RK8XX=y +CONFIG_MFD_RK8XX_I2C=y +# CONFIG_MFD_RK8XX_SPI is not set # CONFIG_MFD_RN5T618 is not set CONFIG_MFD_SEC_CORE=y # CONFIG_MFD_SI476X_CORE is not set @@ -3383,10 +3472,13 @@ CONFIG_MFD_SYSCON=y # CONFIG_MFD_TI_LP873X is not set # CONFIG_MFD_TI_LP87565 is not set # CONFIG_MFD_TPS65218 is not set +# CONFIG_MFD_TPS65219 is not set # CONFIG_MFD_TPS6586X is not set # CONFIG_MFD_TPS65910 is not set # CONFIG_MFD_TPS65912_I2C is not set # CONFIG_MFD_TPS65912_SPI is not set +# CONFIG_MFD_TPS6594_I2C is not set +# CONFIG_MFD_TPS6594_SPI is not set # CONFIG_TWL4030_CORE is not set # CONFIG_TWL6040_CORE is not set # CONFIG_MFD_WL1273_CORE is not set @@ -3411,7 +3503,7 @@ CONFIG_MFD_SYSCON=y CONFIG_MFD_KHADAS_MCU=m # CONFIG_MFD_QCOM_PM8008 is not set # CONFIG_RAVE_SP_CORE is not set -# CONFIG_MFD_INTEL_M10_BMC is not set +# CONFIG_MFD_INTEL_M10_BMC_SPI is not set # CONFIG_MFD_RSMU_I2C is not set # CONFIG_MFD_RSMU_SPI is not set # end of Multifunction device drivers @@ -3424,6 +3516,7 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y # CONFIG_REGULATOR_88PG86X is not set # CONFIG_REGULATOR_ACT8865 is not set # CONFIG_REGULATOR_AD5398 is not set +# CONFIG_REGULATOR_AW37503 is not set # CONFIG_REGULATOR_DA9121 is not set # CONFIG_REGULATOR_DA9210 is not set # CONFIG_REGULATOR_DA9211 is not set @@ -3439,12 +3532,14 @@ CONFIG_REGULATOR_GPIO=y # CONFIG_REGULATOR_LTC3589 is not set # CONFIG_REGULATOR_LTC3676 is not set # CONFIG_REGULATOR_MAX1586 is not set +# CONFIG_REGULATOR_MAX77857 is not set # CONFIG_REGULATOR_MAX8649 is not set # CONFIG_REGULATOR_MAX8660 is not set # CONFIG_REGULATOR_MAX8893 is not set # CONFIG_REGULATOR_MAX8952 is not set # CONFIG_REGULATOR_MAX8973 is not set # CONFIG_REGULATOR_MAX20086 is not set +# CONFIG_REGULATOR_MAX20411 is not set # CONFIG_REGULATOR_MAX77826 is not set # CONFIG_REGULATOR_MCP16502 is not set # CONFIG_REGULATOR_MP5416 is not set @@ -3462,16 +3557,21 @@ CONFIG_REGULATOR_GPIO=y CONFIG_REGULATOR_PWM=y # CONFIG_REGULATOR_QCOM_SPMI is not set # CONFIG_REGULATOR_QCOM_USB_VBUS is not set +# CONFIG_REGULATOR_RAA215300 is not set # CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY is not set CONFIG_REGULATOR_RK808=y # CONFIG_REGULATOR_RT4801 is not set +# CONFIG_REGULATOR_RT4803 is not set # CONFIG_REGULATOR_RT5190A is not set +# CONFIG_REGULATOR_RT5739 is not set # CONFIG_REGULATOR_RT5759 is not set # CONFIG_REGULATOR_RT6160 is not set +# CONFIG_REGULATOR_RT6190 is not set # CONFIG_REGULATOR_RT6245 is not set # CONFIG_REGULATOR_RTQ2134 is not set # CONFIG_REGULATOR_RTMV20 is not set # CONFIG_REGULATOR_RTQ6752 is not set +# CONFIG_REGULATOR_RTQ2208 is not set # CONFIG_REGULATOR_S2MPA01 is not set # CONFIG_REGULATOR_S2MPS11 is not set # CONFIG_REGULATOR_S5M8767 is not set @@ -3482,6 +3582,7 @@ CONFIG_REGULATOR_RK808=y # CONFIG_REGULATOR_TPS51632 is not set # CONFIG_REGULATOR_TPS62360 is not set # CONFIG_REGULATOR_TPS6286X is not set +# CONFIG_REGULATOR_TPS6287X is not set # CONFIG_REGULATOR_TPS65023 is not set # CONFIG_REGULATOR_TPS6507X is not set # CONFIG_REGULATOR_TPS65132 is not set @@ -3569,9 +3670,12 @@ CONFIG_DVB_CORE=y # Video4Linux options # CONFIG_VIDEO_V4L2_I2C=y +CONFIG_VIDEO_V4L2_SUBDEV_API=y # CONFIG_VIDEO_ADV_DEBUG is not set # CONFIG_VIDEO_FIXED_MINOR_RANGES is not set CONFIG_V4L2_MEM2MEM_DEV=y +CONFIG_V4L2_FWNODE=y +CONFIG_V4L2_ASYNC=y # end of Video4Linux options # @@ -3651,6 +3755,10 @@ CONFIG_VIDEO_MESON_GE2D=y # Mediatek media platform drivers # +# +# Microchip Technology, Inc. media platform drivers +# + # # NVidia media platform drivers # @@ -3705,6 +3813,7 @@ CONFIG_VIDEO_MESON_GE2D=y # CONFIG_SMS_SDIO_DRV is not set # CONFIG_V4L_TEST_DRIVERS is not set # CONFIG_DVB_TEST_DRIVERS is not set +CONFIG_UVC_COMMON=m CONFIG_VIDEOBUF2_CORE=y CONFIG_VIDEOBUF2_V4L2=y CONFIG_VIDEOBUF2_MEMOPS=y @@ -3722,10 +3831,7 @@ CONFIG_MEDIA_ATTACH=y # IR I2C driver auto-selected by 'Autoselect ancillary drivers' # CONFIG_VIDEO_IR_I2C=m - -# -# Camera sensor devices -# +CONFIG_VIDEO_CAMERA_SENSOR=y # CONFIG_VIDEO_AR0521 is not set # CONFIG_VIDEO_HI556 is not set # CONFIG_VIDEO_HI846 is not set @@ -3736,30 +3842,32 @@ CONFIG_VIDEO_IR_I2C=m # CONFIG_VIDEO_IMX258 is not set # CONFIG_VIDEO_IMX274 is not set # CONFIG_VIDEO_IMX290 is not set +# CONFIG_VIDEO_IMX296 is not set # CONFIG_VIDEO_IMX319 is not set # CONFIG_VIDEO_IMX334 is not set # CONFIG_VIDEO_IMX335 is not set # CONFIG_VIDEO_IMX355 is not set # CONFIG_VIDEO_IMX412 is not set +# CONFIG_VIDEO_IMX415 is not set # CONFIG_VIDEO_MT9M001 is not set -# CONFIG_VIDEO_MT9M032 is not set # CONFIG_VIDEO_MT9M111 is not set # CONFIG_VIDEO_MT9P031 is not set -# CONFIG_VIDEO_MT9T001 is not set # CONFIG_VIDEO_MT9T112 is not set # CONFIG_VIDEO_MT9V011 is not set # CONFIG_VIDEO_MT9V032 is not set # CONFIG_VIDEO_MT9V111 is not set -# CONFIG_VIDEO_NOON010PC30 is not set # CONFIG_VIDEO_OG01A1B is not set +# CONFIG_VIDEO_OV01A10 is not set # CONFIG_VIDEO_OV02A10 is not set # CONFIG_VIDEO_OV08D10 is not set +# CONFIG_VIDEO_OV08X40 is not set # CONFIG_VIDEO_OV13858 is not set # CONFIG_VIDEO_OV13B10 is not set # CONFIG_VIDEO_OV2640 is not set # CONFIG_VIDEO_OV2659 is not set # CONFIG_VIDEO_OV2680 is not set # CONFIG_VIDEO_OV2685 is not set +# CONFIG_VIDEO_OV4689 is not set # CONFIG_VIDEO_OV5640 is not set # CONFIG_VIDEO_OV5645 is not set # CONFIG_VIDEO_OV5647 is not set @@ -3775,6 +3883,7 @@ CONFIG_VIDEO_IR_I2C=m # CONFIG_VIDEO_OV772X is not set # CONFIG_VIDEO_OV7740 is not set # CONFIG_VIDEO_OV8856 is not set +# CONFIG_VIDEO_OV8858 is not set # CONFIG_VIDEO_OV8865 is not set # CONFIG_VIDEO_OV9282 is not set # CONFIG_VIDEO_OV9640 is not set @@ -3783,16 +3892,11 @@ CONFIG_VIDEO_IR_I2C=m # CONFIG_VIDEO_RDACM21 is not set # CONFIG_VIDEO_RJ54N1 is not set # CONFIG_VIDEO_S5C73M3 is not set -# CONFIG_VIDEO_S5K4ECGX is not set # CONFIG_VIDEO_S5K5BAF is not set # CONFIG_VIDEO_S5K6A3 is not set -# CONFIG_VIDEO_S5K6AA is not set -# CONFIG_VIDEO_SR030PC30 is not set -# CONFIG_VIDEO_VS6624 is not set +# CONFIG_VIDEO_ST_VGXY61 is not set # CONFIG_VIDEO_CCS is not set # CONFIG_VIDEO_ET8EK8 is not set -# CONFIG_VIDEO_M5MOLS is not set -# end of Camera sensor devices # # Lens drivers @@ -3800,6 +3904,7 @@ CONFIG_VIDEO_IR_I2C=m # CONFIG_VIDEO_AD5820 is not set # CONFIG_VIDEO_AK7375 is not set # CONFIG_VIDEO_DW9714 is not set +# CONFIG_VIDEO_DW9719 is not set # CONFIG_VIDEO_DW9768 is not set # CONFIG_VIDEO_DW9807_VCM is not set # end of Lens drivers @@ -3857,6 +3962,7 @@ CONFIG_VIDEO_WM8775=m # CONFIG_VIDEO_SAA7110 is not set CONFIG_VIDEO_SAA711X=m # CONFIG_VIDEO_TC358743 is not set +# CONFIG_VIDEO_TC358746 is not set # CONFIG_VIDEO_TVP514X is not set # CONFIG_VIDEO_TVP5150 is not set # CONFIG_VIDEO_TVP7002 is not set @@ -3876,7 +3982,6 @@ CONFIG_VIDEO_CX25840=m # # Video encoders # -# CONFIG_VIDEO_AD9389B is not set # CONFIG_VIDEO_ADV7170 is not set # CONFIG_VIDEO_ADV7175 is not set # CONFIG_VIDEO_ADV7343 is not set @@ -3916,6 +4021,14 @@ CONFIG_VIDEO_CX25840=m # CONFIG_VIDEO_THS7303 is not set # end of Miscellaneous helper chips +# +# Video serializers and deserializers +# +# CONFIG_VIDEO_DS90UB913 is not set +# CONFIG_VIDEO_DS90UB953 is not set +# CONFIG_VIDEO_DS90UB960 is not set +# end of Video serializers and deserializers + # # Media SPI Adapters # @@ -4139,7 +4252,9 @@ CONFIG_DVB_SP2=m # # Graphics support # -CONFIG_APERTURE_HELPERS=y +CONFIG_VIDEO_CMDLINE=y +CONFIG_VIDEO_NOMODESET=y +# CONFIG_AUXDISPLAY is not set CONFIG_DRM=y CONFIG_DRM_MIPI_DSI=y # CONFIG_DRM_DEBUG_MM is not set @@ -4155,7 +4270,6 @@ CONFIG_DRM_DISPLAY_HDMI_HELPER=y # CONFIG_DRM_DP_AUX_CHARDEV is not set # CONFIG_DRM_DP_CEC is not set CONFIG_DRM_GEM_DMA_HELPER=y -CONFIG_DRM_GEM_SHMEM_HELPER=y # # I2C encoder or helper chips @@ -4183,9 +4297,6 @@ CONFIG_DRM_GEM_SHMEM_HELPER=y # CONFIG_DRM_UDL is not set # CONFIG_DRM_AST is not set # CONFIG_DRM_MGAG200 is not set -# CONFIG_DRM_RCAR_DW_HDMI is not set -# CONFIG_DRM_RCAR_USE_LVDS is not set -# CONFIG_DRM_RCAR_USE_MIPI_DSI is not set # CONFIG_DRM_QXL is not set CONFIG_DRM_PANEL=y @@ -4195,6 +4306,7 @@ CONFIG_DRM_PANEL=y # CONFIG_DRM_PANEL_ABT_Y030XX067A is not set # CONFIG_DRM_PANEL_ARM_VERSATILE is not set # CONFIG_DRM_PANEL_ASUS_Z00T_TM5P5_NT35596 is not set +# CONFIG_DRM_PANEL_AUO_A030JTN01 is not set # CONFIG_DRM_PANEL_BOE_BF060Y8M_AJ0 is not set # CONFIG_DRM_PANEL_BOE_HIMAX8279D is not set # CONFIG_DRM_PANEL_BOE_TV101WUM_NL6 is not set @@ -4206,11 +4318,13 @@ CONFIG_DRM_PANEL=y # CONFIG_DRM_PANEL_ELIDA_KD35T133 is not set # CONFIG_DRM_PANEL_FEIXIN_K101_IM2BA02 is not set # CONFIG_DRM_PANEL_FEIYANG_FY07024DI26A30D is not set +# CONFIG_DRM_PANEL_HIMAX_HX8394 is not set # CONFIG_DRM_PANEL_ILITEK_IL9322 is not set # CONFIG_DRM_PANEL_ILITEK_ILI9341 is not set # CONFIG_DRM_PANEL_ILITEK_ILI9881C is not set # CONFIG_DRM_PANEL_INNOLUX_EJ030NA is not set # CONFIG_DRM_PANEL_INNOLUX_P079ZCA is not set +# CONFIG_DRM_PANEL_JADARD_JD9365DA_H3 is not set # CONFIG_DRM_PANEL_JDI_LT070ME05000 is not set # CONFIG_DRM_PANEL_JDI_R63452 is not set # CONFIG_DRM_PANEL_KHADAS_TS050 is not set @@ -4220,15 +4334,19 @@ CONFIG_DRM_PANEL=y # CONFIG_DRM_PANEL_SAMSUNG_LD9040 is not set # CONFIG_DRM_PANEL_LG_LB035Q02 is not set # CONFIG_DRM_PANEL_LG_LG4573 is not set +# CONFIG_DRM_PANEL_MAGNACHIP_D53E6EA8966 is not set # CONFIG_DRM_PANEL_NEC_NL8048HL11 is not set +# CONFIG_DRM_PANEL_NEWVISION_NV3051D is not set # CONFIG_DRM_PANEL_NEWVISION_NV3052C is not set # CONFIG_DRM_PANEL_NOVATEK_NT35510 is not set # CONFIG_DRM_PANEL_NOVATEK_NT35560 is not set # CONFIG_DRM_PANEL_NOVATEK_NT35950 is not set +# CONFIG_DRM_PANEL_NOVATEK_NT36523 is not set # CONFIG_DRM_PANEL_NOVATEK_NT36672A is not set # CONFIG_DRM_PANEL_NOVATEK_NT39016 is not set # CONFIG_DRM_PANEL_MANTIX_MLAF057WE51 is not set # CONFIG_DRM_PANEL_OLIMEX_LCD_OLINUXINO is not set +# CONFIG_DRM_PANEL_ORISETECH_OTA5601A is not set # CONFIG_DRM_PANEL_ORISETECH_OTM8009A is not set # CONFIG_DRM_PANEL_OSD_OSD101T2587_53TS is not set # CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00 is not set @@ -4240,6 +4358,7 @@ CONFIG_DRM_PANEL=y # CONFIG_DRM_PANEL_SAMSUNG_DB7430 is not set # CONFIG_DRM_PANEL_SAMSUNG_S6D16D0 is not set # CONFIG_DRM_PANEL_SAMSUNG_S6D27A1 is not set +# CONFIG_DRM_PANEL_SAMSUNG_S6D7AA0 is not set # CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2 is not set # CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03 is not set # CONFIG_DRM_PANEL_SAMSUNG_S6E63M0 is not set @@ -4255,13 +4374,17 @@ CONFIG_DRM_PANEL_SITRONIX_ST7701=y # CONFIG_DRM_PANEL_SITRONIX_ST7703 is not set # CONFIG_DRM_PANEL_SITRONIX_ST7789V is not set # CONFIG_DRM_PANEL_SONY_ACX565AKM is not set +# CONFIG_DRM_PANEL_SONY_TD4353_JDI is not set # CONFIG_DRM_PANEL_SONY_TULIP_TRULY_NT35521 is not set +# CONFIG_DRM_PANEL_STARTEK_KD070FHFID015 is not set # CONFIG_DRM_PANEL_TDO_TL070WSH30 is not set # CONFIG_DRM_PANEL_TPO_TD028TTEC1 is not set # CONFIG_DRM_PANEL_TPO_TD043MTEA1 is not set # CONFIG_DRM_PANEL_TPO_TPG110 is not set # CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA is not set # CONFIG_DRM_PANEL_VISIONOX_RM69299 is not set +# CONFIG_DRM_PANEL_VISIONOX_VTDR6130 is not set +# CONFIG_DRM_PANEL_VISIONOX_R66451 is not set # CONFIG_DRM_PANEL_WIDECHIPS_WS2401 is not set # CONFIG_DRM_PANEL_XINPENG_XPP055C272 is not set # end of Display Panels @@ -4272,7 +4395,6 @@ CONFIG_DRM_PANEL_BRIDGE=y # # Display Interface Bridges # -# CONFIG_DRM_CDNS_DSI is not set # CONFIG_DRM_CHIPONE_ICN6211 is not set # CONFIG_DRM_CHRONTEL_CH7033 is not set CONFIG_DRM_DISPLAY_CONNECTOR=y @@ -4288,6 +4410,7 @@ CONFIG_DRM_DISPLAY_CONNECTOR=y # CONFIG_DRM_NXP_PTN3460 is not set # CONFIG_DRM_PARADE_PS8622 is not set # CONFIG_DRM_PARADE_PS8640 is not set +# CONFIG_DRM_SAMSUNG_DSIM is not set # CONFIG_DRM_SIL_SII8620 is not set # CONFIG_DRM_SII902X is not set # CONFIG_DRM_SII9234 is not set @@ -4307,6 +4430,7 @@ CONFIG_DRM_DISPLAY_CONNECTOR=y # CONFIG_DRM_ANALOGIX_ANX78XX is not set # CONFIG_DRM_ANALOGIX_ANX7625 is not set # CONFIG_DRM_I2C_ADV7511 is not set +# CONFIG_DRM_CDNS_DSI is not set # CONFIG_DRM_CDNS_MHDP8546 is not set CONFIG_DRM_DW_HDMI=y # CONFIG_DRM_DW_HDMI_AHB_AUDIO is not set @@ -4316,6 +4440,7 @@ CONFIG_DRM_DW_HDMI_I2S_AUDIO=y CONFIG_DRM_DW_MIPI_DSI=y # end of Display Interface Bridges +# CONFIG_DRM_LOONGSON is not set # CONFIG_DRM_ETNAVIV is not set # CONFIG_DRM_HISI_HIBMC is not set # CONFIG_DRM_HISI_KIRIN is not set @@ -4346,30 +4471,11 @@ CONFIG_DRM_MESON_DW_MIPI_DSI=y # CONFIG_DRM_SSD130X is not set # CONFIG_DRM_LEGACY is not set CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y -CONFIG_DRM_NOMODESET=y # # Frame buffer Devices # -CONFIG_FB_CMDLINE=y -CONFIG_FB_NOTIFY=y CONFIG_FB=y -# CONFIG_FIRMWARE_EDID is not set -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_IMAGEBLIT=y -CONFIG_FB_SYS_FILLRECT=y -CONFIG_FB_SYS_COPYAREA=y -CONFIG_FB_SYS_IMAGEBLIT=y -# CONFIG_FB_FOREIGN_ENDIAN is not set -CONFIG_FB_SYS_FOPS=y -CONFIG_FB_DEFERRED_IO=y -CONFIG_FB_MODE_HELPERS=y -# CONFIG_FB_TILEBLITTING is not set - -# -# Frame buffer hardware drivers -# # CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_ARMCLCD is not set @@ -4406,6 +4512,21 @@ CONFIG_FB_MODE_HELPERS=y # CONFIG_FB_SIMPLE is not set # CONFIG_FB_SSD1307 is not set # CONFIG_FB_SM712 is not set +CONFIG_FB_CORE=y +CONFIG_FB_NOTIFY=y +# CONFIG_FIRMWARE_EDID is not set +CONFIG_FB_DEVICE=y +CONFIG_FB_SYS_FILLRECT=y +CONFIG_FB_SYS_COPYAREA=y +CONFIG_FB_SYS_IMAGEBLIT=y +# CONFIG_FB_FOREIGN_ENDIAN is not set +CONFIG_FB_SYS_FOPS=y +CONFIG_FB_DEFERRED_IO=y +CONFIG_FB_DMAMEM_HELPERS=y +CONFIG_FB_SYSMEM_HELPERS=y +CONFIG_FB_SYSMEM_HELPERS_DEFERRED=y +CONFIG_FB_MODE_HELPERS=y +# CONFIG_FB_TILEBLITTING is not set # end of Frame buffer Devices # @@ -4414,6 +4535,7 @@ CONFIG_FB_MODE_HELPERS=y # CONFIG_LCD_CLASS_DEVICE is not set CONFIG_BACKLIGHT_CLASS_DEVICE=y # CONFIG_BACKLIGHT_KTD253 is not set +# CONFIG_BACKLIGHT_KTZ8866 is not set CONFIG_BACKLIGHT_PWM=y # CONFIG_BACKLIGHT_QCOM_WLED is not set # CONFIG_BACKLIGHT_ADP8860 is not set @@ -4447,6 +4569,7 @@ CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y # CONFIG_LOGO is not set # end of Graphics support +# CONFIG_DRM_ACCEL is not set CONFIG_SOUND=y CONFIG_SND=y CONFIG_SND_TIMER=y @@ -4483,6 +4606,7 @@ CONFIG_SND_HDA_PREALLOC_SIZE=64 CONFIG_SND_SPI=y CONFIG_SND_USB=y CONFIG_SND_USB_AUDIO=m +# CONFIG_SND_USB_AUDIO_MIDI_V2 is not set CONFIG_SND_USB_AUDIO_USE_MEDIA_CONTROLLER=y CONFIG_SND_USB_UA101=m CONFIG_SND_USB_CAIAQ=m @@ -4521,6 +4645,7 @@ CONFIG_SND_SOC=y # CONFIG_SND_SOC_IMX_AUDMUX is not set # end of SoC Audio for Freescale CPUs +# CONFIG_SND_SOC_CHV3_I2S is not set # CONFIG_SND_I2S_HI6210_I2S is not set # CONFIG_SND_SOC_IMG is not set # CONFIG_SND_SOC_MTK_BTCVSD is not set @@ -4583,9 +4708,13 @@ CONFIG_SND_SOC_I2C_AND_SPI=y # CONFIG_SND_SOC_AK5386 is not set # CONFIG_SND_SOC_AK5558 is not set # CONFIG_SND_SOC_ALC5623 is not set +# CONFIG_SND_SOC_AUDIO_IIO_AUX is not set # CONFIG_SND_SOC_AW8738 is not set +# CONFIG_SND_SOC_AW88395 is not set +# CONFIG_SND_SOC_AW88261 is not set # CONFIG_SND_SOC_BD28623 is not set # CONFIG_SND_SOC_BT_SCO is not set +# CONFIG_SND_SOC_CHV3_CODEC is not set # CONFIG_SND_SOC_CS35L32 is not set # CONFIG_SND_SOC_CS35L33 is not set # CONFIG_SND_SOC_CS35L34 is not set @@ -4595,6 +4724,8 @@ CONFIG_SND_SOC_I2C_AND_SPI=y # CONFIG_SND_SOC_CS35L41_I2C is not set # CONFIG_SND_SOC_CS35L45_SPI is not set # CONFIG_SND_SOC_CS35L45_I2C is not set +# CONFIG_SND_SOC_CS35L56_I2C is not set +# CONFIG_SND_SOC_CS35L56_SPI is not set # CONFIG_SND_SOC_CS42L42 is not set # CONFIG_SND_SOC_CS42L51_I2C is not set # CONFIG_SND_SOC_CS42L52 is not set @@ -4625,14 +4756,17 @@ CONFIG_SND_SOC_ES8328_I2C=y # CONFIG_SND_SOC_GTM601 is not set # CONFIG_SND_SOC_HDA is not set # CONFIG_SND_SOC_ICS43432 is not set +# CONFIG_SND_SOC_IDT821034 is not set # CONFIG_SND_SOC_INNO_RK3036 is not set # CONFIG_SND_SOC_MAX98088 is not set +# CONFIG_SND_SOC_MAX98090 is not set CONFIG_SND_SOC_MAX98357A=y # CONFIG_SND_SOC_MAX98504 is not set # CONFIG_SND_SOC_MAX9867 is not set # CONFIG_SND_SOC_MAX98927 is not set # CONFIG_SND_SOC_MAX98520 is not set # CONFIG_SND_SOC_MAX98373_I2C is not set +# CONFIG_SND_SOC_MAX98388 is not set # CONFIG_SND_SOC_MAX98390 is not set # CONFIG_SND_SOC_MAX98396 is not set # CONFIG_SND_SOC_MAX9860 is not set @@ -4651,6 +4785,7 @@ CONFIG_SND_SOC_MAX98357A=y # CONFIG_SND_SOC_PCM5102A is not set # CONFIG_SND_SOC_PCM512x_I2C is not set # CONFIG_SND_SOC_PCM512x_SPI is not set +# CONFIG_SND_SOC_PEB2466 is not set # CONFIG_SND_SOC_RK3328 is not set CONFIG_SND_SOC_RK817=y # CONFIG_SND_SOC_RT5616 is not set @@ -4661,12 +4796,14 @@ CONFIG_SND_SOC_RK817=y # CONFIG_SND_SOC_SGTL5000 is not set CONFIG_SND_SOC_SIMPLE_AMPLIFIER=y # CONFIG_SND_SOC_SIMPLE_MUX is not set +# CONFIG_SND_SOC_SMA1303 is not set CONFIG_SND_SOC_SPDIF=y # CONFIG_SND_SOC_SRC4XXX_I2C is not set # CONFIG_SND_SOC_SSM2305 is not set # CONFIG_SND_SOC_SSM2518 is not set # CONFIG_SND_SOC_SSM2602_SPI is not set # CONFIG_SND_SOC_SSM2602_I2C is not set +# CONFIG_SND_SOC_SSM3515 is not set # CONFIG_SND_SOC_SSM4567 is not set # CONFIG_SND_SOC_STA32X is not set # CONFIG_SND_SOC_STA350 is not set @@ -4676,6 +4813,7 @@ CONFIG_SND_SOC_SPDIF=y # CONFIG_SND_SOC_TAS2764 is not set # CONFIG_SND_SOC_TAS2770 is not set # CONFIG_SND_SOC_TAS2780 is not set +# CONFIG_SND_SOC_TAS2781_I2C is not set # CONFIG_SND_SOC_TAS5086 is not set # CONFIG_SND_SOC_TAS571X is not set # CONFIG_SND_SOC_TAS5720 is not set @@ -4718,6 +4856,7 @@ CONFIG_SND_SOC_SPDIF=y # CONFIG_SND_SOC_WM8904 is not set # CONFIG_SND_SOC_WM8940 is not set # CONFIG_SND_SOC_WM8960 is not set +# CONFIG_SND_SOC_WM8961 is not set # CONFIG_SND_SOC_WM8962 is not set # CONFIG_SND_SOC_WM8974 is not set # CONFIG_SND_SOC_WM8978 is not set @@ -4745,10 +4884,7 @@ CONFIG_SND_SIMPLE_CARD=y CONFIG_SND_AUDIO_GRAPH_CARD=y # CONFIG_SND_AUDIO_GRAPH_CARD2 is not set # CONFIG_SND_TEST_COMPONENT is not set - -# -# HID support -# +CONFIG_HID_SUPPORT=y CONFIG_HID=y # CONFIG_HID_BATTERY_STRENGTH is not set CONFIG_HIDRAW=y @@ -4784,12 +4920,14 @@ CONFIG_DRAGONRISE_FF=y # CONFIG_HID_ELAN is not set # CONFIG_HID_ELECOM is not set # CONFIG_HID_ELO is not set +# CONFIG_HID_EVISION is not set CONFIG_HID_EZKEY=y # CONFIG_HID_FT260 is not set # CONFIG_HID_GEMBIRD is not set # CONFIG_HID_GFRM is not set # CONFIG_HID_GLORIOUS is not set # CONFIG_HID_HOLTEK is not set +# CONFIG_HID_GOOGLE_STADIA_FF is not set # CONFIG_HID_VIVALDI is not set # CONFIG_HID_GT683R is not set # CONFIG_HID_KEYTOUCH is not set @@ -4827,6 +4965,7 @@ CONFIG_HID_MULTITOUCH=m # CONFIG_HID_NINTENDO is not set # CONFIG_HID_NTI is not set # CONFIG_HID_NTRIG is not set +# CONFIG_HID_NVIDIA_SHIELD is not set CONFIG_HID_ORTEK=y CONFIG_HID_PANTHERLORD=y CONFIG_PANTHERLORD_FF=y @@ -4847,6 +4986,7 @@ CONFIG_HID_SONY=y CONFIG_SONY_FF=y # CONFIG_HID_SPEEDLINK is not set CONFIG_HID_STEAM=m +# CONFIG_STEAM_FF is not set # CONFIG_HID_STEELSERIES is not set CONFIG_HID_SUNPLUS=y CONFIG_HID_RMI=y @@ -4870,6 +5010,11 @@ CONFIG_HID_ZYDACRON=y # CONFIG_HID_MCP2221 is not set # end of Special HID drivers +# +# HID-BPF support +# +# end of HID-BPF support + # # USB HID support # @@ -4878,15 +5023,10 @@ CONFIG_USB_HID=y CONFIG_USB_HIDDEV=y # end of USB HID support -# -# I2C HID support -# +CONFIG_I2C_HID=y # CONFIG_I2C_HID_OF is not set # CONFIG_I2C_HID_OF_ELAN is not set # CONFIG_I2C_HID_OF_GOODIX is not set -# end of I2C HID support -# end of HID support - CONFIG_USB_OHCI_LITTLE_ENDIAN=y CONFIG_USB_SUPPORT=y CONFIG_USB_COMMON=y @@ -4927,7 +5067,6 @@ CONFIG_USB_EHCI_TT_NEWSCHED=y CONFIG_USB_EHCI_HCD_PLATFORM=y # CONFIG_USB_OXU210HP_HCD is not set # CONFIG_USB_ISP116X_HCD is not set -# CONFIG_USB_FOTG210_HCD is not set # CONFIG_USB_MAX3421_HCD is not set CONFIG_USB_OHCI_HCD=y CONFIG_USB_OHCI_HCD_PLATFORM=y @@ -4975,6 +5114,10 @@ CONFIG_USB_UAS=y # CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set # CONFIG_USBIP_CORE is not set + +# +# USB dual-mode controller drivers +# # CONFIG_USB_CDNS_SUPPORT is not set # CONFIG_USB_MUSB_HDRC is not set CONFIG_USB_DWC3=y @@ -5069,7 +5212,6 @@ CONFIG_USB_SERIAL_PL2303=m # CONFIG_USB_CYPRESS_CY7C63 is not set # CONFIG_USB_CYTHERM is not set # CONFIG_USB_IDMOUSE is not set -# CONFIG_USB_FTDI_ELAN is not set # CONFIG_USB_APPLEDISPLAY is not set # CONFIG_APPLE_MFI_FASTCHARGE is not set # CONFIG_USB_SISUSBVGA is not set @@ -5109,7 +5251,6 @@ CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 # # USB Peripheral Controller # -# CONFIG_USB_FOTG210_UDC is not set # CONFIG_USB_GR_UDC is not set # CONFIG_USB_R8A66597 is not set # CONFIG_USB_PXA27X is not set @@ -5160,6 +5301,7 @@ CONFIG_USB_CONFIGFS_F_UAC1=y # CONFIG_USB_CONFIGFS_F_UAC1_LEGACY is not set CONFIG_USB_CONFIGFS_F_UAC2=y CONFIG_USB_CONFIGFS_F_MIDI=y +# CONFIG_USB_CONFIGFS_F_MIDI2 is not set CONFIG_USB_CONFIGFS_F_HID=y CONFIG_USB_CONFIGFS_F_UVC=y CONFIG_USB_CONFIGFS_F_PRINTER=y @@ -5202,7 +5344,9 @@ CONFIG_TYPEC_FUSB302=m # USB Type-C Multiplexer/DeMultiplexer Switch support # # CONFIG_TYPEC_MUX_FSA4480 is not set +# CONFIG_TYPEC_MUX_GPIO_SBU is not set # CONFIG_TYPEC_MUX_PI3USB30532 is not set +# CONFIG_TYPEC_MUX_NB7VPQ904M is not set # end of USB Type-C Multiplexer/DeMultiplexer Switch support # @@ -5252,6 +5396,7 @@ CONFIG_LEDS_CLASS=y # LED drivers # # CONFIG_LEDS_AN30259A is not set +# CONFIG_LEDS_AW200XX is not set # CONFIG_LEDS_AW2013 is not set # CONFIG_LEDS_BCM6328 is not set # CONFIG_LEDS_BCM6358 is not set @@ -5270,9 +5415,11 @@ CONFIG_LEDS_GPIO=y # CONFIG_LEDS_LP8860 is not set # CONFIG_LEDS_PCA955X is not set # CONFIG_LEDS_PCA963X is not set +# CONFIG_LEDS_PCA995X is not set # CONFIG_LEDS_DAC124S085 is not set CONFIG_LEDS_PWM=y # CONFIG_LEDS_REGULATOR is not set +# CONFIG_LEDS_BD2606MVV is not set # CONFIG_LEDS_BD2802 is not set # CONFIG_LEDS_LT3593 is not set # CONFIG_LEDS_TCA6507 is not set @@ -5289,7 +5436,7 @@ CONFIG_LEDS_SYSCON=y # CONFIG_LEDS_MLXREG is not set # CONFIG_LEDS_USER is not set # CONFIG_LEDS_SPI_BYTE is not set -# CONFIG_LEDS_TI_LMU_COMMON is not set +# CONFIG_LEDS_LM3697 is not set # # Flash and Torch LED drivers @@ -5311,7 +5458,6 @@ CONFIG_LEDS_TRIGGER_HEARTBEAT=y # CONFIG_LEDS_TRIGGER_BACKLIGHT is not set CONFIG_LEDS_TRIGGER_CPU=y CONFIG_LEDS_TRIGGER_ACTIVITY=y -CONFIG_LEDS_TRIGGER_GPIO=y CONFIG_LEDS_TRIGGER_DEFAULT_ON=y # @@ -5429,9 +5575,7 @@ CONFIG_RTC_DRV_DS3232_HWMON=y # CONFIG_RTC_DRV_M48T35 is not set # CONFIG_RTC_DRV_M48T59 is not set # CONFIG_RTC_DRV_MSM6242 is not set -# CONFIG_RTC_DRV_BQ4802 is not set # CONFIG_RTC_DRV_RP5C01 is not set -# CONFIG_RTC_DRV_V3020 is not set # CONFIG_RTC_DRV_OPTEE is not set # CONFIG_RTC_DRV_ZYNQMP is not set @@ -5466,7 +5610,6 @@ CONFIG_DMABUF_HEAPS_SYSTEM=y CONFIG_DMABUF_HEAPS_CMA=y # end of DMABUF options -# CONFIG_AUXDISPLAY is not set # CONFIG_UIO is not set # CONFIG_VFIO is not set # CONFIG_VIRT_DRIVERS is not set @@ -5487,7 +5630,6 @@ CONFIG_STAGING=y # CONFIG_RTLLIB is not set # CONFIG_RTL8723BS is not set # CONFIG_R8712U is not set -# CONFIG_R8188EU is not set # CONFIG_RTS5208 is not set # CONFIG_VT6655 is not set # CONFIG_VT6656 is not set @@ -5528,12 +5670,6 @@ CONFIG_STAGING=y # CONFIG_AD5933 is not set # end of Network Analyzer, Impedance Converters -# -# Active energy metering IC -# -# CONFIG_ADE7854 is not set -# end of Active energy metering IC - # # Resolver to digital converters # @@ -5543,6 +5679,7 @@ CONFIG_STAGING=y # CONFIG_FB_SM750 is not set CONFIG_STAGING_MEDIA=y +# CONFIG_DVB_AV7110 is not set # CONFIG_VIDEO_MAX96712 is not set CONFIG_VIDEO_MESON_VDEC=y # CONFIG_STAGING_MEDIA_DEPRECATED is not set @@ -5587,6 +5724,8 @@ CONFIG_COMMON_CLK_SCPI=y # CONFIG_COMMON_CLK_XGENE is not set CONFIG_COMMON_CLK_PWM=y # CONFIG_COMMON_CLK_RS9_PCIE is not set +# CONFIG_COMMON_CLK_SI521XX is not set +# CONFIG_COMMON_CLK_VC3 is not set # CONFIG_COMMON_CLK_VC5 is not set # CONFIG_COMMON_CLK_VC7 is not set CONFIG_COMMON_CLK_FIXED_MMIO=y @@ -5601,12 +5740,16 @@ CONFIG_COMMON_CLK_MESON_PHASE=y CONFIG_COMMON_CLK_MESON_PLL=y CONFIG_COMMON_CLK_MESON_SCLK_DIV=y CONFIG_COMMON_CLK_MESON_VID_PLL_DIV=y +CONFIG_COMMON_CLK_MESON_VCLK=y +CONFIG_COMMON_CLK_MESON_CLKC_UTILS=y CONFIG_COMMON_CLK_MESON_AO_CLKC=y CONFIG_COMMON_CLK_MESON_EE_CLKC=y CONFIG_COMMON_CLK_MESON_CPU_DYNDIV=y CONFIG_COMMON_CLK_GXBB=y CONFIG_COMMON_CLK_AXG=y CONFIG_COMMON_CLK_AXG_AUDIO=y +# CONFIG_COMMON_CLK_A1_PLL is not set +# CONFIG_COMMON_CLK_A1_PERIPHERALS is not set CONFIG_COMMON_CLK_G12A=y # end of Clock support for Amlogic platforms @@ -5625,7 +5768,6 @@ CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND=y CONFIG_FSL_ERRATUM_A008585=y # CONFIG_HISILICON_ERRATUM_161010101 is not set CONFIG_ARM64_ERRATUM_858921=y -# CONFIG_MICROCHIP_PIT64B is not set # end of Clock Source drivers CONFIG_MAILBOX=y @@ -5655,6 +5797,7 @@ CONFIG_IOMMU_DEFAULT_DMA_STRICT=y # CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set CONFIG_OF_IOMMU=y CONFIG_IOMMU_DMA=y +# CONFIG_IOMMUFD is not set # CONFIG_ARM_SMMU is not set # CONFIG_ARM_SMMU_V3 is not set @@ -5717,6 +5860,8 @@ CONFIG_MESON_SECURE_PM_DOMAINS=y # CONFIG_LITEX_SOC_CONTROLLER is not set # end of Enable LiteX SoC Builder specific drivers +# CONFIG_WPCM450_SOC is not set + # # Qualcomm SoC drivers # @@ -5803,6 +5948,8 @@ CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 # CONFIG_FXLS8962AF_I2C is not set # CONFIG_FXLS8962AF_SPI is not set # CONFIG_IIO_ST_ACCEL_3AXIS is not set +# CONFIG_IIO_KX022A_SPI is not set +# CONFIG_IIO_KX022A_I2C is not set # CONFIG_KXSD9 is not set # CONFIG_KXCJK1013 is not set # CONFIG_MC3230 is not set @@ -5824,6 +5971,7 @@ CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 # # Analog to digital converters # +# CONFIG_AD4130 is not set # CONFIG_AD7091R5 is not set # CONFIG_AD7124 is not set # CONFIG_AD7192 is not set @@ -5858,6 +6006,7 @@ CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 # CONFIG_MAX11100 is not set # CONFIG_MAX1118 is not set # CONFIG_MAX11205 is not set +# CONFIG_MAX11410 is not set # CONFIG_MAX1241 is not set # CONFIG_MAX1363 is not set # CONFIG_MAX9611 is not set @@ -5879,11 +6028,14 @@ CONFIG_MESON_SARADC=y # CONFIG_TI_ADC128S052 is not set # CONFIG_TI_ADC161S626 is not set # CONFIG_TI_ADS1015 is not set +# CONFIG_TI_ADS7924 is not set +# CONFIG_TI_ADS1100 is not set # CONFIG_TI_ADS7950 is not set # CONFIG_TI_ADS8344 is not set # CONFIG_TI_ADS8688 is not set # CONFIG_TI_ADS124S08 is not set # CONFIG_TI_ADS131E08 is not set +# CONFIG_TI_LMP92064 is not set # CONFIG_TI_TLC4541 is not set # CONFIG_TI_TSC2046 is not set # CONFIG_VF610_ADC is not set @@ -5893,6 +6045,7 @@ CONFIG_MESON_SARADC=y # # Analog to digital and digital to analog converters # +# CONFIG_AD74115 is not set # CONFIG_AD74413R is not set # end of Analog to digital and digital to analog converters @@ -5985,8 +6138,10 @@ CONFIG_MESON_SARADC=y # CONFIG_LTC2632 is not set # CONFIG_M62332 is not set # CONFIG_MAX517 is not set +# CONFIG_MAX5522 is not set # CONFIG_MAX5821 is not set # CONFIG_MCP4725 is not set +# CONFIG_MCP4728 is not set # CONFIG_MCP4922 is not set # CONFIG_TI_DAC082S085 is not set # CONFIG_TI_DAC5571 is not set @@ -6021,6 +6176,7 @@ CONFIG_MESON_SARADC=y # # CONFIG_ADF4350 is not set # CONFIG_ADF4371 is not set +# CONFIG_ADF4377 is not set # CONFIG_ADMV1013 is not set # CONFIG_ADMV1014 is not set # CONFIG_ADMV4420 is not set @@ -6116,6 +6272,8 @@ CONFIG_MESON_SARADC=y # CONFIG_SENSORS_ISL29028 is not set # CONFIG_ISL29125 is not set # CONFIG_JSA1212 is not set +# CONFIG_ROHM_BU27008 is not set +# CONFIG_ROHM_BU27034 is not set # CONFIG_RPR0521 is not set # CONFIG_LTR501 is not set # CONFIG_LTRF216A is not set @@ -6124,6 +6282,7 @@ CONFIG_MESON_SARADC=y # CONFIG_MAX44009 is not set # CONFIG_NOA1305 is not set # CONFIG_OPT3001 is not set +# CONFIG_OPT4001 is not set # CONFIG_PA12203001 is not set # CONFIG_SI1133 is not set # CONFIG_SI1145 is not set @@ -6160,6 +6319,7 @@ CONFIG_MESON_SARADC=y # CONFIG_SENSORS_HMC5843_SPI is not set # CONFIG_SENSORS_RM3100_I2C is not set # CONFIG_SENSORS_RM3100_SPI is not set +# CONFIG_TI_TMAG5273 is not set # CONFIG_YAMAHA_YAS530 is not set # end of Magnetometer sensors @@ -6200,6 +6360,7 @@ CONFIG_MESON_SARADC=y # CONFIG_MCP4531 is not set # CONFIG_MCP41010 is not set # CONFIG_TPL0102 is not set +# CONFIG_X9250 is not set # end of Digital potentiometers # @@ -6220,6 +6381,7 @@ CONFIG_MESON_SARADC=y # CONFIG_MPL115_I2C is not set # CONFIG_MPL115_SPI is not set # CONFIG_MPL3115 is not set +# CONFIG_MPRLS0025PA is not set # CONFIG_MS5611 is not set # CONFIG_MS5637 is not set # CONFIG_IIO_ST_PRESS is not set @@ -6237,6 +6399,7 @@ CONFIG_MESON_SARADC=y # # Proximity and distance sensors # +# CONFIG_IRSD200 is not set # CONFIG_ISL29501 is not set # CONFIG_LIDAR_LITE_V2 is not set # CONFIG_MB1232 is not set @@ -6271,6 +6434,7 @@ CONFIG_MESON_SARADC=y # CONFIG_TMP117 is not set # CONFIG_TSYS01 is not set # CONFIG_TSYS02D is not set +# CONFIG_MAX30208 is not set # CONFIG_MAX31856 is not set # CONFIG_MAX31865 is not set # end of Temperature sensors @@ -6316,7 +6480,6 @@ CONFIG_RESET_MESON_AUDIO_ARB=y # CONFIG_GENERIC_PHY=y CONFIG_GENERIC_PHY_MIPI_DPHY=y -# CONFIG_PHY_XGENE is not set # CONFIG_PHY_CAN_TRANSCEIVER is not set CONFIG_PHY_MESON8B_USB2=y CONFIG_PHY_MESON_GXL_USB2=y @@ -6359,10 +6522,13 @@ CONFIG_POWERCAP=y # CONFIG_ARM_CCN is not set # CONFIG_ARM_CMN is not set # CONFIG_ARM_PMU is not set +# CONFIG_ARM_SMMU_V3_PMU is not set # CONFIG_ARM_DSU_PMU is not set # CONFIG_ARM_SPE_PMU is not set # CONFIG_HISI_PCIE_PMU is not set # CONFIG_HNS3_PMU is not set +# CONFIG_ARM_CORESIGHT_PMU_ARCH_SYSTEM_PMU is not set +# CONFIG_MESON_DDR_PMU is not set # end of Performance monitor support CONFIG_RAS=y @@ -6378,6 +6544,14 @@ CONFIG_RAS=y # CONFIG_DAX is not set CONFIG_NVMEM=y CONFIG_NVMEM_SYSFS=y + +# +# Layout Types +# +# CONFIG_NVMEM_LAYOUT_SL28_VPD is not set +# CONFIG_NVMEM_LAYOUT_ONIE_TLV is not set +# end of Layout Types + # CONFIG_NVMEM_MESON_EFUSE is not set # CONFIG_NVMEM_MESON_MX_EFUSE is not set # CONFIG_NVMEM_RMEM is not set @@ -6396,6 +6570,7 @@ CONFIG_NVMEM_SYSFS=y # CONFIG_FSI is not set CONFIG_TEE=y CONFIG_OPTEE=y +# CONFIG_OPTEE_INSECURE_LOAD_IMAGE is not set CONFIG_MULTIPLEXER=y # @@ -6415,6 +6590,7 @@ CONFIG_PM_OPP=y # CONFIG_MOST is not set # CONFIG_PECI is not set # CONFIG_HTE is not set +# CONFIG_CDX_BUS is not set # end of Device Drivers # @@ -6423,6 +6599,8 @@ CONFIG_PM_OPP=y CONFIG_DCACHE_WORD_ACCESS=y CONFIG_VALIDATE_FS_PARSER=y CONFIG_FS_IOMAP=y +CONFIG_BUFFER_HEAD=y +CONFIG_LEGACY_DIRECT_IO=y # CONFIG_EXT2_FS is not set # CONFIG_EXT3_FS is not set CONFIG_EXT4_FS=y @@ -6444,6 +6622,7 @@ CONFIG_JFS_FS=m # CONFIG_JFS_STATISTICS is not set CONFIG_XFS_FS=m CONFIG_XFS_SUPPORT_V4=y +CONFIG_XFS_SUPPORT_ASCII_CI=y # CONFIG_XFS_QUOTA is not set # CONFIG_XFS_POSIX_ACL is not set # CONFIG_XFS_RT is not set @@ -6479,7 +6658,6 @@ CONFIG_DNOTIFY=y CONFIG_INOTIFY_USER=y CONFIG_FANOTIFY=y # CONFIG_QUOTA is not set -CONFIG_AUTOFS4_FS=y CONFIG_AUTOFS_FS=y CONFIG_FUSE_FS=m # CONFIG_CUSE is not set @@ -6490,6 +6668,7 @@ CONFIG_OVERLAY_FS_REDIRECT_ALWAYS_FOLLOW=y # CONFIG_OVERLAY_FS_INDEX is not set # CONFIG_OVERLAY_FS_XINO_AUTO is not set # CONFIG_OVERLAY_FS_METACOPY is not set +# CONFIG_OVERLAY_FS_DEBUG is not set # # Caches @@ -6540,9 +6719,9 @@ CONFIG_TMPFS=y CONFIG_TMPFS_POSIX_ACL=y CONFIG_TMPFS_XATTR=y # CONFIG_TMPFS_INODE64 is not set +# CONFIG_TMPFS_QUOTA is not set CONFIG_ARCH_SUPPORTS_HUGETLBFS=y # CONFIG_HUGETLBFS is not set -CONFIG_MEMFD_CREATE=y CONFIG_ARCH_HAS_GIGANTIC_PAGE=y CONFIG_CONFIGFS_FS=y # end of Pseudo filesystems @@ -6562,9 +6741,11 @@ CONFIG_HFSPLUS_FS=m CONFIG_SQUASHFS=y # CONFIG_SQUASHFS_FILE_CACHE is not set CONFIG_SQUASHFS_FILE_DIRECT=y -# CONFIG_SQUASHFS_DECOMP_SINGLE is not set -# CONFIG_SQUASHFS_DECOMP_MULTI is not set -CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y +CONFIG_SQUASHFS_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set +CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE=y +# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI is not set +# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set CONFIG_SQUASHFS_XATTR=y CONFIG_SQUASHFS_ZLIB=y CONFIG_SQUASHFS_LZ4=y @@ -6644,6 +6825,7 @@ CONFIG_NLS_ISO8859_1=y # CONFIG_NLS_MAC_ROMANIAN is not set # CONFIG_NLS_MAC_TURKISH is not set CONFIG_NLS_UTF8=y +CONFIG_NLS_UCS2_UTILS=m # CONFIG_DLM is not set # CONFIG_UNICODE is not set CONFIG_IO_WQ=y @@ -6662,7 +6844,6 @@ CONFIG_KEY_DH_OPERATIONS=y # CONFIG_SECURITY_DMESG_RESTRICT is not set # CONFIG_SECURITY is not set # CONFIG_SECURITYFS is not set -CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y # CONFIG_HARDENED_USERCOPY is not set # CONFIG_FORTIFY_SOURCE is not set # CONFIG_STATIC_USERMODEHELPER is not set @@ -6689,6 +6870,13 @@ CONFIG_CC_HAS_ZERO_CALL_USED_REGS=y # CONFIG_ZERO_CALL_USED_REGS is not set # end of Memory initialization +# +# Hardening of kernel data structures +# +# CONFIG_LIST_HARDENED is not set +# CONFIG_BUG_ON_DATA_CORRUPTION is not set +# end of Hardening of kernel data structures + CONFIG_RANDSTRUCT_NONE=y # CONFIG_RANDSTRUCT_FULL is not set # CONFIG_RANDSTRUCT_PERFORMANCE is not set @@ -6705,6 +6893,7 @@ CONFIG_CRYPTO_ALGAPI=y CONFIG_CRYPTO_ALGAPI2=y CONFIG_CRYPTO_AEAD=y CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_SIG2=y CONFIG_CRYPTO_SKCIPHER=y CONFIG_CRYPTO_SKCIPHER2=y CONFIG_CRYPTO_HASH=y @@ -6721,7 +6910,6 @@ CONFIG_CRYPTO_MANAGER=y CONFIG_CRYPTO_MANAGER2=y # CONFIG_CRYPTO_USER is not set CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y -CONFIG_CRYPTO_GF128MUL=y CONFIG_CRYPTO_NULL=y CONFIG_CRYPTO_NULL2=y CONFIG_CRYPTO_PCRYPT=y @@ -6792,6 +6980,7 @@ CONFIG_CRYPTO_ECB=y # CONFIG_CRYPTO_CHACHA20POLY1305 is not set CONFIG_CRYPTO_CCM=y CONFIG_CRYPTO_GCM=y +CONFIG_CRYPTO_GENIV=y CONFIG_CRYPTO_SEQIV=y CONFIG_CRYPTO_ECHAINIV=m # CONFIG_CRYPTO_ESSIV is not set @@ -6812,7 +7001,7 @@ CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_SHA1=y CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=y -# CONFIG_CRYPTO_SHA3 is not set +CONFIG_CRYPTO_SHA3=y # CONFIG_CRYPTO_SM3_GENERIC is not set # CONFIG_CRYPTO_STREEBOG is not set # CONFIG_CRYPTO_VMAC is not set @@ -6851,6 +7040,7 @@ CONFIG_CRYPTO_DRBG_HMAC=y # CONFIG_CRYPTO_DRBG_CTR is not set CONFIG_CRYPTO_DRBG=y CONFIG_CRYPTO_JITTERENTROPY=y +# CONFIG_CRYPTO_JITTERENTROPY_TESTINTERFACE is not set CONFIG_CRYPTO_KDF800108_CTR=y # end of Random number generation @@ -6892,6 +7082,8 @@ CONFIG_CRYPTO_AES_ARM64_BS=y # CONFIG_CRYPTO_SM4_ARM64_CE_BLK is not set # CONFIG_CRYPTO_SM4_ARM64_NEON_BLK is not set CONFIG_CRYPTO_AES_ARM64_CE_CCM=y +# CONFIG_CRYPTO_SM4_ARM64_CE_CCM is not set +# CONFIG_CRYPTO_SM4_ARM64_CE_GCM is not set # CONFIG_CRYPTO_CRCT10DIF_ARM64_CE is not set # end of Accelerated Cryptographic Algorithms for CPU (arm64) @@ -6899,6 +7091,7 @@ CONFIG_CRYPTO_HW=y # CONFIG_CRYPTO_DEV_ATMEL_ECC is not set # CONFIG_CRYPTO_DEV_ATMEL_SHA204A is not set # CONFIG_CRYPTO_DEV_CCP is not set +# CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set # CONFIG_CRYPTO_DEV_QAT_DH895xCC is not set # CONFIG_CRYPTO_DEV_QAT_C3XXX is not set # CONFIG_CRYPTO_DEV_QAT_C62X is not set @@ -6906,7 +7099,6 @@ CONFIG_CRYPTO_HW=y # CONFIG_CRYPTO_DEV_QAT_DH895xCCVF is not set # CONFIG_CRYPTO_DEV_QAT_C3XXXVF is not set # CONFIG_CRYPTO_DEV_QAT_C62XVF is not set -# CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set # CONFIG_CRYPTO_DEV_CAVIUM_ZIP is not set # CONFIG_CRYPTO_DEV_SAFEXCEL is not set # CONFIG_CRYPTO_DEV_CCREE is not set @@ -6961,6 +7153,7 @@ CONFIG_ARCH_USE_SYM_ANNOTATIONS=y CONFIG_CRYPTO_LIB_UTILS=y CONFIG_CRYPTO_LIB_AES=y CONFIG_CRYPTO_LIB_ARC4=y +CONFIG_CRYPTO_LIB_GF128MUL=y CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=y CONFIG_CRYPTO_LIB_CHACHA_GENERIC=y @@ -6997,7 +7190,7 @@ CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y # CONFIG_RANDOM32_SELFTEST is not set CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=m -CONFIG_LZO_COMPRESS=m +CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y CONFIG_LZ4_DECOMPRESS=y CONFIG_ZSTD_COMMON=y @@ -7023,9 +7216,11 @@ CONFIG_GENERIC_ALLOCATOR=y CONFIG_XARRAY_MULTI=y CONFIG_ASSOCIATIVE_ARRAY=y CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y CONFIG_HAS_IOPORT_MAP=y CONFIG_HAS_DMA=y CONFIG_DMA_OPS=y +CONFIG_NEED_SG_DMA_FLAGS=y CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_ARCH_DMA_ADDR_T_64BIT=y @@ -7036,12 +7231,13 @@ CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU=y CONFIG_ARCH_HAS_DMA_PREP_COHERENT=y CONFIG_SWIOTLB=y +# CONFIG_SWIOTLB_DYNAMIC is not set +CONFIG_DMA_BOUNCE_UNALIGNED_KMALLOC=y # CONFIG_DMA_RESTRICTED_POOL is not set CONFIG_DMA_NONCOHERENT_MMAP=y CONFIG_DMA_COHERENT_POOL=y CONFIG_DMA_DIRECT_REMAP=y CONFIG_DMA_CMA=y -# CONFIG_DMA_PERNUMA_CMA is not set # # Default contiguous memory area size: @@ -7179,10 +7375,11 @@ CONFIG_ARCH_HAS_DEBUG_WX=y # CONFIG_DEBUG_WX is not set CONFIG_GENERIC_PTDUMP=y # CONFIG_PTDUMP_DEBUGFS is not set -# CONFIG_DEBUG_OBJECTS is not set -# CONFIG_SHRINKER_DEBUG is not set CONFIG_HAVE_DEBUG_KMEMLEAK=y # CONFIG_DEBUG_KMEMLEAK is not set +# CONFIG_PER_VMA_LOCK_STATS is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_SHRINKER_DEBUG is not set # CONFIG_DEBUG_STACK_USAGE is not set # CONFIG_SCHED_STACK_END_CHECK is not set CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE=y @@ -7213,8 +7410,11 @@ CONFIG_HAVE_ARCH_KFENCE=y CONFIG_PANIC_ON_OOPS_VALUE=0 CONFIG_PANIC_TIMEOUT=1 # CONFIG_SOFTLOCKUP_DETECTOR is not set +CONFIG_HAVE_HARDLOCKUP_DETECTOR_BUDDY=y +# CONFIG_HARDLOCKUP_DETECTOR is not set # CONFIG_DETECT_HUNG_TASK is not set # CONFIG_WQ_WATCHDOG is not set +# CONFIG_WQ_CPU_INTENSIVE_REPORT is not set # CONFIG_TEST_LOCKUP is not set # end of Debug Oops, Lockups and Hangs @@ -7267,12 +7467,9 @@ CONFIG_STACKTRACE=y # CONFIG_DEBUG_PLIST is not set # CONFIG_DEBUG_SG is not set # CONFIG_DEBUG_NOTIFIERS is not set -# CONFIG_BUG_ON_DATA_CORRUPTION is not set # CONFIG_DEBUG_MAPLE_TREE is not set # end of Debug kernel data structures -# CONFIG_DEBUG_CREDENTIALS is not set - # # RCU Debugging # @@ -7281,6 +7478,7 @@ CONFIG_STACKTRACE=y # CONFIG_RCU_REF_SCALE_TEST is not set CONFIG_RCU_CPU_STALL_TIMEOUT=21 CONFIG_RCU_EXP_CPU_STALL_TIMEOUT=0 +# CONFIG_RCU_CPU_STALL_CPUTIME is not set # CONFIG_RCU_TRACE is not set # CONFIG_RCU_EQS_DEBUG is not set # end of RCU Debugging @@ -7290,14 +7488,17 @@ CONFIG_RCU_EXP_CPU_STALL_TIMEOUT=0 # CONFIG_LATENCYTOP is not set CONFIG_HAVE_FUNCTION_TRACER=y CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_GRAPH_RETVAL=y CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y +CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_C_RECORDMCOUNT=y CONFIG_TRACING_SUPPORT=y # CONFIG_FTRACE is not set # CONFIG_SAMPLES is not set +CONFIG_HAVE_SAMPLE_FTRACE_DIRECT=y +CONFIG_HAVE_SAMPLE_FTRACE_DIRECT_MULTI=y # CONFIG_STRICT_DEVMEM is not set # diff --git a/projects/Amlogic/packages/linux/package.mk b/projects/Amlogic/packages/linux/package.mk index 3860010f8c..a5aaac7cf9 100644 --- a/projects/Amlogic/packages/linux/package.mk +++ b/projects/Amlogic/packages/linux/package.mk @@ -18,7 +18,7 @@ PKG_PATCH_DIRS+="${DEVICE}" case ${DEVICE} in S922X*) - PKG_VERSION="6.1.70" + PKG_VERSION="6.6.15" PKG_URL="https://www.kernel.org/pub/linux/kernel/v6.x/${PKG_NAME}-${PKG_VERSION}.tar.xz" ;; esac @@ -164,6 +164,7 @@ make_target() { NO_GTK2=1 \ NO_LIBNUMA=1 \ NO_LIBAUDIT=1 \ + NO_LIBTRACEEVENT=1 \ NO_LZMA=1 \ NO_SDT=1 \ CROSS_COMPILE="${TARGET_PREFIX}" \ diff --git a/projects/Amlogic/packages/linux/patches/S922X/0001-dt-bindings-clk-g12a-clkc-add-CTS_ENCL-clock-ids.patch b/projects/Amlogic/packages/linux/patches/S922X/0001-dt-bindings-clk-g12a-clkc-add-CTS_ENCL-clock-ids.patch new file mode 100644 index 0000000000..d35b6089ae --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0001-dt-bindings-clk-g12a-clkc-add-CTS_ENCL-clock-ids.patch @@ -0,0 +1,29 @@ +From 7f64c5713a47f3216f48048f69df6fa5d49eb9e7 Mon Sep 17 00:00:00 2001 +From: Neil Armstrong +Date: Fri, 24 Nov 2023 09:41:12 +0100 +Subject: [PATCH 01/49] dt-bindings: clk: g12a-clkc: add CTS_ENCL clock ids + +Add new CLK ids for the CTS_ENCL and CTS_ENCL_SEL clocks +on G12A compatible SoCs. + +Acked-by: Conor Dooley +Signed-off-by: Neil Armstrong +--- + include/dt-bindings/clock/g12a-clkc.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/include/dt-bindings/clock/g12a-clkc.h b/include/dt-bindings/clock/g12a-clkc.h +index 387767f4e298..636d713f95ff 100644 +--- a/include/dt-bindings/clock/g12a-clkc.h ++++ b/include/dt-bindings/clock/g12a-clkc.h +@@ -279,5 +279,7 @@ + #define CLKID_MIPI_DSI_PXCLK_DIV 268 + #define CLKID_MIPI_DSI_PXCLK_SEL 269 + #define CLKID_MIPI_DSI_PXCLK 270 ++#define CLKID_CTS_ENCL 271 ++#define CLKID_CTS_ENCL_SEL 272 + + #endif /* __G12A_CLKC_H */ +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0002-clk-meson-g12a-add-CTS_ENCL-CTS_ENCL_SEL-clocks.patch b/projects/Amlogic/packages/linux/patches/S922X/0002-clk-meson-g12a-add-CTS_ENCL-CTS_ENCL_SEL-clocks.patch new file mode 100644 index 0000000000..63e74207d3 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0002-clk-meson-g12a-add-CTS_ENCL-CTS_ENCL_SEL-clocks.patch @@ -0,0 +1,119 @@ +From 25b893fa047b8a8af6cbf925f2126c84a146eb35 Mon Sep 17 00:00:00 2001 +From: Neil Armstrong +Date: Fri, 24 Nov 2023 09:41:17 +0100 +Subject: [PATCH 02/49] clk: meson: g12a: add CTS_ENCL & CTS_ENCL_SEL clocks + +Add new CTS_ENCL & CTS_ENCL_SEL clocks for the G12A compatible +SoCs, they are used to feed the VPU LCD Pixel encoder used for +DSI display purposes. + +Signed-off-by: Neil Armstrong +--- + drivers/clk/meson/g12a.c | 40 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + +diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c +index f373a8d48b1d..cadd824336ad 100644 +--- a/drivers/clk/meson/g12a.c ++++ b/drivers/clk/meson/g12a.c +@@ -3549,6 +3549,22 @@ static struct clk_regmap g12a_cts_encp_sel = { + }, + }; + ++static struct clk_regmap g12a_cts_encl_sel = { ++ .data = &(struct clk_regmap_mux_data){ ++ .offset = HHI_VIID_CLK_DIV, ++ .mask = 0xf, ++ .shift = 12, ++ .table = mux_table_cts_sel, ++ }, ++ .hw.init = &(struct clk_init_data){ ++ .name = "cts_encl_sel", ++ .ops = &clk_regmap_mux_ops, ++ .parent_hws = g12a_cts_parent_hws, ++ .num_parents = ARRAY_SIZE(g12a_cts_parent_hws), ++ .flags = CLK_SET_RATE_NO_REPARENT | CLK_GET_RATE_NOCACHE, ++ }, ++}; ++ + static struct clk_regmap g12a_cts_vdac_sel = { + .data = &(struct clk_regmap_mux_data){ + .offset = HHI_VIID_CLK_DIV, +@@ -3628,6 +3644,22 @@ static struct clk_regmap g12a_cts_encp = { + }, + }; + ++static struct clk_regmap g12a_cts_encl = { ++ .data = &(struct clk_regmap_gate_data){ ++ .offset = HHI_VID_CLK_CNTL2, ++ .bit_idx = 3, ++ }, ++ .hw.init = &(struct clk_init_data) { ++ .name = "cts_encl", ++ .ops = &clk_regmap_gate_ops, ++ .parent_hws = (const struct clk_hw *[]) { ++ &g12a_cts_encl_sel.hw ++ }, ++ .num_parents = 1, ++ .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, ++ }, ++}; ++ + static struct clk_regmap g12a_cts_vdac = { + .data = &(struct clk_regmap_gate_data){ + .offset = HHI_VID_CLK_CNTL2, +@@ -4407,10 +4439,12 @@ static struct clk_hw *g12a_hw_clks[] = { + [CLKID_VCLK2_DIV12] = &g12a_vclk2_div12.hw, + [CLKID_CTS_ENCI_SEL] = &g12a_cts_enci_sel.hw, + [CLKID_CTS_ENCP_SEL] = &g12a_cts_encp_sel.hw, ++ [CLKID_CTS_ENCL_SEL] = &g12a_cts_encl_sel.hw, + [CLKID_CTS_VDAC_SEL] = &g12a_cts_vdac_sel.hw, + [CLKID_HDMI_TX_SEL] = &g12a_hdmi_tx_sel.hw, + [CLKID_CTS_ENCI] = &g12a_cts_enci.hw, + [CLKID_CTS_ENCP] = &g12a_cts_encp.hw, ++ [CLKID_CTS_ENCL] = &g12a_cts_encl.hw, + [CLKID_CTS_VDAC] = &g12a_cts_vdac.hw, + [CLKID_HDMI_TX] = &g12a_hdmi_tx.hw, + [CLKID_HDMI_SEL] = &g12a_hdmi_sel.hw, +@@ -4632,10 +4666,12 @@ static struct clk_hw *g12b_hw_clks[] = { + [CLKID_VCLK2_DIV12] = &g12a_vclk2_div12.hw, + [CLKID_CTS_ENCI_SEL] = &g12a_cts_enci_sel.hw, + [CLKID_CTS_ENCP_SEL] = &g12a_cts_encp_sel.hw, ++ [CLKID_CTS_ENCL_SEL] = &g12a_cts_encl_sel.hw, + [CLKID_CTS_VDAC_SEL] = &g12a_cts_vdac_sel.hw, + [CLKID_HDMI_TX_SEL] = &g12a_hdmi_tx_sel.hw, + [CLKID_CTS_ENCI] = &g12a_cts_enci.hw, + [CLKID_CTS_ENCP] = &g12a_cts_encp.hw, ++ [CLKID_CTS_ENCL] = &g12a_cts_encl.hw, + [CLKID_CTS_VDAC] = &g12a_cts_vdac.hw, + [CLKID_HDMI_TX] = &g12a_hdmi_tx.hw, + [CLKID_HDMI_SEL] = &g12a_hdmi_sel.hw, +@@ -4892,10 +4928,12 @@ static struct clk_hw *sm1_hw_clks[] = { + [CLKID_VCLK2_DIV12] = &g12a_vclk2_div12.hw, + [CLKID_CTS_ENCI_SEL] = &g12a_cts_enci_sel.hw, + [CLKID_CTS_ENCP_SEL] = &g12a_cts_encp_sel.hw, ++ [CLKID_CTS_ENCL_SEL] = &g12a_cts_encl_sel.hw, + [CLKID_CTS_VDAC_SEL] = &g12a_cts_vdac_sel.hw, + [CLKID_HDMI_TX_SEL] = &g12a_hdmi_tx_sel.hw, + [CLKID_CTS_ENCI] = &g12a_cts_enci.hw, + [CLKID_CTS_ENCP] = &g12a_cts_encp.hw, ++ [CLKID_CTS_ENCL] = &g12a_cts_encl.hw, + [CLKID_CTS_VDAC] = &g12a_cts_vdac.hw, + [CLKID_HDMI_TX] = &g12a_hdmi_tx.hw, + [CLKID_HDMI_SEL] = &g12a_hdmi_sel.hw, +@@ -5123,10 +5161,12 @@ static struct clk_regmap *const g12a_clk_regmaps[] = { + &g12a_vclk2_div12_en, + &g12a_cts_enci_sel, + &g12a_cts_encp_sel, ++ &g12a_cts_encl_sel, + &g12a_cts_vdac_sel, + &g12a_hdmi_tx_sel, + &g12a_cts_enci, + &g12a_cts_encp, ++ &g12a_cts_encl, + &g12a_cts_vdac, + &g12a_hdmi_tx, + &g12a_hdmi_sel, +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0003-clk-meson-add-vclk-driver.patch b/projects/Amlogic/packages/linux/patches/S922X/0003-clk-meson-add-vclk-driver.patch new file mode 100644 index 0000000000..939aff632d --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0003-clk-meson-add-vclk-driver.patch @@ -0,0 +1,271 @@ +From 700d570a2f5de05087be651a7732cab05cc7f76f Mon Sep 17 00:00:00 2001 +From: Neil Armstrong +Date: Fri, 24 Nov 2023 09:41:18 +0100 +Subject: [PATCH 03/49] clk: meson: add vclk driver + +The VCLK and VCLK_DIV clocks have supplementary bits. + +The VCLK has a "SOFT RESET" bit to toggle after the whole +VCLK sub-tree rate has been set, this is implemented in +the gate enable callback. + +The VCLK_DIV clocks as enable and reset bits used to disable +and reset the divider, associated with CLK_SET_RATE_GATE it ensures +the rate is set while the divider is disabled and in reset mode. + +The VCLK_DIV enable bit isn't implemented as a gate since it's part +of the divider logic and vendor does this exact sequence to ensure +the divider is correctly set. + +Signed-off-by: Neil Armstrong +--- + drivers/clk/meson/Kconfig | 5 ++ + drivers/clk/meson/Makefile | 1 + + drivers/clk/meson/vclk.c | 141 +++++++++++++++++++++++++++++++++++++ + drivers/clk/meson/vclk.h | 51 ++++++++++++++ + 4 files changed, 198 insertions(+) + create mode 100644 drivers/clk/meson/vclk.c + create mode 100644 drivers/clk/meson/vclk.h + +diff --git a/drivers/clk/meson/Kconfig b/drivers/clk/meson/Kconfig +index 29ffd14d267b..59a40a49f8e1 100644 +--- a/drivers/clk/meson/Kconfig ++++ b/drivers/clk/meson/Kconfig +@@ -30,6 +30,10 @@ config COMMON_CLK_MESON_VID_PLL_DIV + tristate + select COMMON_CLK_MESON_REGMAP + ++config COMMON_CLK_MESON_VCLK ++ tristate ++ select COMMON_CLK_MESON_REGMAP ++ + config COMMON_CLK_MESON_CLKC_UTILS + tristate + +@@ -140,6 +144,7 @@ config COMMON_CLK_G12A + select COMMON_CLK_MESON_EE_CLKC + select COMMON_CLK_MESON_CPU_DYNDIV + select COMMON_CLK_MESON_VID_PLL_DIV ++ select COMMON_CLK_MESON_VCLK + select MFD_SYSCON + help + Support for the clock controller on Amlogic S905D2, S905X2 and S905Y2 +diff --git a/drivers/clk/meson/Makefile b/drivers/clk/meson/Makefile +index 9ee4b954c896..9ba43fe7a07a 100644 +--- a/drivers/clk/meson/Makefile ++++ b/drivers/clk/meson/Makefile +@@ -12,6 +12,7 @@ obj-$(CONFIG_COMMON_CLK_MESON_PLL) += clk-pll.o + obj-$(CONFIG_COMMON_CLK_MESON_REGMAP) += clk-regmap.o + obj-$(CONFIG_COMMON_CLK_MESON_SCLK_DIV) += sclk-div.o + obj-$(CONFIG_COMMON_CLK_MESON_VID_PLL_DIV) += vid-pll-div.o ++obj-$(CONFIG_COMMON_CLK_MESON_VCLK) += vclk.o + + # Amlogic Clock controllers + +diff --git a/drivers/clk/meson/vclk.c b/drivers/clk/meson/vclk.c +new file mode 100644 +index 000000000000..47f08a52b49f +--- /dev/null ++++ b/drivers/clk/meson/vclk.c +@@ -0,0 +1,141 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Copyright (c) 2023 Neil Armstrong ++ */ ++ ++#include ++#include "vclk.h" ++ ++/* The VCLK gate has a supplementary reset bit to pulse after ungating */ ++ ++static inline struct clk_regmap_vclk_data * ++clk_get_regmap_vclk_data(struct clk_regmap *clk) ++{ ++ return (struct clk_regmap_vclk_data *)clk->data; ++} ++ ++static int clk_regmap_vclk_enable(struct clk_hw *hw) ++{ ++ struct clk_regmap *clk = to_clk_regmap(hw); ++ struct clk_regmap_vclk_data *vclk = clk_get_regmap_vclk_data(clk); ++ ++ meson_parm_write(clk->map, &vclk->enable, 1); ++ ++ /* Do a reset pulse */ ++ meson_parm_write(clk->map, &vclk->reset, 1); ++ meson_parm_write(clk->map, &vclk->reset, 0); ++ ++ return 0; ++} ++ ++static void clk_regmap_vclk_disable(struct clk_hw *hw) ++{ ++ struct clk_regmap *clk = to_clk_regmap(hw); ++ struct clk_regmap_vclk_data *vclk = clk_get_regmap_vclk_data(clk); ++ ++ meson_parm_write(clk->map, &vclk->enable, 0); ++} ++ ++static int clk_regmap_vclk_is_enabled(struct clk_hw *hw) ++{ ++ struct clk_regmap *clk = to_clk_regmap(hw); ++ struct clk_regmap_vclk_data *vclk = clk_get_regmap_vclk_data(clk); ++ ++ return meson_parm_read(clk->map, &vclk->enable); ++} ++ ++const struct clk_ops clk_regmap_vclk_ops = { ++ .enable = clk_regmap_vclk_enable, ++ .disable = clk_regmap_vclk_disable, ++ .is_enabled = clk_regmap_vclk_is_enabled, ++}; ++EXPORT_SYMBOL_GPL(clk_regmap_vclk_ops); ++ ++/* The VCLK Divider has supplementary reset & enable bits */ ++ ++static inline struct clk_regmap_vclk_div_data * ++clk_get_regmap_vclk_div_data(struct clk_regmap *clk) ++{ ++ return (struct clk_regmap_vclk_div_data *)clk->data; ++} ++ ++static unsigned long clk_regmap_vclk_div_recalc_rate(struct clk_hw *hw, ++ unsigned long prate) ++{ ++ struct clk_regmap *clk = to_clk_regmap(hw); ++ struct clk_regmap_vclk_div_data *vclk = clk_get_regmap_vclk_div_data(clk); ++ ++ return divider_recalc_rate(hw, prate, meson_parm_read(clk->map, &vclk->div), ++ vclk->table, vclk->flags, vclk->div.width); ++} ++ ++static int clk_regmap_vclk_div_determine_rate(struct clk_hw *hw, ++ struct clk_rate_request *req) ++{ ++ struct clk_regmap *clk = to_clk_regmap(hw); ++ struct clk_regmap_vclk_div_data *vclk = clk_get_regmap_vclk_div_data(clk); ++ ++ return divider_determine_rate(hw, req, vclk->table, vclk->div.width, ++ vclk->flags); ++} ++ ++static int clk_regmap_vclk_div_set_rate(struct clk_hw *hw, unsigned long rate, ++ unsigned long parent_rate) ++{ ++ struct clk_regmap *clk = to_clk_regmap(hw); ++ struct clk_regmap_vclk_div_data *vclk = clk_get_regmap_vclk_div_data(clk); ++ int ret; ++ ++ ret = divider_get_val(rate, parent_rate, vclk->table, vclk->div.width, ++ vclk->flags); ++ if (ret < 0) ++ return ret; ++ ++ meson_parm_write(clk->map, &vclk->div, ret); ++ ++ return 0; ++}; ++ ++static int clk_regmap_vclk_div_enable(struct clk_hw *hw) ++{ ++ struct clk_regmap *clk = to_clk_regmap(hw); ++ struct clk_regmap_vclk_div_data *vclk = clk_get_regmap_vclk_div_data(clk); ++ ++ /* Unreset the divider when ungating */ ++ meson_parm_write(clk->map, &vclk->reset, 0); ++ meson_parm_write(clk->map, &vclk->enable, 1); ++ ++ return 0; ++} ++ ++static void clk_regmap_vclk_div_disable(struct clk_hw *hw) ++{ ++ struct clk_regmap *clk = to_clk_regmap(hw); ++ struct clk_regmap_vclk_div_data *vclk = clk_get_regmap_vclk_div_data(clk); ++ ++ /* Reset the divider when gating */ ++ meson_parm_write(clk->map, &vclk->enable, 0); ++ meson_parm_write(clk->map, &vclk->reset, 1); ++} ++ ++static int clk_regmap_vclk_div_is_enabled(struct clk_hw *hw) ++{ ++ struct clk_regmap *clk = to_clk_regmap(hw); ++ struct clk_regmap_vclk_div_data *vclk = clk_get_regmap_vclk_div_data(clk); ++ ++ return meson_parm_read(clk->map, &vclk->enable); ++} ++ ++const struct clk_ops clk_regmap_vclk_div_ops = { ++ .recalc_rate = clk_regmap_vclk_div_recalc_rate, ++ .determine_rate = clk_regmap_vclk_div_determine_rate, ++ .set_rate = clk_regmap_vclk_div_set_rate, ++ .enable = clk_regmap_vclk_div_enable, ++ .disable = clk_regmap_vclk_div_disable, ++ .is_enabled = clk_regmap_vclk_div_is_enabled, ++}; ++EXPORT_SYMBOL_GPL(clk_regmap_vclk_div_ops); ++ ++MODULE_DESCRIPTION("Amlogic vclk clock driver"); ++MODULE_AUTHOR("Neil Armstrong "); ++MODULE_LICENSE("GPL v2"); +diff --git a/drivers/clk/meson/vclk.h b/drivers/clk/meson/vclk.h +new file mode 100644 +index 000000000000..4f25d7ad2717 +--- /dev/null ++++ b/drivers/clk/meson/vclk.h +@@ -0,0 +1,51 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++/* ++ * Copyright (c) 2023 Neil Armstrong ++ */ ++ ++#ifndef __VCLK_H ++#define __VCLK_H ++ ++#include "clk-regmap.h" ++#include "parm.h" ++ ++/** ++ * struct clk_regmap_vclk_data - vclk regmap backed specific data ++ * ++ * @enable: vclk enable field ++ * @reset: vclk reset field ++ * @flags: hardware-specific flags ++ * ++ * Flags: ++ * Same as clk_gate except CLK_GATE_HIWORD_MASK which is ignored ++ */ ++struct clk_regmap_vclk_data { ++ struct parm enable; ++ struct parm reset; ++ u8 flags; ++}; ++ ++extern const struct clk_ops clk_regmap_vclk_ops; ++ ++/** ++ * struct clk_regmap_vclk_div_data - vclk_div regmap back specific data ++ * ++ * @div: divider field ++ * @enable: vclk divider enable field ++ * @reset: vclk divider reset field ++ * @table: array of value/divider pairs, last entry should have div = 0 ++ * ++ * Flags: ++ * Same as clk_divider except CLK_DIVIDER_HIWORD_MASK which is ignored ++ */ ++struct clk_regmap_vclk_div_data { ++ struct parm div; ++ struct parm enable; ++ struct parm reset; ++ const struct clk_div_table *table; ++ u8 flags; ++}; ++ ++extern const struct clk_ops clk_regmap_vclk_div_ops; ++ ++#endif /* __VCLK_H */ +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0004-clk-meson-g12a-make-VCLK2-and-ENCL-clock-path-config.patch b/projects/Amlogic/packages/linux/patches/S922X/0004-clk-meson-g12a-make-VCLK2-and-ENCL-clock-path-config.patch new file mode 100644 index 0000000000..750e020236 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0004-clk-meson-g12a-make-VCLK2-and-ENCL-clock-path-config.patch @@ -0,0 +1,264 @@ +From 396ed35999fa1987d68643586b9c95052bb34496 Mon Sep 17 00:00:00 2001 +From: Neil Armstrong +Date: Fri, 24 Nov 2023 09:41:19 +0100 +Subject: [PATCH 04/49] clk: meson: g12a: make VCLK2 and ENCL clock path + configurable by CCF + +In order to setup the DSI clock, let's make the unused VCLK2 clock path +configuration via CCF. + +The nocache option is removed from following clocks: +- vclk2_sel +- vclk2_input +- vclk2_div +- vclk2 +- vclk_div1 +- vclk2_div2_en +- vclk2_div4_en +- vclk2_div6_en +- vclk2_div12_en +- vclk2_div2 +- vclk2_div4 +- vclk2_div6 +- vclk2_div12 +- cts_encl_sel + +vclk2 and vclk2_div uses the newly introduced vclk regmap driver +to handle the enable and reset bits. + +In order to set a rate on cts_encl via the vclk2 clock path, +the NO_REPARENT flag is set on cts_encl_sel & vclk2_sel in order +to keep CCF from selection a parent. +The parents of cts_encl_sel & vclk2_sel are expected to be defined +in DT. + +The following clock scheme is to be used for DSI: + +xtal +\_ gp0_pll_dco + \_ gp0_pll + |- vclk2_sel + | \_ vclk2_input + | \_ vclk2_div + | \_ vclk2 + | \_ vclk2_div1 + | \_ cts_encl_sel + | \_ cts_encl -> to VPU LCD Encoder + |- mipi_dsi_pxclk_sel + \_ mipi_dsi_pxclk_div + \_ mipi_dsi_pxclk -> to DSI controller + +The mipi_dsi_pxclk_div is set as RO in order to use the same GP0 +for mipi_dsi_pxclk and vclk2_input. + +Signed-off-by: Neil Armstrong +--- + drivers/clk/meson/g12a.c | 68 +++++++++++++++++++++++++++------------- + 1 file changed, 47 insertions(+), 21 deletions(-) + +diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c +index cadd824336ad..fb3d9196a1fd 100644 +--- a/drivers/clk/meson/g12a.c ++++ b/drivers/clk/meson/g12a.c +@@ -22,6 +22,7 @@ + #include "clk-regmap.h" + #include "clk-cpu-dyndiv.h" + #include "vid-pll-div.h" ++#include "vclk.h" + #include "meson-eeclk.h" + #include "g12a.h" + +@@ -3165,7 +3166,7 @@ static struct clk_regmap g12a_vclk2_sel = { + .ops = &clk_regmap_mux_ops, + .parent_hws = g12a_vclk_parent_hws, + .num_parents = ARRAY_SIZE(g12a_vclk_parent_hws), +- .flags = CLK_SET_RATE_NO_REPARENT | CLK_GET_RATE_NOCACHE, ++ .flags = CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT, + }, + }; + +@@ -3193,7 +3194,7 @@ static struct clk_regmap g12a_vclk2_input = { + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &g12a_vclk2_sel.hw }, + .num_parents = 1, +- .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, ++ .flags = CLK_SET_RATE_PARENT, + }, + }; + +@@ -3215,19 +3216,32 @@ static struct clk_regmap g12a_vclk_div = { + }; + + static struct clk_regmap g12a_vclk2_div = { +- .data = &(struct clk_regmap_div_data){ +- .offset = HHI_VIID_CLK_DIV, +- .shift = 0, +- .width = 8, ++ .data = &(struct clk_regmap_vclk_div_data){ ++ .div = { ++ .reg_off = HHI_VIID_CLK_DIV, ++ .shift = 0, ++ .width = 8, ++ }, ++ .enable = { ++ .reg_off = HHI_VIID_CLK_DIV, ++ .shift = 16, ++ .width = 1, ++ }, ++ .reset = { ++ .reg_off = HHI_VIID_CLK_DIV, ++ .shift = 17, ++ .width = 1, ++ }, ++ .flags = CLK_DIVIDER_ROUND_CLOSEST, + }, + .hw.init = &(struct clk_init_data){ + .name = "vclk2_div", +- .ops = &clk_regmap_divider_ops, ++ .ops = &clk_regmap_vclk_div_ops, + .parent_hws = (const struct clk_hw *[]) { + &g12a_vclk2_input.hw + }, + .num_parents = 1, +- .flags = CLK_GET_RATE_NOCACHE, ++ .flags = CLK_SET_RATE_PARENT | CLK_SET_RATE_GATE, + }, + }; + +@@ -3246,16 +3260,24 @@ static struct clk_regmap g12a_vclk = { + }; + + static struct clk_regmap g12a_vclk2 = { +- .data = &(struct clk_regmap_gate_data){ +- .offset = HHI_VIID_CLK_CNTL, +- .bit_idx = 19, ++ .data = &(struct clk_regmap_vclk_data){ ++ .enable = { ++ .reg_off = HHI_VIID_CLK_CNTL, ++ .shift = 19, ++ .width = 1, ++ }, ++ .reset = { ++ .reg_off = HHI_VIID_CLK_CNTL, ++ .shift = 15, ++ .width = 1, ++ }, + }, + .hw.init = &(struct clk_init_data) { + .name = "vclk2", +- .ops = &clk_regmap_gate_ops, ++ .ops = &clk_regmap_vclk_ops, + .parent_hws = (const struct clk_hw *[]) { &g12a_vclk2_div.hw }, + .num_parents = 1, +- .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, ++ .flags = CLK_SET_RATE_PARENT | CLK_SET_RATE_GATE, + }, + }; + +@@ -3339,7 +3361,7 @@ static struct clk_regmap g12a_vclk2_div1 = { + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &g12a_vclk2.hw }, + .num_parents = 1, +- .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, ++ .flags = CLK_SET_RATE_PARENT, + }, + }; + +@@ -3353,7 +3375,7 @@ static struct clk_regmap g12a_vclk2_div2_en = { + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &g12a_vclk2.hw }, + .num_parents = 1, +- .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, ++ .flags = CLK_SET_RATE_PARENT, + }, + }; + +@@ -3367,7 +3389,7 @@ static struct clk_regmap g12a_vclk2_div4_en = { + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &g12a_vclk2.hw }, + .num_parents = 1, +- .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, ++ .flags = CLK_SET_RATE_PARENT, + }, + }; + +@@ -3381,7 +3403,7 @@ static struct clk_regmap g12a_vclk2_div6_en = { + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &g12a_vclk2.hw }, + .num_parents = 1, +- .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, ++ .flags = CLK_SET_RATE_PARENT, + }, + }; + +@@ -3395,7 +3417,7 @@ static struct clk_regmap g12a_vclk2_div12_en = { + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &g12a_vclk2.hw }, + .num_parents = 1, +- .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, ++ .flags = CLK_SET_RATE_PARENT, + }, + }; + +@@ -3461,6 +3483,7 @@ static struct clk_fixed_factor g12a_vclk2_div2 = { + &g12a_vclk2_div2_en.hw + }, + .num_parents = 1, ++ .flags = CLK_SET_RATE_PARENT, + }, + }; + +@@ -3474,6 +3497,7 @@ static struct clk_fixed_factor g12a_vclk2_div4 = { + &g12a_vclk2_div4_en.hw + }, + .num_parents = 1, ++ .flags = CLK_SET_RATE_PARENT, + }, + }; + +@@ -3487,6 +3511,7 @@ static struct clk_fixed_factor g12a_vclk2_div6 = { + &g12a_vclk2_div6_en.hw + }, + .num_parents = 1, ++ .flags = CLK_SET_RATE_PARENT, + }, + }; + +@@ -3500,6 +3525,7 @@ static struct clk_fixed_factor g12a_vclk2_div12 = { + &g12a_vclk2_div12_en.hw + }, + .num_parents = 1, ++ .flags = CLK_SET_RATE_PARENT, + }, + }; + +@@ -3561,7 +3587,7 @@ static struct clk_regmap g12a_cts_encl_sel = { + .ops = &clk_regmap_mux_ops, + .parent_hws = g12a_cts_parent_hws, + .num_parents = ARRAY_SIZE(g12a_cts_parent_hws), +- .flags = CLK_SET_RATE_NO_REPARENT | CLK_GET_RATE_NOCACHE, ++ .flags = CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT, + }, + }; + +@@ -3717,7 +3743,7 @@ static struct clk_regmap g12a_mipi_dsi_pxclk_sel = { + .ops = &clk_regmap_mux_ops, + .parent_hws = g12a_mipi_dsi_pxclk_parent_hws, + .num_parents = ARRAY_SIZE(g12a_mipi_dsi_pxclk_parent_hws), +- .flags = CLK_SET_RATE_NO_REPARENT, ++ .flags = CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT, + }, + }; + +@@ -3729,7 +3755,7 @@ static struct clk_regmap g12a_mipi_dsi_pxclk_div = { + }, + .hw.init = &(struct clk_init_data){ + .name = "mipi_dsi_pxclk_div", +- .ops = &clk_regmap_divider_ops, ++ .ops = &clk_regmap_divider_ro_ops, + .parent_hws = (const struct clk_hw *[]) { + &g12a_mipi_dsi_pxclk_sel.hw + }, +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0005-drm-meson-gate-px_clk-when-setting-rate.patch b/projects/Amlogic/packages/linux/patches/S922X/0005-drm-meson-gate-px_clk-when-setting-rate.patch new file mode 100644 index 0000000000..f6769c39f8 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0005-drm-meson-gate-px_clk-when-setting-rate.patch @@ -0,0 +1,43 @@ +From 3ecfa3f37500eb0a37d5629fcea59953116c800e Mon Sep 17 00:00:00 2001 +From: Neil Armstrong +Date: Fri, 24 Nov 2023 09:41:20 +0100 +Subject: [PATCH 05/49] drm/meson: gate px_clk when setting rate + +Disable the px_clk when setting the rate to recover a fully +configured and correctly reset VCLK clock tree after the rate +is set. + +Fixes: 77d9e1e6b846 ("drm/meson: add support for MIPI-DSI transceiver") +Signed-off-by: Neil Armstrong +--- + drivers/gpu/drm/meson/meson_dw_mipi_dsi.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c b/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c +index e5fe4e994f43..72abe2057ec3 100644 +--- a/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c ++++ b/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c +@@ -95,6 +95,7 @@ static int dw_mipi_dsi_phy_init(void *priv_data) + return ret; + } + ++ clk_disable_unprepare(mipi_dsi->px_clk); + ret = clk_set_rate(mipi_dsi->px_clk, mipi_dsi->mode->clock * 1000); + + if (ret) { +@@ -103,6 +104,12 @@ static int dw_mipi_dsi_phy_init(void *priv_data) + return ret; + } + ++ ret = clk_prepare_enable(mipi_dsi->px_clk); ++ if (ret) { ++ dev_err(mipi_dsi->dev, "Failed to enable DSI Pixel clock (ret %d)\n", ret); ++ return ret; ++ } ++ + switch (mipi_dsi->dsi_device->format) { + case MIPI_DSI_FMT_RGB888: + dpi_data_format = DPI_COLOR_24BIT; +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0006-arm64-meson-g12-common-add-the-MIPI-DSI-nodes.patch b/projects/Amlogic/packages/linux/patches/S922X/0006-arm64-meson-g12-common-add-the-MIPI-DSI-nodes.patch new file mode 100644 index 0000000000..e686ad31db --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0006-arm64-meson-g12-common-add-the-MIPI-DSI-nodes.patch @@ -0,0 +1,114 @@ +From d8a953f276b7c6cd74f51b7c94cd9fb3edd941d7 Mon Sep 17 00:00:00 2001 +From: Neil Armstrong +Date: Fri, 24 Nov 2023 09:41:21 +0100 +Subject: [PATCH 06/49] arm64: meson: g12-common: add the MIPI DSI nodes + +Add the MIPI DSI Analog & Digital PHY nodes and the DSI control +nodes with proper port endpoint to the VPU. + +Signed-off-by: Neil Armstrong +--- + .../boot/dts/amlogic/meson-g12-common.dtsi | 70 +++++++++++++++++++ + 1 file changed, 70 insertions(+) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +index ff68b911b729..7300408262d5 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +@@ -1663,9 +1663,28 @@ pwrc: power-controller { + <250000000>, + <0>; /* Do Nothing */ + }; ++ ++ mipi_analog_dphy: phy { ++ compatible = "amlogic,g12a-mipi-dphy-analog"; ++ #phy-cells = <0>; ++ status = "disabled"; ++ }; + }; + }; + ++ mipi_dphy: phy@44000 { ++ compatible = "amlogic,axg-mipi-dphy"; ++ reg = <0x0 0x44000 0x0 0x2000>; ++ clocks = <&clkc CLKID_MIPI_DSI_PHY>; ++ clock-names = "pclk"; ++ resets = <&reset RESET_MIPI_DSI_PHY>; ++ reset-names = "phy"; ++ phys = <&mipi_analog_dphy>; ++ phy-names = "analog"; ++ #phy-cells = <0>; ++ status = "disabled"; ++ }; ++ + usb3_pcie_phy: phy@46000 { + compatible = "amlogic,g12a-usb3-pcie-phy"; + reg = <0x0 0x46000 0x0 0x2000>; +@@ -2152,6 +2171,15 @@ hdmi_tx_out: endpoint { + remote-endpoint = <&hdmi_tx_in>; + }; + }; ++ ++ /* DPI output port */ ++ dpi_port: port@2 { ++ reg = <2>; ++ ++ dpi_out: endpoint { ++ remote-endpoint = <&mipi_dsi_in>; ++ }; ++ }; + }; + + gic: interrupt-controller@ffc01000 { +@@ -2189,6 +2217,48 @@ gpio_intc: interrupt-controller@f080 { + amlogic,channel-interrupts = <64 65 66 67 68 69 70 71>; + }; + ++ mipi_dsi: dsi@7000 { ++ compatible = "amlogic,meson-g12a-dw-mipi-dsi"; ++ reg = <0x0 0x7000 0x0 0x1000>; ++ resets = <&reset RESET_MIPI_DSI_HOST>; ++ reset-names = "top"; ++ clocks = <&clkc CLKID_MIPI_DSI_HOST>, ++ <&clkc CLKID_MIPI_DSI_PXCLK>, ++ <&clkc CLKID_CTS_ENCL>; ++ clock-names = "pclk", "bit", "px"; ++ phys = <&mipi_dphy>; ++ phy-names = "dphy"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "disabled"; ++ ++ assigned-clocks = <&clkc CLKID_MIPI_DSI_PXCLK_SEL>, ++ <&clkc CLKID_CTS_ENCL_SEL>, ++ <&clkc CLKID_VCLK2_SEL>; ++ assigned-clock-parents = <&clkc CLKID_GP0_PLL>, ++ <&clkc CLKID_VCLK2_DIV1>, ++ <&clkc CLKID_GP0_PLL>; ++ ++ ports { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ /* VPU VENC Input */ ++ mipi_dsi_venc_port: port@0 { ++ reg = <0>; ++ ++ mipi_dsi_in: endpoint { ++ remote-endpoint = <&dpi_out>; ++ }; ++ }; ++ ++ /* DSI Output */ ++ mipi_dsi_panel_port: port@1 { ++ reg = <1>; ++ }; ++ }; ++ }; ++ + watchdog: watchdog@f0d0 { + compatible = "amlogic,meson-gxbb-wdt"; + reg = <0x0 0xf0d0 0x0 0x10>; +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0007-dt-bindings-clock-g12a-clkc-add-MIPI-ISP-CSI-PHY-clo.patch b/projects/Amlogic/packages/linux/patches/S922X/0007-dt-bindings-clock-g12a-clkc-add-MIPI-ISP-CSI-PHY-clo.patch new file mode 100644 index 0000000000..c48672f68d --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0007-dt-bindings-clock-g12a-clkc-add-MIPI-ISP-CSI-PHY-clo.patch @@ -0,0 +1,33 @@ +From 0e1d615c50e2014a36b734d27045f0ed1cae89ff Mon Sep 17 00:00:00 2001 +From: Neil Armstrong +Date: Tue, 14 Nov 2023 11:14:43 +0100 +Subject: [PATCH 07/49] dt-bindings: clock: g12a-clkc: add MIPI ISP & CSI PHY + clock ids + +Add MIPI ISP & CSI PHY clock ids to G12A clock bindings header + +Signed-off-by: Neil Armstrong +Acked-by: Conor Dooley +--- + include/dt-bindings/clock/g12a-clkc.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/include/dt-bindings/clock/g12a-clkc.h b/include/dt-bindings/clock/g12a-clkc.h +index 636d713f95ff..fd09819da2ec 100644 +--- a/include/dt-bindings/clock/g12a-clkc.h ++++ b/include/dt-bindings/clock/g12a-clkc.h +@@ -281,5 +281,11 @@ + #define CLKID_MIPI_DSI_PXCLK 270 + #define CLKID_CTS_ENCL 271 + #define CLKID_CTS_ENCL_SEL 272 ++#define CLKID_MIPI_ISP_DIV 273 ++#define CLKID_MIPI_ISP_SEL 274 ++#define CLKID_MIPI_ISP 275 ++#define CLKID_MIPI_ISP_GATE 276 ++#define CLKID_MIPI_ISP_CSI_PHY0 277 ++#define CLKID_MIPI_ISP_CSI_PHY1 278 + + #endif /* __G12A_CLKC_H */ +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0008-clk-meson-g12a-add-MIPI-ISP-clocks.patch b/projects/Amlogic/packages/linux/patches/S922X/0008-clk-meson-g12a-add-MIPI-ISP-clocks.patch new file mode 100644 index 0000000000..e5483d1e54 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0008-clk-meson-g12a-add-MIPI-ISP-clocks.patch @@ -0,0 +1,120 @@ +From a348bd3e7dc25c847ca76acaa8014c30a401edfb Mon Sep 17 00:00:00 2001 +From: Neil Armstrong +Date: Tue, 14 Nov 2023 11:14:44 +0100 +Subject: [PATCH 08/49] clk: meson: g12a: add MIPI ISP clocks + +Add the MIPI ISP gate, divider and mux used to feed the MIPI CSI ISP +(Image Signal Processor) IP on the Amlogic G12B SoC. + +Signed-off-by: Neil Armstrong +--- + drivers/clk/meson/g12a.c | 66 ++++++++++++++++++++++++++++++++++++++++ + drivers/clk/meson/g12a.h | 1 + + 2 files changed, 67 insertions(+) + +diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c +index fb3d9196a1fd..b32812bf6d8d 100644 +--- a/drivers/clk/meson/g12a.c ++++ b/drivers/clk/meson/g12a.c +@@ -3780,6 +3780,66 @@ static struct clk_regmap g12a_mipi_dsi_pxclk = { + }, + }; + ++/* MIPI ISP Clocks */ ++ ++static const struct clk_parent_data g12b_mipi_isp_parent_data[] = { ++ { .fw_name = "xtal", }, ++ { .hw = &g12a_gp0_pll.hw }, ++ { .hw = &g12a_hifi_pll.hw }, ++ { .hw = &g12a_fclk_div2p5.hw }, ++ { .hw = &g12a_fclk_div3.hw }, ++ { .hw = &g12a_fclk_div4.hw }, ++ { .hw = &g12a_fclk_div5.hw }, ++ { .hw = &g12a_fclk_div7.hw }, ++}; ++ ++static struct clk_regmap g12b_mipi_isp_sel = { ++ .data = &(struct clk_regmap_mux_data){ ++ .offset = HHI_ISP_CLK_CNTL, ++ .mask = 7, ++ .shift = 9, ++ }, ++ .hw.init = &(struct clk_init_data){ ++ .name = "mipi_isp_sel", ++ .ops = &clk_regmap_mux_ops, ++ .parent_data = g12b_mipi_isp_parent_data, ++ .num_parents = ARRAY_SIZE(g12b_mipi_isp_parent_data), ++ }, ++}; ++ ++static struct clk_regmap g12b_mipi_isp_div = { ++ .data = &(struct clk_regmap_div_data){ ++ .offset = HHI_ISP_CLK_CNTL, ++ .shift = 0, ++ .width = 7, ++ }, ++ .hw.init = &(struct clk_init_data){ ++ .name = "mipi_isp_div", ++ .ops = &clk_regmap_divider_ops, ++ .parent_hws = (const struct clk_hw *[]) { ++ &g12b_mipi_isp_sel.hw ++ }, ++ .num_parents = 1, ++ .flags = CLK_SET_RATE_PARENT, ++ }, ++}; ++ ++static struct clk_regmap g12b_mipi_isp = { ++ .data = &(struct clk_regmap_gate_data){ ++ .offset = HHI_ISP_CLK_CNTL, ++ .bit_idx = 8, ++ }, ++ .hw.init = &(struct clk_init_data) { ++ .name = "mipi_isp", ++ .ops = &clk_regmap_gate_ops, ++ .parent_hws = (const struct clk_hw *[]) { ++ &g12b_mipi_isp_div.hw ++ }, ++ .num_parents = 1, ++ .flags = CLK_SET_RATE_PARENT, ++ }, ++}; ++ + /* HDMI Clocks */ + + static const struct clk_parent_data g12a_hdmi_parent_data[] = { +@@ -4791,6 +4851,9 @@ static struct clk_hw *g12b_hw_clks[] = { + [CLKID_MIPI_DSI_PXCLK_SEL] = &g12a_mipi_dsi_pxclk_sel.hw, + [CLKID_MIPI_DSI_PXCLK_DIV] = &g12a_mipi_dsi_pxclk_div.hw, + [CLKID_MIPI_DSI_PXCLK] = &g12a_mipi_dsi_pxclk.hw, ++ [CLKID_MIPI_ISP_SEL] = &g12b_mipi_isp_sel.hw, ++ [CLKID_MIPI_ISP_DIV] = &g12b_mipi_isp_div.hw, ++ [CLKID_MIPI_ISP] = &g12b_mipi_isp.hw, + }; + + static struct clk_hw *sm1_hw_clks[] = { +@@ -5287,6 +5350,9 @@ static struct clk_regmap *const g12a_clk_regmaps[] = { + &g12a_mipi_dsi_pxclk_sel, + &g12a_mipi_dsi_pxclk_div, + &g12a_mipi_dsi_pxclk, ++ &g12b_mipi_isp_sel, ++ &g12b_mipi_isp_div, ++ &g12b_mipi_isp, + }; + + static const struct reg_sequence g12a_init_regs[] = { +diff --git a/drivers/clk/meson/g12a.h b/drivers/clk/meson/g12a.h +index f11ee3c59849..27df99c4565a 100644 +--- a/drivers/clk/meson/g12a.h ++++ b/drivers/clk/meson/g12a.h +@@ -70,6 +70,7 @@ + #define HHI_MALI_CLK_CNTL 0x1b0 + #define HHI_VPU_CLKC_CNTL 0x1b4 + #define HHI_VPU_CLK_CNTL 0x1bC ++#define HHI_ISP_CLK_CNTL 0x1C0 + #define HHI_NNA_CLK_CNTL 0x1C8 + #define HHI_HDMI_CLK_CNTL 0x1CC + #define HHI_VDEC_CLK_CNTL 0x1E0 +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0009-clk-meson-g12a-add-CSI-ISP-gates-clocks.patch b/projects/Amlogic/packages/linux/patches/S922X/0009-clk-meson-g12a-add-CSI-ISP-gates-clocks.patch new file mode 100644 index 0000000000..f8dea62b11 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0009-clk-meson-g12a-add-CSI-ISP-gates-clocks.patch @@ -0,0 +1,52 @@ +From 0ee184dfa040dc25a8d698e7b006752936471868 Mon Sep 17 00:00:00 2001 +From: Neil Armstrong +Date: Tue, 14 Nov 2023 11:14:45 +0100 +Subject: [PATCH 09/49] clk: meson: g12a: add CSI & ISP gates clocks + +Add the gates entires for the CSI ISP domain and CSI PHYs. + +Signed-off-by: Neil Armstrong +--- + drivers/clk/meson/g12a.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c +index b32812bf6d8d..078ef5cd026c 100644 +--- a/drivers/clk/meson/g12a.c ++++ b/drivers/clk/meson/g12a.c +@@ -4332,9 +4332,12 @@ static MESON_GATE(g12a_htx_hdcp22, HHI_GCLK_MPEG2, 3); + static MESON_GATE(g12a_htx_pclk, HHI_GCLK_MPEG2, 4); + static MESON_GATE(g12a_bt656, HHI_GCLK_MPEG2, 6); + static MESON_GATE(g12a_usb1_to_ddr, HHI_GCLK_MPEG2, 8); ++static MESON_GATE(g12b_mipi_isp_gate, HHI_GCLK_MPEG2, 17); + static MESON_GATE(g12a_mmc_pclk, HHI_GCLK_MPEG2, 11); + static MESON_GATE(g12a_uart2, HHI_GCLK_MPEG2, 15); + static MESON_GATE(g12a_vpu_intr, HHI_GCLK_MPEG2, 25); ++static MESON_GATE(g12b_csi_phy1, HHI_GCLK_MPEG2, 28); ++static MESON_GATE(g12b_csi_phy0, HHI_GCLK_MPEG2, 29); + static MESON_GATE(g12a_gic, HHI_GCLK_MPEG2, 30); + + static MESON_GATE(g12a_vclk2_venci0, HHI_GCLK_OTHER, 1); +@@ -4854,6 +4857,9 @@ static struct clk_hw *g12b_hw_clks[] = { + [CLKID_MIPI_ISP_SEL] = &g12b_mipi_isp_sel.hw, + [CLKID_MIPI_ISP_DIV] = &g12b_mipi_isp_div.hw, + [CLKID_MIPI_ISP] = &g12b_mipi_isp.hw, ++ [CLKID_MIPI_ISP_GATE] = &g12b_mipi_isp_gate.hw, ++ [CLKID_MIPI_ISP_CSI_PHY0] = &g12b_csi_phy0.hw, ++ [CLKID_MIPI_ISP_CSI_PHY1] = &g12b_csi_phy1.hw, + }; + + static struct clk_hw *sm1_hw_clks[] = { +@@ -5353,6 +5359,9 @@ static struct clk_regmap *const g12a_clk_regmaps[] = { + &g12b_mipi_isp_sel, + &g12b_mipi_isp_div, + &g12b_mipi_isp, ++ &g12b_mipi_isp_gate, ++ &g12b_csi_phy1, ++ &g12b_csi_phy0, + }; + + static const struct reg_sequence g12a_init_regs[] = { +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/001.01-Add-ODROID-N2L-device-tree.patch b/projects/Amlogic/packages/linux/patches/S922X/001.01-Add-ODROID-N2L-device-tree.patch deleted file mode 100644 index 720c939ef0..0000000000 --- a/projects/Amlogic/packages/linux/patches/S922X/001.01-Add-ODROID-N2L-device-tree.patch +++ /dev/null @@ -1,80 +0,0 @@ ---- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2l.dts -+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2l.dts -@@ -0,0 +1,77 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * Copyright (c) 2023 JELOS (https://github.com/JustEnoughLinuxOS) -+ */ -+ -+/dts-v1/; -+ -+#include "meson-g12b-a311d.dtsi" -+#include "meson-g12b-odroid-n2.dtsi" -+ -+/ { -+ compatible = "hardkernel,odroid-n2l", "amlogic,s922x", "amlogic,g12b"; -+ model = "Hardkernel ODROID-N2L"; -+ -+ sound { -+ compatible = "amlogic,axg-sound-card"; -+ model = "ODROID-N2L"; -+ audio-aux-devs = <&tdmout_b>, <&tdmin_a>, <&tdmin_b>, -+ <&tdmin_c>, <&tdmin_lb>; -+ audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1", -+ "TDMOUT_B IN 1", "FRDDR_B OUT 1", -+ "TDMOUT_B IN 2", "FRDDR_C OUT 1", -+ "TDM_B Playback", "TDMOUT_B OUT", -+ "TDMIN_A IN 4", "TDM_B Loopback", -+ "TDMIN_B IN 4", "TDM_B Loopback", -+ "TDMIN_C IN 4", "TDM_B Loopback", -+ "TDMIN_LB IN 1", "TDM_B Loopback", -+ "TODDR_A IN 0", "TDMIN_A OUT", -+ "TODDR_B IN 0", "TDMIN_A OUT", -+ "TODDR_C IN 0", "TDMIN_A OUT", -+ "TODDR_A IN 1", "TDMIN_B OUT", -+ "TODDR_B IN 1", "TDMIN_B OUT", -+ "TODDR_C IN 1", "TDMIN_B OUT", -+ "TODDR_A IN 2", "TDMIN_C OUT", -+ "TODDR_B IN 2", "TDMIN_C OUT", -+ "TODDR_C IN 2", "TDMIN_C OUT", -+ "TODDR_A IN 6", "TDMIN_LB OUT", -+ "TODDR_B IN 6", "TDMIN_LB OUT", -+ "TODDR_C IN 6", "TDMIN_LB OUT"; -+ -+ dai-link-6 { -+ /delete-node/ codec-1; -+ }; -+ -+ dai-link-7 { -+ /delete-node/ codec-1; -+ }; -+ -+ /delete-node/ dai-link-9; -+ }; -+}; -+ -+ð_phy { -+ status = "disabled"; -+}; -+ -+&vddcpu_a { -+ regulator-min-microvolt = <680000>; -+ regulator-max-microvolt = <1040000>; -+ -+ pwms = <&pwm_ab 0 1500 0>; -+}; -+ -+&vddcpu_b { -+ regulator-min-microvolt = <680000>; -+ regulator-max-microvolt = <1040000>; -+ -+ pwms = <&pwm_AO_cd 1 1500 0>; -+}; -+ -+&usb2_phy0 { -+ phy-supply = <&usb_pwr_en>; -+}; -+ -+&usb2_phy1 { -+ phy-supply = <&usb_pwr_en>; -+}; diff --git a/projects/Amlogic/packages/linux/patches/S922X/001.02-Add-ODROID-GO-Ultra-device-tree.patch b/projects/Amlogic/packages/linux/patches/S922X/001.02-Add-ODROID-GO-Ultra-device-tree.patch deleted file mode 100644 index d7ba940df4..0000000000 --- a/projects/Amlogic/packages/linux/patches/S922X/001.02-Add-ODROID-GO-Ultra-device-tree.patch +++ /dev/null @@ -1,1003 +0,0 @@ -diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts -new file mode 100644 -index 000000000000..6d0453220212 ---- /dev/null -+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts -@@ -0,0 +1,997 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * Copyright (c) 2022 Neil Armstrong -+ */ -+ -+/dts-v1/; -+ -+#include "meson-g12b-a311d.dtsi" -+#include -+#include -+#include -+#include -+#include -+ -+/ { -+ compatible = "hardkernel,odroid-go-ultra", "amlogic,s922x", "amlogic,g12b"; -+ model = "Hardkernel ODROID-GO-Ultra"; -+ -+ aliases { -+ serial0 = &uart_AO; -+ rtc0 = &vrtc; -+ mmc0 = &sd_emmc_c; -+ mmc1 = &sd_emmc_b; -+ }; -+ -+ panel_backlight: backlight { -+ compatible = "pwm-backlight"; -+ pwms = <&pwm_ef 1 40000 0>; -+ brightness-levels = <0 255>; -+ num-interpolated-steps = <255>; -+ default-brightness-level = <255>; -+ }; -+ -+ bat: battery { -+ compatible = "simple-battery"; -+ voltage-max-design-microvolt = <4200000>; -+ voltage-min-design-microvolt = <3500000>; -+ charge-full-design-microamp-hours = <4000000>; -+ charge-term-current-microamp = <200000>; -+ constant-charge-current-max-microamp = <1500000>; -+ constant-charge-voltage-max-microvolt = <4200000>; -+ factory-internal-resistance-micro-ohms = <180000>; -+ -+ -+ ocv-capacity-celsius = <20>; -+ ocv-capacity-table-0 = <4146950 100>, <4001920 95>, <3967900 90>, <3919950 85>, -+ <3888450 80>, <3861850 75>, <3831540 70>, <3799130 65>, -+ <3768190 60>, <3745650 55>, <3726610 50>, <3711630 45>, -+ <3696720 40>, <3685660 35>, <3674950 30>, <3663050 25>, -+ <3649470 20>, <3635260 15>, <3616920 10>, <3592440 5>, -+ <3574170 0>; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ codec_clk: codec-clk { -+ compatible = "fixed-clock"; -+ clock-frequency = <12288000>; -+ clock-output-names = "codec_clk"; -+ #clock-cells = <0>; -+ }; -+ -+ gpio_keys: volume-keys { -+ compatible = "gpio-keys-polled"; -+ poll-interval = <5>; -+ autorepeat; -+ -+ volume-up-button { -+ label = "VOLUME-UP"; -+ linux,code = ; -+ gpios = <&gpio GPIOX_8 GPIO_ACTIVE_LOW>; -+ }; -+ volume-down-button { -+ label = "VOLUME-DOWN"; -+ linux,code = ; -+ gpios = <&gpio GPIOX_9 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+ -+ hp_detect_switch: hp-detect-switch { -+ compatible = "gpio-keys-polled"; -+ poll-interval = <5>; -+ autorepeat; -+ -+ hp-detect-pin { -+ label = "HEADPHONE"; -+ linux,input-type = ; -+ linux,code = ; -+ gpios = <&gpio_ao GPIOAO_9 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ joypad: gou_joypad { -+ compatible = "odroidgou-joypad"; -+ poll-interval = <10>; -+ pinctrl-0 = <&keypad_gpio_pins>; -+ pinctrl-names = "default"; -+ status = "okay"; -+ -+ joypad-name = "GO-Ultra Gamepad"; -+ //joypad-vendor = <0x045e>; -+ joypad-product = <0x1000>; -+ joypad-revision = <0x0100>; -+ -+ /* Analog sticks */ -+ io-channels = <&saradc 0>, <&saradc 1>, <&saradc 2>, <&saradc 3>; -+ io-channel-names = "key-RY", "key-RX", "key-LY", "key-LX"; -+ button-adc-scale = <4>; -+ button-adc-deadzone = <64>; -+ button-adc-fuzz = <32>; -+ button-adc-flat = <32>; -+ abs_x-p-tuning = <350>; -+ abs_x-n-tuning = <350>; -+ abs_y-p-tuning = <350>; -+ abs_y-n-tuning = <350>; -+ abs_rx-p-tuning = <350>; -+ abs_rx-n-tuning = <350>; -+ abs_ry-p-tuning = <350>; -+ abs_ry-n-tuning = <350>; -+ -+ /* Buttons */ -+ sw1 { -+ gpios = <&gpio GPIOX_0 GPIO_ACTIVE_LOW>; -+ label = "GPIO DPAD-UP"; -+ linux,code = ; // 0x220 -+ }; -+ sw2 { -+ gpios = <&gpio GPIOX_1 GPIO_ACTIVE_LOW>; -+ label = "GPIO DPAD-DOWN"; -+ linux,code = ; // 0x221 -+ }; -+ sw3 { -+ gpios = <&gpio GPIOX_2 GPIO_ACTIVE_LOW>; -+ label = "GPIO DPAD-LEFT"; -+ linux,code = ; // 0x222 -+ }; -+ sw4 { -+ gpios = <&gpio GPIOX_3 GPIO_ACTIVE_LOW>; -+ label = "GPIO DPAD-RIGHT"; -+ linux,code = ; // 0x223 -+ }; -+ sw5 { -+ gpios = <&gpio GPIOX_4 GPIO_ACTIVE_LOW>; -+ label = "GPIO BTN-A"; -+ linux,code = ; // 0x131 -+ }; -+ sw6 { -+ gpios = <&gpio GPIOX_5 GPIO_ACTIVE_LOW>; -+ label = "GPIO BTN-B"; -+ linux,code = ; // 0x130 -+ }; -+ sw7 { -+ gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>; -+ label = "GPIO BTN-Y"; -+ linux,code = ; // 0x134 -+ }; -+ sw8 { -+ gpios = <&gpio GPIOX_7 GPIO_ACTIVE_LOW>; -+ label = "GPIO BTN-X"; -+ linux,code = ; // 0x133 -+ }; -+ sw11 { -+ gpios = <&gpio GPIOX_10 GPIO_ACTIVE_LOW>; -+ label = "GPIO F2"; -+ linux,code = ; // 0x2c2 -+ }; -+ sw12 { -+ gpios = <&gpio GPIOX_11 GPIO_ACTIVE_LOW>; -+ label = "GPIO F3"; -+ linux,code = ; // 0x2c3 -+ }; -+ sw13 { -+ gpios = <&gpio GPIOX_12 GPIO_ACTIVE_LOW>; -+ label = "GPIO F4"; -+ linux,code = ; // 0x2c4 -+ }; -+ sw14 { -+ gpios = <&gpio GPIOX_13 GPIO_ACTIVE_LOW>; -+ label = "GPIO F5"; -+ linux,code = ; // 0x13c -+ }; -+ sw15 { -+ gpios = <&gpio GPIOX_14 GPIO_ACTIVE_LOW>; -+ label = "GPIO TOP-LEFT"; -+ linux,code = ; // 0x02 -+ }; -+ sw16 { -+ gpios = <&gpio GPIOX_15 GPIO_ACTIVE_LOW>; -+ label = "GPIO TOP-RIGHT"; -+ linux,code = ; // 0x05 -+ }; -+ sw17 { -+ gpios = <&gpio GPIOX_16 GPIO_ACTIVE_LOW>; -+ label = "GPIO F6"; -+ linux,code = ; -+ }; -+ sw18 { -+ gpios = <&gpio GPIOX_17 GPIO_ACTIVE_LOW>; -+ label = "GPIO F1"; -+ linux,code = ; -+ }; -+ sw19 { -+ gpios = <&gpio GPIOX_18 GPIO_ACTIVE_LOW>; -+ label = "GPIO TOP-RIGHT2"; -+ linux,code = ; -+ }; -+ sw20 { -+ gpios = <&gpio GPIOX_19 GPIO_ACTIVE_LOW>; -+ label = "GPIO TOP-LEFT2"; -+ linux,code = ; -+ }; -+ }; -+ -+ memory@0 { -+ device_type = "memory"; -+ reg = <0x0 0x0 0x0 0x40000000>; -+ }; -+ -+ emmc_pwrseq: emmc-pwrseq { -+ compatible = "mmc-pwrseq-emmc"; -+ reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ -+ led-blue { -+ color = ; -+ function = LED_FUNCTION_STATUS; -+ gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_HIGH>; -+ linux,default-trigger = "none"; -+ }; -+ -+ led-red { -+ color = ; -+ function = LED_FUNCTION_STATUS; -+ gpios = <&gpio_ao GPIOAO_6 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ poweroff { -+ compatible = "hardkernel,odroid-go-ultra-poweroff"; -+ hardkernel,rk817-pmic = <&rk817>; -+ hardkernel,rk818-pmic = <&rk818>; -+ }; -+ -+ vdd_sys: regulator-vdd_sys { -+ compatible = "regulator-fixed"; -+ regulator-name = "VDD_SYS"; -+ regulator-min-microvolt = <3800000>; -+ regulator-max-microvolt = <3800000>; -+ regulator-always-on; -+ }; -+ -+ sound { -+ compatible = "amlogic,axg-sound-card"; -+ model = "ODROID-GO-ULTRA"; -+ audio-aux-devs = <&tdmout_b>; -+ audio-routing = "TDMOUT_B IN 0", "FRDDR_A OUT 1", -+ "TDM_B Playback", "TDMOUT_B OUT"; -+ -+ assigned-clocks = <&clkc CLKID_MPLL2>, -+ <&clkc CLKID_MPLL0>, -+ <&clkc CLKID_MPLL1>; -+ assigned-clock-parents = <0>, <0>, <0>; -+ assigned-clock-rates = <294912000>, -+ <270950400>, -+ <393216000>; -+ status = "okay"; -+ -+ dai-link-0 { -+ sound-dai = <&frddr_a>; -+ }; -+ -+ dai-link-1 { -+ sound-dai = <&frddr_b>; -+ }; -+ -+ dai-link-2 { -+ sound-dai = <&frddr_c>; -+ }; -+ -+ dai-link-3 { -+ sound-dai = <&toddr_a>; -+ }; -+ -+ dai-link-4 { -+ sound-dai = <&toddr_b>; -+ }; -+ -+ dai-link-5 { -+ sound-dai = <&toddr_c>; -+ }; -+ -+ /* 8ch hdmi interface */ -+ dai-link-6 { -+ sound-dai = <&tdmif_b>; -+ dai-format = "i2s"; -+ dai-tdm-slot-tx-mask-0 = <1 1>; -+ dai-tdm-slot-tx-mask-1 = <1 1>; -+ mclk-fs = <256>; -+ -+ codec-0 { -+ sound-dai = <&rk817>; -+ }; -+ }; -+ }; -+}; -+ -+&arb { -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <&vddcpu_b>; -+ operating-points-v2 = <&cpu_opp_table_0>; -+ clocks = <&clkc CLKID_CPU_CLK>; -+ clock-latency = <50000>; -+}; -+ -+&cpu1 { -+ cpu-supply = <&vddcpu_b>; -+ operating-points-v2 = <&cpu_opp_table_0>; -+ clocks = <&clkc CLKID_CPU_CLK>; -+ clock-latency = <50000>; -+}; -+ -+&cpu100 { -+ cpu-supply = <&vddcpu_a>; -+ operating-points-v2 = <&cpub_opp_table_1>; -+ clocks = <&clkc CLKID_CPUB_CLK>; -+ clock-latency = <50000>; -+}; -+ -+&cpu101 { -+ cpu-supply = <&vddcpu_a>; -+ operating-points-v2 = <&cpub_opp_table_1>; -+ clocks = <&clkc CLKID_CPUB_CLK>; -+ clock-latency = <50000>; -+}; -+ -+&cpu102 { -+ cpu-supply = <&vddcpu_a>; -+ operating-points-v2 = <&cpub_opp_table_1>; -+ clocks = <&clkc CLKID_CPUB_CLK>; -+ clock-latency = <50000>; -+}; -+ -+&cpu103 { -+ cpu-supply = <&vddcpu_a>; -+ operating-points-v2 = <&cpub_opp_table_1>; -+ clocks = <&clkc CLKID_CPUB_CLK>; -+ clock-latency = <50000>; -+}; -+ -+/* RK817 only supports 12.5mV steps, round up the values */ -+&cpu_opp_table_0 { -+ opp-1000000000 { -+ opp-microvolt = <737500>; -+ }; -+ opp-1200000000 { -+ opp-microvolt = <737500>; -+ }; -+ opp-1398000000 { -+ opp-microvolt = <762500>; -+ }; -+ opp-1512000000 { -+ opp-microvolt = <800000>; -+ }; -+ opp-1608000000 { -+ opp-microvolt = <837500>; -+ }; -+ opp-1704000000 { -+ opp-microvolt = <862500>; -+ }; -+ opp-1800000000 { -+ opp-microvolt = <987500>; -+ }; -+}; -+ -+/* RK818 only supports 12.5mV steps, round up the values */ -+&cpub_opp_table_1 { -+ opp-1000000000 { -+ opp-microvolt = <775000>; -+ }; -+ opp-1200000000 { -+ opp-microvolt = <775000>; -+ }; -+ opp-1398000000 { -+ opp-microvolt = <800000>; -+ }; -+ opp-1512000000 { -+ opp-microvolt = <825000>; -+ }; -+ opp-1608000000 { -+ opp-microvolt = <862500>; -+ }; -+ opp-1704000000 { -+ opp-microvolt = <900000>; -+ }; -+ opp-1800000000 { -+ opp-microvolt = <987500>; -+ }; -+ opp-1908000000 { -+ opp-microvolt = <1025000>; -+ }; -+ opp-2016000000 { -+ opp-microvolt = <1025000>; -+ }; -+ opp-2108000000 { -+ opp-microvolt = <1025000>; -+ }; -+ opp-2208000000 { -+ opp-microvolt = <1050000>; -+ }; -+}; -+ -+&i2c_AO { -+ status = "okay"; -+ pinctrl-0 = <&i2c_ao_sck_pins>, <&i2c_ao_sda_pins>; -+ pinctrl-names = "default"; -+ -+ rk818: pmic@1c { -+ compatible = "rockchip,rk818"; -+ reg = <0x1c>; -+ interrupt-parent = <&gpio_intc>; -+ interrupts = <7 IRQ_TYPE_LEVEL_LOW>; /* GPIOAO_7 */ -+ rockchip,system-power-controller; -+ clock-output-names = "rk808-clkout1", "rk808-clkout2"; -+ -+ vcc1-supply = <&vdd_sys>; -+ vcc2-supply = <&vdd_sys>; -+ vcc3-supply = <&vdd_sys>; -+ vcc4-supply = <&vdd_sys>; -+ vcc6-supply = <&vdd_sys>; -+ vcc7-supply = <&vcc_2v3>; -+ vcc8-supply = <&vcc_2v3>; -+ vcc9-supply = <&vddao_3v3>; -+ boost-supply = <&vdd_sys>; -+ switch-supply = <&vdd_sys>; -+ -+ regulators { -+ vddcpu_a: DCDC_REG1 { -+ regulator-name = "vddcpu_a"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <750000>; -+ regulator-max-microvolt = <1050000>; -+ regulator-ramp-delay = <6001>; -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <750000>; -+ }; -+ }; -+ -+ vdd_ee: DCDC_REG2 { -+ regulator-name = "vdd_ee"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <875000>; -+ regulator-max-microvolt = <900000>; -+ regulator-ramp-delay = <6001>; -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <875000>; -+ }; -+ }; -+ -+ vddq_1v1: DCDC_REG3 { -+ regulator-name = "vddq_1v1"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ }; -+ }; -+ -+ vddao_3v3: DCDC_REG4 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vddao_3v3"; -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <3000000>; -+ }; -+ }; -+ -+ hp_5v: DCDC_BOOST { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-name = "hp_5v"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ LDO_REG1 { -+ regulator-boot-off; -+ regulator-name = "rk818_LDO1"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ LDO_REG2 { -+ regulator-boot-off; -+ regulator-name = "rk818_LDO2"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ LDO_REG3 { -+ regulator-boot-off; -+ regulator-name = "rk818_LDO3"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ LDO_REG4 { -+ regulator-boot-off; -+ regulator-name = "rk818_LDO4"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vddio_ao1v8: LDO_REG5 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-name = "vddio_ao1v8"; -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ LDO_REG6 { -+ regulator-boot-off; -+ regulator-name = "rk818_LDO6"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vddq_1v8: LDO_REG7 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-name = "vddq_1v8"; -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ LDO_REG8 { -+ regulator-boot-off; -+ regulator-name = "rk818_LDO8"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vddio_c: LDO_REG9 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vddio_c"; -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <3300000>; -+ }; -+ }; -+ -+ vcc_sd: SWITCH_REG { -+ regulator-name = "vcc_sd"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ }; -+ }; -+ -+ rk818_otg_switch: OTG_SWITCH { -+ regulator-name = "otg_switch"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ }; -+ -+ battery { -+ compatible = "rockchip,rk818-battery"; -+ -+ ocv_table = < -+ 3470 3599 3671 3701 3728 3746 3762 -+ 3772 3781 3792 3816 3836 3866 3910 -+ 3942 3971 4002 4050 4088 4132 4200>; -+ design_capacity = <4000>; -+ design_qmax = <4100>; -+ bat_res = <180>; -+ max_input_current = <2000>; -+ max_chrg_current = <1500>; -+ max_chrg_voltage = <4250>; -+ sleep_enter_current = <300>; -+ sleep_exit_current = <300>; -+ power_off_thresd = <3450>; -+ zero_algorithm_vol = <3700>; -+ fb_temperature = <105>; -+ sample_res = <10>; -+ max_soc_offset = <60>; -+ energy_mode = <0>; -+ monitor_sec = <5>; -+ virtual_power = <0>; -+ power_dc2otg = <0>; -+ otg5v_suspend_enable = <0>; -+ }; -+ -+ charger { -+ compatible = "rockchip,rk818-charger"; -+ monitored-battery = <&bat>; -+ }; -+ -+ }; -+}; -+ -+&i2c3 { -+ status = "okay"; -+ pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>; -+ pinctrl-names = "default"; -+ -+ rk817: pmic@20 { -+ compatible = "rockchip,rk817"; -+ reg = <0x20>; -+ status = "okay"; -+ interrupt-parent = <&gpio_intc>; -+ interrupts = <5 IRQ_TYPE_LEVEL_LOW>; /* GPIOAO_5 */ -+ wakeup-source; -+ -+ vcc1-supply = <&vdd_sys>; -+ vcc2-supply = <&vdd_sys>; -+ vcc3-supply = <&vdd_sys>; -+ vcc4-supply = <&vdd_sys>; -+ vcc5-supply = <&vdd_sys>; -+ vcc6-supply = <&vdd_sys>; -+ vcc7-supply = <&vdd_sys>; -+ vcc8-supply = <&vdd_sys>; -+ vcc9-supply = <&rk817_boost>; -+ -+ #sound-dai-cells = <0>; -+ clocks = <&codec_clk>; -+ clock-names = "mclk"; -+ -+ regulators { -+ DCDC_REG1 { -+ regulator-boot-off; -+ regulator-name = "rk817_BUCK1"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vddcpu_b: DCDC_REG2 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <725000>; -+ regulator-max-microvolt = <1050000>; -+ regulator-ramp-delay = <6001>; -+ regulator-initial-mode = <0x2>; -+ regulator-name = "vddcpu_b"; -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1000000>; -+ }; -+ }; -+ -+ vcc_2v3: DCDC_REG3 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <2300000>; -+ regulator-max-microvolt = <2400000>; -+ regulator-initial-mode = <0x2>; -+ regulator-name = "vcc_2v3"; -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ }; -+ }; -+ -+ DCDC_REG4 { -+ regulator-boot-off; -+ regulator-name = "rk817_BUCK4"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ LDO_REG1 { -+ regulator-boot-off; -+ regulator-name = "rk817_LDO1"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ LDO_REG2 { -+ regulator-boot-off; -+ regulator-name = "rk817_LDO2"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ LDO_REG3 { -+ regulator-boot-off; -+ regulator-name = "rk817_LDO3"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ LDO_REG4 { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vdd_codec"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ LDO_REG5 { -+ regulator-boot-off; -+ regulator-name = "rk817_LDO5"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ LDO_REG6 { -+ regulator-boot-off; -+ regulator-name = "rk817_LDO6"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ LDO_REG7 { -+ regulator-boot-off; -+ regulator-name = "rk817_LDO7"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_lcd: LDO_REG8 { -+ regulator-boot-on; -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc_lcd"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ LDO_REG9 { -+ regulator-boot-off; -+ regulator-name = "rk817_LDO9"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ rk817_boost: BOOST { -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5400000>; -+ regulator-name = "rk817_boost"; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ usb_host: OTG_SWITCH { -+ regulator-name = "usb_host"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ }; -+ -+ rk817_codec: codec { -+ rockchip,mic-in-differential; -+ }; -+ }; -+}; -+ -+&clkc_audio { -+ status = "okay"; -+}; -+ -+ð_phy { -+ status = "disabled"; -+}; -+ -+&frddr_a { -+ status = "okay"; -+}; -+ -+&frddr_b { -+ status = "okay"; -+}; -+ -+&frddr_c { -+ status = "okay"; -+}; -+ -+&toddr_a { -+ status = "okay"; -+}; -+ -+&toddr_b { -+ status = "okay"; -+}; -+ -+&toddr_c { -+ status = "okay"; -+}; -+ -+&mipi_dsi { -+ status = "okay"; -+ -+ assigned-clocks = <&clkc CLKID_GP0_PLL>, -+ <&clkc CLKID_MIPI_DSI_PXCLK_SEL>, -+ <&clkc CLKID_MIPI_DSI_PXCLK>, -+ <&clkc CLKID_CTS_ENCL_SEL>, -+ <&clkc CLKID_VCLK2_SEL>; -+ assigned-clock-parents = <0>, -+ <&clkc CLKID_GP0_PLL>, -+ <0>, -+ <&clkc CLKID_VCLK2_DIV1>, -+ <&clkc CLKID_GP0_PLL>; -+ assigned-clock-rates = <344976000>, -+ <0>, -+ <344976000>, -+ <0>, -+ <0>; -+ -+ panel@0 { -+ compatible = "elida,kd50t048a", "sitronix,st7701"; -+ reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_HIGH>; -+ IOVCC-supply = <&vcc_lcd>; -+ VCC-supply = <&vcc_lcd>; -+ backlight = <&panel_backlight>; -+ rotation = <270>; -+ reg = <0>; -+ -+ port { -+ mipi_in_panel: endpoint { -+ remote-endpoint = <&mipi_out_panel>; -+ }; -+ }; -+ }; -+}; -+ -+&mipi_analog_dphy { -+ status = "okay"; -+}; -+ -+&mipi_dphy { -+ status = "okay"; -+}; -+ -+&mipi_dsi_panel_port { -+ mipi_out_panel: endpoint { -+ remote-endpoint = <&mipi_in_panel>; -+ }; -+}; -+ -+&periphs_pinctrl { -+ keypad_gpio_pins: keypad-gpio { -+ mux { -+ groups = "GPIOX_0", "GPIOX_1", "GPIOX_2", "GPIOX_3", -+ "GPIOX_4", "GPIOX_5", "GPIOX_6", "GPIOX_7", -+ "GPIOX_8", "GPIOX_9", "GPIOX_10", "GPIOX_11", -+ "GPIOX_12", "GPIOX_13", "GPIOX_14", "GPIOX_15", -+ "GPIOX_16", "GPIOX_17", "GPIOX_18", "GPIOX_19"; -+ function = "gpio_periphs"; -+ bias-pull-up; -+ output-disable; -+ }; -+ }; -+}; -+ -+&pwm_ef { -+ status = "okay"; -+ pinctrl-0 = <&pwm_f_h_pins>; -+ pinctrl-names = "default"; -+}; -+ -+&saradc { -+ status = "okay"; -+ vref-supply = <&vddio_ao1v8>; -+}; -+ -+/* SD card */ -+&sd_emmc_b { -+ status = "okay"; -+ pinctrl-0 = <&sdcard_c_pins>; -+ pinctrl-1 = <&sdcard_clk_gate_c_pins>; -+ pinctrl-names = "default", "clk-gate"; -+ -+ bus-width = <4>; -+ cap-sd-highspeed; -+ max-frequency = <50000000>; -+ disable-wp; -+ -+ cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>; -+ vmmc-supply = <&vcc_sd>; -+ vqmmc-supply = <&vddio_c>; -+ -+}; -+ -+/* eMMC */ -+&sd_emmc_c { -+ status = "okay"; -+ pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>; -+ pinctrl-1 = <&emmc_clk_gate_pins>; -+ pinctrl-names = "default", "clk-gate"; -+ -+ bus-width = <8>; -+ cap-mmc-highspeed; -+ mmc-ddr-1_8v; -+ mmc-hs200-1_8v; -+ max-frequency = <200000000>; -+ disable-wp; -+ -+ mmc-pwrseq = <&emmc_pwrseq>; -+ vmmc-supply = <&vcc_sd>; -+ vqmmc-supply = <&vddio_ao1v8>; -+}; -+ -+ -+&tdmif_b { -+ pinctrl-0 = <&mclk0_a_pins>, <&tdm_b_fs_pins>, <&tdm_b_sclk_pins>, -+ <&tdm_b_dout0_pins>; -+ pinctrl-names = "default"; -+ status = "okay"; -+ -+ assigned-clocks = <&clkc_audio AUD_CLKID_TDM_MCLK_PAD0>, -+ <&clkc_audio AUD_CLKID_TDM_SCLK_PAD1>, -+ <&clkc_audio AUD_CLKID_TDM_LRCLK_PAD1>; -+ assigned-clock-parents = <&clkc_audio AUD_CLKID_MST_B_MCLK>, -+ <&clkc_audio AUD_CLKID_MST_B_SCLK>, -+ <&clkc_audio AUD_CLKID_MST_B_LRCLK>; -+ assigned-clock-rates = <0>, <0>, <0>; -+}; -+ -+&tdmout_b { -+ status = "okay"; -+}; -+ -+&uart_AO { -+ status = "okay"; -+ pinctrl-0 = <&uart_ao_a_pins>; -+ pinctrl-names = "default"; -+}; -+ -+&usb { -+ status = "okay"; -+ dr_mode = "peripheral"; -+}; -+ -+&usb2_phy0 { -+ status = "okay"; -+}; -+ -+&usb2_phy1 { -+ status = "okay"; -+ phy-supply = <&usb_host>; -+}; diff --git a/projects/Amlogic/packages/linux/patches/S922X/0010-drm-panel-st7701-add-odroid-go-ultra-panel-support.patch b/projects/Amlogic/packages/linux/patches/S922X/0010-drm-panel-st7701-add-odroid-go-ultra-panel-support.patch new file mode 100644 index 0000000000..f01cb7cff4 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0010-drm-panel-st7701-add-odroid-go-ultra-panel-support.patch @@ -0,0 +1,213 @@ +From 7833886e61125266a6f391d96f5db14b5013a28a Mon Sep 17 00:00:00 2001 +From: adamg +Date: Tue, 23 Jan 2024 23:28:55 +0000 +Subject: [PATCH 10/49] drm: panel: st7701: add odroid-go-ultra panel support + +--- + drivers/gpu/drm/panel/panel-sitronix-st7701.c | 162 +++++++++++++++++- + 1 file changed, 161 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7701.c b/drivers/gpu/drm/panel/panel-sitronix-st7701.c +index 036ac403ed21..2676e6161a44 100644 +--- a/drivers/gpu/drm/panel/panel-sitronix-st7701.c ++++ b/drivers/gpu/drm/panel/panel-sitronix-st7701.c +@@ -423,6 +423,66 @@ static void kd50t048a_gip_sequence(struct st7701 *st7701) + 0xFF, 0xFF, 0xFF, 0xFF, 0x10, 0x45, 0x67, 0x98, 0xBA); + } + ++static void go_ultra_gip_sequence(struct st7701 *st7701) ++{ ++ /** ++ * ST7701_SPEC_V1.2 is unable to provide enough information above this ++ * specific command sequence, so grab the same from vendor BSP driver. ++ */ ++ ST7701_DSI(st7701, 0x01); ++ msleep(5); ++ ST7701_DSI(st7701, 0x11); ++ msleep(120); ++ ++ ST7701_DSI(st7701, 0xFF, 0x77, 0x01, 0x00, 0x00, 0x10); ++ ST7701_DSI(st7701, 0xC0, 0xE9, 0x03); ++ ST7701_DSI(st7701, 0xC1, 0x11, 0x02); ++ ST7701_DSI(st7701, 0xC2, 0x31, 0x08); ++ ST7701_DSI(st7701, 0xCC, 0x10); ++ ST7701_DSI(st7701, 0xB0, 0x00, 0x0D, 0x14, 0x0D, 0x10, 0x05, 0x02, 0x08, ++ 0x08, 0x1E, 0x05, 0x13, 0x11, 0xA3, 0x29, 0x18); ++ ST7701_DSI(st7701, 0xB1, 0x00, 0x0C, 0x14, 0x0C, 0x10, 0x05, 0x03, 0x08, ++ 0x07, 0x20, 0x05, 0x13, 0x11, 0xA4, 0x29, 0x18); ++ ST7701_DSI(st7701, 0xFF, 0x77, 0x01, 0x00, 0x00, 0x11); ++ ST7701_DSI(st7701, 0xB0, 0x6C); ++ ST7701_DSI(st7701, 0xB1, 0x43); ++ ST7701_DSI(st7701, 0xB2, 0x07); ++ ST7701_DSI(st7701, 0xB3, 0x80); ++ ST7701_DSI(st7701, 0xB5, 0x47); ++ ST7701_DSI(st7701, 0xB7, 0x85); ++ ST7701_DSI(st7701, 0xB8, 0x20); ++ ST7701_DSI(st7701, 0xB9, 0x10); ++ ST7701_DSI(st7701, 0xC1, 0x78); ++ ST7701_DSI(st7701, 0xC3, 0x78); ++ ST7701_DSI(st7701, 0xD0, 0x88); ++ msleep(120); ++ ++ ST7701_DSI(st7701, 0xE0, 0x00, 0x00, 0x02); ++ ST7701_DSI(st7701, 0xE1, 0x08, 0x00, 0x0A, 0x00, 0x07, 0x00, 0x09, ++ 0x00, 0x00, 0x33, 0x33); ++ ST7701_DSI(st7701, 0xE2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); ++ ST7701_DSI(st7701, 0xE3, 0x00, 0x00, 0x33, 0x33); ++ ST7701_DSI(st7701, 0xE4, 0x44, 0x44); ++ ST7701_DSI(st7701, 0xE5, 0x0E, 0x60, 0xA0, 0xA0, 0x10, 0x60, 0xA0, ++ 0xA0, 0x0A, 0x60, 0xA0, 0xA0, 0x0C, 0x60, 0xA0, 0xA0); ++ ST7701_DSI(st7701, 0xE6, 0x00, 0x00, 0x33, 0x33); ++ ST7701_DSI(st7701, 0xE7, 0x44, 0x44); ++ ST7701_DSI(st7701, 0xE8, 0x0D, 0x60, 0xA0, 0xA0, 0x0F, 0x60, 0xA0, ++ 0xA0, 0x09, 0x60, 0xA0, 0xA0, 0x0B, 0x60, 0xA0, 0xA0); ++ ST7701_DSI(st7701, 0xEB, 0x02, 0x01, 0xE4, 0xE4, 0x44, 0x00, 0x40); ++ ST7701_DSI(st7701, 0xEC, 0x02, 0x01); ++ ST7701_DSI(st7701, 0xED, 0xAB, 0x89, 0x76, 0x54, 0x01, 0xFF, 0xFF, ++ 0xFF, 0xFF, 0xFF, 0xFF, 0x10, 0x45, 0x67, 0x98, 0xBA); ++ ST7701_DSI(st7701, 0xFF, 0x77, 0x01, 0x00, 0x00, 0x00); ++ ST7701_DSI(st7701, 0x3A, 0x70); ++ ST7701_DSI(st7701, 0x53, 0xEC); ++ ST7701_DSI(st7701, 0x55, 0xB3); ++ ST7701_DSI(st7701, 0x5E, 0xFF); ++ ST7701_DSI(st7701, 0x29); ++ msleep(50); ++} ++ + static int st7701_prepare(struct drm_panel *panel) + { + struct st7701 *st7701 = panel_to_st7701(panel); +@@ -434,7 +494,7 @@ static int st7701_prepare(struct drm_panel *panel) + st7701->supplies); + if (ret < 0) + return ret; +- msleep(20); ++ msleep(120); + + gpiod_set_value(st7701->reset, 1); + msleep(150); +@@ -759,6 +819,25 @@ static const struct drm_display_mode kd50t048a_mode = { + .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, + }; + ++static const struct drm_display_mode go_ultra_mode = { ++ .clock = 28748, ++ ++ .hdisplay = 480, ++ .hsync_start = 480 + 12, ++ .hsync_end = 480 + 12 + 12, ++ .htotal = 480 + 12 + 12 + 38, ++ ++ .vdisplay = 854, ++ .vsync_start = 854 + 0, ++ .vsync_end = 854 + 0 + 19, ++ .vtotal = 854 + 0 + 19 + 11, ++ ++ .width_mm = 70, ++ .height_mm = 140, ++ ++ .type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED, ++}; ++ + static const struct st7701_panel_desc kd50t048a_desc = { + .mode = &kd50t048a_mode, + .lanes = 2, +@@ -839,6 +918,86 @@ static const struct st7701_panel_desc kd50t048a_desc = { + .gip_sequence = kd50t048a_gip_sequence, + }; + ++static const struct st7701_panel_desc go_ultra_desc = { ++ .mode = &go_ultra_mode, ++ .lanes = 2, ++ .format = MIPI_DSI_FMT_RGB888, ++ .panel_sleep_delay = 120, ++ ++ .pv_gamma = { ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC0_MASK, 0), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC4_MASK, 0xd), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC8_MASK, 0x14), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC16_MASK, 0xd), ++ ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC24_MASK, 0x10), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC52_MASK, 0x5), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC80_MASK, 0x2), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC108_MASK, 0x8), ++ ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC147_MASK, 0x8), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC175_MASK, 0x1e), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC203_MASK, 0x5), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC231_MASK, 0x13), ++ ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC239_MASK, 0x11), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 2) | ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC247_MASK, 0x23), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC251_MASK, 0x29), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC255_MASK, 0x18) ++ }, ++ .nv_gamma = { ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC0_MASK, 0), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC4_MASK, 0xc), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC8_MASK, 0x14), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC16_MASK, 0xc), ++ ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC24_MASK, 0x10), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC52_MASK, 0x5), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC80_MASK, 0x3), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC108_MASK, 0x8), ++ ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC147_MASK, 0x7), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC175_MASK, 0x20), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC203_MASK, 0x5), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC231_MASK, 0x13), ++ ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC239_MASK, 0x11), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 2) | ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC247_MASK, 0x24), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC251_MASK, 0x29), ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_AJ_MASK, 0) | ++ CFIELD_PREP(DSI_CMD2_BK0_GAMCTRL_VC255_MASK, 0x18) ++ }, ++ .nlinv = 1, ++ .vop_uv = 4887500, ++ .vcom_uv = 937500, ++ .vgh_mv = 15000, ++ .vgl_mv = -9510, ++ .avdd_mv = 6600, ++ .avcl_mv = -4400, ++ .gamma_op_bias = OP_BIAS_MIDDLE, ++ .input_op_bias = OP_BIAS_MIN, ++ .output_op_bias = OP_BIAS_MIN, ++ .t2d_ns = 1600, ++ .t3d_ns = 10400, ++ .eot_en = true, ++ .gip_sequence = go_ultra_gip_sequence, ++}; ++ + static int st7701_dsi_probe(struct mipi_dsi_device *dsi) + { + const struct st7701_panel_desc *desc; +@@ -919,6 +1078,7 @@ static void st7701_dsi_remove(struct mipi_dsi_device *dsi) + static const struct of_device_id st7701_of_match[] = { + { .compatible = "densitron,dmt028vghmcmi-1a", .data = &dmt028vghmcmi_1a_desc }, + { .compatible = "elida,kd50t048a", .data = &kd50t048a_desc }, ++ { .compatible = "odroid,go-ultra-panel", .data = &go_ultra_desc }, + { .compatible = "techstar,ts8550b", .data = &ts8550b_desc }, + { } + }; +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0011-arm64-meson-odroid-go-ultra-add-DSI-panel.patch b/projects/Amlogic/packages/linux/patches/S922X/0011-arm64-meson-odroid-go-ultra-add-DSI-panel.patch new file mode 100644 index 0000000000..e1990d5bc0 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0011-arm64-meson-odroid-go-ultra-add-DSI-panel.patch @@ -0,0 +1,107 @@ +From b98ce182b139c787137cc732877632a053d3d747 Mon Sep 17 00:00:00 2001 +From: adamg +Date: Tue, 23 Jan 2024 23:41:40 +0000 +Subject: [PATCH 11/49] arm64: meson: odroid-go-ultra: add DSI panel + +--- + .../amlogic/meson-g12b-odroid-go-ultra.dts | 66 +++++++++++++++++++ + 1 file changed, 66 insertions(+) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts +index eed2a23047ca..6844b906fbcd 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts +@@ -196,6 +196,14 @@ emmc_pwrseq: emmc-pwrseq { + reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>; + }; + ++ panel_backlight: backlight { ++ compatible = "pwm-backlight"; ++ pwms = <&pwm_ef 1 40000 0>; ++ brightness-levels = <0 255>; ++ num-interpolated-steps = <255>; ++ default-brightness-level = <255>; ++ }; ++ + leds { + compatible = "gpio-leds"; + +@@ -576,6 +584,8 @@ regulator-state-mem { + }; + + vcc_lcd: LDO_REG8 { ++ regulator-always-on; ++ regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc_lcd"; +@@ -634,6 +644,12 @@ mux { + }; + }; + ++&pwm_ef { ++ status = "okay"; ++ pinctrl-0 = <&pwm_f_h_pins>; ++ pinctrl-names = "default"; ++}; ++ + &saradc { + status = "okay"; + vref-supply = <&vddio_ao1v8>; +@@ -720,3 +736,53 @@ &usb2_phy1 { + status = "okay"; + phy-supply = <&usb_host>; + }; ++ ++&mipi_dsi { ++ status = "okay"; ++ ++ assigned-clocks = <&clkc CLKID_GP0_PLL>, ++ <&clkc CLKID_MIPI_DSI_PXCLK_SEL>, ++ <&clkc CLKID_MIPI_DSI_PXCLK>, ++ <&clkc CLKID_CTS_ENCL_SEL>, ++ <&clkc CLKID_VCLK2_SEL>; ++ assigned-clock-parents = <0>, ++ <&clkc CLKID_GP0_PLL>, ++ <0>, ++ <&clkc CLKID_VCLK2_DIV1>, ++ <&clkc CLKID_GP0_PLL>; ++ assigned-clock-rates = <344976000>, ++ <0>, ++ <344976000>, ++ <0>, ++ <0>; ++ ++ panel@0 { ++ compatible = "odroid,go-ultra-panel", "sitronix,st7701"; ++ reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_HIGH>; ++ IOVCC-supply = <&vcc_lcd>; ++ VCC-supply = <&vcc_lcd>; ++ backlight = <&panel_backlight>; ++ rotation = <270>; ++ reg = <0>; ++ ++ port { ++ mipi_in_panel: endpoint { ++ remote-endpoint = <&mipi_out_panel>; ++ }; ++ }; ++ }; ++}; ++ ++&mipi_analog_dphy { ++ status = "okay"; ++}; ++ ++&mipi_dphy { ++ status = "okay"; ++}; ++ ++&mipi_dsi_panel_port { ++ mipi_out_panel: endpoint { ++ remote-endpoint = <&mipi_in_panel>; ++ }; ++}; +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0012-clk-meson-g12a-fix-mipi-display-output-for-odroid-go.patch b/projects/Amlogic/packages/linux/patches/S922X/0012-clk-meson-g12a-fix-mipi-display-output-for-odroid-go.patch new file mode 100644 index 0000000000..d69e37665d --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0012-clk-meson-g12a-fix-mipi-display-output-for-odroid-go.patch @@ -0,0 +1,44 @@ +From dfad46b4d3834f1c36233f171943af7a0e9f34e6 Mon Sep 17 00:00:00 2001 +From: "Mauro (mdrjr) Ribeiro" +Date: Tue, 23 Jan 2024 23:56:49 +0000 +Subject: [PATCH 12/49] clk: meson: g12a: fix mipi display output for + odroid-go-ultra + +--- + drivers/clk/meson/g12a.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c +index 078ef5cd026c..cdecb43e04c4 100644 +--- a/drivers/clk/meson/g12a.c ++++ b/drivers/clk/meson/g12a.c +@@ -3151,7 +3151,7 @@ static struct clk_regmap g12a_vclk_sel = { + .ops = &clk_regmap_mux_ops, + .parent_hws = g12a_vclk_parent_hws, + .num_parents = ARRAY_SIZE(g12a_vclk_parent_hws), +- .flags = CLK_SET_RATE_NO_REPARENT | CLK_GET_RATE_NOCACHE, ++ .flags = CLK_SET_RATE_NO_REPARENT, + }, + }; + +@@ -3180,7 +3180,7 @@ static struct clk_regmap g12a_vclk_input = { + .ops = &clk_regmap_gate_ops, + .parent_hws = (const struct clk_hw *[]) { &g12a_vclk_sel.hw }, + .num_parents = 1, +- .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, ++ //.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, + }, + }; + +@@ -3743,7 +3743,7 @@ static struct clk_regmap g12a_mipi_dsi_pxclk_sel = { + .ops = &clk_regmap_mux_ops, + .parent_hws = g12a_mipi_dsi_pxclk_parent_hws, + .num_parents = ARRAY_SIZE(g12a_mipi_dsi_pxclk_parent_hws), +- .flags = CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT, ++ .flags = CLK_SET_RATE_NO_REPARENT, + }, + }; + +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0013-arm64-meson-odroid-go-ultra-correct-voltages.patch b/projects/Amlogic/packages/linux/patches/S922X/0013-arm64-meson-odroid-go-ultra-correct-voltages.patch new file mode 100644 index 0000000000..2b7d67ee43 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0013-arm64-meson-odroid-go-ultra-correct-voltages.patch @@ -0,0 +1,70 @@ +From 6d1d09be179529c1a707f9ed83d23c167900c2c5 Mon Sep 17 00:00:00 2001 +From: "Mauro (mdrjr) Ribeiro" +Date: Tue, 23 Jan 2024 23:53:24 +0000 +Subject: [PATCH 13/49] arm64: meson: odroid-go-ultra: correct voltages + +--- + .../dts/amlogic/meson-g12b-odroid-go-ultra.dts | 16 +++++++--------- + 1 file changed, 7 insertions(+), 9 deletions(-) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts +index 6844b906fbcd..571a0393e148 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts +@@ -420,7 +420,7 @@ vdd_ee: DCDC_REG2 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <875000>; +- regulator-max-microvolt = <1250000>; ++ regulator-max-microvolt = <900000>; + regulator-ramp-delay = <6001>; + regulator-state-mem { + regulator-on-in-suspend; +@@ -440,12 +440,12 @@ regulator-state-mem { + vddao_3v3: DCDC_REG4 { + regulator-always-on; + regulator-boot-on; +- regulator-min-microvolt = <3300000>; +- regulator-max-microvolt = <3300000>; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; + regulator-name = "vddao_3v3"; + regulator-state-mem { + regulator-on-in-suspend; +- regulator-suspend-microvolt = <3300000>; ++ regulator-suspend-microvolt = <3000000>; + }; + }; + +@@ -500,8 +500,6 @@ vcc_sd: SWITCH_REG { + regulator-name = "vcc_sd"; + regulator-always-on; + regulator-boot-on; +- regulator-min-microvolt = <3300000>; +- regulator-max-microvolt = <3300000>; + regulator-state-mem { + regulator-on-in-suspend; + }; +@@ -550,7 +548,7 @@ vddcpu_b: DCDC_REG2 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <737500>; +- regulator-max-microvolt = <1012500>; ++ regulator-max-microvolt = <1050000>; + regulator-ramp-delay = <6001>; + regulator-initial-mode = <0x2>; + regulator-name = "vddcpu_b"; +@@ -586,8 +584,8 @@ regulator-state-mem { + vcc_lcd: LDO_REG8 { + regulator-always-on; + regulator-boot-on; +- regulator-min-microvolt = <3300000>; +- regulator-max-microvolt = <3300000>; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; + regulator-name = "vcc_lcd"; + regulator-state-mem { + regulator-off-in-suspend; +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0014-arm64-meson-odroid-go-ultra-add-over-clocking-freque.patch b/projects/Amlogic/packages/linux/patches/S922X/0014-arm64-meson-odroid-go-ultra-add-over-clocking-freque.patch new file mode 100644 index 0000000000..42f3f6f65a --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0014-arm64-meson-odroid-go-ultra-add-over-clocking-freque.patch @@ -0,0 +1,57 @@ +From b78534965f9800ec6bc29816b5fc4a518a55bc38 Mon Sep 17 00:00:00 2001 +From: "Mauro (mdrjr) Ribeiro" +Date: Wed, 24 Jan 2024 10:56:00 +0000 +Subject: [PATCH 14/49] arm64: meson: odroid-go-ultra: add over-clocking + frequencies + +--- + .../amlogic/meson-g12b-odroid-go-ultra.dts | 26 ++++++++++++++++++- + 1 file changed, 25 insertions(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts +index 571a0393e148..1fcfe421ec73 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts +@@ -347,7 +347,11 @@ opp-1896000000 { + opp-microvolt = <987500>; + }; + opp-1992000000 { +- opp-microvolt = <1012500>; ++ opp-microvolt = <1050000>; ++ }; ++ opp-2016000000 { ++ opp-hz = /bits/ 64 <2016000000>; ++ opp-microvolt = <1050000>; + }; + }; + +@@ -377,6 +381,26 @@ opp-1800000000 { + opp-1908000000 { + opp-microvolt = <1025000>; + }; ++ opp-2016000000 { ++ opp-hz = /bits/ 64 <2016000000>; ++ opp-microvolt = <1025000>; ++ }; ++ opp-2100000000 { ++ opp-hz = /bits/ 64 <2100000000>; ++ opp-microvolt = <1025000>; ++ }; ++ opp-2208000000 { ++ opp-hz = /bits/ 64 <2208000000>; ++ opp-microvolt = <1050000>; ++ }; ++ opp-2304000000 { ++ opp-hz = /bits/ 64 <2304000000>; ++ opp-microvolt = <1050000>; ++ }; ++ opp-2400000000 { ++ opp-hz = /bits/ 64 <2400000000>; ++ opp-microvolt = <1050000>; ++ }; + }; + + &i2c_AO { +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0015-arm64-meson-odroid-go-ultra-specify-overclocking-fre.patch b/projects/Amlogic/packages/linux/patches/S922X/0015-arm64-meson-odroid-go-ultra-specify-overclocking-fre.patch new file mode 100644 index 0000000000..3bc508ab55 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0015-arm64-meson-odroid-go-ultra-specify-overclocking-fre.patch @@ -0,0 +1,53 @@ +From 90a1c072c1d2312f485bd0d47b39ef594e0f65d3 Mon Sep 17 00:00:00 2001 +From: adamg +Date: Wed, 24 Jan 2024 11:37:48 +0000 +Subject: [PATCH 15/49] arm64: meson: odroid-go-ultra: specify overclocking + frequencies as turbo mode + +--- + arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts +index 1fcfe421ec73..d13ac7f6c2ff 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts +@@ -352,6 +352,7 @@ opp-1992000000 { + opp-2016000000 { + opp-hz = /bits/ 64 <2016000000>; + opp-microvolt = <1050000>; ++ turbo-mode; + }; + }; + +@@ -384,22 +385,27 @@ opp-1908000000 { + opp-2016000000 { + opp-hz = /bits/ 64 <2016000000>; + opp-microvolt = <1025000>; ++ turbo-mode; + }; + opp-2100000000 { + opp-hz = /bits/ 64 <2100000000>; + opp-microvolt = <1025000>; ++ turbo-mode; + }; + opp-2208000000 { + opp-hz = /bits/ 64 <2208000000>; + opp-microvolt = <1050000>; ++ turbo-mode; + }; + opp-2304000000 { + opp-hz = /bits/ 64 <2304000000>; + opp-microvolt = <1050000>; ++ turbo-mode; + }; + opp-2400000000 { + opp-hz = /bits/ 64 <2400000000>; + opp-microvolt = <1050000>; ++ turbo-mode; + }; + }; + +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0016-arm64-meson-odroid-go-ultra-remove-adc-joystick.patch b/projects/Amlogic/packages/linux/patches/S922X/0016-arm64-meson-odroid-go-ultra-remove-adc-joystick.patch new file mode 100644 index 0000000000..e5e487afa2 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0016-arm64-meson-odroid-go-ultra-remove-adc-joystick.patch @@ -0,0 +1,69 @@ +From 63b0fc884bb654a7247f14b05cedb2c2f18c24d0 Mon Sep 17 00:00:00 2001 +From: "Mauro (mdrjr) Ribeiro" +Date: Wed, 24 Jan 2024 12:08:19 +0000 +Subject: [PATCH 16/49] arm64: meson: odroid-go-ultra: remove adc joystick + +--- + .../amlogic/meson-g12b-odroid-go-ultra.dts | 46 ------------------- + 1 file changed, 46 deletions(-) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts +index d13ac7f6c2ff..01d433769da8 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts +@@ -21,52 +21,6 @@ aliases { + rtc0 = &vrtc; + }; + +- adc-joystick-left { +- compatible = "adc-joystick"; +- io-channels = <&saradc 2>, <&saradc 3>; +- poll-interval = <10>; +- #address-cells = <1>; +- #size-cells = <0>; +- +- axis@0 { +- reg = <0>; +- linux,code = ; +- abs-range = <3150 950>; +- abs-fuzz = <32>; +- abs-flat = <64>; +- }; +- axis@1 { +- reg = <1>; +- linux,code = ; +- abs-range = <700 2900>; +- abs-fuzz = <32>; +- abs-flat = <64>; +- }; +- }; +- +- adc-joystick-right { +- compatible = "adc-joystick"; +- io-channels = <&saradc 0>, <&saradc 1>; +- poll-interval = <10>; +- #address-cells = <1>; +- #size-cells = <0>; +- +- axis@0 { +- reg = <0>; +- linux,code = ; +- abs-range = <3150 950>; +- abs-fuzz = <32>; +- abs-flat = <64>; +- }; +- axis@1 { +- reg = <1>; +- linux,code = ; +- abs-range = <800 3000>; +- abs-fuzz = <32>; +- abs-flat = <64>; +- }; +- }; +- + chosen { + stdout-path = "serial0:115200n8"; + }; +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0017-drm-meson-venc-HACK-panic-when-gamma-is-not-set-corr.patch b/projects/Amlogic/packages/linux/patches/S922X/0017-drm-meson-venc-HACK-panic-when-gamma-is-not-set-corr.patch new file mode 100644 index 0000000000..90916555d9 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0017-drm-meson-venc-HACK-panic-when-gamma-is-not-set-corr.patch @@ -0,0 +1,47 @@ +From fac13764b8819963ac934ff6ed56a4314e664973 Mon Sep 17 00:00:00 2001 +From: brooksytech <1673861+brooksytech@users.noreply.github.com> +Date: Wed, 24 Jan 2024 16:18:45 +0000 +Subject: [PATCH 17/49] drm: meson: venc: HACK: panic when gamma is not set + correctly + +--- + drivers/gpu/drm/meson/meson_venc.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/meson/meson_venc.c b/drivers/gpu/drm/meson/meson_venc.c +index 3bf0d6e4fc30..ace2e6c21f69 100644 +--- a/drivers/gpu/drm/meson/meson_venc.c ++++ b/drivers/gpu/drm/meson/meson_venc.c +@@ -1590,7 +1590,8 @@ static void meson_encl_set_gamma_table(struct meson_drm *priv, u16 *data, + ret = readl_relaxed_poll_timeout(priv->io_base + _REG(L_GAMMA_CNTL_PORT), + reg, reg & L_GAMMA_CNTL_PORT_ADR_RDY, 10, 10000); + if (ret) +- pr_warn("%s: GAMMA ADR_RDY timeout\n", __func__); ++ //pr_warn("%s: GAMMA ADR_RDY timeout\n", __func__); ++ panic("NOT ENOUGH SALT, GAMMA NOT SET"); + + writel_relaxed(L_GAMMA_ADDR_PORT_AUTO_INC | rgb_mask | + FIELD_PREP(L_GAMMA_ADDR_PORT_ADDR, 0), +@@ -1601,7 +1602,8 @@ static void meson_encl_set_gamma_table(struct meson_drm *priv, u16 *data, + reg, reg & L_GAMMA_CNTL_PORT_WR_RDY, + 10, 10000); + if (ret) +- pr_warn_once("%s: GAMMA WR_RDY timeout\n", __func__); ++ //pr_warn_once("%s: GAMMA WR_RDY timeout\n", __func__); ++ panic("NOT ENOUGH SALT, GAMMA NOT SET"); + + writel_relaxed(data[i], priv->io_base + _REG(L_GAMMA_DATA_PORT)); + } +@@ -1609,7 +1611,8 @@ static void meson_encl_set_gamma_table(struct meson_drm *priv, u16 *data, + ret = readl_relaxed_poll_timeout(priv->io_base + _REG(L_GAMMA_CNTL_PORT), + reg, reg & L_GAMMA_CNTL_PORT_ADR_RDY, 10, 10000); + if (ret) +- pr_warn("%s: GAMMA ADR_RDY timeout\n", __func__); ++ //pr_warn("%s: GAMMA ADR_RDY timeout\n", __func__); ++ panic("NOT ENOUGH SALT, GAMMA NOT SET"); + + writel_relaxed(L_GAMMA_ADDR_PORT_AUTO_INC | rgb_mask | + FIELD_PREP(L_GAMMA_ADDR_PORT_ADDR, 0x23), +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0018-gpiolib-of-revert-api-changes-needed-for-joypad-driv.patch b/projects/Amlogic/packages/linux/patches/S922X/0018-gpiolib-of-revert-api-changes-needed-for-joypad-driv.patch new file mode 100644 index 0000000000..16f29c0e32 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0018-gpiolib-of-revert-api-changes-needed-for-joypad-driv.patch @@ -0,0 +1,350 @@ +From 262f961e5600728f46041b70fc79e463bf6c22c7 Mon Sep 17 00:00:00 2001 +From: adamg +Date: Wed, 24 Jan 2024 22:12:01 +0000 +Subject: [PATCH 18/49] gpiolib: of: revert api changes needed for joypad + driver + +--- + drivers/gpio/gpiolib-of.c | 14 ++ + include/linux/of_gpio_legacy.h | 304 +++++++++++++++++++++++++++++++++ + 2 files changed, 318 insertions(+) + create mode 100644 include/linux/of_gpio_legacy.h + +diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c +index 402f7d99b0c1..c3b5a3aecfc7 100644 +--- a/drivers/gpio/gpiolib-of.c ++++ b/drivers/gpio/gpiolib-of.c +@@ -408,6 +408,20 @@ static struct gpio_desc *of_get_named_gpiod_flags(const struct device_node *np, + return desc; + } + ++int of_get_named_gpio_flags(const struct device_node *np, const char *list_name, ++ int index, enum of_gpio_flags *flags) ++{ ++ struct gpio_desc *desc; ++ ++ desc = of_get_named_gpiod_flags(np, list_name, index, flags); ++ ++ if (IS_ERR(desc)) ++ return PTR_ERR(desc); ++ else ++ return desc_to_gpio(desc); ++} ++EXPORT_SYMBOL_GPL(of_get_named_gpio_flags); ++ + /** + * of_get_named_gpio() - Get a GPIO number to use with GPIO API + * @np: device node to get GPIO from +diff --git a/include/linux/of_gpio_legacy.h b/include/linux/of_gpio_legacy.h +new file mode 100644 +index 000000000000..ce58afecb4f9 +--- /dev/null ++++ b/include/linux/of_gpio_legacy.h +@@ -0,0 +1,304 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * OF helpers for the GPIO API ++ * ++ * Copyright (c) 2007-2008 MontaVista Software, Inc. ++ * ++ * Author: Anton Vorontsov ++ */ ++ ++#ifndef __LINUX_OF_GPIO_H ++#define __LINUX_OF_GPIO_H ++ ++#include ++#include ++#include /* FIXME: Shouldn't be here */ ++#include ++ ++struct device_node; ++ ++/* ++ * This is Linux-specific flags. By default controllers' and Linux' mapping ++ * match, but GPIO controllers are free to translate their own flags to ++ * Linux-specific in their .xlate callback. Though, 1:1 mapping is recommended. ++ */ ++enum of_gpio_flags { ++ OF_GPIO_ACTIVE_LOW = 0x1, ++ OF_GPIO_SINGLE_ENDED = 0x2, ++ OF_GPIO_OPEN_DRAIN = 0x4, ++ OF_GPIO_TRANSITORY = 0x8, ++ OF_GPIO_PULL_UP = 0x10, ++ OF_GPIO_PULL_DOWN = 0x20, ++}; ++ ++#ifdef CONFIG_OF_GPIO ++ ++#include ++ ++/* ++ * OF GPIO chip for memory mapped banks ++ */ ++struct of_mm_gpio_chip { ++ struct gpio_chip gc; ++ void (*save_regs)(struct of_mm_gpio_chip *mm_gc); ++ void __iomem *regs; ++}; ++ ++static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc) ++{ ++ return container_of(gc, struct of_mm_gpio_chip, gc); ++} ++ ++extern int of_get_named_gpio_flags(const struct device_node *np, ++ const char *list_name, int index, enum of_gpio_flags *flags); ++ ++extern int of_mm_gpiochip_add_data(struct device_node *np, ++ struct of_mm_gpio_chip *mm_gc, ++ void *data); ++static inline int of_mm_gpiochip_add(struct device_node *np, ++ struct of_mm_gpio_chip *mm_gc) ++{ ++ return of_mm_gpiochip_add_data(np, mm_gc, NULL); ++} ++extern void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc); ++ ++#else /* CONFIG_OF_GPIO */ ++ ++#include ++ ++/* Drivers may not strictly depend on the GPIO support, so let them link. */ ++static inline int of_get_named_gpio_flags(const struct device_node *np, ++ const char *list_name, int index, enum of_gpio_flags *flags) ++{ ++ if (flags) ++ *flags = 0; ++ ++ return -ENOSYS; ++} ++ ++#endif /* CONFIG_OF_GPIO */ ++ ++/** ++ * of_gpio_named_count() - Count GPIOs for a device ++ * @np: device node to count GPIOs for ++ * @propname: property name containing gpio specifier(s) ++ * ++ * The function returns the count of GPIOs specified for a node. ++ * Note that the empty GPIO specifiers count too. Returns either ++ * Number of gpios defined in property, ++ * -EINVAL for an incorrectly formed gpios property, or ++ * -ENOENT for a missing gpios property ++ * ++ * Example: ++ * gpios = <0 ++ * &gpio1 1 2 ++ * 0 ++ * &gpio2 3 4>; ++ * ++ * The above example defines four GPIOs, two of which are not specified. ++ * This function will return '4' ++ */ ++static inline int of_gpio_named_count(const struct device_node *np, ++ const char *propname) ++{ ++ return of_count_phandle_with_args(np, propname, "#gpio-cells"); ++} ++ ++/** ++ * of_gpio_count() - Count GPIOs for a device ++ * @np: device node to count GPIOs for ++ * ++ * Same as of_gpio_named_count, but hard coded to use the 'gpios' property ++ */ ++static inline int of_gpio_count(const struct device_node *np) ++{ ++ return of_gpio_named_count(np, "gpios"); ++} ++ ++static inline int of_get_gpio_flags(const struct device_node *np, int index, ++ enum of_gpio_flags *flags) ++{ ++ return of_get_named_gpio_flags(np, "gpios", index, flags); ++} ++ ++/** ++ * of_get_named_gpio() - Get a GPIO number to use with GPIO API ++ * @np: device node to get GPIO from ++ * @propname: Name of property containing gpio specifier(s) ++ * @index: index of the GPIO ++ * ++ * Returns GPIO number to use with Linux generic GPIO API, or one of the errno ++ * value on the error condition. ++ */ ++static inline int of_get_named_gpio(const struct device_node *np, ++ const char *propname, int index) ++{ ++ return of_get_named_gpio_flags(np, propname, index, NULL); ++} ++ ++/** ++ * of_get_gpio() - Get a GPIO number to use with GPIO API ++ * @np: device node to get GPIO from ++ * @index: index of the GPIO ++ * ++ * Returns GPIO number to use with Linux generic GPIO API, or one of the errno ++ * value on the error condition. ++ */ ++static inline int of_get_gpio(const struct device_node *np, int index) ++{ ++ return of_get_gpio_flags(np, index, NULL); ++} ++ ++#endif /* __LINUX_OF_GPIO_H */ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * OF helpers for the GPIO API ++ * ++ * Copyright (c) 2007-2008 MontaVista Software, Inc. ++ * ++ * Author: Anton Vorontsov ++ */ ++ ++#ifndef __LINUX_OF_GPIO_H ++#define __LINUX_OF_GPIO_H ++ ++#include ++#include ++#include /* FIXME: Shouldn't be here */ ++#include ++ ++struct device_node; ++ ++/* ++ * This is Linux-specific flags. By default controllers' and Linux' mapping ++ * match, but GPIO controllers are free to translate their own flags to ++ * Linux-specific in their .xlate callback. Though, 1:1 mapping is recommended. ++ */ ++enum of_gpio_flags { ++ OF_GPIO_ACTIVE_LOW = 0x1, ++ OF_GPIO_SINGLE_ENDED = 0x2, ++ OF_GPIO_OPEN_DRAIN = 0x4, ++ OF_GPIO_TRANSITORY = 0x8, ++ OF_GPIO_PULL_UP = 0x10, ++ OF_GPIO_PULL_DOWN = 0x20, ++}; ++ ++#ifdef CONFIG_OF_GPIO ++ ++#include ++ ++/* ++ * OF GPIO chip for memory mapped banks ++ */ ++struct of_mm_gpio_chip { ++ struct gpio_chip gc; ++ void (*save_regs)(struct of_mm_gpio_chip *mm_gc); ++ void __iomem *regs; ++}; ++ ++static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc) ++{ ++ return container_of(gc, struct of_mm_gpio_chip, gc); ++} ++ ++extern int of_get_named_gpio_flags(const struct device_node *np, ++ const char *list_name, int index, enum of_gpio_flags *flags); ++ ++extern int of_mm_gpiochip_add_data(struct device_node *np, ++ struct of_mm_gpio_chip *mm_gc, ++ void *data); ++static inline int of_mm_gpiochip_add(struct device_node *np, ++ struct of_mm_gpio_chip *mm_gc) ++{ ++ return of_mm_gpiochip_add_data(np, mm_gc, NULL); ++} ++extern void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc); ++ ++#else /* CONFIG_OF_GPIO */ ++ ++#include ++ ++/* Drivers may not strictly depend on the GPIO support, so let them link. */ ++static inline int of_get_named_gpio_flags(const struct device_node *np, ++ const char *list_name, int index, enum of_gpio_flags *flags) ++{ ++ if (flags) ++ *flags = 0; ++ ++ return -ENOSYS; ++} ++ ++#endif /* CONFIG_OF_GPIO */ ++ ++/** ++ * of_gpio_named_count() - Count GPIOs for a device ++ * @np: device node to count GPIOs for ++ * @propname: property name containing gpio specifier(s) ++ * ++ * The function returns the count of GPIOs specified for a node. ++ * Note that the empty GPIO specifiers count too. Returns either ++ * Number of gpios defined in property, ++ * -EINVAL for an incorrectly formed gpios property, or ++ * -ENOENT for a missing gpios property ++ * ++ * Example: ++ * gpios = <0 ++ * &gpio1 1 2 ++ * 0 ++ * &gpio2 3 4>; ++ * ++ * The above example defines four GPIOs, two of which are not specified. ++ * This function will return '4' ++ */ ++static inline int of_gpio_named_count(const struct device_node *np, ++ const char *propname) ++{ ++ return of_count_phandle_with_args(np, propname, "#gpio-cells"); ++} ++ ++/** ++ * of_gpio_count() - Count GPIOs for a device ++ * @np: device node to count GPIOs for ++ * ++ * Same as of_gpio_named_count, but hard coded to use the 'gpios' property ++ */ ++static inline int of_gpio_count(const struct device_node *np) ++{ ++ return of_gpio_named_count(np, "gpios"); ++} ++ ++static inline int of_get_gpio_flags(const struct device_node *np, int index, ++ enum of_gpio_flags *flags) ++{ ++ return of_get_named_gpio_flags(np, "gpios", index, flags); ++} ++ ++/** ++ * of_get_named_gpio() - Get a GPIO number to use with GPIO API ++ * @np: device node to get GPIO from ++ * @propname: Name of property containing gpio specifier(s) ++ * @index: index of the GPIO ++ * ++ * Returns GPIO number to use with Linux generic GPIO API, or one of the errno ++ * value on the error condition. ++ */ ++static inline int of_get_named_gpio(const struct device_node *np, ++ const char *propname, int index) ++{ ++ return of_get_named_gpio_flags(np, propname, index, NULL); ++} ++ ++/** ++ * of_get_gpio() - Get a GPIO number to use with GPIO API ++ * @np: device node to get GPIO from ++ * @index: index of the GPIO ++ * ++ * Returns GPIO number to use with Linux generic GPIO API, or one of the errno ++ * value on the error condition. ++ */ ++static inline int of_get_gpio(const struct device_node *np, int index) ++{ ++ return of_get_gpio_flags(np, index, NULL); ++} ++ ++#endif /* __LINUX_OF_GPIO_H */ +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/004.03-polled-input-device-driver.patch b/projects/Amlogic/packages/linux/patches/S922X/0019-input-add-input-polldev-driver.patch similarity index 90% rename from projects/Amlogic/packages/linux/patches/S922X/004.03-polled-input-device-driver.patch rename to projects/Amlogic/packages/linux/patches/S922X/0019-input-add-input-polldev-driver.patch index 52d9cd4b77..ba00d67940 100644 --- a/projects/Amlogic/packages/linux/patches/S922X/004.03-polled-input-device-driver.patch +++ b/projects/Amlogic/packages/linux/patches/S922X/0019-input-add-input-polldev-driver.patch @@ -1,6 +1,21 @@ -diff -rupN linux.orig/drivers/input/Kconfig linux/drivers/input/Kconfig ---- linux.orig/drivers/input/Kconfig 2023-09-12 12:02:58.173629790 +0000 -+++ linux/drivers/input/Kconfig 2023-09-12 12:03:27.490291628 +0000 +From 86e95809b9184c287232cda8f29690826d832e86 Mon Sep 17 00:00:00 2001 +From: adamg +Date: Wed, 24 Jan 2024 21:50:05 +0000 +Subject: [PATCH 19/49] input: add input-polldev driver + +--- + drivers/input/Kconfig | 13 ++ + drivers/input/Makefile | 1 + + drivers/input/input-polldev.c | 362 ++++++++++++++++++++++++++++++++++ + include/linux/input-polldev.h | 58 ++++++ + 4 files changed, 434 insertions(+) + create mode 100644 drivers/input/input-polldev.c + create mode 100644 include/linux/input-polldev.h + +diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig +index 3bdbd34314b3..779daf5009c1 100644 +--- a/drivers/input/Kconfig ++++ b/drivers/input/Kconfig @@ -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. @@ -21,11 +36,11 @@ diff -rupN linux.orig/drivers/input/Kconfig linux/drivers/input/Kconfig config INPUT_SPARSEKMAP tristate "Sparse keymap support library" help - -diff -rupN linux.orig/drivers/input/Makefile linux/drivers/input/Makefile ---- linux.orig/drivers/input/Makefile 2023-09-12 12:02:58.173629790 +0000 -+++ linux/drivers/input/Makefile 2023-09-12 12:03:27.490291628 +0000 -@@ -10,6 +10,7 @@ input-core-y := input.o input-compat.o i +diff --git a/drivers/input/Makefile b/drivers/input/Makefile +index c78753274921..e92c29174c36 100644 +--- a/drivers/input/Makefile ++++ b/drivers/input/Makefile +@@ -10,6 +10,7 @@ input-core-y := input.o input-compat.o input-mt.o input-poller.o ff-core.o input-core-y += touchscreen.o obj-$(CONFIG_INPUT_FF_MEMLESS) += ff-memless.o @@ -33,9 +48,11 @@ diff -rupN linux.orig/drivers/input/Makefile linux/drivers/input/Makefile obj-$(CONFIG_INPUT_SPARSEKMAP) += sparse-keymap.o obj-$(CONFIG_INPUT_MATRIXKMAP) += matrix-keymap.o 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-09-12 12:03:27.490291628 +0000 +diff --git a/drivers/input/input-polldev.c b/drivers/input/input-polldev.c +new file mode 100644 +index 000000000000..9bf1c9aeb4c4 +--- /dev/null ++++ b/drivers/input/input-polldev.c @@ -0,0 +1,362 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* @@ -399,10 +416,11 @@ diff -rupN linux.orig/drivers/input/input-polldev.c linux/drivers/input/input-po + input_unregister_device(dev->input); +} +EXPORT_SYMBOL(input_unregister_polled_device); - -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-09-12 12:03:27.490291628 +0000 +diff --git a/include/linux/input-polldev.h b/include/linux/input-polldev.h +new file mode 100644 +index 000000000000..14821fd231c0 +--- /dev/null ++++ b/include/linux/input-polldev.h @@ -0,0 +1,58 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef _INPUT_POLLDEV_H @@ -462,3 +480,6 @@ diff -rupN linux.orig/include/linux/input-polldev.h linux/include/linux/input-po +void input_unregister_polled_device(struct input_polled_dev *dev); + +#endif +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/004.01-ODROID-GO-Ultra-joypad-driver.patch b/projects/Amlogic/packages/linux/patches/S922X/0020-input-joystick-add-odroid-go-ultra-joypad-driver.patch similarity index 95% rename from projects/Amlogic/packages/linux/patches/S922X/004.01-ODROID-GO-Ultra-joypad-driver.patch rename to projects/Amlogic/packages/linux/patches/S922X/0020-input-joystick-add-odroid-go-ultra-joypad-driver.patch index 8f68ef8731..3f75b2f4fd 100644 --- a/projects/Amlogic/packages/linux/patches/S922X/004.01-ODROID-GO-Ultra-joypad-driver.patch +++ b/projects/Amlogic/packages/linux/patches/S922X/0020-input-joystick-add-odroid-go-ultra-joypad-driver.patch @@ -1,6 +1,21 @@ -diff -rupN linux.orig/drivers/input/joystick/Kconfig linux/drivers/input/joystick/Kconfig ---- linux.orig/drivers/input/joystick/Kconfig 2023-09-12 12:02:58.173629790 +0000 -+++ linux/drivers/input/joystick/Kconfig 2023-09-12 12:03:27.490291628 +0000 +From e27840af97ac40407d190c221d1eb32737bb0172 Mon Sep 17 00:00:00 2001 +From: adamg +Date: Wed, 24 Jan 2024 21:55:38 +0000 +Subject: [PATCH 20/49] input: joystick: add odroid-go ultra-joypad driver + +--- + drivers/input/joystick/Kconfig | 6 + + drivers/input/joystick/Makefile | 1 + + drivers/input/joystick/amlogic-saradc.h | 32 + + drivers/input/joystick/odroid-gou-joypad.c | 960 +++++++++++++++++++++ + 4 files changed, 999 insertions(+) + create mode 100644 drivers/input/joystick/amlogic-saradc.h + create mode 100644 drivers/input/joystick/odroid-gou-joypad.c + +diff --git a/drivers/input/joystick/Kconfig b/drivers/input/joystick/Kconfig +index ac6925ce8366..63dff101c0e6 100644 +--- a/drivers/input/joystick/Kconfig ++++ b/drivers/input/joystick/Kconfig @@ -344,6 +344,12 @@ config JOYSTICK_MAPLE To compile this as a module choose M here: the module will be called maplecontrol. @@ -14,10 +29,11 @@ diff -rupN linux.orig/drivers/input/joystick/Kconfig linux/drivers/input/joystic config JOYSTICK_PSXPAD_SPI tristate "PlayStation 1/2 joypads via SPI interface" depends on SPI -diff -rupN linux.orig/drivers/input/joystick/Makefile linux/drivers/input/joystick/Makefile ---- linux.orig/drivers/input/joystick/Makefile 2023-09-12 12:02:58.173629790 +0000 -+++ linux/drivers/input/joystick/Makefile 2023-09-12 12:03:27.490291628 +0000 -@@ -25,6 +25,7 @@ obj-$(CONFIG_JOYSTICK_JOYDUMP) += joydu +diff --git a/drivers/input/joystick/Makefile b/drivers/input/joystick/Makefile +index 3937535f0098..b7e4e471ac32 100644 +--- a/drivers/input/joystick/Makefile ++++ b/drivers/input/joystick/Makefile +@@ -25,6 +25,7 @@ obj-$(CONFIG_JOYSTICK_JOYDUMP) += joydump.o obj-$(CONFIG_JOYSTICK_MAGELLAN) += magellan.o obj-$(CONFIG_JOYSTICK_MAPLE) += maplecontrol.o obj-$(CONFIG_JOYSTICK_N64) += n64joy.o @@ -25,9 +41,11 @@ diff -rupN linux.orig/drivers/input/joystick/Makefile linux/drivers/input/joysti obj-$(CONFIG_JOYSTICK_PSXPAD_SPI) += psxpad-spi.o obj-$(CONFIG_JOYSTICK_PXRC) += pxrc.o obj-$(CONFIG_JOYSTICK_QWIIC) += qwiic-joystick.o -diff -rupN linux.orig/drivers/input/joystick/amlogic-saradc.h linux/drivers/input/joystick/amlogic-saradc.h ---- linux.orig/drivers/input/joystick/amlogic-saradc.h 1970-01-01 00:00:00.000000000 +0000 -+++ linux/drivers/input/joystick/amlogic-saradc.h 2023-09-12 12:03:27.490291628 +0000 +diff --git a/drivers/input/joystick/amlogic-saradc.h b/drivers/input/joystick/amlogic-saradc.h +new file mode 100644 +index 000000000000..126796b99924 +--- /dev/null ++++ b/drivers/input/joystick/amlogic-saradc.h @@ -0,0 +1,32 @@ +/* + * include/dt-bindings/iio/adc/amlogic-saradc.h @@ -61,9 +79,11 @@ diff -rupN linux.orig/drivers/input/joystick/amlogic-saradc.h linux/drivers/inpu +#define SARADC_CH_NUM 8 + +#endif -diff -rupN linux.orig/drivers/input/joystick/odroid-gou-joypad.c linux/drivers/input/joystick/odroid-gou-joypad.c ---- linux.orig/drivers/input/joystick/odroid-gou-joypad.c 1970-01-01 00:00:00.000000000 +0000 -+++ linux/drivers/input/joystick/odroid-gou-joypad.c 2023-09-12 12:03:27.490291628 +0000 +diff --git a/drivers/input/joystick/odroid-gou-joypad.c b/drivers/input/joystick/odroid-gou-joypad.c +new file mode 100644 +index 000000000000..93f7644c469b +--- /dev/null ++++ b/drivers/input/joystick/odroid-gou-joypad.c @@ -0,0 +1,960 @@ +/*----------------------------------------------------------------------------*/ +#include @@ -79,7 +99,7 @@ diff -rupN linux.orig/drivers/input/joystick/odroid-gou-joypad.c linux/drivers/i +#include +#include +#include -+#include ++#include +#include +#include "amlogic-saradc.h" +#include @@ -1025,4 +1045,6 @@ diff -rupN linux.orig/drivers/input/joystick/odroid-gou-joypad.c linux/drivers/i +MODULE_ALIAS("platform:" DRV_NAME); + +/*----------------------------------------------------------------------------*/ +-- +2.34.1 diff --git a/projects/Amlogic/packages/linux/patches/S922X/0021-arm64-meson-odroid-go-ultra-add-joypad.patch b/projects/Amlogic/packages/linux/patches/S922X/0021-arm64-meson-odroid-go-ultra-add-joypad.patch new file mode 100644 index 0000000000..ba12b94b74 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0021-arm64-meson-odroid-go-ultra-add-joypad.patch @@ -0,0 +1,215 @@ +From c19ec625d944a7152c5697ea46dcc9a73752fc26 Mon Sep 17 00:00:00 2001 +From: adamg +Date: Wed, 24 Jan 2024 21:57:34 +0000 +Subject: [PATCH 21/49] arm64: meson: odroid-go-ultra: add joypad + +--- + .../amlogic/meson-g12b-odroid-go-ultra.dts | 156 +++++++++++------- + 1 file changed, 93 insertions(+), 63 deletions(-) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts +index 01d433769da8..11bd4939f283 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts +@@ -34,9 +34,8 @@ codec_clk: codec-clk { + + gpio-keys { + compatible = "gpio-keys-polled"; +- poll-interval = <10>; +- pinctrl-0 = <&keypad_gpio_pins>; +- pinctrl-names = "default"; ++ poll-interval = <5>; ++ autorepeat; + + volume-up-button { + label = "VOLUME-UP"; +@@ -48,95 +47,126 @@ volume-down-button { + linux,code = ; + gpios = <&gpio GPIOX_9 GPIO_ACTIVE_LOW>; + }; +- dpad-up-button { +- label = "DPAD-UP"; +- linux,code = ; ++ }; ++ ++ joypad: gou_joypad { ++ compatible = "odroidgou-joypad"; ++ poll-interval = <10>; ++ pinctrl-0 = <&keypad_gpio_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++ ++ joypad-name = "GO-Ultra Gamepad"; ++ //joypad-vendor = <0x045e>; ++ joypad-product = <0x1000>; ++ joypad-revision = <0x0100>; ++ ++ /* Analog sticks */ ++ io-channels = <&saradc 0>, <&saradc 1>, <&saradc 2>, <&saradc 3>; ++ io-channel-names = "key-RY", "key-RX", "key-LY", "key-LX"; ++ button-adc-scale = <4>; ++ button-adc-deadzone = <64>; ++ button-adc-fuzz = <32>; ++ button-adc-flat = <32>; ++ abs_x-p-tuning = <350>; ++ abs_x-n-tuning = <350>; ++ abs_y-p-tuning = <350>; ++ abs_y-n-tuning = <350>; ++ abs_rx-p-tuning = <350>; ++ abs_rx-n-tuning = <350>; ++ abs_ry-p-tuning = <350>; ++ abs_ry-n-tuning = <350>; ++ ++ /* Buttons */ ++ sw1 { + gpios = <&gpio GPIOX_0 GPIO_ACTIVE_LOW>; ++ label = "GPIO DPAD-UP"; ++ linux,code = ; // 0x220 + }; +- dpad-down-button { +- label = "DPAD-DOWN"; +- linux,code = ; ++ sw2 { + gpios = <&gpio GPIOX_1 GPIO_ACTIVE_LOW>; ++ label = "GPIO DPAD-DOWN"; ++ linux,code = ; // 0x221 + }; +- dpad-left-button { +- label = "DPAD-LEFT"; +- linux,code = ; ++ sw3 { + gpios = <&gpio GPIOX_2 GPIO_ACTIVE_LOW>; ++ label = "GPIO DPAD-LEFT"; ++ linux,code = ; // 0x222 + }; +- dpad-right-button { +- label = "DPAD-RIGHT"; +- linux,code = ; ++ sw4 { + gpios = <&gpio GPIOX_3 GPIO_ACTIVE_LOW>; ++ label = "GPIO DPAD-RIGHT"; ++ linux,code = ; // 0x223 + }; +- a-button { +- label = "A"; +- linux,code = ; ++ sw5 { + gpios = <&gpio GPIOX_4 GPIO_ACTIVE_LOW>; ++ label = "GPIO BTN-A"; ++ linux,code = ; // 0x131 + }; +- b-button { +- label = "B"; +- linux,code = ; ++ sw6 { + gpios = <&gpio GPIOX_5 GPIO_ACTIVE_LOW>; ++ label = "GPIO BTN-B"; ++ linux,code = ; // 0x130 + }; +- y-button { +- label = "Y"; +- linux,code = ; ++ sw7 { + gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>; ++ label = "GPIO BTN-Y"; ++ linux,code = ; // 0x134 + }; +- x-button { +- label = "X"; +- linux,code = ; ++ sw8 { + gpios = <&gpio GPIOX_7 GPIO_ACTIVE_LOW>; ++ label = "GPIO BTN-X"; ++ linux,code = ; // 0x133 + }; +- f1-button { +- label = "F1"; +- linux,code = ; +- gpios = <&gpio GPIOX_17 GPIO_ACTIVE_LOW>; +- }; +- f2-button { +- label = "F2"; +- linux,code = ; ++ sw11 { + gpios = <&gpio GPIOX_10 GPIO_ACTIVE_LOW>; ++ label = "GPIO F2"; ++ linux,code = ; // 0x2c2 + }; +- f3-button { +- label = "F3"; +- linux,code = ; ++ sw12 { + gpios = <&gpio GPIOX_11 GPIO_ACTIVE_LOW>; ++ label = "GPIO F3"; ++ linux,code = ; // 0x2c3 + }; +- f4-button { +- label = "F4"; +- linux,code = ; ++ sw13 { + gpios = <&gpio GPIOX_12 GPIO_ACTIVE_LOW>; ++ label = "GPIO F4"; ++ linux,code = ; // 0x2c4 + }; +- f5-button { +- label = "F5"; +- linux,code = ; ++ sw14 { + gpios = <&gpio GPIOX_13 GPIO_ACTIVE_LOW>; ++ label = "GPIO F5"; ++ linux,code = ; // 0x13c + }; +- f6-button { +- label = "F6"; +- linux,code = ; +- gpios = <&gpio GPIOX_16 GPIO_ACTIVE_LOW>; +- }; +- top-left-button { +- label = "TOP Left"; +- linux,code = ; ++ sw15 { + gpios = <&gpio GPIOX_14 GPIO_ACTIVE_LOW>; ++ label = "GPIO TOP-LEFT"; ++ linux,code = ; // 0x02 + }; +- top-left2-button { +- label = "TOP Left 2"; +- linux,code = ; +- gpios = <&gpio GPIOX_19 GPIO_ACTIVE_LOW>; +- }; +- top-right-button { +- label = "TOP Right"; +- linux,code = ; ++ sw16 { + gpios = <&gpio GPIOX_15 GPIO_ACTIVE_LOW>; ++ label = "GPIO TOP-RIGHT"; ++ linux,code = ; // 0x05 + }; +- top-right2-button { +- label = "TOP Right 2"; +- linux,code = ; ++ sw17 { ++ gpios = <&gpio GPIOX_16 GPIO_ACTIVE_LOW>; ++ label = "GPIO F6"; ++ linux,code = ; ++ }; ++ sw18 { ++ gpios = <&gpio GPIOX_17 GPIO_ACTIVE_LOW>; ++ label = "GPIO F1"; ++ linux,code = ; ++ }; ++ sw19 { + gpios = <&gpio GPIOX_18 GPIO_ACTIVE_LOW>; ++ label = "GPIO TOP-RIGHT2"; ++ linux,code = ; ++ }; ++ sw20 { ++ gpios = <&gpio GPIOX_19 GPIO_ACTIVE_LOW>; ++ label = "GPIO TOP-LEFT2"; ++ linux,code = ; + }; + }; + +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0022-arm64-meson-odroid-disable-heartbeat.patch b/projects/Amlogic/packages/linux/patches/S922X/0022-arm64-meson-odroid-disable-heartbeat.patch new file mode 100644 index 0000000000..282cd55a5a --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0022-arm64-meson-odroid-disable-heartbeat.patch @@ -0,0 +1,39 @@ +From ca5e6f5823e8fcfc58e7130390ada5cb3c422491 Mon Sep 17 00:00:00 2001 +From: adamg +Date: Wed, 24 Jan 2024 22:22:49 +0000 +Subject: [PATCH 22/49] arm64: meson: odroid: disable heartbeat + +--- + arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts | 2 +- + arch/arm64/boot/dts/amlogic/meson-g12b-odroid.dtsi | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts +index 11bd4939f283..9e2db8828f1f 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts +@@ -194,7 +194,7 @@ leds { + led-blue { + color = ; + gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_HIGH>; +- linux,default-trigger = "heartbeat"; ++ linux,default-trigger = "none"; + }; + }; + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid.dtsi +index 9e12a34b2840..fd41aaad2acc 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid.dtsi +@@ -44,7 +44,7 @@ leds { + led-blue { + label = "n2:blue"; + gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_HIGH>; +- linux,default-trigger = "heartbeat"; ++ linux,default-trigger = "none"; + }; + }; + +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/002.02-Add-Mali-to-device-trees.patch b/projects/Amlogic/packages/linux/patches/S922X/0023-arm64-meson-g12-common-add-mali-to-dts.patch similarity index 50% rename from projects/Amlogic/packages/linux/patches/S922X/002.02-Add-Mali-to-device-trees.patch rename to projects/Amlogic/packages/linux/patches/S922X/0023-arm64-meson-g12-common-add-mali-to-dts.patch index 9746ea302d..0302f0cfd5 100644 --- a/projects/Amlogic/packages/linux/patches/S922X/002.02-Add-Mali-to-device-trees.patch +++ b/projects/Amlogic/packages/linux/patches/S922X/0023-arm64-meson-g12-common-add-mali-to-dts.patch @@ -1,7 +1,18 @@ -diff -rupN linux.orig/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi linux/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi ---- linux.orig/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi 2023-09-12 12:02:56.937601871 +0000 -+++ linux/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi 2023-09-12 12:03:27.490291628 +0000 -@@ -2394,14 +2391,20 @@ +From 2097bdaed54ed1185fedb5946354f0e724b27265 Mon Sep 17 00:00:00 2001 +From: adamg +Date: Wed, 24 Jan 2024 23:56:58 +0000 +Subject: [PATCH 23/49] arm64: meson: g12-common: add mali to dts + +--- + .../arm64/boot/dts/amlogic/meson-g12-common.dtsi | 16 +++++++++++----- + arch/arm64/boot/dts/amlogic/meson-g12b.dtsi | 3 ++- + 2 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +index 7300408262d5..b31b077bd891 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +@@ -2476,14 +2476,20 @@ dwc3: usb@ff500000 { }; mali: gpu@ffe40000 { @@ -27,10 +38,11 @@ diff -rupN linux.orig/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi linux/ar resets = <&reset RESET_DVALIN_CAPB3>, <&reset RESET_DVALIN>; operating-points-v2 = <&gpu_opp_table>; #cooling-cells = <2>; -diff -rupN linux.orig/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi linux/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi ---- linux.orig/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi 2023-09-12 12:02:56.937601871 +0000 -+++ linux/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi 2023-09-12 12:03:27.490291628 +0000 -@@ -137,5 +139,6 @@ +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi +index 86e6ceb31d5e..f22c27a1472c 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi +@@ -139,7 +139,8 @@ map1 { }; &mali { @@ -38,3 +50,8 @@ diff -rupN linux.orig/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi linux/arch/arm + system-coherency = <0>; + power_policy = "always_on"; }; + + &pmu { +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0024-arm64-meson-odroid-go-ultra-increase-vddcpu_a-voltag.patch b/projects/Amlogic/packages/linux/patches/S922X/0024-arm64-meson-odroid-go-ultra-increase-vddcpu_a-voltag.patch new file mode 100644 index 0000000000..fc64193f25 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0024-arm64-meson-odroid-go-ultra-increase-vddcpu_a-voltag.patch @@ -0,0 +1,26 @@ +From 515c800b6c23502d25ccd971dcfdc6ca0dde7897 Mon Sep 17 00:00:00 2001 +From: adamg +Date: Thu, 25 Jan 2024 00:32:40 +0000 +Subject: [PATCH 24/49] arm64: meson: odroid-go-ultra: increase vddcpu_a + voltage for overclock + +--- + arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts +index 9e2db8828f1f..071f07e9e883 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts +@@ -421,7 +421,7 @@ vddcpu_a: DCDC_REG1 { + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <775000>; +- regulator-max-microvolt = <1025000>; ++ regulator-max-microvolt = <1050000>; + regulator-ramp-delay = <6001>; + regulator-state-mem { + regulator-on-in-suspend; +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/001.03-Add-Powkiddy-RGB10-MAX-3-Pro-device-tree.patch b/projects/Amlogic/packages/linux/patches/S922X/0025-arm64-meson-add-dt-for-powkiddy-rgb10-max-3-pro.patch similarity index 55% rename from projects/Amlogic/packages/linux/patches/S922X/001.03-Add-Powkiddy-RGB10-MAX-3-Pro-device-tree.patch rename to projects/Amlogic/packages/linux/patches/S922X/0025-arm64-meson-add-dt-for-powkiddy-rgb10-max-3-pro.patch index 27121f42fa..825e4d5522 100644 --- a/projects/Amlogic/packages/linux/patches/S922X/001.03-Add-Powkiddy-RGB10-MAX-3-Pro-device-tree.patch +++ b/projects/Amlogic/packages/linux/patches/S922X/0025-arm64-meson-add-dt-for-powkiddy-rgb10-max-3-pro.patch @@ -1,9 +1,19 @@ +From 2e182dc98e292ddcb126633aea6446ba4549e3f2 Mon Sep 17 00:00:00 2001 +From: adamg +Date: Fri, 26 Jan 2024 17:55:02 +0000 +Subject: [PATCH 25/49] arm64: meson: add dt for powkiddy-rgb10-max-3-pro + +--- + .../meson-g12b-powkiddy-rgb10-max-3-pro.dts | 54 +++++++++++++++++++ + 1 file changed, 54 insertions(+) + create mode 100644 arch/arm64/boot/dts/amlogic/meson-g12b-powkiddy-rgb10-max-3-pro.dts + diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-powkiddy-rgb10-max-3-pro.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-powkiddy-rgb10-max-3-pro.dts new file mode 100644 -index 000000000000..df5dde6eec79 +index 000000000000..32dd41f5d4fe --- /dev/null +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-powkiddy-rgb10-max-3-pro.dts -@@ -0,0 +1,39 @@ +@@ -0,0 +1,54 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2023 JELOS (https://github.com/JustEnoughLinuxOS) @@ -40,6 +50,24 @@ index 000000000000..df5dde6eec79 + }; + + sound { -+ model = "RGB10-MAX-3-PRO"; ++ model = "RGB10-MAX-3-Pro"; ++ }; ++ ++ opp-table-0 { ++ opp-1800000000 { ++ opp-hz = /bits/ 64 <1800000000>; ++ opp-microvolt = <981000>; ++ }; ++ /delete-node/ opp-1896000000; ++ /delete-node/ opp-1992000000; ++ /delete-node/ opp-2016000000; ++ }; ++ ++ opp-table-1 { ++ /delete-node/ opp-2304000000; ++ /delete-node/ opp-2400000000; + }; +}; +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/004.04-rk818-charger-driver.patch b/projects/Amlogic/packages/linux/patches/S922X/0026-power-supply-rk818-battery-Add-battery-driver-for-RK.patch similarity index 81% rename from projects/Amlogic/packages/linux/patches/S922X/004.04-rk818-charger-driver.patch rename to projects/Amlogic/packages/linux/patches/S922X/0026-power-supply-rk818-battery-Add-battery-driver-for-RK.patch index dc6b2ec71b..724411cb84 100644 --- a/projects/Amlogic/packages/linux/patches/S922X/004.04-rk818-charger-driver.patch +++ b/projects/Amlogic/packages/linux/patches/S922X/0026-power-supply-rk818-battery-Add-battery-driver-for-RK.patch @@ -1,31 +1,139 @@ -diff -rupN linux.orig/drivers/power/supply/Kconfig linux/drivers/power/supply/Kconfig ---- linux.orig/drivers/power/supply/Kconfig 2023-09-12 12:02:58.745642709 +0000 -+++ linux/drivers/power/supply/Kconfig 2023-09-12 12:03:27.490291628 +0000 -@@ -918,4 +918,12 @@ config BATTERY_UG3105 - device is off or suspended, the functionality of this driver is - limited to reporting capacity only. +From 6229c1cbda5a197866a060c1d0519b6205dccc92 Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Sun, 11 Jun 2023 18:29:24 +0200 +Subject: [PATCH 26/49] power: supply: rk818-battery: Add battery driver for + RK818 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This is forward ported driver from Rockchip BSP. + +Signed-of-by: Kamil TrzciÅ„ski +--- + drivers/mfd/rk8xx-core.c | 6 +- + drivers/mfd/rk8xx-i2c.c | 38 +- + drivers/power/supply/Kconfig | 17 + + drivers/power/supply/Makefile | 1 + + drivers/power/supply/rk818_battery.c | 3568 ++++++++++++++++++++++++++ + drivers/power/supply/rk818_battery.h | 168 ++ + include/linux/mfd/rk808.h | 81 +- + 7 files changed, 3874 insertions(+), 5 deletions(-) + create mode 100644 drivers/power/supply/rk818_battery.c + create mode 100644 drivers/power/supply/rk818_battery.h + +diff --git a/drivers/mfd/rk8xx-core.c b/drivers/mfd/rk8xx-core.c +index b1ffc3b9e2be..05175284079e 100644 +--- a/drivers/mfd/rk8xx-core.c ++++ b/drivers/mfd/rk8xx-core.c +@@ -109,8 +109,10 @@ static const struct mfd_cell rk817s[] = { + }; + + static const struct mfd_cell rk818s[] = { +- { .name = "rk808-clkout", }, +- { .name = "rk808-regulator", }, ++ { .name = "rk808-clkout", .id = PLATFORM_DEVID_NONE, }, ++ { .name = "rk808-regulator", .id = PLATFORM_DEVID_NONE, }, ++ { .name = "rk818-battery", .of_compatible = "rockchip,rk818-battery", }, ++ { .name = "rk818-charger", .of_compatible = "rockchip,rk818-charger", }, + { + .name = "rk808-rtc", + .num_resources = ARRAY_SIZE(rtc_resources), +diff --git a/drivers/mfd/rk8xx-i2c.c b/drivers/mfd/rk8xx-i2c.c +index 75b5cf09d5a0..3d9632fb3554 100644 +--- a/drivers/mfd/rk8xx-i2c.c ++++ b/drivers/mfd/rk8xx-i2c.c +@@ -75,13 +75,47 @@ static bool rk817_is_volatile_reg(struct device *dev, unsigned int reg) + return false; + } + ++static bool rk818_is_volatile_reg(struct device *dev, unsigned int reg) ++{ ++ /* ++ * Notes: ++ * - Technically the ROUND_30s bit makes RTC_CTRL_REG volatile, but ++ * we don't use that feature. It's better to cache. ++ * - It's unlikely we care that RK808_DEVCTRL_REG is volatile since ++ * bits are cleared in case when we shutoff anyway, but better safe. ++ */ ++ ++ switch (reg) { ++ case RK808_SECONDS_REG ... RK808_WEEKS_REG: ++ case RK808_RTC_STATUS_REG: ++ case RK808_VB_MON_REG: ++ case RK808_THERMAL_REG: ++ case RK808_DCDC_EN_REG: ++ case RK808_LDO_EN_REG: ++ case RK808_DCDC_UV_STS_REG: ++ case RK808_LDO_UV_STS_REG: ++ case RK808_DCDC_PG_REG: ++ case RK808_LDO_PG_REG: ++ case RK808_DEVCTRL_REG: ++ case RK808_INT_STS_REG1: ++ case RK808_INT_STS_REG2: ++ case RK808_INT_STS_MSK_REG1: ++ case RK808_INT_STS_MSK_REG2: ++ case RK818_LDO8_ON_VSEL_REG: // TODO(ayufan):?? ++ case RK818_LDO8_SLP_VSEL_REG: // TODO(ayufan):?? ++ case RK818_SUP_STS_REG ... RK818_SAVE_DATA19: ++ return true; ++ } ++ ++ return false; ++} + + static const struct regmap_config rk818_regmap_config = { + .reg_bits = 8, + .val_bits = 8, +- .max_register = RK818_USB_CTRL_REG, ++ .max_register = RK818_SAVE_DATA19, + .cache_type = REGCACHE_MAPLE, +- .volatile_reg = rk808_is_volatile_reg, ++ .volatile_reg = rk818_is_volatile_reg, + }; -+config CHARGER_RK818 -+ bool "RK818 Charger driver" + static const struct regmap_config rk805_regmap_config = { +diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig +index f21cb05815ec..1722fc1ee7ec 100644 +--- a/drivers/power/supply/Kconfig ++++ b/drivers/power/supply/Kconfig +@@ -984,4 +984,21 @@ config FUEL_GAUGE_MM8013 + the state of charge, temperature, cycle count, actual and design + capacity, etc. + ++config FUEL_GAUGE_MM8013 ++ tristate "Mitsumi MM8013 fuel gauge driver" ++ depends on I2C ++ help ++ Say Y here to enable the Mitsumi MM8013 fuel gauge driver. ++ It enables the monitoring of many battery parameters, including ++ the state of charge, temperature, cycle count, actual and design ++ capacity, etc. ++ ++config BATTERY_RK818 ++ bool "RK818 Battery driver" + depends on MFD_RK808 + default n + help -+ If you say yes here you will get support for the charger of RK818 PMIC. -+ This driver can give support for Rk818 Charger Interface. ++ If you say yes here you will get support for the battery of RK818 PMIC. ++ This driver can give support for Rk818 Battery Charge Interface. + endif # POWER_SUPPLY -diff -rupN linux.orig/drivers/power/supply/Makefile linux/drivers/power/supply/Makefile ---- linux.orig/drivers/power/supply/Makefile 2023-09-12 12:02:58.745642709 +0000 -+++ linux/drivers/power/supply/Makefile 2023-09-12 12:03:27.490291628 +0000 -@@ -110,3 +110,4 @@ obj-$(CONFIG_BATTERY_ACER_A500) += acer_ - obj-$(CONFIG_BATTERY_SURFACE) += surface_battery.o - obj-$(CONFIG_CHARGER_SURFACE) += surface_charger.o +diff --git a/drivers/power/supply/Makefile b/drivers/power/supply/Makefile +index 58b567278034..aa3de47be2c5 100644 +--- a/drivers/power/supply/Makefile ++++ b/drivers/power/supply/Makefile +@@ -114,3 +114,4 @@ obj-$(CONFIG_CHARGER_SURFACE) += surface_charger.o obj-$(CONFIG_BATTERY_UG3105) += ug3105_battery.o -+obj-$(CONFIG_CHARGER_RK818) += rk818_charger.o rk818_battery.o -diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/supply/rk818_battery.c ---- linux.orig/drivers/power/supply/rk818_battery.c 1970-01-01 00:00:00.000000000 +0000 -+++ linux/drivers/power/supply/rk818_battery.c 2023-09-12 12:03:27.490291628 +0000 -@@ -0,0 +1,3498 @@ + obj-$(CONFIG_CHARGER_QCOM_SMB2) += qcom_pmi8998_charger.o + obj-$(CONFIG_FUEL_GAUGE_MM8013) += mm8013.o ++obj-$(CONFIG_BATTERY_RK818) += rk818_battery.o +diff --git a/drivers/power/supply/rk818_battery.c b/drivers/power/supply/rk818_battery.c +new file mode 100644 +index 000000000000..f09f45605a8b +--- /dev/null ++++ b/drivers/power/supply/rk818_battery.c +@@ -0,0 +1,3568 @@ +/* + * rk818 battery driver + * @@ -245,6 +353,7 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s + bool sleep_chrg_online; + u8 sleep_chrg_status; + bool adc_allow_update; ++ int fb_blank; + bool s2r; /*suspend to resume*/ + u32 work_mode; + int temperature; @@ -920,23 +1029,86 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s + POWER_SUPPLY_PROP_CURRENT_MAX, +}; + ++static int rk818_bat_get_usb_psy(struct device *dev, void *data) ++{ ++ struct rk818_battery *di = data; ++ struct power_supply *psy = dev_get_drvdata(dev); ++ ++ if (psy->desc->type == POWER_SUPPLY_TYPE_USB) { ++ di->usb_psy = psy; ++ return 1; ++ } ++ ++ return 0; ++} ++ ++static int rk818_bat_get_ac_psy(struct device *dev, void *data) ++{ ++ struct rk818_battery *di = data; ++ struct power_supply *psy = dev_get_drvdata(dev); ++ ++ if (psy->desc->type == POWER_SUPPLY_TYPE_MAINS) { ++ di->ac_psy = psy; ++ return 1; ++ } ++ ++ return 0; ++} ++ ++static void rk818_bat_get_chrg_psy(struct rk818_battery *di) ++{ ++ if (!di->usb_psy) ++ class_for_each_device(power_supply_class, NULL, (void *)di, ++ rk818_bat_get_usb_psy); ++ if (!di->ac_psy) ++ class_for_each_device(power_supply_class, NULL, (void *)di, ++ rk818_bat_get_ac_psy); ++} ++ +static int rk818_bat_get_charge_state(struct rk818_battery *di) +{ -+ return di->current_avg > 0; ++ union power_supply_propval val; ++ int ret; ++ ++ if (!di->usb_psy || !di->ac_psy) ++ rk818_bat_get_chrg_psy(di); ++ ++ if (di->usb_psy) { ++ ret = di->usb_psy->desc->get_property(di->usb_psy, ++ POWER_SUPPLY_PROP_ONLINE, ++ &val); ++ if (!ret) ++ di->usb_in = val.intval; ++ } ++ ++ if (di->ac_psy) { ++ ret = di->ac_psy->desc->get_property(di->ac_psy, ++ POWER_SUPPLY_PROP_ONLINE, ++ &val); ++ if (!ret) ++ di->ac_in = val.intval; ++ } ++ ++ DBG("%s: ac_online=%d, usb_online=%d\n", ++ __func__, di->ac_in, di->usb_in); ++ ++ return (di->usb_in || di->ac_in); +} + -+int rk818_battery_get_property(struct rk818_battery *di, -+ enum power_supply_property psp, -+ union power_supply_propval *val) ++static int rk818_battery_get_property(struct power_supply *psy, ++ enum power_supply_property psp, ++ union power_supply_propval *val) +{ ++ struct rk818_battery *di = power_supply_get_drvdata(psy); ++ + switch (psp) { + case POWER_SUPPLY_PROP_CURRENT_NOW: -+ val->intval = rk818_bat_get_avg_current(di) * 1000;/*uA*/ ++ val->intval = di->current_avg * 1000;/*uA*/ + if (di->pdata->bat_mode == MODE_VIRTUAL) + val->intval = VIRTUAL_CURRENT * 1000; + break; + case POWER_SUPPLY_PROP_VOLTAGE_NOW: -+ val->intval = rk818_bat_get_avg_voltage(di) * 1000;/*uV*/ ++ val->intval = di->voltage_avg * 1000;/*uV*/ + if (di->pdata->bat_mode == MODE_VIRTUAL) + val->intval = VIRTUAL_VOLTAGE * 1000; + break; @@ -987,26 +1159,16 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s + + return 0; +} -+EXPORT_SYMBOL_GPL(rk818_battery_get_property); -+ -+static int rk818_battery_get_property_psy(struct power_supply *psy, -+ enum power_supply_property psp, -+ union power_supply_propval *val) -+{ -+ struct rk818_battery *di = power_supply_get_drvdata(psy); -+ -+ return rk818_battery_get_property(di, psp, val); -+} + +static const struct power_supply_desc rk818_bat_desc = { + .name = "battery", + .type = POWER_SUPPLY_TYPE_BATTERY, + .properties = rk818_bat_props, + .num_properties = ARRAY_SIZE(rk818_bat_props), -+ .get_property = rk818_battery_get_property_psy, ++ .get_property = rk818_battery_get_property, +}; + -+static __maybe_unused int rk818_bat_init_power_supply(struct rk818_battery *di) ++static int rk818_bat_init_power_supply(struct rk818_battery *di) +{ + struct power_supply_config psy_cfg = { .drv_data = di, }; + @@ -1132,6 +1294,34 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s + rk818_bat_write(di, RK818_REBOOT_CNT_REG, save_cnt); +} + ++static int rk818_bat_fb_notifier(struct notifier_block *nb, ++ unsigned long event, void *data) ++{ ++ struct rk818_battery *di; ++ struct fb_event *evdata = data; ++ ++ if (event != FB_EARLY_EVENT_BLANK && event != FB_EVENT_BLANK) ++ return NOTIFY_OK; ++ ++ di = container_of(nb, struct rk818_battery, fb_nb); ++ di->fb_blank = *(int *)evdata->data; ++ ++ return 0; ++} ++ ++static int rk818_bat_register_fb_notify(struct rk818_battery *di) ++{ ++ memset(&di->fb_nb, 0, sizeof(di->fb_nb)); ++ di->fb_nb.notifier_call = rk818_bat_fb_notifier; ++ ++ return fb_register_client(&di->fb_nb); ++} ++ ++static int rk818_bat_unregister_fb_notify(struct rk818_battery *di) ++{ ++ return fb_unregister_client(&di->fb_nb); ++} ++ +static u8 rk818_bat_get_halt_cnt(struct rk818_battery *di) +{ + return rk818_bat_read(di, RK818_HALT_CNT_REG); @@ -1519,7 +1709,7 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s + int ocv_cap, dead_cap, xsoc; + int ocv_soc, dead_soc; + int pwroff_vol; -+ int i, cnt = 0, vol_old, vol_now; ++ int i, cnt, vol_old, vol_now; + int org_linek = 0, min_gap_xsoc; + + if ((abs(di->current_avg) < 500) && (di->dsoc > 10)) @@ -1891,7 +2081,7 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s + "Dsoc=%d, Rsoc=%d, Vavg=%d, Iavg=%d, Cap=%d, Fcc=%d, d=%d\n" + "K=%d, Mode=%s, Oldcap=%d, Is=%d, Ip=%d, Vs=%d\n" + "fb_temp=%d, bat_temp=%d, sample_res=%d, USB=%d, DC=%d\n" -+ "off:i=0x%x, c=0x%x, p=%d, Rbat=%d, age_ocv_cap=%d, hot=%d\n" ++ "off:i=0x%x, c=0x%x, p=%d, Rbat=%d, age_ocv_cap=%d, fb=%d, hot=%d\n" + "adp:finish=%lu, boot_min=%lu, sleep_min=%lu, adc=%d, Vsys=%d\n" + "bat:%s, meet: soc=%d, calc: dsoc=%d, rsoc=%d, Vocv=%d\n" + "pwr: dsoc=%d, rsoc=%d, vol=%d, halt: st=%d, cnt=%d, reboot=%d\n" @@ -1908,7 +2098,7 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s + di->pdata->sample_res, di->usb_in, di->ac_in, + rk818_bat_get_ioffset(di), + rk818_bat_get_coffset(di), di->poffset, di->bat_res, -+ di->age_adjust_cap, !!(thermal & HOTDIE_STS), ++ di->age_adjust_cap, di->fb_blank, !!(thermal & HOTDIE_STS), + base2min(di->finish_base), + base2min(di->boot_base), di->sleep_sum_sec / 60, + di->adc_allow_update, @@ -2458,10 +2648,7 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s + status = (status & CHRG_STATUS_MSK) >> 4; + old_soc = di->dsoc; + di->last_dsoc = di->dsoc; -+ -+ if (di->bat) -+ power_supply_changed(di->bat); -+ ++ power_supply_changed(di->bat); + BAT_INFO("changed: dsoc=%d, rsoc=%d, v=%d, ov=%d c=%d, " + "cap=%d, f=%d, st=%s, hotdie=%d\n", + di->dsoc, di->rsoc, di->voltage_avg, di->voltage_ocv, @@ -2505,12 +2692,13 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s + int est_vol, remain_cap; + static unsigned long sec; + -+ if (di->remain_cap < 0) { ++ if ((di->remain_cap < 0) && (di->fb_blank != 0)) { + if (!sec) + sec = get_boot_sec(); ++ // wake_lock_timeout(&di->wake_lock, ++ // (di->pdata->monitor_sec + 1) * HZ); + + DBG("sec=%ld, hold_sec=%ld\n", sec, base2sec(sec)); -+ + if (base2sec(sec) >= 60) { + sec = 0; + di->dbg_cap_low0++; @@ -2520,6 +2708,7 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s + rk818_bat_init_capacity(di, remain_cap); + BAT_INFO("adjust cap below 0 --> %d, rsoc=%d\n", + di->remain_cap, di->rsoc); ++ // wake_unlock(&di->wake_lock); + } + } else { + sec = 0; @@ -2958,6 +3147,7 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s +{ + struct rk818_battery *di = (struct rk818_battery *)bat; + ++ di->dsoc = 0; + rk_send_wakeup_key(); + BAT_INFO("lower power yet, power off system! v=%d, c=%d, dsoc=%d\n", + di->voltage_avg, di->current_avg, di->dsoc); @@ -3048,7 +3238,6 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s +{ + u8 val; + -+#if 0 + /* set vbat lowest 3.0v shutdown */ + val = rk818_bat_read(di, RK818_VB_MON_REG); + val &= ~(VBAT_LOW_VOL_MASK | VBAT_LOW_ACT_MASK); @@ -3058,13 +3247,6 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s + /* disable low irq */ + rk818_bat_set_bits(di, RK818_INT_STS_MSK_REG1, + VB_LOW_INT_EN, VB_LOW_INT_EN); -+#endif -+ -+ val = rk818_bat_read(di, RK818_VB_MON_REG); -+ val &= (~(VBAT_LOW_VOL_MASK | VBAT_LOW_ACT_MASK)); -+ val |= (RK818_VBAT_LOW_3V4 | EN_VBAT_LOW_IRQ); -+ rk818_bat_write(di, RK818_VB_MON_REG, val); -+ rk818_bat_set_bits(di, RK818_INT_STS_MSK_REG1, VB_LOW_INT_EN, 0); +} + +static void rk818_bat_init_fg(struct rk818_battery *di) @@ -3293,18 +3475,10 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s +#endif + +static const struct of_device_id rk818_battery_of_match[] = { -+ { .compatible = "rockchip,rk818-battery", }, ++ {.compatible = "rk818-battery",}, + { }, +}; + -+static struct rk818_battery* bat; -+ -+struct rk818_battery* rk818_battery_get(void) -+{ -+ return bat; -+} -+EXPORT_SYMBOL_GPL(rk818_battery_get); -+ +static int rk818_battery_probe(struct platform_device *pdev) +{ + const struct of_device_id *of_id = @@ -3345,17 +3519,16 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s + return ret; + } + -+ /* + ret = rk818_bat_init_power_supply(di); + if (ret) { + dev_err(di->dev, "rk818 power supply register failed!\n"); + return ret; + } -+ */ + + rk818_bat_init_info(di); + rk818_bat_init_fg(di); + rk818_bat_init_sysfs(di); ++ rk818_bat_register_fb_notify(di); + //wake_lock_init(&di->wake_lock, WAKE_LOCK_SUSPEND, "rk818_bat_lock"); + di->bat_monitor_wq = alloc_ordered_workqueue("%s", + WQ_MEM_RECLAIM | WQ_FREEZABLE, "rk818-bat-monitor-wq"); @@ -3365,7 +3538,6 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s + + BAT_INFO("driver version %s\n", DRIVER_VERSION); + -+ bat = di; + return ret; +} + @@ -3465,7 +3637,12 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s + rk818_bat_save_data(di); + + /* set vbat lowest 3.0v shutdown */ -+ rk818_bat_set_shtd_vol(di); ++ val = rk818_bat_read(di, RK818_VB_MON_REG); ++ val &= ~(VBAT_LOW_VOL_MASK | VBAT_LOW_ACT_MASK); ++ val |= (RK818_VBAT_LOW_3V0 | EN_VABT_LOW_SHUT_DOWN); ++ rk818_bat_write(di, RK818_VB_MON_REG, val); ++ rk818_bat_set_bits(di, RK818_INT_STS_MSK_REG1, ++ VB_LOW_INT_EN, VB_LOW_INT_EN); + + /* charge/lowpower lock: for battery work to update dsoc and rsoc */ + // if ((di->sleep_chrg_online) || @@ -3485,6 +3662,7 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s + + cancel_delayed_work_sync(&di->bat_delay_work); + cancel_delayed_work_sync(&di->calib_delay_work); ++ rk818_bat_unregister_fb_notify(di); + del_timer(&di->caltimer); + if (base2sec(di->boot_base) < REBOOT_PERIOD_SEC) + cnt = rk818_bat_check_reboot(di); @@ -3524,9 +3702,12 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.c linux/drivers/power/s +MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:rk818-battery"); +MODULE_AUTHOR("chenjh"); -diff -rupN linux.orig/drivers/power/supply/rk818_battery.h linux/drivers/power/supply/rk818_battery.h ---- linux.orig/drivers/power/supply/rk818_battery.h 1970-01-01 00:00:00.000000000 +0000 -+++ linux/drivers/power/supply/rk818_battery.h 2023-09-12 12:03:27.490291628 +0000 +\ No newline at end of file +diff --git a/drivers/power/supply/rk818_battery.h b/drivers/power/supply/rk818_battery.h +new file mode 100644 +index 000000000000..2f4430a98167 +--- /dev/null ++++ b/drivers/power/supply/rk818_battery.h @@ -0,0 +1,168 @@ +/* + * rk818_battery.h: fuel gauge driver structures @@ -3696,739 +3877,11 @@ diff -rupN linux.orig/drivers/power/supply/rk818_battery.h linux/drivers/power/s +int rk818_bat_temp_notifier_unregister(struct notifier_block *nb); + +#endif -diff -rupN linux.orig/drivers/power/supply/rk818_charger.c linux/drivers/power/supply/rk818_charger.c ---- linux.orig/drivers/power/supply/rk818_charger.c 1970-01-01 00:00:00.000000000 +0000 -+++ linux/drivers/power/supply/rk818_charger.c 2023-09-12 12:03:27.490291628 +0000 -@@ -0,0 +1,726 @@ -+// SPDX-License-Identifier: GPL-2.0-only -+/* -+ * rk818 usb power driver -+ * -+ * Copyright (c) 2021 OndÅ™ej Jirman -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define RK818_CHG_STS_MASK (7u << 4) /* charger status */ -+#define RK818_CHG_STS_NONE (0u << 4) -+#define RK818_CHG_STS_WAKEUP_CUR (1u << 4) -+#define RK818_CHG_STS_TRICKLE_CUR (2u << 4) -+#define RK818_CHG_STS_CC_OR_CV (3u << 4) -+#define RK818_CHG_STS_TERMINATED (4u << 4) -+#define RK818_CHG_STS_USB_OV (5u << 4) -+#define RK818_CHG_STS_BAT_TEMP_FAULT (6u << 4) -+#define RK818_CHG_STS_TIMEOUT (7u << 4) -+ -+/* RK818_SUP_STS_REG */ -+#define RK818_SUP_STS_USB_VLIM_EN BIT(3) /* input voltage limit enable */ -+#define RK818_SUP_STS_USB_ILIM_EN BIT(2) /* input current limit enable */ -+#define RK818_SUP_STS_USB_EXS BIT(1) /* USB power connected */ -+#define RK818_SUP_STS_USB_EFF BIT(0) /* USB fault */ -+ -+/* RK818_USB_CTRL_REG */ -+#define RK818_USB_CTRL_USB_ILIM_MASK (0xfu) -+#define RK818_USB_CTRL_USB_CHG_SD_VSEL_OFFSET 4 -+#define RK818_USB_CTRL_USB_CHG_SD_VSEL_MASK (0x7u << 4) -+ -+/* RK818_CHRG_CTRL_REG1 */ -+#define RK818_CHRG_CTRL_REG1_CHRG_EN BIT(7) -+#define RK818_CHRG_CTRL_REG1_CHRG_VOL_SEL_OFFSET 4 -+#define RK818_CHRG_CTRL_REG1_CHRG_VOL_SEL_MASK (0x7u << 4) -+#define RK818_CHRG_CTRL_REG1_CHRG_CUR_SEL_OFFSET 0 -+#define RK818_CHRG_CTRL_REG1_CHRG_CUR_SEL_MASK (0xfu << 0) -+ -+/* RK818_CHRG_CTRL_REG3 */ -+#define RK818_CHRG_CTRL_REG3_CHRG_TERM_DIGITAL BIT(5) -+ -+struct rk818_charger { -+ struct device *dev; -+ struct rk808 *rk818; -+ struct regmap *regmap; -+ -+ struct power_supply *usb_psy; -+ struct power_supply *charger_psy; -+ -+ bool apply_ilim; -+}; -+ -+// {{{ USB supply -+ -+static int rk818_usb_set_input_current_max(struct rk818_charger *cg, -+ int val) -+{ -+ int ret; -+ unsigned reg; -+ -+ if (val < 450000) -+ reg = 1; -+ else if (val < 850000) -+ reg = 0; -+ else if (val < 1000000) -+ reg = 2; -+ else if (val < 3000000) -+ reg = 3 + (val - 1000000) / 250000; -+ else -+ reg = 11; -+ -+ dev_info(cg->dev, "applying input current limit %d mA\n", val / 1000); -+ -+ ret = regmap_update_bits(cg->regmap, RK818_USB_CTRL_REG, -+ RK818_USB_CTRL_USB_ILIM_MASK, reg); -+ if (ret) -+ dev_err(cg->dev, -+ "USB input current limit setting failed (%d)\n", ret); -+ -+ return ret; -+} -+ -+static int rk818_usb_get_input_current_max(struct rk818_charger *cg, -+ int *val) -+{ -+ unsigned reg; -+ int ret; -+ -+ ret = regmap_read(cg->regmap, RK818_USB_CTRL_REG, ®); -+ if (ret) { -+ dev_err(cg->dev, -+ "USB input current limit getting failed (%d)\n", ret); -+ return ret; -+ } -+ -+ reg &= RK818_USB_CTRL_USB_ILIM_MASK; -+ if (reg == 0) -+ *val = 450000; -+ else if (reg == 1) -+ *val = 80000; -+ else if (reg == 2) -+ *val = 850000; -+ else if (reg < 11) -+ *val = 1000000 + (reg - 3) * 250000; -+ else -+ *val = 3000000; -+ -+ return 0; -+} -+ -+static int rk818_usb_set_input_voltage_min(struct rk818_charger *cg, -+ int val) -+{ -+ unsigned reg; -+ int ret; -+ -+ if (val < 2780000) -+ reg = 0; -+ else if (val < 3270000) -+ reg = (val - 2780000) / 70000; -+ else -+ reg = 7; -+ -+ ret = regmap_update_bits(cg->regmap, RK818_USB_CTRL_REG, -+ RK818_USB_CTRL_USB_CHG_SD_VSEL_MASK, -+ reg << RK818_USB_CTRL_USB_CHG_SD_VSEL_OFFSET); -+ if (ret) -+ dev_err(cg->dev, -+ "USB input voltage limit setting failed (%d)\n", ret); -+ -+ return ret; -+} -+ -+static int rk818_usb_get_input_voltage_min(struct rk818_charger *cg, -+ int *val) -+{ -+ unsigned reg; -+ int ret; -+ -+ ret = regmap_read(cg->regmap, RK818_USB_CTRL_REG, ®); -+ if (ret) { -+ dev_err(cg->dev, -+ "USB input voltage limit getting failed (%d)\n", ret); -+ return ret; -+ } -+ -+ reg &= RK818_USB_CTRL_USB_CHG_SD_VSEL_MASK; -+ reg >>= RK818_USB_CTRL_USB_CHG_SD_VSEL_OFFSET; -+ -+ *val = 2780000 + (reg * 70000); -+ -+ return 0; -+} -+ -+static int rk818_usb_power_get_property(struct power_supply *psy, -+ enum power_supply_property psp, -+ union power_supply_propval *val) -+{ -+ struct rk818_charger *cg = power_supply_get_drvdata(psy); -+ unsigned reg; -+ int ret; -+ -+ switch (psp) { -+ case POWER_SUPPLY_PROP_PRESENT: -+ ret = regmap_read(cg->regmap, RK818_SUP_STS_REG, ®); -+ if (ret) -+ return ret; -+ -+ val->intval = !!(reg & RK818_SUP_STS_USB_EXS); -+ break; -+ -+ case POWER_SUPPLY_PROP_HEALTH: -+ ret = regmap_read(cg->regmap, RK818_SUP_STS_REG, ®); -+ if (ret) -+ return ret; -+ -+ if (!(reg & RK818_SUP_STS_USB_EXS)) { -+ val->intval = POWER_SUPPLY_HEALTH_UNKNOWN; -+ } else if (reg & RK818_SUP_STS_USB_EFF) { -+ val->intval = POWER_SUPPLY_HEALTH_GOOD; -+ } else { -+ val->intval = POWER_SUPPLY_HEALTH_UNSPEC_FAILURE; -+ } -+ -+ break; -+ -+ case POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT: -+ return rk818_usb_get_input_voltage_min(cg, &val->intval); -+ -+ case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT: -+ return rk818_usb_get_input_current_max(cg, &val->intval); -+ -+ default: -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+static int rk818_usb_power_set_property(struct power_supply *psy, -+ enum power_supply_property psp, -+ const union power_supply_propval *val) -+{ -+ struct rk818_charger *cg = power_supply_get_drvdata(psy); -+ -+ switch (psp) { -+ case POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT: -+ return rk818_usb_set_input_voltage_min(cg, val->intval); -+ -+ case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT: -+ return rk818_usb_set_input_current_max(cg, val->intval); -+ -+ default: -+ return -EINVAL; -+ } -+} -+ -+static int rk818_usb_power_prop_writeable(struct power_supply *psy, -+ enum power_supply_property psp) -+{ -+ switch (psp) { -+ case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT: -+ case POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT: -+ return 1; -+ -+ default: -+ return 0; -+ } -+} -+ -+/* Sync the input-current-limit with our parent supply (if we have one) */ -+static void rk818_usb_power_external_power_changed(struct power_supply *psy) -+{ -+ struct rk818_charger *cg = power_supply_get_drvdata(psy); -+ union power_supply_propval val; -+ int ret; -+ -+ ret = power_supply_get_property_from_supplier(cg->usb_psy, -+ POWER_SUPPLY_PROP_CURRENT_MAX, -+ &val); -+ if (ret) -+ return; -+ -+ /* -+ * We only want to start applying input current limit after we get first -+ * non-0 value from the supplier. Until then, we keep the limit applied -+ * by the bootloader. If we lower the limit before the charger is properly -+ * detected, we risk boot failure due to insufficient power. -+ */ -+ if (!cg->apply_ilim) { -+ if (!val.intval) -+ return; -+ -+ cg->apply_ilim = true; -+ } -+ -+ if (val.intval < 500000) -+ val.intval = 500000; -+ -+ rk818_usb_power_set_property(cg->usb_psy, -+ POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, -+ &val); -+} -+ -+static enum power_supply_property rk818_usb_power_props[] = { -+ POWER_SUPPLY_PROP_PRESENT, -+ POWER_SUPPLY_PROP_HEALTH, -+ POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, -+ POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT, -+}; -+ -+static const struct power_supply_desc rk818_usb_desc = { -+ .name = "rk818-usb-charger", -+ .type = POWER_SUPPLY_TYPE_USB, -+ .properties = rk818_usb_power_props, -+ .num_properties = ARRAY_SIZE(rk818_usb_power_props), -+ .property_is_writeable = rk818_usb_power_prop_writeable, -+ .get_property = rk818_usb_power_get_property, -+ .set_property = rk818_usb_power_set_property, -+ .external_power_changed = rk818_usb_power_external_power_changed, -+}; -+ -+// }}} -+// {{{ Charger supply -+ -+static int rk818_charger_set_current_max(struct rk818_charger *cg, int val) -+{ -+ unsigned reg; -+ int ret; -+ -+ if (val < 1000000) -+ reg = 0; -+ else if (val < 3000000) -+ reg = (val - 1000000) / 200000; -+ else -+ reg = 10; -+ -+ ret = regmap_update_bits(cg->regmap, RK818_CHRG_CTRL_REG1, -+ RK818_CHRG_CTRL_REG1_CHRG_CUR_SEL_MASK, -+ reg << RK818_CHRG_CTRL_REG1_CHRG_CUR_SEL_OFFSET); -+ if (ret) -+ dev_err(cg->dev, -+ "Charging max current setting failed (%d)\n", ret); -+ -+ return ret; -+} -+ -+static int rk818_charger_get_current_max(struct rk818_charger *cg, int *val) -+{ -+ unsigned reg; -+ int ret; -+ -+ ret = regmap_read(cg->regmap, RK818_CHRG_CTRL_REG1, ®); -+ if (ret) { -+ dev_err(cg->dev, -+ "Charging max current getting failed (%d)\n", ret); -+ return ret; -+ } -+ -+ reg &= RK818_CHRG_CTRL_REG1_CHRG_CUR_SEL_MASK; -+ reg >>= RK818_CHRG_CTRL_REG1_CHRG_CUR_SEL_OFFSET; -+ -+ *val = 1000000 + reg * 200000; -+ -+ return 0; -+} -+ -+static int rk818_charger_set_voltage_max(struct rk818_charger *cg, int val) -+{ -+ unsigned reg; -+ int ret; -+ -+ if (val < 4050000) -+ reg = 0; -+ else if (val < 4350000) -+ reg = (val - 4050000) / 50000; -+ else -+ reg = 6; -+ -+ ret = regmap_update_bits(cg->regmap, RK818_CHRG_CTRL_REG1, -+ RK818_CHRG_CTRL_REG1_CHRG_VOL_SEL_MASK, -+ reg << RK818_CHRG_CTRL_REG1_CHRG_VOL_SEL_OFFSET); -+ if (ret) -+ dev_err(cg->dev, -+ "Charging end voltage setting failed (%d)\n", ret); -+ -+ return ret; -+} -+ -+static int rk818_charger_get_voltage_max(struct rk818_charger *cg, int *val) -+{ -+ unsigned reg; -+ int ret; -+ -+ ret = regmap_read(cg->regmap, RK818_CHRG_CTRL_REG1, ®); -+ if (ret) { -+ dev_err(cg->dev, -+ "Charging end voltage getting failed (%d)\n", ret); -+ return ret; -+ } -+ -+ reg &= RK818_CHRG_CTRL_REG1_CHRG_VOL_SEL_MASK; -+ reg >>= RK818_CHRG_CTRL_REG1_CHRG_VOL_SEL_OFFSET; -+ -+ *val = 4050000 + reg * 50000; -+ -+ return 0; -+} -+ -+struct rk818_battery; -+struct rk818_battery* rk818_battery_get(void); -+int rk818_battery_get_property(struct rk818_battery *di, -+ enum power_supply_property psp, -+ union power_supply_propval *val); -+ -+static int rk818_charger_get_property(struct power_supply *psy, -+ enum power_supply_property psp, -+ union power_supply_propval *val) -+{ -+ struct rk818_charger *cg = power_supply_get_drvdata(psy); -+ struct rk818_battery* di = rk818_battery_get(); -+ unsigned reg; -+ int ret; -+ -+ switch (psp) { -+ case POWER_SUPPLY_PROP_CURRENT_NOW: -+ case POWER_SUPPLY_PROP_VOLTAGE_NOW: -+ case POWER_SUPPLY_PROP_PRESENT: -+ case POWER_SUPPLY_PROP_CAPACITY: -+ case POWER_SUPPLY_PROP_TEMP: -+ case POWER_SUPPLY_PROP_STATUS: -+ case POWER_SUPPLY_PROP_CHARGE_COUNTER: -+ case POWER_SUPPLY_PROP_CHARGE_FULL: -+ if (!di) -+ return -ENODEV; -+ return rk818_battery_get_property(di, psp, val); -+ default:; -+ } -+ -+ switch (psp) { -+ case POWER_SUPPLY_PROP_ONLINE: -+ ret = regmap_read(cg->regmap, RK818_CHRG_CTRL_REG1, ®); -+ if (ret) { -+ dev_err(cg->dev, "failed to read the charger state (%d)\n", ret); -+ return ret; -+ } -+ -+ val->intval = !!(reg & RK818_CHRG_CTRL_REG1_CHRG_EN); -+ break; -+ -+ case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR: -+ ret = regmap_read(cg->regmap, RK818_CHRG_CTRL_REG1, ®); -+ if (ret) { -+ dev_err(cg->dev, "failed to read the charger state (%d)\n", ret); -+ return ret; -+ } -+ -+ if (reg & RK818_CHRG_CTRL_REG1_CHRG_EN) -+ val->intval = POWER_SUPPLY_CHARGE_BEHAVIOUR_AUTO; -+ else -+ val->intval = POWER_SUPPLY_CHARGE_BEHAVIOUR_INHIBIT_CHARGE; -+ -+ return 0; -+ -+ case POWER_SUPPLY_PROP_STATUS: -+ ret = regmap_read(cg->regmap, RK818_SUP_STS_REG, ®); -+ if (ret) -+ return ret; -+ -+ switch (reg & RK818_CHG_STS_MASK) { -+ case RK818_CHG_STS_WAKEUP_CUR: -+ case RK818_CHG_STS_TRICKLE_CUR: -+ case RK818_CHG_STS_CC_OR_CV: -+ val->intval = POWER_SUPPLY_STATUS_CHARGING; -+ break; -+ case RK818_CHG_STS_TERMINATED: -+ default: -+ val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; -+ break; -+ } -+ -+ break; -+ -+ case POWER_SUPPLY_PROP_CHARGE_TYPE: -+ ret = regmap_read(cg->regmap, RK818_SUP_STS_REG, ®); -+ if (ret) -+ return ret; -+ -+ switch (reg & RK818_CHG_STS_MASK) { -+ case RK818_CHG_STS_WAKEUP_CUR: -+ case RK818_CHG_STS_TRICKLE_CUR: -+ val->intval = POWER_SUPPLY_CHARGE_TYPE_TRICKLE; -+ break; -+ case RK818_CHG_STS_CC_OR_CV: -+ val->intval = POWER_SUPPLY_CHARGE_TYPE_FAST; -+ break; -+ case RK818_CHG_STS_TERMINATED: -+ val->intval = POWER_SUPPLY_CHARGE_TYPE_NONE; -+ break; -+ default: -+ val->intval = POWER_SUPPLY_CHARGE_TYPE_UNKNOWN; -+ break; -+ } -+ -+ break; -+ -+ case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT: -+ ret = regmap_read(cg->regmap, RK818_CHRG_CTRL_REG2, ®); -+ if (ret) -+ return ret; -+ -+ val->intval = 100000 + ((reg >> 6) & 3) * 50000; -+ break; -+ -+ case POWER_SUPPLY_PROP_HEALTH: -+ ret = regmap_read(cg->regmap, RK818_SUP_STS_REG, ®); -+ if (ret) -+ return ret; -+ -+ switch (reg & RK818_CHG_STS_MASK) { -+ case RK818_CHG_STS_USB_OV: -+ val->intval = POWER_SUPPLY_HEALTH_OVERVOLTAGE; -+ break; -+ case RK818_CHG_STS_BAT_TEMP_FAULT: -+ val->intval = POWER_SUPPLY_HEALTH_OVERHEAT; -+ break; -+ case RK818_CHG_STS_TIMEOUT: -+ val->intval = POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE; -+ break; -+ default: -+ val->intval = POWER_SUPPLY_HEALTH_GOOD; -+ break; -+ } -+ -+ break; -+ -+ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE: -+ return rk818_charger_get_voltage_max(cg, &val->intval); -+ -+ case POWER_SUPPLY_PROP_PRECHARGE_CURRENT: -+ ret = rk818_charger_get_current_max(cg, &val->intval); -+ val->intval /= 10; -+ return ret; -+ -+ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT: -+ return rk818_charger_get_current_max(cg, &val->intval); -+ -+ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX: -+ val->intval = 4350000; -+ break; -+ -+ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX: -+ val->intval = 3000000; -+ break; -+ -+ case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN: -+ val->intval = 11400000; -+ return 0; -+ -+ case POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN: -+ val->intval = 0; -+ return 0; -+ -+ default: -+ return -EINVAL; -+ } -+ -+ return 0; -+} -+ -+static int rk818_charger_set_property(struct power_supply *psy, -+ enum power_supply_property psp, -+ const union power_supply_propval *val) -+{ -+ struct rk818_charger *cg = power_supply_get_drvdata(psy); -+ int ret; -+ -+ switch (psp) { -+ case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR: -+ switch (val->intval) { -+ case POWER_SUPPLY_CHARGE_BEHAVIOUR_AUTO: -+ return regmap_update_bits(cg->regmap, RK818_CHRG_CTRL_REG1, -+ RK818_CHRG_CTRL_REG1_CHRG_EN, -+ RK818_CHRG_CTRL_REG1_CHRG_EN); -+ case POWER_SUPPLY_CHARGE_BEHAVIOUR_INHIBIT_CHARGE: -+ return regmap_update_bits(cg->regmap, RK818_CHRG_CTRL_REG1, -+ RK818_CHRG_CTRL_REG1_CHRG_EN, 0); -+ default: -+ return -EINVAL; -+ } -+ -+ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE: -+ return rk818_charger_set_voltage_max(cg, val->intval); -+ -+ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT: -+ return rk818_charger_set_current_max(cg, val->intval); -+ -+ default: -+ return -EINVAL; -+ } -+} -+ -+static int rk818_charger_prop_writeable(struct power_supply *psy, -+ enum power_supply_property psp) -+{ -+ switch (psp) { -+ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT: -+ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE: -+ case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR: -+ return 1; -+ -+ default: -+ return 0; -+ } -+} -+ -+static enum power_supply_property rk818_charger_props[] = { -+ POWER_SUPPLY_PROP_ONLINE, -+ POWER_SUPPLY_PROP_HEALTH, -+ POWER_SUPPLY_PROP_STATUS, -+ POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR, -+ POWER_SUPPLY_PROP_CHARGE_TYPE, -+ POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT, -+ POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT, -+ POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE, -+ POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX, -+ POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX, -+ POWER_SUPPLY_PROP_PRECHARGE_CURRENT, -+ POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, -+ POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN, -+ -+ // inherited from BSP battery driver -+ POWER_SUPPLY_PROP_CURRENT_NOW, -+ POWER_SUPPLY_PROP_VOLTAGE_NOW, -+ POWER_SUPPLY_PROP_PRESENT, -+ POWER_SUPPLY_PROP_CAPACITY, -+ POWER_SUPPLY_PROP_TEMP, -+ POWER_SUPPLY_PROP_CHARGE_COUNTER, -+ POWER_SUPPLY_PROP_CHARGE_FULL, -+}; -+ -+/* -+ * We import some capacity tracking functionality from the BSP battery driver. -+ * Some poor soul will have to understand and clean up the BSP battery driver, -+ * but not me, not now. :) -+ */ -+static const struct power_supply_desc rk818_charger_desc = { -+ .name = "battery", -+ .type = POWER_SUPPLY_TYPE_BATTERY, -+ .properties = rk818_charger_props, -+ .num_properties = ARRAY_SIZE(rk818_charger_props), -+ .property_is_writeable = rk818_charger_prop_writeable, -+ .get_property = rk818_charger_get_property, -+ .set_property = rk818_charger_set_property, -+}; -+ -+// }}} -+ -+static int rk818_charger_probe(struct platform_device *pdev) -+{ -+ struct rk808 *rk818 = dev_get_drvdata(pdev->dev.parent); -+ struct power_supply_config psy_cfg = { }; -+ struct device *dev = &pdev->dev; -+ struct rk818_charger *cg; -+ int ret; -+ -+ cg = devm_kzalloc(dev, sizeof(*cg), GFP_KERNEL); -+ if (!cg) -+ return -ENOMEM; -+ -+ cg->rk818 = rk818; -+ cg->dev = dev; -+ cg->regmap = rk818->regmap; -+ platform_set_drvdata(pdev, cg); -+ -+ psy_cfg.drv_data = cg; -+ psy_cfg.of_node = dev->of_node; -+ -+ cg->usb_psy = devm_power_supply_register(dev, &rk818_usb_desc, -+ &psy_cfg); -+ if (IS_ERR(cg->usb_psy)) -+ return dev_err_probe(dev, PTR_ERR(cg->usb_psy), -+ "register usb power supply fail\n"); -+ -+ cg->charger_psy = devm_power_supply_register(dev, &rk818_charger_desc, -+ &psy_cfg); -+ if (IS_ERR(cg->charger_psy)) -+ return dev_err_probe(dev, PTR_ERR(cg->charger_psy), -+ "register charger power supply fail\n"); -+ -+ /* disable voltage limit and enable input current limit */ -+ ret = regmap_update_bits(cg->regmap, RK818_SUP_STS_REG, -+ RK818_SUP_STS_USB_ILIM_EN | RK818_SUP_STS_USB_VLIM_EN, -+ RK818_SUP_STS_USB_ILIM_EN); -+ if (ret) -+ dev_warn(cg->dev, "failed to enable input current limit (%d)\n", ret); -+ -+ /* make sure analog control loop is enabled */ -+ ret = regmap_update_bits(cg->regmap, RK818_CHRG_CTRL_REG3, -+ RK818_CHRG_CTRL_REG3_CHRG_TERM_DIGITAL, -+ 0); -+ if (ret) -+ dev_warn(cg->dev, "failed to enable analog control loop (%d)\n", ret); -+ -+ /* enable charger and set some reasonable limits on each boot */ -+ ret = regmap_write(cg->regmap, RK818_CHRG_CTRL_REG1, -+ RK818_CHRG_CTRL_REG1_CHRG_EN -+ | (1) /* 1.2A */ -+ | (5 << 4) /* 4.3V */); -+ if (ret) -+ dev_warn(cg->dev, "failed to enable charger (%d)\n", ret); -+ -+ rk818_usb_power_external_power_changed(cg->usb_psy); -+ -+ return 0; -+} -+ -+static int rk818_charger_remove(struct platform_device *pdev) -+{ -+ //struct rk818_charger *cg = platform_get_drvdata(pdev); -+ -+ return 0; -+} -+ -+static void rk818_charger_shutdown(struct platform_device *pdev) -+{ -+} -+ -+static int rk818_charger_suspend(struct platform_device *pdev, -+ pm_message_t state) -+{ -+ return 0; -+} -+ -+static int rk818_charger_resume(struct platform_device *pdev) -+{ -+ return 0; -+} -+ -+static const struct of_device_id rk818_charger_of_match[] = { -+ { .compatible = "rockchip,rk818-charger", }, -+ { }, -+}; -+ -+static struct platform_driver rk818_charger_driver = { -+ .probe = rk818_charger_probe, -+ .remove = rk818_charger_remove, -+ .suspend = rk818_charger_suspend, -+ .resume = rk818_charger_resume, -+ .shutdown = rk818_charger_shutdown, -+ .driver = { -+ .name = "rk818-charger", -+ .of_match_table = rk818_charger_of_match, -+ }, -+}; -+ -+module_platform_driver(rk818_charger_driver); -+ -+MODULE_LICENSE("GPL"); -+MODULE_ALIAS("platform:rk818-charger"); -+MODULE_AUTHOR("OndÅ™ej Jirman "); -diff -rupN linux.orig/include/linux/mfd/rk808.h linux/include/linux/mfd/rk808.h ---- linux.orig/include/linux/mfd/rk808.h 2023-09-12 12:02:59.205653098 +0000 -+++ linux/include/linux/mfd/rk808.h 2023-09-12 12:03:27.490291628 +0000 +\ No newline at end of file +diff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h +index 78e167a92483..05d61ae8a0f5 100644 +--- a/include/linux/mfd/rk808.h ++++ b/include/linux/mfd/rk808.h @@ -138,6 +138,8 @@ enum rk818_reg { RK818_ID_OTG_SWITCH, }; @@ -4530,151 +3983,6 @@ diff -rupN linux.orig/include/linux/mfd/rk808.h linux/include/linux/mfd/rk808.h #define RK818_H5V_EN BIT(0) #define RK818_REF_RDY_CTRL BIT(1) -@@ -382,6 +461,8 @@ enum rk805_reg { - - #define VOUT_LO_INT BIT(0) - #define CLK32KOUT2_EN BIT(0) -+#define CLK32KOUT2_FUNC (0 << 1) -+#define CLK32KOUT2_FUNC_MASK BIT(1) - - #define TEMP115C 0x0c - #define TEMP_HOTDIE_MSK 0x0c -diff -rupN linux.orig/drivers/mfd/rk808.c linux/drivers/mfd/rk808.c ---- linux.orig/drivers/mfd/rk808.c 2023-09-12 12:02:58.341633584 +0000 -+++ linux/drivers/mfd/rk808.c 2023-09-12 12:03:27.490291628 +0000 -@@ -81,12 +81,47 @@ static bool rk817_is_volatile_reg(struct - return false; - } - -+static bool rk818_is_volatile_reg(struct device *dev, unsigned int reg) -+{ -+ /* -+ * Notes: -+ * - Technically the ROUND_30s bit makes RTC_CTRL_REG volatile, but -+ * we don't use that feature. It's better to cache. -+ * - It's unlikely we care that RK808_DEVCTRL_REG is volatile since -+ * bits are cleared in case when we shutoff anyway, but better safe. -+ */ -+ -+ switch (reg) { -+ case RK808_SECONDS_REG ... RK808_WEEKS_REG: -+ case RK808_RTC_STATUS_REG: -+ case RK808_VB_MON_REG: -+ case RK808_THERMAL_REG: -+ case RK808_DCDC_EN_REG: -+ case RK808_LDO_EN_REG: -+ case RK808_DCDC_UV_STS_REG: -+ case RK808_LDO_UV_STS_REG: -+ case RK808_DCDC_PG_REG: -+ case RK808_LDO_PG_REG: -+ case RK808_DEVCTRL_REG: -+ case RK808_INT_STS_REG1: -+ case RK808_INT_STS_REG2: -+ case RK808_INT_STS_MSK_REG1: -+ case RK808_INT_STS_MSK_REG2: -+ case RK818_LDO8_ON_VSEL_REG: // TODO(ayufan):?? -+ case RK818_LDO8_SLP_VSEL_REG: // TODO(ayufan):?? -+ case RK818_SUP_STS_REG ... RK818_SAVE_DATA19: -+ return true; -+ } -+ -+ return false; -+} -+ - static const struct regmap_config rk818_regmap_config = { - .reg_bits = 8, - .val_bits = 8, -- .max_register = RK818_USB_CTRL_REG, -+ .max_register = RK818_SAVE_DATA19, - .cache_type = REGCACHE_RBTREE, -- .volatile_reg = rk808_is_volatile_reg, -+ .volatile_reg = rk818_is_volatile_reg, - }; - - static const struct regmap_config rk805_regmap_config = { -@@ -137,58 +172,67 @@ static const struct resource rk817_charg - }; - - static const struct mfd_cell rk805s[] = { -- { .name = "rk808-clkout", }, -- { .name = "rk808-regulator", }, -- { .name = "rk805-pinctrl", }, -+ { .name = "rk808-clkout", .id = -1, }, -+ { .name = "rk808-regulator", .id = -1, }, -+ { .name = "rk805-pinctrl", .id = -1, }, - { - .name = "rk808-rtc", - .num_resources = ARRAY_SIZE(rtc_resources), - .resources = &rtc_resources[0], -+ .id = -1, - }, - { .name = "rk805-pwrkey", - .num_resources = ARRAY_SIZE(rk805_key_resources), - .resources = &rk805_key_resources[0], -+ .id = -1, - }, - }; - - static const struct mfd_cell rk808s[] = { -- { .name = "rk808-clkout", }, -- { .name = "rk808-regulator", }, -+ { .name = "rk808-clkout", .id = -1, }, -+ { .name = "rk808-regulator", .id = -1, }, - { - .name = "rk808-rtc", - .num_resources = ARRAY_SIZE(rtc_resources), - .resources = rtc_resources, -+ .id = -1, - }, - }; - - static const struct mfd_cell rk817s[] = { -- { .name = "rk808-clkout",}, -- { .name = "rk808-regulator",}, -+ { .name = "rk808-clkout", .id = -1, }, -+ { .name = "rk808-regulator", .id = -1, }, - { - .name = "rk805-pwrkey", - .num_resources = ARRAY_SIZE(rk817_pwrkey_resources), - .resources = &rk817_pwrkey_resources[0], -+ .id = -1, - }, - { - .name = "rk808-rtc", - .num_resources = ARRAY_SIZE(rk817_rtc_resources), - .resources = &rk817_rtc_resources[0], -+ .id = -1, - }, -- { .name = "rk817-codec",}, -+ { .name = "rk817-codec", .id = -1, }, - { - .name = "rk817-charger", - .num_resources = ARRAY_SIZE(rk817_charger_resources), - .resources = &rk817_charger_resources[0], -+ .id = -1, - }, - }; - - static const struct mfd_cell rk818s[] = { -- { .name = "rk808-clkout", }, -- { .name = "rk808-regulator", }, -+ { .name = "rk808-clkout", .id = -1, }, -+ { .name = "rk808-regulator", .id = -1, }, -+ { .name = "rk818-battery", .of_compatible = "rockchip,rk818-battery", }, -+ { .name = "rk818-charger", .of_compatible = "rockchip,rk818-charger", }, - { - .name = "rk808-rtc", - .num_resources = ARRAY_SIZE(rtc_resources), - .resources = rtc_resources, -+ .id = -1, - }, - }; - -@@ -318,6 +362,7 @@ static const struct rk808_reg_data rk818 - { RK818_H5V_EN_REG, BIT(0), RK818_H5V_EN }, - { RK808_VB_MON_REG, MASK_ALL, VB_LO_ACT | - VB_LO_SEL_3500MV }, -+ { RK808_CLK32OUT_REG, CLK32KOUT2_FUNC_MASK, CLK32KOUT2_FUNC }, - }; - - static const struct regmap_irq rk805_irqs[] = { +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0027-power-supply-rk818-battery-Use-a-more-propper-compat.patch b/projects/Amlogic/packages/linux/patches/S922X/0027-power-supply-rk818-battery-Use-a-more-propper-compat.patch new file mode 100644 index 0000000000..b44e4fd3d4 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0027-power-supply-rk818-battery-Use-a-more-propper-compat.patch @@ -0,0 +1,36 @@ +From 6654f3a58925a1a84f0d98dfb1365eb006b57c3a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Sun, 7 Nov 2021 19:30:07 +0100 +Subject: [PATCH 27/49] power: supply: rk818-battery: Use a more propper + compatible string + +Prefix with vendor name. + +Signed-off-by: Ondrej Jirman +--- + drivers/power/supply/rk818_battery.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/power/supply/rk818_battery.c b/drivers/power/supply/rk818_battery.c +index f09f45605a8b..665f043377c6 100644 +--- a/drivers/power/supply/rk818_battery.c ++++ b/drivers/power/supply/rk818_battery.c +@@ -3339,7 +3339,7 @@ static int rk818_bat_parse_dt(struct rk818_battery *di) + #endif + + static const struct of_device_id rk818_battery_of_match[] = { +- {.compatible = "rk818-battery",}, ++ { .compatible = "rockchip,rk818-battery", }, + { }, + }; + +@@ -3565,4 +3565,4 @@ module_exit(battery_exit); + + MODULE_LICENSE("GPL"); + MODULE_ALIAS("platform:rk818-battery"); +-MODULE_AUTHOR("chenjh"); +\ No newline at end of file ++MODULE_AUTHOR("chenjh"); +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0028-power-supply-rk818-charger-Implement-charger-driver-.patch b/projects/Amlogic/packages/linux/patches/S922X/0028-power-supply-rk818-charger-Implement-charger-driver-.patch new file mode 100644 index 0000000000..016bdc1afb --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0028-power-supply-rk818-charger-Implement-charger-driver-.patch @@ -0,0 +1,703 @@ +From b6fb69c12d1362b3784b96bdb3b768bb306a57d2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Sun, 7 Nov 2021 20:09:02 +0100 +Subject: [PATCH 28/49] power: supply: rk818-charger: Implement charger driver + for RK818 PMIC + +For now this driver is just meant to watch Type-C power supply +and apply current limits to RK818, to not overload the Type-C +partner. + +Signed-off-by: Ondrej Jirman +--- + drivers/power/supply/Kconfig | 8 + + drivers/power/supply/Makefile | 1 + + drivers/power/supply/rk818_charger.c | 650 +++++++++++++++++++++++++++ + 3 files changed, 659 insertions(+) + create mode 100644 drivers/power/supply/rk818_charger.c + +diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig +index 1722fc1ee7ec..a8f03555188f 100644 +--- a/drivers/power/supply/Kconfig ++++ b/drivers/power/supply/Kconfig +@@ -1001,4 +1001,12 @@ config BATTERY_RK818 + If you say yes here you will get support for the battery of RK818 PMIC. + This driver can give support for Rk818 Battery Charge Interface. + ++config CHARGER_RK818 ++ bool "RK818 Charger driver" ++ depends on MFD_RK8XX ++ default n ++ help ++ If you say yes here you will get support for the charger of RK818 PMIC. ++ This driver can give support for Rk818 Charger Interface. ++ + endif # POWER_SUPPLY +diff --git a/drivers/power/supply/Makefile b/drivers/power/supply/Makefile +index aa3de47be2c5..5a2480aca754 100644 +--- a/drivers/power/supply/Makefile ++++ b/drivers/power/supply/Makefile +@@ -115,3 +115,4 @@ obj-$(CONFIG_BATTERY_UG3105) += ug3105_battery.o + obj-$(CONFIG_CHARGER_QCOM_SMB2) += qcom_pmi8998_charger.o + obj-$(CONFIG_FUEL_GAUGE_MM8013) += mm8013.o + obj-$(CONFIG_BATTERY_RK818) += rk818_battery.o ++obj-$(CONFIG_CHARGER_RK818) += rk818_charger.o +diff --git a/drivers/power/supply/rk818_charger.c b/drivers/power/supply/rk818_charger.c +new file mode 100644 +index 000000000000..00fe5d8f4785 +--- /dev/null ++++ b/drivers/power/supply/rk818_charger.c +@@ -0,0 +1,650 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++/* ++ * rk818 usb power driver ++ * ++ * Copyright (c) 2021 OndÅ™ej Jirman ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define RK818_CHG_STS_MASK (7u << 4) /* charger status */ ++#define RK818_CHG_STS_NONE (0u << 4) ++#define RK818_CHG_STS_WAKEUP_CUR (1u << 4) ++#define RK818_CHG_STS_TRICKLE_CUR (2u << 4) ++#define RK818_CHG_STS_CC_OR_CV (3u << 4) ++#define RK818_CHG_STS_TERMINATED (4u << 4) ++#define RK818_CHG_STS_USB_OV (5u << 4) ++#define RK818_CHG_STS_BAT_TEMP_FAULT (6u << 4) ++#define RK818_CHG_STS_TIMEOUT (7u << 4) ++ ++/* RK818_SUP_STS_REG */ ++#define RK818_SUP_STS_USB_VLIM_EN BIT(3) /* input voltage limit enable */ ++#define RK818_SUP_STS_USB_ILIM_EN BIT(2) /* input current limit enable */ ++#define RK818_SUP_STS_USB_EXS BIT(1) /* USB power connected */ ++#define RK818_SUP_STS_USB_EFF BIT(0) /* USB fault */ ++ ++/* RK818_USB_CTRL_REG */ ++#define RK818_USB_CTRL_USB_ILIM_MASK (0xfu) ++#define RK818_USB_CTRL_USB_CHG_SD_VSEL_OFFSET 4 ++#define RK818_USB_CTRL_USB_CHG_SD_VSEL_MASK (0x7u << 4) ++ ++/* RK818_CHRG_CTRL_REG1 */ ++#define RK818_CHRG_CTRL_REG1_CHRG_EN BIT(7) ++#define RK818_CHRG_CTRL_REG1_CHRG_VOL_SEL_OFFSET 4 ++#define RK818_CHRG_CTRL_REG1_CHRG_VOL_SEL_MASK (0x7u << 4) ++#define RK818_CHRG_CTRL_REG1_CHRG_CUR_SEL_OFFSET 0 ++#define RK818_CHRG_CTRL_REG1_CHRG_CUR_SEL_MASK (0xfu << 0) ++ ++/* RK818_CHRG_CTRL_REG3 */ ++#define RK818_CHRG_CTRL_REG3_CHRG_TERM_DIGITAL BIT(5) ++ ++struct rk818_charger { ++ struct device *dev; ++ struct rk808 *rk818; ++ struct regmap *regmap; ++ ++ struct power_supply *usb_psy; ++ struct power_supply *charger_psy; ++}; ++ ++// {{{ USB supply ++ ++static int rk818_usb_set_input_current_max(struct rk818_charger *cg, ++ int val) ++{ ++ int ret; ++ unsigned reg; ++ ++ if (val < 450000) ++ reg = 1; ++ else if (val < 850000) ++ reg = 0; ++ else if (val < 1000000) ++ reg = 2; ++ else if (val < 3000000) ++ reg = 3 + (val - 1000000) / 250000; ++ else ++ reg = 11; ++ ++ ret = regmap_update_bits(cg->regmap, RK818_USB_CTRL_REG, ++ RK818_USB_CTRL_USB_ILIM_MASK, reg); ++ if (ret) ++ dev_err(cg->dev, ++ "USB input current limit setting failed (%d)\n", ret); ++ ++ return ret; ++} ++ ++static int rk818_usb_get_input_current_max(struct rk818_charger *cg, ++ int *val) ++{ ++ unsigned reg; ++ int ret; ++ ++ ret = regmap_read(cg->regmap, RK818_USB_CTRL_REG, ®); ++ if (ret) { ++ dev_err(cg->dev, ++ "USB input current limit getting failed (%d)\n", ret); ++ return ret; ++ } ++ ++ reg &= RK818_USB_CTRL_USB_ILIM_MASK; ++ if (reg == 0) ++ *val = 450000; ++ else if (reg == 1) ++ *val = 80000; ++ else if (reg == 2) ++ *val = 850000; ++ else if (reg < 11) ++ *val = 1000000 + (reg - 3) * 250000; ++ else ++ *val = 3000000; ++ ++ return 0; ++} ++ ++static int rk818_usb_set_input_voltage_min(struct rk818_charger *cg, ++ int val) ++{ ++ unsigned reg; ++ int ret; ++ ++ if (val < 2780000) ++ reg = 0; ++ else if (val < 3270000) ++ reg = (val - 2780000) / 70000; ++ else ++ reg = 7; ++ ++ ret = regmap_update_bits(cg->regmap, RK818_USB_CTRL_REG, ++ RK818_USB_CTRL_USB_CHG_SD_VSEL_MASK, ++ reg << RK818_USB_CTRL_USB_CHG_SD_VSEL_OFFSET); ++ if (ret) ++ dev_err(cg->dev, ++ "USB input voltage limit setting failed (%d)\n", ret); ++ ++ return ret; ++} ++ ++static int rk818_usb_get_input_voltage_min(struct rk818_charger *cg, ++ int *val) ++{ ++ unsigned reg; ++ int ret; ++ ++ ret = regmap_read(cg->regmap, RK818_USB_CTRL_REG, ®); ++ if (ret) { ++ dev_err(cg->dev, ++ "USB input voltage limit getting failed (%d)\n", ret); ++ return ret; ++ } ++ ++ reg &= RK818_USB_CTRL_USB_CHG_SD_VSEL_MASK; ++ reg >>= RK818_USB_CTRL_USB_CHG_SD_VSEL_OFFSET; ++ ++ *val = 2780000 + (reg * 70000); ++ ++ return 0; ++} ++ ++static int rk818_usb_power_get_property(struct power_supply *psy, ++ enum power_supply_property psp, ++ union power_supply_propval *val) ++{ ++ struct rk818_charger *cg = power_supply_get_drvdata(psy); ++ unsigned reg; ++ int ret; ++ ++ switch (psp) { ++ case POWER_SUPPLY_PROP_PRESENT: ++ ret = regmap_read(cg->regmap, RK818_SUP_STS_REG, ®); ++ if (ret) ++ return ret; ++ ++ val->intval = !!(reg & RK818_SUP_STS_USB_EXS); ++ break; ++ ++ case POWER_SUPPLY_PROP_HEALTH: ++ ret = regmap_read(cg->regmap, RK818_SUP_STS_REG, ®); ++ if (ret) ++ return ret; ++ ++ if (!(reg & RK818_SUP_STS_USB_EXS)) { ++ val->intval = POWER_SUPPLY_HEALTH_UNKNOWN; ++ } else if (reg & RK818_SUP_STS_USB_EFF) { ++ val->intval = POWER_SUPPLY_HEALTH_GOOD; ++ } else { ++ val->intval = POWER_SUPPLY_HEALTH_UNSPEC_FAILURE; ++ } ++ ++ break; ++ ++ case POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT: ++ return rk818_usb_get_input_voltage_min(cg, &val->intval); ++ ++ case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT: ++ return rk818_usb_get_input_current_max(cg, &val->intval); ++ ++ default: ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++static int rk818_usb_power_set_property(struct power_supply *psy, ++ enum power_supply_property psp, ++ const union power_supply_propval *val) ++{ ++ struct rk818_charger *cg = power_supply_get_drvdata(psy); ++ ++ switch (psp) { ++ case POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT: ++ return rk818_usb_set_input_voltage_min(cg, val->intval); ++ ++ case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT: ++ return rk818_usb_set_input_current_max(cg, val->intval); ++ ++ default: ++ return -EINVAL; ++ } ++} ++ ++static int rk818_usb_power_prop_writeable(struct power_supply *psy, ++ enum power_supply_property psp) ++{ ++ switch (psp) { ++ case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT: ++ case POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT: ++ return 1; ++ ++ default: ++ return 0; ++ } ++} ++ ++/* Sync the input-current-limit with our parent supply (if we have one) */ ++static void rk818_usb_power_external_power_changed(struct power_supply *psy) ++{ ++ struct rk818_charger *cg = power_supply_get_drvdata(psy); ++ union power_supply_propval val; ++ int ret; ++ ++ ret = power_supply_get_property_from_supplier(cg->usb_psy, ++ POWER_SUPPLY_PROP_CURRENT_MAX, ++ &val); ++ if (ret) ++ return; ++ ++ if (val.intval < 500000) ++ val.intval = 500000; ++ ++ rk818_usb_power_set_property(cg->usb_psy, ++ POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, ++ &val); ++} ++ ++static enum power_supply_property rk818_usb_power_props[] = { ++ POWER_SUPPLY_PROP_PRESENT, ++ POWER_SUPPLY_PROP_HEALTH, ++ POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, ++ POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT, ++}; ++ ++static const struct power_supply_desc rk818_usb_desc = { ++ .name = "rk818-usb", ++ .type = POWER_SUPPLY_TYPE_USB, ++ .properties = rk818_usb_power_props, ++ .num_properties = ARRAY_SIZE(rk818_usb_power_props), ++ .property_is_writeable = rk818_usb_power_prop_writeable, ++ .get_property = rk818_usb_power_get_property, ++ .set_property = rk818_usb_power_set_property, ++ .external_power_changed = rk818_usb_power_external_power_changed, ++}; ++ ++// }}} ++// {{{ Charger supply ++ ++static int rk818_charger_set_current_max(struct rk818_charger *cg, int val) ++{ ++ unsigned reg; ++ int ret; ++ ++ if (val < 1000000) ++ reg = 0; ++ else if (val < 3000000) ++ reg = (val - 1000000) / 200000; ++ else ++ reg = 10; ++ ++ ret = regmap_update_bits(cg->regmap, RK818_CHRG_CTRL_REG1, ++ RK818_CHRG_CTRL_REG1_CHRG_CUR_SEL_MASK, ++ reg << RK818_CHRG_CTRL_REG1_CHRG_CUR_SEL_OFFSET); ++ if (ret) ++ dev_err(cg->dev, ++ "Charging max current setting failed (%d)\n", ret); ++ ++ return ret; ++} ++ ++static int rk818_charger_get_current_max(struct rk818_charger *cg, int *val) ++{ ++ unsigned reg; ++ int ret; ++ ++ ret = regmap_read(cg->regmap, RK818_CHRG_CTRL_REG1, ®); ++ if (ret) { ++ dev_err(cg->dev, ++ "Charging max current getting failed (%d)\n", ret); ++ return ret; ++ } ++ ++ reg &= RK818_CHRG_CTRL_REG1_CHRG_CUR_SEL_MASK; ++ reg >>= RK818_CHRG_CTRL_REG1_CHRG_CUR_SEL_OFFSET; ++ ++ *val = 1000000 + reg * 200000; ++ ++ return 0; ++} ++ ++static int rk818_charger_set_voltage_max(struct rk818_charger *cg, int val) ++{ ++ unsigned reg; ++ int ret; ++ ++ if (val < 4050000) ++ reg = 0; ++ else if (val < 4350000) ++ reg = (val - 4050000) / 50000; ++ else ++ reg = 6; ++ ++ ret = regmap_update_bits(cg->regmap, RK818_CHRG_CTRL_REG1, ++ RK818_CHRG_CTRL_REG1_CHRG_VOL_SEL_MASK, ++ reg << RK818_CHRG_CTRL_REG1_CHRG_VOL_SEL_OFFSET); ++ if (ret) ++ dev_err(cg->dev, ++ "Charging end voltage setting failed (%d)\n", ret); ++ ++ return ret; ++} ++ ++static int rk818_charger_get_voltage_max(struct rk818_charger *cg, int *val) ++{ ++ unsigned reg; ++ int ret; ++ ++ ret = regmap_read(cg->regmap, RK818_CHRG_CTRL_REG1, ®); ++ if (ret) { ++ dev_err(cg->dev, ++ "Charging end voltage getting failed (%d)\n", ret); ++ return ret; ++ } ++ ++ reg &= RK818_CHRG_CTRL_REG1_CHRG_VOL_SEL_MASK; ++ reg >>= RK818_CHRG_CTRL_REG1_CHRG_VOL_SEL_OFFSET; ++ ++ *val = 4050000 + reg * 50000; ++ ++ return 0; ++} ++ ++static int rk818_charger_get_property(struct power_supply *psy, ++ enum power_supply_property psp, ++ union power_supply_propval *val) ++{ ++ struct rk818_charger *cg = power_supply_get_drvdata(psy); ++ unsigned reg; ++ int ret; ++ ++ switch (psp) { ++ case POWER_SUPPLY_PROP_ONLINE: ++ ret = regmap_read(cg->regmap, RK818_CHRG_CTRL_REG1, ®); ++ if (ret) { ++ dev_err(cg->dev, "failed to read the charger state (%d)\n", ret); ++ return ret; ++ } ++ ++ val->intval = !!(reg & RK818_CHRG_CTRL_REG1_CHRG_EN); ++ break; ++ ++ case POWER_SUPPLY_PROP_STATUS: ++ ret = regmap_read(cg->regmap, RK818_SUP_STS_REG, ®); ++ if (ret) ++ return ret; ++ ++ switch (reg & RK818_CHG_STS_MASK) { ++ case RK818_CHG_STS_WAKEUP_CUR: ++ case RK818_CHG_STS_TRICKLE_CUR: ++ case RK818_CHG_STS_CC_OR_CV: ++ val->intval = POWER_SUPPLY_STATUS_CHARGING; ++ break; ++ case RK818_CHG_STS_TERMINATED: ++ default: ++ val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; ++ break; ++ } ++ ++ break; ++ ++ case POWER_SUPPLY_PROP_CHARGE_TYPE: ++ ret = regmap_read(cg->regmap, RK818_SUP_STS_REG, ®); ++ if (ret) ++ return ret; ++ ++ switch (reg & RK818_CHG_STS_MASK) { ++ case RK818_CHG_STS_WAKEUP_CUR: ++ case RK818_CHG_STS_TRICKLE_CUR: ++ val->intval = POWER_SUPPLY_CHARGE_TYPE_TRICKLE; ++ break; ++ case RK818_CHG_STS_CC_OR_CV: ++ val->intval = POWER_SUPPLY_CHARGE_TYPE_FAST; ++ break; ++ case RK818_CHG_STS_TERMINATED: ++ val->intval = POWER_SUPPLY_CHARGE_TYPE_NONE; ++ break; ++ default: ++ val->intval = POWER_SUPPLY_CHARGE_TYPE_UNKNOWN; ++ break; ++ } ++ ++ break; ++ ++ case POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT: ++ ret = regmap_read(cg->regmap, RK818_CHRG_CTRL_REG2, ®); ++ if (ret) ++ return ret; ++ ++ val->intval = 100000 + ((reg >> 6) & 3) * 50000; ++ break; ++ ++ case POWER_SUPPLY_PROP_HEALTH: ++ ret = regmap_read(cg->regmap, RK818_SUP_STS_REG, ®); ++ if (ret) ++ return ret; ++ ++ switch (reg & RK818_CHG_STS_MASK) { ++ case RK818_CHG_STS_USB_OV: ++ val->intval = POWER_SUPPLY_HEALTH_OVERVOLTAGE; ++ break; ++ case RK818_CHG_STS_BAT_TEMP_FAULT: ++ val->intval = POWER_SUPPLY_HEALTH_OVERHEAT; ++ break; ++ case RK818_CHG_STS_TIMEOUT: ++ val->intval = POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE; ++ break; ++ default: ++ val->intval = POWER_SUPPLY_HEALTH_GOOD; ++ break; ++ } ++ ++ break; ++ ++ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE: ++ return rk818_charger_get_voltage_max(cg, &val->intval); ++ ++ case POWER_SUPPLY_PROP_PRECHARGE_CURRENT: ++ ret = rk818_charger_get_current_max(cg, &val->intval); ++ val->intval /= 10; ++ return ret; ++ ++ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT: ++ return rk818_charger_get_current_max(cg, &val->intval); ++ ++ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX: ++ val->intval = 4350000; ++ break; ++ ++ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX: ++ val->intval = 3000000; ++ break; ++ ++ default: ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++static int rk818_charger_set_property(struct power_supply *psy, ++ enum power_supply_property psp, ++ const union power_supply_propval *val) ++{ ++ struct rk818_charger *cg = power_supply_get_drvdata(psy); ++ int ret; ++ ++ switch (psp) { ++ case POWER_SUPPLY_PROP_ONLINE: ++ ret = regmap_update_bits(cg->regmap, RK818_CHRG_CTRL_REG1, ++ RK818_CHRG_CTRL_REG1_CHRG_EN, ++ val->intval ? RK818_CHRG_CTRL_REG1_CHRG_EN : 0); ++ if (ret) ++ dev_err(cg->dev, "failed to setup the charger (%d)\n", ret); ++ ++ return ret; ++ ++ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE: ++ return rk818_charger_set_voltage_max(cg, val->intval); ++ ++ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT: ++ return rk818_charger_set_current_max(cg, val->intval); ++ ++ default: ++ return -EINVAL; ++ } ++} ++ ++static int rk818_charger_prop_writeable(struct power_supply *psy, ++ enum power_supply_property psp) ++{ ++ switch (psp) { ++ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT: ++ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE: ++ case POWER_SUPPLY_PROP_ONLINE: ++ return 1; ++ ++ default: ++ return 0; ++ } ++} ++ ++static enum power_supply_property rk818_charger_props[] = { ++ POWER_SUPPLY_PROP_ONLINE, ++ POWER_SUPPLY_PROP_HEALTH, ++ POWER_SUPPLY_PROP_STATUS, ++ POWER_SUPPLY_PROP_CHARGE_TYPE, ++ POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT, ++ POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT, ++ POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE, ++ POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX, ++ POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX, ++ POWER_SUPPLY_PROP_PRECHARGE_CURRENT, ++}; ++ ++/* ++ * TODO: This functionality should be in a battery driver/supply, but that one ++ * is such a mess, I don't want to touch it now. Let's have a separate supply ++ * for controlling the charger for now, and a prayer for the poor soul that ++ * will have to understand and clean up the battery driver. ++ */ ++static const struct power_supply_desc rk818_charger_desc = { ++ .name = "rk818-charger", ++ .type = POWER_SUPPLY_TYPE_BATTERY, ++ .properties = rk818_charger_props, ++ .num_properties = ARRAY_SIZE(rk818_charger_props), ++ .property_is_writeable = rk818_charger_prop_writeable, ++ .get_property = rk818_charger_get_property, ++ .set_property = rk818_charger_set_property, ++}; ++ ++// }}} ++ ++static int rk818_charger_probe(struct platform_device *pdev) ++{ ++ struct rk808 *rk818 = dev_get_drvdata(pdev->dev.parent); ++ struct power_supply_config psy_cfg = { }; ++ struct device *dev = &pdev->dev; ++ struct rk818_charger *cg; ++ int ret; ++ ++ cg = devm_kzalloc(dev, sizeof(*cg), GFP_KERNEL); ++ if (!cg) ++ return -ENOMEM; ++ ++ cg->rk818 = rk818; ++ cg->dev = dev; ++ cg->regmap = rk818->regmap; ++ platform_set_drvdata(pdev, cg); ++ ++ psy_cfg.drv_data = cg; ++ psy_cfg.of_node = dev->of_node; ++ ++ cg->usb_psy = devm_power_supply_register(dev, &rk818_usb_desc, ++ &psy_cfg); ++ if (IS_ERR(cg->usb_psy)) ++ return dev_err_probe(dev, PTR_ERR(cg->usb_psy), ++ "register usb power supply fail\n"); ++ ++ cg->charger_psy = devm_power_supply_register(dev, &rk818_charger_desc, ++ &psy_cfg); ++ if (IS_ERR(cg->charger_psy)) ++ return dev_err_probe(dev, PTR_ERR(cg->charger_psy), ++ "register charger power supply fail\n"); ++ ++ /* disable voltage limit and enable input current limit */ ++ ret = regmap_update_bits(cg->regmap, RK818_SUP_STS_REG, ++ RK818_SUP_STS_USB_ILIM_EN | RK818_SUP_STS_USB_VLIM_EN, ++ RK818_SUP_STS_USB_ILIM_EN); ++ if (ret) ++ dev_warn(cg->dev, "failed to enable input current limit (%d)\n", ret); ++ ++ /* make sure analog control loop is enabled */ ++ ret = regmap_update_bits(cg->regmap, RK818_CHRG_CTRL_REG3, ++ RK818_CHRG_CTRL_REG3_CHRG_TERM_DIGITAL, ++ 0); ++ if (ret) ++ dev_warn(cg->dev, "failed to enable analog control loop (%d)\n", ret); ++ ++ /* enable charger and set some reasonable limits on each boot */ ++ ret = regmap_write(cg->regmap, RK818_CHRG_CTRL_REG1, ++ RK818_CHRG_CTRL_REG1_CHRG_EN ++ | (1) /* 1.2A */ ++ | (5 << 4) /* 4.3V */); ++ if (ret) ++ dev_warn(cg->dev, "failed to enable charger (%d)\n", ret); ++ ++ rk818_usb_power_external_power_changed(cg->usb_psy); ++ ++ return 0; ++} ++ ++static int rk818_charger_remove(struct platform_device *pdev) ++{ ++ //struct rk818_charger *cg = platform_get_drvdata(pdev); ++ ++ return 0; ++} ++ ++static void rk818_charger_shutdown(struct platform_device *pdev) ++{ ++} ++ ++static int rk818_charger_suspend(struct platform_device *pdev, ++ pm_message_t state) ++{ ++ return 0; ++} ++ ++static int rk818_charger_resume(struct platform_device *pdev) ++{ ++ return 0; ++} ++ ++static const struct of_device_id rk818_charger_of_match[] = { ++ { .compatible = "rockchip,rk818-charger", }, ++ { }, ++}; ++ ++static struct platform_driver rk818_charger_driver = { ++ .probe = rk818_charger_probe, ++ .remove = rk818_charger_remove, ++ .suspend = rk818_charger_suspend, ++ .resume = rk818_charger_resume, ++ .shutdown = rk818_charger_shutdown, ++ .driver = { ++ .name = "rk818-charger", ++ .of_match_table = rk818_charger_of_match, ++ }, ++}; ++ ++module_platform_driver(rk818_charger_driver); ++ ++MODULE_LICENSE("GPL"); ++MODULE_ALIAS("platform:rk818-charger"); ++MODULE_AUTHOR("OndÅ™ej Jirman "); +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0029-power-supply-rk818-charger-Change-charger-type-to-MA.patch b/projects/Amlogic/packages/linux/patches/S922X/0029-power-supply-rk818-charger-Change-charger-type-to-MA.patch new file mode 100644 index 0000000000..badcd1849b --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0029-power-supply-rk818-charger-Change-charger-type-to-MA.patch @@ -0,0 +1,29 @@ +From c141f790a38f9cc2a50642edb44bf71b3a50d78d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Thu, 13 Jan 2022 13:53:03 +0100 +Subject: [PATCH 29/49] power: supply: rk818-charger: Change charger type to + MAINS + +To un-confuse userspace. + +Signed-off-by: Ondrej Jirman +--- + drivers/power/supply/rk818_charger.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/power/supply/rk818_charger.c b/drivers/power/supply/rk818_charger.c +index 00fe5d8f4785..6a9f2d1a7086 100644 +--- a/drivers/power/supply/rk818_charger.c ++++ b/drivers/power/supply/rk818_charger.c +@@ -535,7 +535,7 @@ static enum power_supply_property rk818_charger_props[] = { + */ + static const struct power_supply_desc rk818_charger_desc = { + .name = "rk818-charger", +- .type = POWER_SUPPLY_TYPE_BATTERY, ++ .type = POWER_SUPPLY_TYPE_MAINS, + .properties = rk818_charger_props, + .num_properties = ARRAY_SIZE(rk818_charger_props), + .property_is_writeable = rk818_charger_prop_writeable, +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/003.01-ODROID-N2-heartbeat-quirk.patch b/projects/Amlogic/packages/linux/patches/S922X/003.01-ODROID-N2-heartbeat-quirk.patch deleted file mode 100644 index fe818752f2..0000000000 --- a/projects/Amlogic/packages/linux/patches/S922X/003.01-ODROID-N2-heartbeat-quirk.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi -@@ -45,7 +45,7 @@ - led-blue { - label = "n2:blue"; - gpios = <&gpio_ao GPIOAO_11 GPIO_ACTIVE_HIGH>; -- linux,default-trigger = "heartbeat"; -+ linux,default-trigger = "none"; - }; - }; - diff --git a/projects/Amlogic/packages/linux/patches/S922X/003.02-silence-dmesg-spam.patch b/projects/Amlogic/packages/linux/patches/S922X/003.02-silence-dmesg-spam.patch deleted file mode 100644 index 829f2b4d68..0000000000 --- a/projects/Amlogic/packages/linux/patches/S922X/003.02-silence-dmesg-spam.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c -index f3964060a044..dc1ffb3a098b 100644 ---- a/sound/soc/soc-pcm.c -+++ b/sound/soc/soc-pcm.c -@@ -41,9 +41,6 @@ static inline int _soc_pcm_ret(struct snd_soc_pcm_runtime *rtd, - case -ENOTSUPP: - break; - default: -- dev_err(rtd->dev, -- "ASoC: error at %s on %s: %d\n", -- func, rtd->dai_link->name, ret); - } - - return ret; -@@ -2438,8 +2435,6 @@ static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream) - - /* there is no point preparing this FE if there are no BEs */ - if (list_empty(&fe->dpcm[stream].be_clients)) { -- dev_err(fe->dev, "ASoC: no backend DAIs enabled for %s\n", -- fe->dai_link->name); - ret = -EINVAL; - goto out; - } diff --git a/projects/Amlogic/packages/linux/patches/S922X/0030-power-supply-rk818-battery-Report-charging-status-ba.patch b/projects/Amlogic/packages/linux/patches/S922X/0030-power-supply-rk818-battery-Report-charging-status-ba.patch new file mode 100644 index 0000000000..b8bec5d37d --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0030-power-supply-rk818-battery-Report-charging-status-ba.patch @@ -0,0 +1,93 @@ +From 76f8f9577608e114af43c00aa1e60aacaa11d2dc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Jirman?= +Date: Fri, 21 Jan 2022 11:38:00 +0100 +Subject: [PATCH 30/49] power: supply: rk818-battery: Report charging status + based on charging current + +If the current is positive, battery is charging, if negative the battery +is discharging. Duh?! + +Signed-off-by: Ondrej Jirman +--- + drivers/power/supply/rk818_battery.c | 63 +--------------------------- + 1 file changed, 1 insertion(+), 62 deletions(-) + +diff --git a/drivers/power/supply/rk818_battery.c b/drivers/power/supply/rk818_battery.c +index 665f043377c6..741195e77da6 100644 +--- a/drivers/power/supply/rk818_battery.c ++++ b/drivers/power/supply/rk818_battery.c +@@ -893,70 +893,9 @@ static enum power_supply_property rk818_bat_props[] = { + POWER_SUPPLY_PROP_CURRENT_MAX, + }; + +-static int rk818_bat_get_usb_psy(struct device *dev, void *data) +-{ +- struct rk818_battery *di = data; +- struct power_supply *psy = dev_get_drvdata(dev); +- +- if (psy->desc->type == POWER_SUPPLY_TYPE_USB) { +- di->usb_psy = psy; +- return 1; +- } +- +- return 0; +-} +- +-static int rk818_bat_get_ac_psy(struct device *dev, void *data) +-{ +- struct rk818_battery *di = data; +- struct power_supply *psy = dev_get_drvdata(dev); +- +- if (psy->desc->type == POWER_SUPPLY_TYPE_MAINS) { +- di->ac_psy = psy; +- return 1; +- } +- +- return 0; +-} +- +-static void rk818_bat_get_chrg_psy(struct rk818_battery *di) +-{ +- if (!di->usb_psy) +- class_for_each_device(power_supply_class, NULL, (void *)di, +- rk818_bat_get_usb_psy); +- if (!di->ac_psy) +- class_for_each_device(power_supply_class, NULL, (void *)di, +- rk818_bat_get_ac_psy); +-} +- + static int rk818_bat_get_charge_state(struct rk818_battery *di) + { +- union power_supply_propval val; +- int ret; +- +- if (!di->usb_psy || !di->ac_psy) +- rk818_bat_get_chrg_psy(di); +- +- if (di->usb_psy) { +- ret = di->usb_psy->desc->get_property(di->usb_psy, +- POWER_SUPPLY_PROP_ONLINE, +- &val); +- if (!ret) +- di->usb_in = val.intval; +- } +- +- if (di->ac_psy) { +- ret = di->ac_psy->desc->get_property(di->ac_psy, +- POWER_SUPPLY_PROP_ONLINE, +- &val); +- if (!ret) +- di->ac_in = val.intval; +- } +- +- DBG("%s: ac_online=%d, usb_online=%d\n", +- __func__, di->ac_in, di->usb_in); +- +- return (di->usb_in || di->ac_in); ++ return di->current_avg > 0; + } + + static int rk818_battery_get_property(struct power_supply *psy, +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0031-power-supply-rk818-battery-Drop-dependency-on-frameb.patch b/projects/Amlogic/packages/linux/patches/S922X/0031-power-supply-rk818-battery-Drop-dependency-on-frameb.patch new file mode 100644 index 0000000000..81962352bb --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0031-power-supply-rk818-battery-Drop-dependency-on-frameb.patch @@ -0,0 +1,131 @@ +From d7ab30b72c46d9d6ddfe72f567267dde1f06e447 Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Tue, 17 May 2022 23:30:46 +0200 +Subject: [PATCH 31/49] power: supply: rk818-battery: Drop dependency on + framebuffer + +It was bizarre anyway. Framebuffer is barely used on Linux anyway, +so this is not a great way to check for system inactivity. + +Signed-off-by: Ondrej Jirman +--- + drivers/power/supply/rk818_battery.c | 43 ++++------------------------ + 1 file changed, 5 insertions(+), 38 deletions(-) + +diff --git a/drivers/power/supply/rk818_battery.c b/drivers/power/supply/rk818_battery.c +index 741195e77da6..cc409b7aafb5 100644 +--- a/drivers/power/supply/rk818_battery.c ++++ b/drivers/power/supply/rk818_battery.c +@@ -217,7 +217,6 @@ struct rk818_battery { + bool sleep_chrg_online; + u8 sleep_chrg_status; + bool adc_allow_update; +- int fb_blank; + bool s2r; /*suspend to resume*/ + u32 work_mode; + int temperature; +@@ -1097,34 +1096,6 @@ static void rk818_bat_save_reboot_cnt(struct rk818_battery *di, u8 save_cnt) + rk818_bat_write(di, RK818_REBOOT_CNT_REG, save_cnt); + } + +-static int rk818_bat_fb_notifier(struct notifier_block *nb, +- unsigned long event, void *data) +-{ +- struct rk818_battery *di; +- struct fb_event *evdata = data; +- +- if (event != FB_EARLY_EVENT_BLANK && event != FB_EVENT_BLANK) +- return NOTIFY_OK; +- +- di = container_of(nb, struct rk818_battery, fb_nb); +- di->fb_blank = *(int *)evdata->data; +- +- return 0; +-} +- +-static int rk818_bat_register_fb_notify(struct rk818_battery *di) +-{ +- memset(&di->fb_nb, 0, sizeof(di->fb_nb)); +- di->fb_nb.notifier_call = rk818_bat_fb_notifier; +- +- return fb_register_client(&di->fb_nb); +-} +- +-static int rk818_bat_unregister_fb_notify(struct rk818_battery *di) +-{ +- return fb_unregister_client(&di->fb_nb); +-} +- + static u8 rk818_bat_get_halt_cnt(struct rk818_battery *di) + { + return rk818_bat_read(di, RK818_HALT_CNT_REG); +@@ -1512,7 +1483,7 @@ static void rk818_bat_calc_zero_linek(struct rk818_battery *di) + int ocv_cap, dead_cap, xsoc; + int ocv_soc, dead_soc; + int pwroff_vol; +- int i, cnt, vol_old, vol_now; ++ int i, cnt = 0, vol_old, vol_now; + int org_linek = 0, min_gap_xsoc; + + if ((abs(di->current_avg) < 500) && (di->dsoc > 10)) +@@ -1884,7 +1855,7 @@ static void rk818_bat_debug_info(struct rk818_battery *di) + "Dsoc=%d, Rsoc=%d, Vavg=%d, Iavg=%d, Cap=%d, Fcc=%d, d=%d\n" + "K=%d, Mode=%s, Oldcap=%d, Is=%d, Ip=%d, Vs=%d\n" + "fb_temp=%d, bat_temp=%d, sample_res=%d, USB=%d, DC=%d\n" +- "off:i=0x%x, c=0x%x, p=%d, Rbat=%d, age_ocv_cap=%d, fb=%d, hot=%d\n" ++ "off:i=0x%x, c=0x%x, p=%d, Rbat=%d, age_ocv_cap=%d, hot=%d\n" + "adp:finish=%lu, boot_min=%lu, sleep_min=%lu, adc=%d, Vsys=%d\n" + "bat:%s, meet: soc=%d, calc: dsoc=%d, rsoc=%d, Vocv=%d\n" + "pwr: dsoc=%d, rsoc=%d, vol=%d, halt: st=%d, cnt=%d, reboot=%d\n" +@@ -1901,7 +1872,7 @@ static void rk818_bat_debug_info(struct rk818_battery *di) + di->pdata->sample_res, di->usb_in, di->ac_in, + rk818_bat_get_ioffset(di), + rk818_bat_get_coffset(di), di->poffset, di->bat_res, +- di->age_adjust_cap, di->fb_blank, !!(thermal & HOTDIE_STS), ++ di->age_adjust_cap, !!(thermal & HOTDIE_STS), + base2min(di->finish_base), + base2min(di->boot_base), di->sleep_sum_sec / 60, + di->adc_allow_update, +@@ -2495,13 +2466,12 @@ static void rk818_bat_rsoc_daemon(struct rk818_battery *di) + int est_vol, remain_cap; + static unsigned long sec; + +- if ((di->remain_cap < 0) && (di->fb_blank != 0)) { ++ if (di->remain_cap < 0) { + if (!sec) + sec = get_boot_sec(); +- // wake_lock_timeout(&di->wake_lock, +- // (di->pdata->monitor_sec + 1) * HZ); + + DBG("sec=%ld, hold_sec=%ld\n", sec, base2sec(sec)); ++ + if (base2sec(sec) >= 60) { + sec = 0; + di->dbg_cap_low0++; +@@ -2511,7 +2481,6 @@ static void rk818_bat_rsoc_daemon(struct rk818_battery *di) + rk818_bat_init_capacity(di, remain_cap); + BAT_INFO("adjust cap below 0 --> %d, rsoc=%d\n", + di->remain_cap, di->rsoc); +- // wake_unlock(&di->wake_lock); + } + } else { + sec = 0; +@@ -3331,7 +3300,6 @@ static int rk818_battery_probe(struct platform_device *pdev) + rk818_bat_init_info(di); + rk818_bat_init_fg(di); + rk818_bat_init_sysfs(di); +- rk818_bat_register_fb_notify(di); + //wake_lock_init(&di->wake_lock, WAKE_LOCK_SUSPEND, "rk818_bat_lock"); + di->bat_monitor_wq = alloc_ordered_workqueue("%s", + WQ_MEM_RECLAIM | WQ_FREEZABLE, "rk818-bat-monitor-wq"); +@@ -3465,7 +3433,6 @@ static void rk818_battery_shutdown(struct platform_device *dev) + + cancel_delayed_work_sync(&di->bat_delay_work); + cancel_delayed_work_sync(&di->calib_delay_work); +- rk818_bat_unregister_fb_notify(di); + del_timer(&di->caltimer); + if (base2sec(di->boot_base) < REBOOT_PERIOD_SEC) + cnt = rk818_bat_check_reboot(di); +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0032-power-supply-rk818-charger-Unify-rk818-charger-and-r.patch b/projects/Amlogic/packages/linux/patches/S922X/0032-power-supply-rk818-charger-Unify-rk818-charger-and-r.patch new file mode 100644 index 0000000000..38985b8179 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0032-power-supply-rk818-charger-Unify-rk818-charger-and-r.patch @@ -0,0 +1,287 @@ +From e40e882849f5e9686c7c89db8e7a29b07a0e7875 Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Sat, 4 Nov 2023 18:25:03 +0100 +Subject: [PATCH 32/49] power: supply: rk818-charger: Unify rk818-charger and + rk818-battery + +The BSP driver is still used, but there is now a one device handling +the battery/charger properties, which should confuse the userspace +less. This also makes writing a power manager for the keyboard easier. + +Signed-off-by: Ondrej Jirman +--- + drivers/power/supply/Kconfig | 8 --- + drivers/power/supply/Makefile | 3 +- + drivers/power/supply/rk818_battery.c | 38 ++++++++++--- + drivers/power/supply/rk818_charger.c | 79 ++++++++++++++++++++++------ + 4 files changed, 95 insertions(+), 33 deletions(-) + +diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig +index a8f03555188f..b058d033fbf4 100644 +--- a/drivers/power/supply/Kconfig ++++ b/drivers/power/supply/Kconfig +@@ -993,14 +993,6 @@ config FUEL_GAUGE_MM8013 + the state of charge, temperature, cycle count, actual and design + capacity, etc. + +-config BATTERY_RK818 +- bool "RK818 Battery driver" +- depends on MFD_RK808 +- default n +- help +- If you say yes here you will get support for the battery of RK818 PMIC. +- This driver can give support for Rk818 Battery Charge Interface. +- + config CHARGER_RK818 + bool "RK818 Charger driver" + depends on MFD_RK8XX +diff --git a/drivers/power/supply/Makefile b/drivers/power/supply/Makefile +index 5a2480aca754..873d0cc4cbeb 100644 +--- a/drivers/power/supply/Makefile ++++ b/drivers/power/supply/Makefile +@@ -114,5 +114,4 @@ obj-$(CONFIG_CHARGER_SURFACE) += surface_charger.o + obj-$(CONFIG_BATTERY_UG3105) += ug3105_battery.o + obj-$(CONFIG_CHARGER_QCOM_SMB2) += qcom_pmi8998_charger.o + obj-$(CONFIG_FUEL_GAUGE_MM8013) += mm8013.o +-obj-$(CONFIG_BATTERY_RK818) += rk818_battery.o +-obj-$(CONFIG_CHARGER_RK818) += rk818_charger.o ++obj-$(CONFIG_CHARGER_RK818) += rk818_charger.o rk818_battery.o +diff --git a/drivers/power/supply/rk818_battery.c b/drivers/power/supply/rk818_battery.c +index cc409b7aafb5..e0e5ed0e3d2a 100644 +--- a/drivers/power/supply/rk818_battery.c ++++ b/drivers/power/supply/rk818_battery.c +@@ -897,12 +897,10 @@ static int rk818_bat_get_charge_state(struct rk818_battery *di) + return di->current_avg > 0; + } + +-static int rk818_battery_get_property(struct power_supply *psy, +- enum power_supply_property psp, +- union power_supply_propval *val) ++int rk818_battery_get_property(struct rk818_battery *di, ++ enum power_supply_property psp, ++ union power_supply_propval *val) + { +- struct rk818_battery *di = power_supply_get_drvdata(psy); +- + switch (psp) { + case POWER_SUPPLY_PROP_CURRENT_NOW: + val->intval = di->current_avg * 1000;/*uA*/ +@@ -961,16 +959,26 @@ static int rk818_battery_get_property(struct power_supply *psy, + + return 0; + } ++EXPORT_SYMBOL_GPL(rk818_battery_get_property); ++ ++static int rk818_battery_get_property_psy(struct power_supply *psy, ++ enum power_supply_property psp, ++ union power_supply_propval *val) ++{ ++ struct rk818_battery *di = power_supply_get_drvdata(psy); ++ ++ return rk818_battery_get_property(di, psp, val); ++} + + static const struct power_supply_desc rk818_bat_desc = { + .name = "battery", + .type = POWER_SUPPLY_TYPE_BATTERY, + .properties = rk818_bat_props, + .num_properties = ARRAY_SIZE(rk818_bat_props), +- .get_property = rk818_battery_get_property, ++ .get_property = rk818_battery_get_property_psy, + }; + +-static int rk818_bat_init_power_supply(struct rk818_battery *di) ++static __maybe_unused int rk818_bat_init_power_supply(struct rk818_battery *di) + { + struct power_supply_config psy_cfg = { .drv_data = di, }; + +@@ -2422,7 +2430,10 @@ static void rk818_bat_power_supply_changed(struct rk818_battery *di) + status = (status & CHRG_STATUS_MSK) >> 4; + old_soc = di->dsoc; + di->last_dsoc = di->dsoc; +- power_supply_changed(di->bat); ++ ++ if (di->bat) ++ power_supply_changed(di->bat); ++ + BAT_INFO("changed: dsoc=%d, rsoc=%d, v=%d, ov=%d c=%d, " + "cap=%d, f=%d, st=%s, hotdie=%d\n", + di->dsoc, di->rsoc, di->voltage_avg, di->voltage_ocv, +@@ -3251,6 +3262,14 @@ static const struct of_device_id rk818_battery_of_match[] = { + { }, + }; + ++static struct rk818_battery* bat; ++ ++struct rk818_battery* rk818_battery_get(void) ++{ ++ return bat; ++} ++EXPORT_SYMBOL_GPL(rk818_battery_get); ++ + static int rk818_battery_probe(struct platform_device *pdev) + { + const struct of_device_id *of_id = +@@ -3291,11 +3310,13 @@ static int rk818_battery_probe(struct platform_device *pdev) + return ret; + } + ++ /* + ret = rk818_bat_init_power_supply(di); + if (ret) { + dev_err(di->dev, "rk818 power supply register failed!\n"); + return ret; + } ++ */ + + rk818_bat_init_info(di); + rk818_bat_init_fg(di); +@@ -3309,6 +3330,7 @@ static int rk818_battery_probe(struct platform_device *pdev) + + BAT_INFO("driver version %s\n", DRIVER_VERSION); + ++ bat = di; + return ret; + } + +diff --git a/drivers/power/supply/rk818_charger.c b/drivers/power/supply/rk818_charger.c +index 6a9f2d1a7086..16bc4686b547 100644 +--- a/drivers/power/supply/rk818_charger.c ++++ b/drivers/power/supply/rk818_charger.c +@@ -355,14 +355,36 @@ static int rk818_charger_get_voltage_max(struct rk818_charger *cg, int *val) + return 0; + } + ++struct rk818_battery; ++struct rk818_battery* rk818_battery_get(void); ++int rk818_battery_get_property(struct rk818_battery *di, ++ enum power_supply_property psp, ++ union power_supply_propval *val); ++ + static int rk818_charger_get_property(struct power_supply *psy, + enum power_supply_property psp, + union power_supply_propval *val) + { + struct rk818_charger *cg = power_supply_get_drvdata(psy); ++ struct rk818_battery* di = rk818_battery_get(); + unsigned reg; + int ret; + ++ switch (psp) { ++ case POWER_SUPPLY_PROP_CURRENT_NOW: ++ case POWER_SUPPLY_PROP_VOLTAGE_NOW: ++ case POWER_SUPPLY_PROP_PRESENT: ++ case POWER_SUPPLY_PROP_CAPACITY: ++ case POWER_SUPPLY_PROP_TEMP: ++ case POWER_SUPPLY_PROP_STATUS: ++ case POWER_SUPPLY_PROP_CHARGE_COUNTER: ++ case POWER_SUPPLY_PROP_CHARGE_FULL: ++ if (!di) ++ return -ENODEV; ++ return rk818_battery_get_property(di, psp, val); ++ default:; ++ } ++ + switch (psp) { + case POWER_SUPPLY_PROP_ONLINE: + ret = regmap_read(cg->regmap, RK818_CHRG_CTRL_REG1, ®); +@@ -374,6 +396,20 @@ static int rk818_charger_get_property(struct power_supply *psy, + val->intval = !!(reg & RK818_CHRG_CTRL_REG1_CHRG_EN); + break; + ++ case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR: ++ ret = regmap_read(cg->regmap, RK818_CHRG_CTRL_REG1, ®); ++ if (ret) { ++ dev_err(cg->dev, "failed to read the charger state (%d)\n", ret); ++ return ret; ++ } ++ ++ if (reg & RK818_CHRG_CTRL_REG1_CHRG_EN) ++ val->intval = POWER_SUPPLY_CHARGE_BEHAVIOUR_AUTO; ++ else ++ val->intval = POWER_SUPPLY_CHARGE_BEHAVIOUR_INHIBIT_CHARGE; ++ ++ return 0; ++ + case POWER_SUPPLY_PROP_STATUS: + ret = regmap_read(cg->regmap, RK818_SUP_STS_REG, ®); + if (ret) +@@ -480,14 +516,18 @@ static int rk818_charger_set_property(struct power_supply *psy, + int ret; + + switch (psp) { +- case POWER_SUPPLY_PROP_ONLINE: +- ret = regmap_update_bits(cg->regmap, RK818_CHRG_CTRL_REG1, +- RK818_CHRG_CTRL_REG1_CHRG_EN, +- val->intval ? RK818_CHRG_CTRL_REG1_CHRG_EN : 0); +- if (ret) +- dev_err(cg->dev, "failed to setup the charger (%d)\n", ret); +- +- return ret; ++ case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR: ++ switch (val->intval) { ++ case POWER_SUPPLY_CHARGE_BEHAVIOUR_AUTO: ++ return regmap_update_bits(cg->regmap, RK818_CHRG_CTRL_REG1, ++ RK818_CHRG_CTRL_REG1_CHRG_EN, ++ RK818_CHRG_CTRL_REG1_CHRG_EN); ++ case POWER_SUPPLY_CHARGE_BEHAVIOUR_INHIBIT_CHARGE: ++ return regmap_update_bits(cg->regmap, RK818_CHRG_CTRL_REG1, ++ RK818_CHRG_CTRL_REG1_CHRG_EN, 0); ++ default: ++ return -EINVAL; ++ } + + case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE: + return rk818_charger_set_voltage_max(cg, val->intval); +@@ -506,7 +546,7 @@ static int rk818_charger_prop_writeable(struct power_supply *psy, + switch (psp) { + case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT: + case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE: +- case POWER_SUPPLY_PROP_ONLINE: ++ case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR: + return 1; + + default: +@@ -518,6 +558,7 @@ static enum power_supply_property rk818_charger_props[] = { + POWER_SUPPLY_PROP_ONLINE, + POWER_SUPPLY_PROP_HEALTH, + POWER_SUPPLY_PROP_STATUS, ++ POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR, + POWER_SUPPLY_PROP_CHARGE_TYPE, + POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT, + POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT, +@@ -525,17 +566,25 @@ static enum power_supply_property rk818_charger_props[] = { + POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX, + POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX, + POWER_SUPPLY_PROP_PRECHARGE_CURRENT, ++ ++ // inherited from BSP battery driver ++ POWER_SUPPLY_PROP_CURRENT_NOW, ++ POWER_SUPPLY_PROP_VOLTAGE_NOW, ++ POWER_SUPPLY_PROP_PRESENT, ++ POWER_SUPPLY_PROP_CAPACITY, ++ POWER_SUPPLY_PROP_TEMP, ++ POWER_SUPPLY_PROP_CHARGE_COUNTER, ++ POWER_SUPPLY_PROP_CHARGE_FULL, + }; + + /* +- * TODO: This functionality should be in a battery driver/supply, but that one +- * is such a mess, I don't want to touch it now. Let's have a separate supply +- * for controlling the charger for now, and a prayer for the poor soul that +- * will have to understand and clean up the battery driver. ++ * We import some capacity tracking functionality from the BSP battery driver. ++ * Some poor soul will have to understand and clean up the BSP battery driver, ++ * but not me, not now. :) + */ + static const struct power_supply_desc rk818_charger_desc = { +- .name = "rk818-charger", +- .type = POWER_SUPPLY_TYPE_MAINS, ++ .name = "rk818-battery", ++ .type = POWER_SUPPLY_TYPE_BATTERY, + .properties = rk818_charger_props, + .num_properties = ARRAY_SIZE(rk818_charger_props), + .property_is_writeable = rk818_charger_prop_writeable, +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0033-power-supply-rk818-battery-Speed-up-battery-current-.patch b/projects/Amlogic/packages/linux/patches/S922X/0033-power-supply-rk818-battery-Speed-up-battery-current-.patch new file mode 100644 index 0000000000..203c187622 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0033-power-supply-rk818-battery-Speed-up-battery-current-.patch @@ -0,0 +1,36 @@ +From 5e4566a4d1aea04096d90b612475767167b8757c Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Fri, 27 May 2022 03:07:54 +0200 +Subject: [PATCH 33/49] power: supply: rk818-battery: Speed up battery current + readout + +PMIC does averaging, driver does averaging on top of that averaging, +and it's just too much averaging, and the speed suffers. + +Signed-off-by: Ondrej Jirman +--- + drivers/power/supply/rk818_battery.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/power/supply/rk818_battery.c b/drivers/power/supply/rk818_battery.c +index e0e5ed0e3d2a..9323666491db 100644 +--- a/drivers/power/supply/rk818_battery.c ++++ b/drivers/power/supply/rk818_battery.c +@@ -903,12 +903,12 @@ int rk818_battery_get_property(struct rk818_battery *di, + { + switch (psp) { + case POWER_SUPPLY_PROP_CURRENT_NOW: +- val->intval = di->current_avg * 1000;/*uA*/ ++ val->intval = rk818_bat_get_avg_current(di) * 1000;/*uA*/ + if (di->pdata->bat_mode == MODE_VIRTUAL) + val->intval = VIRTUAL_CURRENT * 1000; + break; + case POWER_SUPPLY_PROP_VOLTAGE_NOW: +- val->intval = di->voltage_avg * 1000;/*uV*/ ++ val->intval = rk818_bat_get_avg_voltage(di) * 1000;/*uV*/ + if (di->pdata->bat_mode == MODE_VIRTUAL) + val->intval = VIRTUAL_VOLTAGE * 1000; + break; +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0034-power-supply-rk818-charger-Delay-applying-input-curr.patch b/projects/Amlogic/packages/linux/patches/S922X/0034-power-supply-rk818-charger-Delay-applying-input-curr.patch new file mode 100644 index 0000000000..71d203a67e --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0034-power-supply-rk818-charger-Delay-applying-input-curr.patch @@ -0,0 +1,64 @@ +From c35257b3f311f46a6ed4b15c5af433433486f8a1 Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Tue, 2 Aug 2022 09:37:05 +0200 +Subject: [PATCH 34/49] power: supply: rk818-charger: Delay applying input + current limit until first BC detection finishes + +When the phone boots for the first time, we only want to react to +changes in charger power supply max current after the USB power supply +type detection finishes. This allows us to keep the limit set by +the bootloader, until we know better. + +This is part of the workaround for Pinephone Pro boot loops on low battery. +The other part is bootloader raising the input current limit to 2A. + +Signed-off-by: Ondrej Jirman +--- + drivers/power/supply/rk818_charger.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/drivers/power/supply/rk818_charger.c b/drivers/power/supply/rk818_charger.c +index 16bc4686b547..979165c98e5a 100644 +--- a/drivers/power/supply/rk818_charger.c ++++ b/drivers/power/supply/rk818_charger.c +@@ -51,6 +51,8 @@ struct rk818_charger { + + struct power_supply *usb_psy; + struct power_supply *charger_psy; ++ ++ bool apply_ilim; + }; + + // {{{ USB supply +@@ -72,6 +74,8 @@ static int rk818_usb_set_input_current_max(struct rk818_charger *cg, + else + reg = 11; + ++ dev_info(cg->dev, "applying input current limit %d mA\n", val / 1000); ++ + ret = regmap_update_bits(cg->regmap, RK818_USB_CTRL_REG, + RK818_USB_CTRL_USB_ILIM_MASK, reg); + if (ret) +@@ -242,6 +246,19 @@ static void rk818_usb_power_external_power_changed(struct power_supply *psy) + if (ret) + return; + ++ /* ++ * We only want to start applying input current limit after we get first ++ * non-0 value from the supplier. Until then, we keep the limit applied ++ * by the bootloader. If we lower the limit before the charger is properly ++ * detected, we risk boot failure due to insufficient power. ++ */ ++ if (!cg->apply_ilim) { ++ if (!val.intval) ++ return; ++ ++ cg->apply_ilim = true; ++ } ++ + if (val.intval < 500000) + val.intval = 500000; + +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0035-power-supply-rk818-battery-Don-t-auto-poweroff-the-P.patch b/projects/Amlogic/packages/linux/patches/S922X/0035-power-supply-rk818-battery-Don-t-auto-poweroff-the-P.patch new file mode 100644 index 0000000000..701a4c816e --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0035-power-supply-rk818-battery-Don-t-auto-poweroff-the-P.patch @@ -0,0 +1,63 @@ +From 88271052cc0c74b7109ea781a53dc8e863eda764 Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Thu, 10 Nov 2022 20:03:47 +0100 +Subject: [PATCH 35/49] power: supply: rk818-battery: Don't auto-poweroff the + PMIC on low battery + +Just raise the interrupt. This avoids undervoltage shutdowns when +unplugging the USB PSU from USB keyboard. IP5209 stop supplying power +to VOUT during transition from pass-through mode until VOUT boost +is enabled. (about 30ms on the oscilloscope) + +Somehow RK818 doesn't like this when EN_VABT_LOW_SHUT_DOWN is enabled +and PMIC shuts down. Emergency shutdown is implemented in keyboard +power manager driver. + +Signed-off-by: Ondrej Jirman +--- + drivers/power/supply/rk818_battery.c | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/drivers/power/supply/rk818_battery.c b/drivers/power/supply/rk818_battery.c +index 9323666491db..e3d04a51e145 100644 +--- a/drivers/power/supply/rk818_battery.c ++++ b/drivers/power/supply/rk818_battery.c +@@ -3021,6 +3021,7 @@ static void rk818_bat_set_shtd_vol(struct rk818_battery *di) + { + u8 val; + ++#if 0 + /* set vbat lowest 3.0v shutdown */ + val = rk818_bat_read(di, RK818_VB_MON_REG); + val &= ~(VBAT_LOW_VOL_MASK | VBAT_LOW_ACT_MASK); +@@ -3030,6 +3031,13 @@ static void rk818_bat_set_shtd_vol(struct rk818_battery *di) + /* disable low irq */ + rk818_bat_set_bits(di, RK818_INT_STS_MSK_REG1, + VB_LOW_INT_EN, VB_LOW_INT_EN); ++#endif ++ ++ val = rk818_bat_read(di, RK818_VB_MON_REG); ++ val &= (~(VBAT_LOW_VOL_MASK | VBAT_LOW_ACT_MASK)); ++ val |= (RK818_VBAT_LOW_3V4 | EN_VBAT_LOW_IRQ); ++ rk818_bat_write(di, RK818_VB_MON_REG, val); ++ rk818_bat_set_bits(di, RK818_INT_STS_MSK_REG1, VB_LOW_INT_EN, 0); + } + + static void rk818_bat_init_fg(struct rk818_battery *di) +@@ -3430,12 +3438,7 @@ static int rk818_battery_resume(struct platform_device *dev) + rk818_bat_save_data(di); + + /* set vbat lowest 3.0v shutdown */ +- val = rk818_bat_read(di, RK818_VB_MON_REG); +- val &= ~(VBAT_LOW_VOL_MASK | VBAT_LOW_ACT_MASK); +- val |= (RK818_VBAT_LOW_3V0 | EN_VABT_LOW_SHUT_DOWN); +- rk818_bat_write(di, RK818_VB_MON_REG, val); +- rk818_bat_set_bits(di, RK818_INT_STS_MSK_REG1, +- VB_LOW_INT_EN, VB_LOW_INT_EN); ++ rk818_bat_set_shtd_vol(di); + + /* charge/lowpower lock: for battery work to update dsoc and rsoc */ + // if ((di->sleep_chrg_online) || +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0036-power-supply-rk818-charger-Add-support-for-POWER_SUP.patch b/projects/Amlogic/packages/linux/patches/S922X/0036-power-supply-rk818-charger-Add-support-for-POWER_SUP.patch new file mode 100644 index 0000000000..437f0cb7ff --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0036-power-supply-rk818-charger-Add-support-for-POWER_SUP.patch @@ -0,0 +1,44 @@ +From 557a625ad061282bd321e9c96e5d0cf362e59706 Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Thu, 10 Nov 2022 20:05:16 +0100 +Subject: [PATCH 36/49] power: supply: rk818-charger: Add support for + POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN + +Report total battery capacity. + +Signed-off-by: Ondrej Jirman +--- + drivers/power/supply/rk818_charger.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/drivers/power/supply/rk818_charger.c b/drivers/power/supply/rk818_charger.c +index 979165c98e5a..cdef0dcd1f8c 100644 +--- a/drivers/power/supply/rk818_charger.c ++++ b/drivers/power/supply/rk818_charger.c +@@ -518,6 +518,14 @@ static int rk818_charger_get_property(struct power_supply *psy, + val->intval = 3000000; + break; + ++ case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN: ++ val->intval = 11400000; ++ return 0; ++ ++ case POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN: ++ val->intval = 0; ++ return 0; ++ + default: + return -EINVAL; + } +@@ -583,6 +591,8 @@ static enum power_supply_property rk818_charger_props[] = { + POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX, + POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX, + POWER_SUPPLY_PROP_PRECHARGE_CURRENT, ++ POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, ++ POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN, + + // inherited from BSP battery driver + POWER_SUPPLY_PROP_CURRENT_NOW, +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0037-power-supply-rk818-battery-Don-t-reset-dsoc-to-0-on-.patch b/projects/Amlogic/packages/linux/patches/S922X/0037-power-supply-rk818-battery-Don-t-reset-dsoc-to-0-on-.patch new file mode 100644 index 0000000000..c10eb235e9 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0037-power-supply-rk818-battery-Don-t-reset-dsoc-to-0-on-.patch @@ -0,0 +1,28 @@ +From 22446adc1a1745a578419bd8ce652ae1a02d9615 Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Sun, 11 Dec 2022 10:39:22 +0100 +Subject: [PATCH 37/49] power: supply: rk818-battery: Don't reset dsoc to 0 on + rk818_vb_low_irq + +The interrupt fires at 3.4V vbat which is not equivalent to 0% charge. + +Signed-off-by: Ondrej Jirman +--- + drivers/power/supply/rk818_battery.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/power/supply/rk818_battery.c b/drivers/power/supply/rk818_battery.c +index e3d04a51e145..b62d59a4b228 100644 +--- a/drivers/power/supply/rk818_battery.c ++++ b/drivers/power/supply/rk818_battery.c +@@ -2930,7 +2930,6 @@ static irqreturn_t rk818_vb_low_irq(int irq, void *bat) + { + struct rk818_battery *di = (struct rk818_battery *)bat; + +- di->dsoc = 0; + rk_send_wakeup_key(); + BAT_INFO("lower power yet, power off system! v=%d, c=%d, dsoc=%d\n", + di->voltage_avg, di->current_avg, di->dsoc); +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0038-supply-rk817-Fix-battery-capacity-sanity-check-calcu.patch b/projects/Amlogic/packages/linux/patches/S922X/0038-supply-rk817-Fix-battery-capacity-sanity-check-calcu.patch new file mode 100644 index 0000000000..2374207b22 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0038-supply-rk817-Fix-battery-capacity-sanity-check-calcu.patch @@ -0,0 +1,30 @@ +From 776d63cd8ab6e498ae405f05d20808f4a8dae920 Mon Sep 17 00:00:00 2001 +From: Alexander Warnecke +Date: Thu, 29 Jun 2023 19:52:42 +1000 +Subject: [PATCH 38/49] supply: rk817: Fix battery capacity sanity check + calculation + +If the nvram variable is corrupted in a way that multiplying it by 1000 causes an integer overflow and wraps around to a number within or below the sanity check bounds, the check fails and capacity is reported incorrectly. +Change the sanity check calculation to not multiply the variable read from the rk817 nvram, preventing the overflow and resulting in all corrupt capacity values being detected. + +Signed-off-by: Alexander Warnecke +--- + drivers/power/supply/rk817_charger.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/power/supply/rk817_charger.c b/drivers/power/supply/rk817_charger.c +index 7ca91739c6cc..44af88045ac1 100644 +--- a/drivers/power/supply/rk817_charger.c ++++ b/drivers/power/supply/rk817_charger.c +@@ -715,7 +715,7 @@ static int rk817_read_battery_nvram_values(struct rk817_charger *charger) + * correct it. + */ + if ((charger->fcc_mah < 500) || +- ((charger->fcc_mah * 1000) > charger->bat_charge_full_design_uah)) { ++ (charger->fcc_mah > (charger->bat_charge_full_design_uah / 1000))) { + dev_info(charger->dev, + "Invalid NVRAM max charge, setting to %u uAH\n", + charger->bat_charge_full_design_uah); +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/0039-power-supply-rk817-charger-Add-input-current-limit-s.patch b/projects/Amlogic/packages/linux/patches/S922X/0039-power-supply-rk817-charger-Add-input-current-limit-s.patch new file mode 100644 index 0000000000..47e370d1a1 --- /dev/null +++ b/projects/Amlogic/packages/linux/patches/S922X/0039-power-supply-rk817-charger-Add-input-current-limit-s.patch @@ -0,0 +1,194 @@ +From 559a8cdd09bf04bb96f5ac3e25e8eaa58873c8ee Mon Sep 17 00:00:00 2001 +From: Ondrej Jirman +Date: Sun, 6 Aug 2023 02:55:22 +0200 +Subject: [PATCH 39/49] power: supply: rk817-charger: Add input current limit + setting + +This is useful for proper USB input current limiting. + +Signed-off-by: Ondrej Jirman +--- + drivers/power/supply/rk817_charger.c | 112 +++++++++++++++++++++++---- + 1 file changed, 99 insertions(+), 13 deletions(-) + +diff --git a/drivers/power/supply/rk817_charger.c b/drivers/power/supply/rk817_charger.c +index 44af88045ac1..833b12cfcced 100644 +--- a/drivers/power/supply/rk817_charger.c ++++ b/drivers/power/supply/rk817_charger.c +@@ -556,11 +556,72 @@ static int rk817_bat_get_prop(struct power_supply *ps, + return 0; + } + ++static const int rk817_usb_input_current_limits[] = { ++ 1, 80000, ++ 0, 450000, ++ 2, 850000, ++ 3, 1500000, ++ 4, 1750000, ++ 5, 2000000, ++ 6, 2500000, ++ 7, 3000000, ++}; ++ ++static int rk817_usb_set_input_current_max(struct rk817_charger *cg, ++ int val) ++{ ++ int ret, i; ++ ++ for (i = ARRAY_SIZE(rk817_usb_input_current_limits) / 2 - 1; i > 0; i--) { ++ if (val >= rk817_usb_input_current_limits[2 * i + 1]) ++ break; ++ } ++ ++ dev_info(cg->dev, "applying input current limit %d mA\n", ++ rk817_usb_input_current_limits[2 * i + 1] / 1000); ++ ++ ret = regmap_write_bits(cg->rk808->regmap, RK817_PMIC_CHRG_IN, ++ RK817_USB_ILIM_SEL, ++ rk817_usb_input_current_limits[2 * i]); ++ if (ret) ++ dev_err(cg->dev, ++ "USB input current limit setting failed (%d)\n", ret); ++ ++ return ret; ++} ++ ++static int rk817_usb_get_input_current_max(struct rk817_charger *cg, ++ int *val) ++{ ++ unsigned reg; ++ int ret; ++ ++ ret = regmap_read(cg->rk808->regmap, RK817_PMIC_CHRG_IN, ®); ++ if (ret) { ++ dev_err(cg->dev, ++ "USB input current limit getting failed (%d)\n", ret); ++ return ret; ++ } ++ ++ reg &= RK817_USB_ILIM_SEL; ++ ++ for (int i = 0; i < ARRAY_SIZE(rk817_usb_input_current_limits) / 2; i++) { ++ int r = rk817_usb_input_current_limits[2 * i]; ++ if (r == reg) { ++ *val = rk817_usb_input_current_limits[2 * i + 1]; ++ break; ++ } ++ } ++ ++ return 0; ++} ++ + static int rk817_chg_get_prop(struct power_supply *ps, + enum power_supply_property prop, + union power_supply_propval *val) + { + struct rk817_charger *charger = power_supply_get_drvdata(ps); ++ int ret; + + switch (prop) { + case POWER_SUPPLY_PROP_ONLINE: +@@ -577,6 +638,11 @@ static int rk817_chg_get_prop(struct power_supply *ps, + case POWER_SUPPLY_PROP_VOLTAGE_AVG: + val->intval = charger->charger_input_volt_avg_uv; + break; ++ case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT: ++ ret = rk817_usb_get_input_current_max(charger, &val->intval); ++ if (ret) ++ return ret; ++ break; + /* + * While it's possible that other implementations could use different + * USB types, the current implementation for this PMIC (the Odroid Go +@@ -589,6 +655,25 @@ static int rk817_chg_get_prop(struct power_supply *ps, + return -EINVAL; + } + return 0; ++} ++ ++static int rk817_chg_set_prop(struct power_supply *ps, ++ enum power_supply_property prop, ++ const union power_supply_propval *val) ++{ ++ struct rk817_charger *charger = power_supply_get_drvdata(ps); ++ int ret; ++ ++ switch (prop) { ++ case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT: ++ ret = rk817_usb_set_input_current_max(charger, val->intval); ++ if (ret) ++ return ret; ++ break; ++ default: ++ return -EINVAL; ++ } ++ return 0; + + } + +@@ -632,15 +717,6 @@ static irqreturn_t rk817_plug_out_isr(int irq, void *cg) + regmap_write_bits(rk808->regmap, RK817_PMIC_CHRG_IN, RK817_USB_VLIM_EN, + (0x01 << 7)); + +- /* +- * Set average USB input current limit to 1.5A and enable USB current +- * input limit. +- */ +- regmap_write_bits(rk808->regmap, RK817_PMIC_CHRG_IN, +- RK817_USB_ILIM_SEL, 0x03); +- regmap_write_bits(rk808->regmap, RK817_PMIC_CHRG_IN, RK817_USB_ILIM_EN, +- (0x01 << 3)); +- + rk817_read_props(charger); + + dev_dbg(charger->dev, "Power Cord Removed\n"); +@@ -648,6 +724,17 @@ static irqreturn_t rk817_plug_out_isr(int irq, void *cg) + return IRQ_HANDLED; + } + ++static int rk817_charger_prop_writeable(struct power_supply *psy, ++ enum power_supply_property psp) ++{ ++ switch (psp) { ++ case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT: ++ return 1; ++ default: ++ return 0; ++ } ++} ++ + static enum power_supply_property rk817_bat_props[] = { + POWER_SUPPLY_PROP_PRESENT, + POWER_SUPPLY_PROP_STATUS, +@@ -671,6 +758,7 @@ static enum power_supply_property rk817_chg_props[] = { + POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN, + POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN, + POWER_SUPPLY_PROP_VOLTAGE_AVG, ++ POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, + }; + + static enum power_supply_usb_type rk817_usb_type[] = { +@@ -693,7 +781,9 @@ static const struct power_supply_desc rk817_chg_desc = { + .num_usb_types = ARRAY_SIZE(rk817_usb_type), + .properties = rk817_chg_props, + .num_properties = ARRAY_SIZE(rk817_chg_props), ++ .property_is_writeable = rk817_charger_prop_writeable, + .get_property = rk817_chg_get_prop, ++ .set_property = rk817_chg_set_prop, + }; + + static int rk817_read_battery_nvram_values(struct rk817_charger *charger) +@@ -1025,10 +1115,6 @@ static int rk817_battery_init(struct rk817_charger *charger, + * Set average USB input current limit to 1.5A and enable USB current + * input limit. + */ +- regmap_write_bits(rk808->regmap, RK817_PMIC_CHRG_IN, +- RK817_USB_ILIM_SEL, 0x03); +- regmap_write_bits(rk808->regmap, RK817_PMIC_CHRG_IN, RK817_USB_ILIM_EN, +- (0x01 << 3)); + + return 0; + } +-- +2.34.1 + diff --git a/projects/Amlogic/packages/linux/patches/S922X/004.02-ODROID-GO-Ultra-power-off-driver.patch b/projects/Amlogic/packages/linux/patches/S922X/004.02-ODROID-GO-Ultra-power-off-driver.patch deleted file mode 100644 index ce44b83684..0000000000 --- a/projects/Amlogic/packages/linux/patches/S922X/004.02-ODROID-GO-Ultra-power-off-driver.patch +++ /dev/null @@ -1,210 +0,0 @@ -diff -rupN linux.orig/drivers/power/reset/Kconfig linux/drivers/power/reset/Kconfig ---- linux.orig/drivers/power/reset/Kconfig 2023-09-12 12:02:58.741642619 +0000 -+++ linux/drivers/power/reset/Kconfig 2023-09-12 12:03:27.490291628 +0000 -@@ -141,6 +141,13 @@ config POWER_RESET_OCELOT_RESET - help - This driver supports restart for Microsemi Ocelot SoC and similar. - -+config POWER_RESET_ODROID_GO_ULTRA_POWEROFF -+ bool "Odroid Go Ultra power-off driver" -+ depends on ARCH_MESON || COMPILE_TEST -+ depends on I2C=y && OF -+ help -+ This driver supports Power off for Odroid Go Ultra device. -+ - config POWER_RESET_OXNAS - bool "OXNAS SoC restart driver" - depends on ARCH_OXNAS -diff -rupN linux.orig/drivers/power/reset/Makefile linux/drivers/power/reset/Makefile ---- linux.orig/drivers/power/reset/Makefile 2023-09-12 12:02:58.741642619 +0000 -+++ linux/drivers/power/reset/Makefile 2023-09-12 12:03:27.490291628 +0000 -@@ -17,6 +17,7 @@ obj-$(CONFIG_POWER_RESET_MT6323) += mt63 - obj-$(CONFIG_POWER_RESET_OXNAS) += oxnas-restart.o - obj-$(CONFIG_POWER_RESET_QCOM_PON) += qcom-pon.o - obj-$(CONFIG_POWER_RESET_OCELOT_RESET) += ocelot-reset.o -+obj-$(CONFIG_POWER_RESET_ODROID_GO_ULTRA_POWEROFF) += odroid-go-ultra-poweroff.o - obj-$(CONFIG_POWER_RESET_PIIX4_POWEROFF) += piix4-poweroff.o - obj-$(CONFIG_POWER_RESET_LTC2952) += ltc2952-poweroff.o - obj-$(CONFIG_POWER_RESET_QNAP) += qnap-poweroff.o -diff -rupN linux.orig/drivers/power/reset/odroid-go-ultra-poweroff.c linux/drivers/power/reset/odroid-go-ultra-poweroff.c ---- linux.orig/drivers/power/reset/odroid-go-ultra-poweroff.c 1970-01-01 00:00:00.000000000 +0000 -+++ linux/drivers/power/reset/odroid-go-ultra-poweroff.c 2023-09-12 12:03:27.490291628 +0000 -@@ -0,0 +1,177 @@ -+// SPDX-License-Identifier: GPL-2.0+ -+/* -+ * Copyright (c) 2023 Neil Armstrong -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* -+ * The Odroid Go Ultra has 2 PMICs: -+ * - RK818 (manages the battery and USB-C power supply) -+ * - RK817 -+ * Both PMICs feeds power to the S922X SoC, so they must be powered-off in sequence. -+ * Vendor does power-off the RK817 first, then the RK818 so here we follow this sequence. -+ */ -+ -+struct odroid_go_ultra_poweroff_data { -+ struct device *dev; -+ struct device *rk817; -+ struct device *rk818; -+}; -+ -+static int odroid_go_ultra_poweroff_prepare(struct sys_off_data *data) -+{ -+ struct odroid_go_ultra_poweroff_data *poweroff_data = data->cb_data; -+ struct regmap *rk817, *rk818; -+ int ret; -+ -+ /* RK817 Regmap */ -+ rk817 = dev_get_regmap(poweroff_data->rk817, NULL); -+ if (!rk817) { -+ dev_err(poweroff_data->dev, "failed to get rk817 regmap\n"); -+ return notifier_from_errno(-EINVAL); -+ } -+ -+ /* RK818 Regmap */ -+ rk818 = dev_get_regmap(poweroff_data->rk818, NULL); -+ if (!rk818) { -+ dev_err(poweroff_data->dev, "failed to get rk818 regmap\n"); -+ return notifier_from_errno(-EINVAL); -+ } -+ -+ dev_info(poweroff_data->dev, "Setting PMICs for power off"); -+ -+ /* RK817 */ -+ ret = regmap_update_bits(rk817, RK817_SYS_CFG(3), DEV_OFF, DEV_OFF); -+ if (ret) { -+ dev_err(poweroff_data->dev, "failed to poweroff rk817\n"); -+ return notifier_from_errno(ret); -+ } -+ -+ /* RK818 */ -+ ret = regmap_update_bits(rk818, RK818_DEVCTRL_REG, DEV_OFF, DEV_OFF); -+ if (ret) { -+ dev_err(poweroff_data->dev, "failed to poweroff rk818\n"); -+ return notifier_from_errno(ret); -+ } -+ -+ return NOTIFY_OK; -+} -+ -+static void odroid_go_ultra_poweroff_put_pmic_device(void *data) -+{ -+ struct device *dev = data; -+ -+ put_device(dev); -+} -+ -+static int odroid_go_ultra_poweroff_get_pmic_device(struct device *dev, const char *compatible, -+ struct device **pmic) -+{ -+ struct device_node *pmic_node; -+ struct i2c_client *pmic_client; -+ -+ pmic_node = of_find_compatible_node(NULL, NULL, compatible); -+ if (!pmic_node) -+ return -ENODEV; -+ -+ pmic_client = of_find_i2c_device_by_node(pmic_node); -+ of_node_put(pmic_node); -+ if (!pmic_client) -+ return -EPROBE_DEFER; -+ -+ *pmic = &pmic_client->dev; -+ -+ return devm_add_action_or_reset(dev, odroid_go_ultra_poweroff_put_pmic_device, *pmic); -+} -+ -+static int odroid_go_ultra_poweroff_probe(struct platform_device *pdev) -+{ -+ struct odroid_go_ultra_poweroff_data *poweroff_data; -+ int ret; -+ -+ poweroff_data = devm_kzalloc(&pdev->dev, sizeof(*poweroff_data), GFP_KERNEL); -+ if (!poweroff_data) -+ return -ENOMEM; -+ -+ dev_set_drvdata(&pdev->dev, poweroff_data); -+ -+ /* RK818 PMIC Device */ -+ ret = odroid_go_ultra_poweroff_get_pmic_device(&pdev->dev, "rockchip,rk818", -+ &poweroff_data->rk818); -+ if (ret) -+ return dev_err_probe(&pdev->dev, ret, "failed to get rk818 mfd data\n"); -+ -+ /* RK817 PMIC Device */ -+ ret = odroid_go_ultra_poweroff_get_pmic_device(&pdev->dev, "rockchip,rk817", -+ &poweroff_data->rk817); -+ if (ret) -+ return dev_err_probe(&pdev->dev, ret, "failed to get rk817 mfd data\n"); -+ -+ /* Register as SYS_OFF_MODE_POWER_OFF_PREPARE because regmap_update_bits may sleep */ -+ ret = devm_register_sys_off_handler(&pdev->dev, -+ SYS_OFF_MODE_POWER_OFF_PREPARE, -+ SYS_OFF_PRIO_DEFAULT, -+ odroid_go_ultra_poweroff_prepare, -+ poweroff_data); -+ if (ret) -+ return dev_err_probe(&pdev->dev, ret, "failed to register sys-off handler\n"); -+ -+ dev_info(&pdev->dev, "Registered Power-Off handler\n"); -+ -+ return 0; -+} -+static struct platform_device *pdev; -+ -+static struct platform_driver odroid_go_ultra_poweroff_driver = { -+ .driver = { -+ .name = "odroid-go-ultra-poweroff", -+ }, -+ .probe = odroid_go_ultra_poweroff_probe, -+}; -+ -+static int __init odroid_go_ultra_poweroff_init(void) -+{ -+ int ret; -+ -+ /* Only create when running on the Odroid Go Ultra device */ -+ if (!of_device_is_compatible(of_root, "hardkernel,odroid-go-ultra")) -+ return -ENODEV; -+ -+ ret = platform_driver_register(&odroid_go_ultra_poweroff_driver); -+ if (ret) -+ return ret; -+ -+ pdev = platform_device_register_resndata(NULL, "odroid-go-ultra-poweroff", -1, -+ NULL, 0, NULL, 0); -+ -+ if (IS_ERR(pdev)) { -+ platform_driver_unregister(&odroid_go_ultra_poweroff_driver); -+ return PTR_ERR(pdev); -+ } -+ -+ return 0; -+} -+ -+static void __exit odroid_go_ultra_poweroff_exit(void) -+{ -+ /* Only delete when running on the Odroid Go Ultra device */ -+ if (!of_device_is_compatible(of_root, "hardkernel,odroid-go-ultra")) -+ return; -+ -+ platform_device_unregister(pdev); -+ platform_driver_unregister(&odroid_go_ultra_poweroff_driver); -+} -+ -+module_init(odroid_go_ultra_poweroff_init); -+module_exit(odroid_go_ultra_poweroff_exit); -+ -+MODULE_AUTHOR("Neil Armstrong "); -+MODULE_DESCRIPTION("Odroid Go Ultra poweroff driver"); -+MODULE_LICENSE("GPL"); - diff --git a/projects/Amlogic/packages/linux/patches/S922X/004.05-dsi-driver.patch b/projects/Amlogic/packages/linux/patches/S922X/004.05-dsi-driver.patch deleted file mode 100644 index ec86a1ada7..0000000000 --- a/projects/Amlogic/packages/linux/patches/S922X/004.05-dsi-driver.patch +++ /dev/null @@ -1,3186 +0,0 @@ -diff -rupN linux.orig/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi linux/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi ---- linux.orig/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi 2023-08-22 23:19:15.430576261 +0000 -+++ linux/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi 2023-08-22 23:08:18.677044634 +0000 -@@ -1656,9 +1656,28 @@ - <250000000>, - <0>; /* Do Nothing */ - }; -+ -+ mipi_analog_dphy: phy { -+ compatible = "amlogic,g12a-mipi-dphy-analog"; -+ #phy-cells = <0>; -+ status = "disabled"; -+ }; - }; - }; - -+ mipi_dphy: phy@44000 { -+ compatible = "amlogic,axg-mipi-dphy"; -+ reg = <0x0 0x44000 0x0 0x2000>; -+ clocks = <&clkc CLKID_MIPI_DSI_PHY>; -+ clock-names = "pclk"; -+ resets = <&reset RESET_MIPI_DSI_PHY>; -+ reset-names = "phy"; -+ phys = <&mipi_analog_dphy>; -+ phy-names = "analog"; -+ #phy-cells = <0>; -+ status = "disabled"; -+ }; -+ - usb3_pcie_phy: phy@46000 { - compatible = "amlogic,g12a-usb3-pcie-phy"; - reg = <0x0 0x46000 0x0 0x2000>; -@@ -2143,6 +2162,15 @@ - remote-endpoint = <&hdmi_tx_in>; - }; - }; -+ -+ /* DPI output port */ -+ dpi_port: port@2 { -+ reg = <2>; -+ -+ dpi_out: endpoint { -+ remote-endpoint = <&mipi_dsi_in>; -+ }; -+ }; - }; - - gic: interrupt-controller@ffc01000 { -@@ -2180,6 +2208,48 @@ - amlogic,channel-interrupts = <64 65 66 67 68 69 70 71>; - }; - -+ mipi_dsi: mipi-dsi@7000 { -+ compatible = "amlogic,meson-g12a-dw-mipi-dsi"; -+ reg = <0x0 0x7000 0x0 0x1000>; -+ resets = <&reset RESET_MIPI_DSI_HOST>; -+ reset-names = "top"; -+ clocks = <&clkc CLKID_MIPI_DSI_HOST>, -+ <&clkc CLKID_MIPI_DSI_PXCLK>, -+ <&clkc CLKID_CTS_ENCL>; -+ clock-names = "pclk", "bit", "px"; -+ phys = <&mipi_dphy>; -+ phy-names = "dphy"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "disabled"; -+ -+ assigned-clocks = <&clkc CLKID_MIPI_DSI_PXCLK_SEL>, -+ <&clkc CLKID_CTS_ENCL_SEL>, -+ <&clkc CLKID_VCLK2_SEL>; -+ assigned-clock-parents = <&clkc CLKID_GP0_PLL>, -+ <&clkc CLKID_VCLK2_DIV1>, -+ <&clkc CLKID_GP0_PLL>; -+ -+ ports { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ /* VPU VENC Input */ -+ mipi_dsi_venc_port: port@0 { -+ reg = <0>; -+ -+ mipi_dsi_in: endpoint { -+ remote-endpoint = <&dpi_out>; -+ }; -+ }; -+ -+ /* DSI Output */ -+ mipi_dsi_panel_port: port@1 { -+ reg = <1>; -+ }; -+ }; -+ }; -+ - watchdog: watchdog@f0d0 { - compatible = "amlogic,meson-gxbb-wdt"; - reg = <0x0 0xf0d0 0x0 0x10>; -diff -rupN linux.orig/drivers/clk/meson/g12a.c linux/drivers/clk/meson/g12a.c ---- linux.orig/drivers/clk/meson/g12a.c 2023-08-22 23:19:15.618582349 +0000 -+++ linux/drivers/clk/meson/g12a.c 2023-08-22 23:08:18.873051181 +0000 -@@ -3163,7 +3163,7 @@ static struct clk_regmap g12a_vclk2_sel - .ops = &clk_regmap_mux_ops, - .parent_hws = g12a_vclk_parent_hws, - .num_parents = ARRAY_SIZE(g12a_vclk_parent_hws), -- .flags = CLK_SET_RATE_NO_REPARENT | CLK_GET_RATE_NOCACHE, -+ .flags = CLK_SET_RATE_NO_REPARENT, - }, - }; - -@@ -3191,7 +3191,6 @@ static struct clk_regmap g12a_vclk2_inpu - .ops = &clk_regmap_gate_ops, - .parent_hws = (const struct clk_hw *[]) { &g12a_vclk2_sel.hw }, - .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, - }, - }; - -@@ -3212,6 +3211,40 @@ static struct clk_regmap g12a_vclk_div = - }, - }; - -+struct g12a_vclk_div_notifier { -+ struct clk_regmap *clk; -+ unsigned int offset; -+ u8 en_bit_idx; -+ u8 reset_bit_idx; -+ struct notifier_block nb; -+}; -+ -+static int g12a_vclk_div_notifier_cb(struct notifier_block *nb, -+ unsigned long event, void *data) -+{ -+ struct g12a_vclk_div_notifier *nb_data = -+ container_of(nb, struct g12a_vclk_div_notifier, nb); -+ -+ switch (event) { -+ case PRE_RATE_CHANGE: -+ /* disable and reset vclk2 divider */ -+ regmap_update_bits(nb_data->clk->map, nb_data->offset, -+ BIT(nb_data->en_bit_idx) | -+ BIT(nb_data->reset_bit_idx), -+ BIT(nb_data->reset_bit_idx)); -+ return NOTIFY_OK; -+ case POST_RATE_CHANGE: -+ /* enabled and release reset */ -+ regmap_update_bits(nb_data->clk->map, nb_data->offset, -+ BIT(nb_data->en_bit_idx) | -+ BIT(nb_data->reset_bit_idx), -+ BIT(nb_data->en_bit_idx)); -+ return NOTIFY_OK; -+ default: -+ return NOTIFY_DONE; -+ }; -+}; -+ - static struct clk_regmap g12a_vclk2_div = { - .data = &(struct clk_regmap_div_data){ - .offset = HHI_VIID_CLK_DIV, -@@ -3225,10 +3258,18 @@ static struct clk_regmap g12a_vclk2_div - &g12a_vclk2_input.hw - }, - .num_parents = 1, -- .flags = CLK_GET_RATE_NOCACHE, -+ .flags = CLK_DIVIDER_ROUND_CLOSEST, - }, - }; - -+static struct g12a_vclk_div_notifier g12a_vclk2_div_data = { -+ .clk = &g12a_vclk2_div, -+ .offset = HHI_VIID_CLK_DIV, -+ .en_bit_idx = 16, -+ .reset_bit_idx = 17, -+ .nb.notifier_call = g12a_vclk_div_notifier_cb, -+}; -+ - static struct clk_regmap g12a_vclk = { - .data = &(struct clk_regmap_gate_data){ - .offset = HHI_VID_CLK_CNTL, -@@ -3243,6 +3284,33 @@ static struct clk_regmap g12a_vclk = { - }, - }; - -+struct g12a_vclk_reset_notifier { -+ struct clk_regmap *clk; -+ unsigned int offset; -+ u8 bit_idx; -+ struct notifier_block nb; -+}; -+ -+static int g12a_vclk_notifier_cb(struct notifier_block *nb, -+ unsigned long event, void *data) -+{ -+ struct g12a_vclk_reset_notifier *nb_data = -+ container_of(nb, struct g12a_vclk_reset_notifier, nb); -+ -+ switch (event) { -+ case POST_RATE_CHANGE: -+ /* reset vclk2 */ -+ regmap_update_bits(nb_data->clk->map, nb_data->offset, -+ BIT(nb_data->bit_idx), BIT(nb_data->bit_idx)); -+ regmap_update_bits(nb_data->clk->map, nb_data->offset, -+ BIT(nb_data->bit_idx), 0); -+ -+ return NOTIFY_OK; -+ default: -+ return NOTIFY_DONE; -+ }; -+} -+ - static struct clk_regmap g12a_vclk2 = { - .data = &(struct clk_regmap_gate_data){ - .offset = HHI_VIID_CLK_CNTL, -@@ -3253,10 +3321,17 @@ static struct clk_regmap g12a_vclk2 = { - .ops = &clk_regmap_gate_ops, - .parent_hws = (const struct clk_hw *[]) { &g12a_vclk2_div.hw }, - .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, -+ .flags = CLK_SET_RATE_PARENT, - }, - }; - -+static struct g12a_vclk_reset_notifier g12a_vclk2_data = { -+ .clk = &g12a_vclk2, -+ .offset = HHI_VIID_CLK_CNTL, -+ .bit_idx = 15, -+ .nb.notifier_call = g12a_vclk_notifier_cb, -+}; -+ - static struct clk_regmap g12a_vclk_div1 = { - .data = &(struct clk_regmap_gate_data){ - .offset = HHI_VID_CLK_CNTL, -@@ -3337,7 +3412,7 @@ static struct clk_regmap g12a_vclk2_div1 - .ops = &clk_regmap_gate_ops, - .parent_hws = (const struct clk_hw *[]) { &g12a_vclk2.hw }, - .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, -+ .flags = CLK_SET_RATE_PARENT, - }, - }; - -@@ -3351,7 +3426,7 @@ static struct clk_regmap g12a_vclk2_div2 - .ops = &clk_regmap_gate_ops, - .parent_hws = (const struct clk_hw *[]) { &g12a_vclk2.hw }, - .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, -+ .flags = CLK_SET_RATE_PARENT, - }, - }; - -@@ -3365,7 +3440,7 @@ static struct clk_regmap g12a_vclk2_div4 - .ops = &clk_regmap_gate_ops, - .parent_hws = (const struct clk_hw *[]) { &g12a_vclk2.hw }, - .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, -+ .flags = CLK_SET_RATE_PARENT, - }, - }; - -@@ -3379,7 +3454,7 @@ static struct clk_regmap g12a_vclk2_div6 - .ops = &clk_regmap_gate_ops, - .parent_hws = (const struct clk_hw *[]) { &g12a_vclk2.hw }, - .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, -+ .flags = CLK_SET_RATE_PARENT, - }, - }; - -@@ -3393,7 +3468,7 @@ static struct clk_regmap g12a_vclk2_div1 - .ops = &clk_regmap_gate_ops, - .parent_hws = (const struct clk_hw *[]) { &g12a_vclk2.hw }, - .num_parents = 1, -- .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, -+ .flags = CLK_SET_RATE_PARENT, - }, - }; - -@@ -3459,6 +3534,7 @@ static struct clk_fixed_factor g12a_vclk - &g12a_vclk2_div2_en.hw - }, - .num_parents = 1, -+ .flags = CLK_SET_RATE_PARENT, - }, - }; - -@@ -3472,6 +3548,7 @@ static struct clk_fixed_factor g12a_vclk - &g12a_vclk2_div4_en.hw - }, - .num_parents = 1, -+ .flags = CLK_SET_RATE_PARENT, - }, - }; - -@@ -3485,6 +3562,7 @@ static struct clk_fixed_factor g12a_vclk - &g12a_vclk2_div6_en.hw - }, - .num_parents = 1, -+ .flags = CLK_SET_RATE_PARENT, - }, - }; - -@@ -3498,6 +3576,7 @@ static struct clk_fixed_factor g12a_vclk - &g12a_vclk2_div12_en.hw - }, - .num_parents = 1, -+ .flags = CLK_SET_RATE_PARENT, - }, - }; - -@@ -3547,6 +3626,22 @@ static struct clk_regmap g12a_cts_encp_s - }, - }; - -+static struct clk_regmap g12a_cts_encl_sel = { -+ .data = &(struct clk_regmap_mux_data){ -+ .offset = HHI_VIID_CLK_DIV, -+ .mask = 0xf, -+ .shift = 12, -+ .table = mux_table_cts_sel, -+ }, -+ .hw.init = &(struct clk_init_data){ -+ .name = "cts_encl_sel", -+ .ops = &clk_regmap_mux_ops, -+ .parent_hws = g12a_cts_parent_hws, -+ .num_parents = ARRAY_SIZE(g12a_cts_parent_hws), -+ .flags = CLK_SET_RATE_NO_REPARENT | CLK_SET_RATE_PARENT, -+ }, -+}; -+ - static struct clk_regmap g12a_cts_vdac_sel = { - .data = &(struct clk_regmap_mux_data){ - .offset = HHI_VIID_CLK_DIV, -@@ -3626,6 +3721,22 @@ static struct clk_regmap g12a_cts_encp = - }, - }; - -+static struct clk_regmap g12a_cts_encl = { -+ .data = &(struct clk_regmap_gate_data){ -+ .offset = HHI_VID_CLK_CNTL2, -+ .bit_idx = 3, -+ }, -+ .hw.init = &(struct clk_init_data) { -+ .name = "cts_encl", -+ .ops = &clk_regmap_gate_ops, -+ .parent_hws = (const struct clk_hw *[]) { -+ &g12a_cts_encl_sel.hw -+ }, -+ .num_parents = 1, -+ .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, -+ }, -+}; -+ - static struct clk_regmap g12a_cts_vdac = { - .data = &(struct clk_regmap_gate_data){ - .offset = HHI_VID_CLK_CNTL2, -@@ -3695,7 +3806,7 @@ static struct clk_regmap g12a_mipi_dsi_p - }, - .hw.init = &(struct clk_init_data){ - .name = "mipi_dsi_pxclk_div", -- .ops = &clk_regmap_divider_ops, -+ .ops = &clk_regmap_divider_ro_ops, - .parent_hws = (const struct clk_hw *[]) { - &g12a_mipi_dsi_pxclk_sel.hw - }, -@@ -4255,8 +4366,8 @@ static struct clk_hw_onecell_data g12a_h - [CLKID_FCLK_DIV7] = &g12a_fclk_div7.hw, - [CLKID_FCLK_DIV2P5] = &g12a_fclk_div2p5.hw, - [CLKID_GP0_PLL] = &g12a_gp0_pll.hw, -- [CLKID_MPEG_SEL] = &g12a_mpeg_clk_sel.hw, -- [CLKID_MPEG_DIV] = &g12a_mpeg_clk_div.hw, -+ [CLKID_PRIV_MPEG_SEL] = &g12a_mpeg_clk_sel.hw, -+ [CLKID_PRIV_MPEG_DIV] = &g12a_mpeg_clk_div.hw, - [CLKID_CLK81] = &g12a_clk81.hw, - [CLKID_MPLL0] = &g12a_mpll0.hw, - [CLKID_MPLL1] = &g12a_mpll1.hw, -@@ -4307,25 +4418,25 @@ static struct clk_hw_onecell_data g12a_h - [CLKID_UART2] = &g12a_uart2.hw, - [CLKID_VPU_INTR] = &g12a_vpu_intr.hw, - [CLKID_GIC] = &g12a_gic.hw, -- [CLKID_SD_EMMC_A_CLK0_SEL] = &g12a_sd_emmc_a_clk0_sel.hw, -- [CLKID_SD_EMMC_A_CLK0_DIV] = &g12a_sd_emmc_a_clk0_div.hw, -+ [CLKID_PRIV_SD_EMMC_A_CLK0_SEL] = &g12a_sd_emmc_a_clk0_sel.hw, -+ [CLKID_PRIV_SD_EMMC_A_CLK0_DIV] = &g12a_sd_emmc_a_clk0_div.hw, - [CLKID_SD_EMMC_A_CLK0] = &g12a_sd_emmc_a_clk0.hw, -- [CLKID_SD_EMMC_B_CLK0_SEL] = &g12a_sd_emmc_b_clk0_sel.hw, -- [CLKID_SD_EMMC_B_CLK0_DIV] = &g12a_sd_emmc_b_clk0_div.hw, -+ [CLKID_PRIV_SD_EMMC_B_CLK0_SEL] = &g12a_sd_emmc_b_clk0_sel.hw, -+ [CLKID_PRIV_SD_EMMC_B_CLK0_DIV] = &g12a_sd_emmc_b_clk0_div.hw, - [CLKID_SD_EMMC_B_CLK0] = &g12a_sd_emmc_b_clk0.hw, -- [CLKID_SD_EMMC_C_CLK0_SEL] = &g12a_sd_emmc_c_clk0_sel.hw, -- [CLKID_SD_EMMC_C_CLK0_DIV] = &g12a_sd_emmc_c_clk0_div.hw, -+ [CLKID_PRIV_SD_EMMC_C_CLK0_SEL] = &g12a_sd_emmc_c_clk0_sel.hw, -+ [CLKID_PRIV_SD_EMMC_C_CLK0_DIV] = &g12a_sd_emmc_c_clk0_div.hw, - [CLKID_SD_EMMC_C_CLK0] = &g12a_sd_emmc_c_clk0.hw, -- [CLKID_MPLL0_DIV] = &g12a_mpll0_div.hw, -- [CLKID_MPLL1_DIV] = &g12a_mpll1_div.hw, -- [CLKID_MPLL2_DIV] = &g12a_mpll2_div.hw, -- [CLKID_MPLL3_DIV] = &g12a_mpll3_div.hw, -- [CLKID_FCLK_DIV2_DIV] = &g12a_fclk_div2_div.hw, -- [CLKID_FCLK_DIV3_DIV] = &g12a_fclk_div3_div.hw, -- [CLKID_FCLK_DIV4_DIV] = &g12a_fclk_div4_div.hw, -- [CLKID_FCLK_DIV5_DIV] = &g12a_fclk_div5_div.hw, -- [CLKID_FCLK_DIV7_DIV] = &g12a_fclk_div7_div.hw, -- [CLKID_FCLK_DIV2P5_DIV] = &g12a_fclk_div2p5_div.hw, -+ [CLKID_PRIV_MPLL0_DIV] = &g12a_mpll0_div.hw, -+ [CLKID_PRIV_MPLL1_DIV] = &g12a_mpll1_div.hw, -+ [CLKID_PRIV_MPLL2_DIV] = &g12a_mpll2_div.hw, -+ [CLKID_PRIV_MPLL3_DIV] = &g12a_mpll3_div.hw, -+ [CLKID_PRIV_FCLK_DIV2_DIV] = &g12a_fclk_div2_div.hw, -+ [CLKID_PRIV_FCLK_DIV3_DIV] = &g12a_fclk_div3_div.hw, -+ [CLKID_PRIV_FCLK_DIV4_DIV] = &g12a_fclk_div4_div.hw, -+ [CLKID_PRIV_FCLK_DIV5_DIV] = &g12a_fclk_div5_div.hw, -+ [CLKID_PRIV_FCLK_DIV7_DIV] = &g12a_fclk_div7_div.hw, -+ [CLKID_PRIV_FCLK_DIV2P5_DIV] = &g12a_fclk_div2p5_div.hw, - [CLKID_HIFI_PLL] = &g12a_hifi_pll.hw, - [CLKID_VCLK2_VENCI0] = &g12a_vclk2_venci0.hw, - [CLKID_VCLK2_VENCI1] = &g12a_vclk2_venci1.hw, -@@ -4346,56 +4457,56 @@ static struct clk_hw_onecell_data g12a_h - [CLKID_VCLK2_VENCLMMC] = &g12a_vclk2_venclmmc.hw, - [CLKID_VCLK2_VENCL] = &g12a_vclk2_vencl.hw, - [CLKID_VCLK2_OTHER1] = &g12a_vclk2_other1.hw, -- [CLKID_FIXED_PLL_DCO] = &g12a_fixed_pll_dco.hw, -- [CLKID_SYS_PLL_DCO] = &g12a_sys_pll_dco.hw, -- [CLKID_GP0_PLL_DCO] = &g12a_gp0_pll_dco.hw, -- [CLKID_HIFI_PLL_DCO] = &g12a_hifi_pll_dco.hw, -+ [CLKID_PRIV_FIXED_PLL_DCO] = &g12a_fixed_pll_dco.hw, -+ [CLKID_PRIV_SYS_PLL_DCO] = &g12a_sys_pll_dco.hw, -+ [CLKID_PRIV_GP0_PLL_DCO] = &g12a_gp0_pll_dco.hw, -+ [CLKID_PRIV_HIFI_PLL_DCO] = &g12a_hifi_pll_dco.hw, - [CLKID_DMA] = &g12a_dma.hw, - [CLKID_EFUSE] = &g12a_efuse.hw, - [CLKID_ROM_BOOT] = &g12a_rom_boot.hw, - [CLKID_RESET_SEC] = &g12a_reset_sec.hw, - [CLKID_SEC_AHB_APB3] = &g12a_sec_ahb_apb3.hw, -- [CLKID_MPLL_PREDIV] = &g12a_mpll_prediv.hw, -+ [CLKID_PRIV_MPLL_PREDIV] = &g12a_mpll_prediv.hw, - [CLKID_VPU_0_SEL] = &g12a_vpu_0_sel.hw, -- [CLKID_VPU_0_DIV] = &g12a_vpu_0_div.hw, -+ [CLKID_PRIV_VPU_0_DIV] = &g12a_vpu_0_div.hw, - [CLKID_VPU_0] = &g12a_vpu_0.hw, - [CLKID_VPU_1_SEL] = &g12a_vpu_1_sel.hw, -- [CLKID_VPU_1_DIV] = &g12a_vpu_1_div.hw, -+ [CLKID_PRIV_VPU_1_DIV] = &g12a_vpu_1_div.hw, - [CLKID_VPU_1] = &g12a_vpu_1.hw, - [CLKID_VPU] = &g12a_vpu.hw, - [CLKID_VAPB_0_SEL] = &g12a_vapb_0_sel.hw, -- [CLKID_VAPB_0_DIV] = &g12a_vapb_0_div.hw, -+ [CLKID_PRIV_VAPB_0_DIV] = &g12a_vapb_0_div.hw, - [CLKID_VAPB_0] = &g12a_vapb_0.hw, - [CLKID_VAPB_1_SEL] = &g12a_vapb_1_sel.hw, -- [CLKID_VAPB_1_DIV] = &g12a_vapb_1_div.hw, -+ [CLKID_PRIV_VAPB_1_DIV] = &g12a_vapb_1_div.hw, - [CLKID_VAPB_1] = &g12a_vapb_1.hw, - [CLKID_VAPB_SEL] = &g12a_vapb_sel.hw, - [CLKID_VAPB] = &g12a_vapb.hw, -- [CLKID_HDMI_PLL_DCO] = &g12a_hdmi_pll_dco.hw, -- [CLKID_HDMI_PLL_OD] = &g12a_hdmi_pll_od.hw, -- [CLKID_HDMI_PLL_OD2] = &g12a_hdmi_pll_od2.hw, -+ [CLKID_PRIV_HDMI_PLL_DCO] = &g12a_hdmi_pll_dco.hw, -+ [CLKID_PRIV_HDMI_PLL_OD] = &g12a_hdmi_pll_od.hw, -+ [CLKID_PRIV_HDMI_PLL_OD2] = &g12a_hdmi_pll_od2.hw, - [CLKID_HDMI_PLL] = &g12a_hdmi_pll.hw, - [CLKID_VID_PLL] = &g12a_vid_pll_div.hw, -- [CLKID_VID_PLL_SEL] = &g12a_vid_pll_sel.hw, -- [CLKID_VID_PLL_DIV] = &g12a_vid_pll.hw, -- [CLKID_VCLK_SEL] = &g12a_vclk_sel.hw, -+ [CLKID_PRIV_VID_PLL_SEL] = &g12a_vid_pll_sel.hw, -+ [CLKID_PRIV_VID_PLL_DIV] = &g12a_vid_pll.hw, -+ [CLKID_PRIV_VCLK_SEL] = &g12a_vclk_sel.hw, - [CLKID_VCLK2_SEL] = &g12a_vclk2_sel.hw, -- [CLKID_VCLK_INPUT] = &g12a_vclk_input.hw, -- [CLKID_VCLK2_INPUT] = &g12a_vclk2_input.hw, -- [CLKID_VCLK_DIV] = &g12a_vclk_div.hw, -- [CLKID_VCLK2_DIV] = &g12a_vclk2_div.hw, -+ [CLKID_PRIV_VCLK_INPUT] = &g12a_vclk_input.hw, -+ [CLKID_PRIV_VCLK2_INPUT] = &g12a_vclk2_input.hw, -+ [CLKID_PRIV_VCLK_DIV] = &g12a_vclk_div.hw, -+ [CLKID_PRIV_VCLK2_DIV] = &g12a_vclk2_div.hw, - [CLKID_VCLK] = &g12a_vclk.hw, - [CLKID_VCLK2] = &g12a_vclk2.hw, - [CLKID_VCLK_DIV1] = &g12a_vclk_div1.hw, -- [CLKID_VCLK_DIV2_EN] = &g12a_vclk_div2_en.hw, -- [CLKID_VCLK_DIV4_EN] = &g12a_vclk_div4_en.hw, -- [CLKID_VCLK_DIV6_EN] = &g12a_vclk_div6_en.hw, -- [CLKID_VCLK_DIV12_EN] = &g12a_vclk_div12_en.hw, -+ [CLKID_PRIV_VCLK_DIV2_EN] = &g12a_vclk_div2_en.hw, -+ [CLKID_PRIV_VCLK_DIV4_EN] = &g12a_vclk_div4_en.hw, -+ [CLKID_PRIV_VCLK_DIV6_EN] = &g12a_vclk_div6_en.hw, -+ [CLKID_PRIV_VCLK_DIV12_EN] = &g12a_vclk_div12_en.hw, - [CLKID_VCLK2_DIV1] = &g12a_vclk2_div1.hw, -- [CLKID_VCLK2_DIV2_EN] = &g12a_vclk2_div2_en.hw, -- [CLKID_VCLK2_DIV4_EN] = &g12a_vclk2_div4_en.hw, -- [CLKID_VCLK2_DIV6_EN] = &g12a_vclk2_div6_en.hw, -- [CLKID_VCLK2_DIV12_EN] = &g12a_vclk2_div12_en.hw, -+ [CLKID_PRIV_VCLK2_DIV2_EN] = &g12a_vclk2_div2_en.hw, -+ [CLKID_PRIV_VCLK2_DIV4_EN] = &g12a_vclk2_div4_en.hw, -+ [CLKID_PRIV_VCLK2_DIV6_EN] = &g12a_vclk2_div6_en.hw, -+ [CLKID_PRIV_VCLK2_DIV12_EN] = &g12a_vclk2_div12_en.hw, - [CLKID_VCLK_DIV2] = &g12a_vclk_div2.hw, - [CLKID_VCLK_DIV4] = &g12a_vclk_div4.hw, - [CLKID_VCLK_DIV6] = &g12a_vclk_div6.hw, -@@ -4404,69 +4515,71 @@ static struct clk_hw_onecell_data g12a_h - [CLKID_VCLK2_DIV4] = &g12a_vclk2_div4.hw, - [CLKID_VCLK2_DIV6] = &g12a_vclk2_div6.hw, - [CLKID_VCLK2_DIV12] = &g12a_vclk2_div12.hw, -- [CLKID_CTS_ENCI_SEL] = &g12a_cts_enci_sel.hw, -- [CLKID_CTS_ENCP_SEL] = &g12a_cts_encp_sel.hw, -- [CLKID_CTS_VDAC_SEL] = &g12a_cts_vdac_sel.hw, -- [CLKID_HDMI_TX_SEL] = &g12a_hdmi_tx_sel.hw, -+ [CLKID_PRIV_CTS_ENCI_SEL] = &g12a_cts_enci_sel.hw, -+ [CLKID_PRIV_CTS_ENCP_SEL] = &g12a_cts_encp_sel.hw, -+ [CLKID_CTS_ENCL_SEL] = &g12a_cts_encl_sel.hw, -+ [CLKID_PRIV_CTS_VDAC_SEL] = &g12a_cts_vdac_sel.hw, -+ [CLKID_PRIV_HDMI_TX_SEL] = &g12a_hdmi_tx_sel.hw, - [CLKID_CTS_ENCI] = &g12a_cts_enci.hw, - [CLKID_CTS_ENCP] = &g12a_cts_encp.hw, -+ [CLKID_CTS_ENCL] = &g12a_cts_encl.hw, - [CLKID_CTS_VDAC] = &g12a_cts_vdac.hw, - [CLKID_HDMI_TX] = &g12a_hdmi_tx.hw, -- [CLKID_HDMI_SEL] = &g12a_hdmi_sel.hw, -- [CLKID_HDMI_DIV] = &g12a_hdmi_div.hw, -+ [CLKID_PRIV_HDMI_SEL] = &g12a_hdmi_sel.hw, -+ [CLKID_PRIV_HDMI_DIV] = &g12a_hdmi_div.hw, - [CLKID_HDMI] = &g12a_hdmi.hw, - [CLKID_MALI_0_SEL] = &g12a_mali_0_sel.hw, -- [CLKID_MALI_0_DIV] = &g12a_mali_0_div.hw, -+ [CLKID_PRIV_MALI_0_DIV] = &g12a_mali_0_div.hw, - [CLKID_MALI_0] = &g12a_mali_0.hw, - [CLKID_MALI_1_SEL] = &g12a_mali_1_sel.hw, -- [CLKID_MALI_1_DIV] = &g12a_mali_1_div.hw, -+ [CLKID_PRIV_MALI_1_DIV] = &g12a_mali_1_div.hw, - [CLKID_MALI_1] = &g12a_mali_1.hw, - [CLKID_MALI] = &g12a_mali.hw, -- [CLKID_MPLL_50M_DIV] = &g12a_mpll_50m_div.hw, -+ [CLKID_PRIV_MPLL_50M_DIV] = &g12a_mpll_50m_div.hw, - [CLKID_MPLL_50M] = &g12a_mpll_50m.hw, -- [CLKID_SYS_PLL_DIV16_EN] = &g12a_sys_pll_div16_en.hw, -- [CLKID_SYS_PLL_DIV16] = &g12a_sys_pll_div16.hw, -- [CLKID_CPU_CLK_DYN0_SEL] = &g12a_cpu_clk_premux0.hw, -- [CLKID_CPU_CLK_DYN0_DIV] = &g12a_cpu_clk_mux0_div.hw, -- [CLKID_CPU_CLK_DYN0] = &g12a_cpu_clk_postmux0.hw, -- [CLKID_CPU_CLK_DYN1_SEL] = &g12a_cpu_clk_premux1.hw, -- [CLKID_CPU_CLK_DYN1_DIV] = &g12a_cpu_clk_mux1_div.hw, -- [CLKID_CPU_CLK_DYN1] = &g12a_cpu_clk_postmux1.hw, -- [CLKID_CPU_CLK_DYN] = &g12a_cpu_clk_dyn.hw, -+ [CLKID_PRIV_SYS_PLL_DIV16_EN] = &g12a_sys_pll_div16_en.hw, -+ [CLKID_PRIV_SYS_PLL_DIV16] = &g12a_sys_pll_div16.hw, -+ [CLKID_PRIV_CPU_CLK_DYN0_SEL] = &g12a_cpu_clk_premux0.hw, -+ [CLKID_PRIV_CPU_CLK_DYN0_DIV] = &g12a_cpu_clk_mux0_div.hw, -+ [CLKID_PRIV_CPU_CLK_DYN0] = &g12a_cpu_clk_postmux0.hw, -+ [CLKID_PRIV_CPU_CLK_DYN1_SEL] = &g12a_cpu_clk_premux1.hw, -+ [CLKID_PRIV_CPU_CLK_DYN1_DIV] = &g12a_cpu_clk_mux1_div.hw, -+ [CLKID_PRIV_CPU_CLK_DYN1] = &g12a_cpu_clk_postmux1.hw, -+ [CLKID_PRIV_CPU_CLK_DYN] = &g12a_cpu_clk_dyn.hw, - [CLKID_CPU_CLK] = &g12a_cpu_clk.hw, -- [CLKID_CPU_CLK_DIV16_EN] = &g12a_cpu_clk_div16_en.hw, -- [CLKID_CPU_CLK_DIV16] = &g12a_cpu_clk_div16.hw, -- [CLKID_CPU_CLK_APB_DIV] = &g12a_cpu_clk_apb_div.hw, -- [CLKID_CPU_CLK_APB] = &g12a_cpu_clk_apb.hw, -- [CLKID_CPU_CLK_ATB_DIV] = &g12a_cpu_clk_atb_div.hw, -- [CLKID_CPU_CLK_ATB] = &g12a_cpu_clk_atb.hw, -- [CLKID_CPU_CLK_AXI_DIV] = &g12a_cpu_clk_axi_div.hw, -- [CLKID_CPU_CLK_AXI] = &g12a_cpu_clk_axi.hw, -- [CLKID_CPU_CLK_TRACE_DIV] = &g12a_cpu_clk_trace_div.hw, -- [CLKID_CPU_CLK_TRACE] = &g12a_cpu_clk_trace.hw, -- [CLKID_PCIE_PLL_DCO] = &g12a_pcie_pll_dco.hw, -- [CLKID_PCIE_PLL_DCO_DIV2] = &g12a_pcie_pll_dco_div2.hw, -- [CLKID_PCIE_PLL_OD] = &g12a_pcie_pll_od.hw, -+ [CLKID_PRIV_CPU_CLK_DIV16_EN] = &g12a_cpu_clk_div16_en.hw, -+ [CLKID_PRIV_CPU_CLK_DIV16] = &g12a_cpu_clk_div16.hw, -+ [CLKID_PRIV_CPU_CLK_APB_DIV] = &g12a_cpu_clk_apb_div.hw, -+ [CLKID_PRIV_CPU_CLK_APB] = &g12a_cpu_clk_apb.hw, -+ [CLKID_PRIV_CPU_CLK_ATB_DIV] = &g12a_cpu_clk_atb_div.hw, -+ [CLKID_PRIV_CPU_CLK_ATB] = &g12a_cpu_clk_atb.hw, -+ [CLKID_PRIV_CPU_CLK_AXI_DIV] = &g12a_cpu_clk_axi_div.hw, -+ [CLKID_PRIV_CPU_CLK_AXI] = &g12a_cpu_clk_axi.hw, -+ [CLKID_PRIV_CPU_CLK_TRACE_DIV] = &g12a_cpu_clk_trace_div.hw, -+ [CLKID_PRIV_CPU_CLK_TRACE] = &g12a_cpu_clk_trace.hw, -+ [CLKID_PRIV_PCIE_PLL_DCO] = &g12a_pcie_pll_dco.hw, -+ [CLKID_PRIV_PCIE_PLL_DCO_DIV2] = &g12a_pcie_pll_dco_div2.hw, -+ [CLKID_PRIV_PCIE_PLL_OD] = &g12a_pcie_pll_od.hw, - [CLKID_PCIE_PLL] = &g12a_pcie_pll.hw, -- [CLKID_VDEC_1_SEL] = &g12a_vdec_1_sel.hw, -- [CLKID_VDEC_1_DIV] = &g12a_vdec_1_div.hw, -+ [CLKID_PRIV_VDEC_1_SEL] = &g12a_vdec_1_sel.hw, -+ [CLKID_PRIV_VDEC_1_DIV] = &g12a_vdec_1_div.hw, - [CLKID_VDEC_1] = &g12a_vdec_1.hw, -- [CLKID_VDEC_HEVC_SEL] = &g12a_vdec_hevc_sel.hw, -- [CLKID_VDEC_HEVC_DIV] = &g12a_vdec_hevc_div.hw, -+ [CLKID_PRIV_VDEC_HEVC_SEL] = &g12a_vdec_hevc_sel.hw, -+ [CLKID_PRIV_VDEC_HEVC_DIV] = &g12a_vdec_hevc_div.hw, - [CLKID_VDEC_HEVC] = &g12a_vdec_hevc.hw, -- [CLKID_VDEC_HEVCF_SEL] = &g12a_vdec_hevcf_sel.hw, -- [CLKID_VDEC_HEVCF_DIV] = &g12a_vdec_hevcf_div.hw, -+ [CLKID_PRIV_VDEC_HEVCF_SEL] = &g12a_vdec_hevcf_sel.hw, -+ [CLKID_PRIV_VDEC_HEVCF_DIV] = &g12a_vdec_hevcf_div.hw, - [CLKID_VDEC_HEVCF] = &g12a_vdec_hevcf.hw, -- [CLKID_TS_DIV] = &g12a_ts_div.hw, -+ [CLKID_PRIV_TS_DIV] = &g12a_ts_div.hw, - [CLKID_TS] = &g12a_ts.hw, -- [CLKID_SPICC0_SCLK_SEL] = &g12a_spicc0_sclk_sel.hw, -- [CLKID_SPICC0_SCLK_DIV] = &g12a_spicc0_sclk_div.hw, -+ [CLKID_PRIV_SPICC0_SCLK_SEL] = &g12a_spicc0_sclk_sel.hw, -+ [CLKID_PRIV_SPICC0_SCLK_DIV] = &g12a_spicc0_sclk_div.hw, - [CLKID_SPICC0_SCLK] = &g12a_spicc0_sclk.hw, -- [CLKID_SPICC1_SCLK_SEL] = &g12a_spicc1_sclk_sel.hw, -- [CLKID_SPICC1_SCLK_DIV] = &g12a_spicc1_sclk_div.hw, -+ [CLKID_PRIV_SPICC1_SCLK_SEL] = &g12a_spicc1_sclk_sel.hw, -+ [CLKID_PRIV_SPICC1_SCLK_DIV] = &g12a_spicc1_sclk_div.hw, - [CLKID_SPICC1_SCLK] = &g12a_spicc1_sclk.hw, - [CLKID_MIPI_DSI_PXCLK_SEL] = &g12a_mipi_dsi_pxclk_sel.hw, -- [CLKID_MIPI_DSI_PXCLK_DIV] = &g12a_mipi_dsi_pxclk_div.hw, -+ [CLKID_PRIV_MIPI_DSI_PXCLK_DIV] = &g12a_mipi_dsi_pxclk_div.hw, - [CLKID_MIPI_DSI_PXCLK] = &g12a_mipi_dsi_pxclk.hw, - [NR_CLKS] = NULL, - }, -@@ -4484,8 +4597,8 @@ static struct clk_hw_onecell_data g12b_h - [CLKID_FCLK_DIV7] = &g12a_fclk_div7.hw, - [CLKID_FCLK_DIV2P5] = &g12a_fclk_div2p5.hw, - [CLKID_GP0_PLL] = &g12a_gp0_pll.hw, -- [CLKID_MPEG_SEL] = &g12a_mpeg_clk_sel.hw, -- [CLKID_MPEG_DIV] = &g12a_mpeg_clk_div.hw, -+ [CLKID_PRIV_MPEG_SEL] = &g12a_mpeg_clk_sel.hw, -+ [CLKID_PRIV_MPEG_DIV] = &g12a_mpeg_clk_div.hw, - [CLKID_CLK81] = &g12a_clk81.hw, - [CLKID_MPLL0] = &g12a_mpll0.hw, - [CLKID_MPLL1] = &g12a_mpll1.hw, -@@ -4536,25 +4649,25 @@ static struct clk_hw_onecell_data g12b_h - [CLKID_UART2] = &g12a_uart2.hw, - [CLKID_VPU_INTR] = &g12a_vpu_intr.hw, - [CLKID_GIC] = &g12a_gic.hw, -- [CLKID_SD_EMMC_A_CLK0_SEL] = &g12a_sd_emmc_a_clk0_sel.hw, -- [CLKID_SD_EMMC_A_CLK0_DIV] = &g12a_sd_emmc_a_clk0_div.hw, -+ [CLKID_PRIV_SD_EMMC_A_CLK0_SEL] = &g12a_sd_emmc_a_clk0_sel.hw, -+ [CLKID_PRIV_SD_EMMC_A_CLK0_DIV] = &g12a_sd_emmc_a_clk0_div.hw, - [CLKID_SD_EMMC_A_CLK0] = &g12a_sd_emmc_a_clk0.hw, -- [CLKID_SD_EMMC_B_CLK0_SEL] = &g12a_sd_emmc_b_clk0_sel.hw, -- [CLKID_SD_EMMC_B_CLK0_DIV] = &g12a_sd_emmc_b_clk0_div.hw, -+ [CLKID_PRIV_SD_EMMC_B_CLK0_SEL] = &g12a_sd_emmc_b_clk0_sel.hw, -+ [CLKID_PRIV_SD_EMMC_B_CLK0_DIV] = &g12a_sd_emmc_b_clk0_div.hw, - [CLKID_SD_EMMC_B_CLK0] = &g12a_sd_emmc_b_clk0.hw, -- [CLKID_SD_EMMC_C_CLK0_SEL] = &g12a_sd_emmc_c_clk0_sel.hw, -- [CLKID_SD_EMMC_C_CLK0_DIV] = &g12a_sd_emmc_c_clk0_div.hw, -+ [CLKID_PRIV_SD_EMMC_C_CLK0_SEL] = &g12a_sd_emmc_c_clk0_sel.hw, -+ [CLKID_PRIV_SD_EMMC_C_CLK0_DIV] = &g12a_sd_emmc_c_clk0_div.hw, - [CLKID_SD_EMMC_C_CLK0] = &g12a_sd_emmc_c_clk0.hw, -- [CLKID_MPLL0_DIV] = &g12a_mpll0_div.hw, -- [CLKID_MPLL1_DIV] = &g12a_mpll1_div.hw, -- [CLKID_MPLL2_DIV] = &g12a_mpll2_div.hw, -- [CLKID_MPLL3_DIV] = &g12a_mpll3_div.hw, -- [CLKID_FCLK_DIV2_DIV] = &g12a_fclk_div2_div.hw, -- [CLKID_FCLK_DIV3_DIV] = &g12a_fclk_div3_div.hw, -- [CLKID_FCLK_DIV4_DIV] = &g12a_fclk_div4_div.hw, -- [CLKID_FCLK_DIV5_DIV] = &g12a_fclk_div5_div.hw, -- [CLKID_FCLK_DIV7_DIV] = &g12a_fclk_div7_div.hw, -- [CLKID_FCLK_DIV2P5_DIV] = &g12a_fclk_div2p5_div.hw, -+ [CLKID_PRIV_MPLL0_DIV] = &g12a_mpll0_div.hw, -+ [CLKID_PRIV_MPLL1_DIV] = &g12a_mpll1_div.hw, -+ [CLKID_PRIV_MPLL2_DIV] = &g12a_mpll2_div.hw, -+ [CLKID_PRIV_MPLL3_DIV] = &g12a_mpll3_div.hw, -+ [CLKID_PRIV_FCLK_DIV2_DIV] = &g12a_fclk_div2_div.hw, -+ [CLKID_PRIV_FCLK_DIV3_DIV] = &g12a_fclk_div3_div.hw, -+ [CLKID_PRIV_FCLK_DIV4_DIV] = &g12a_fclk_div4_div.hw, -+ [CLKID_PRIV_FCLK_DIV5_DIV] = &g12a_fclk_div5_div.hw, -+ [CLKID_PRIV_FCLK_DIV7_DIV] = &g12a_fclk_div7_div.hw, -+ [CLKID_PRIV_FCLK_DIV2P5_DIV] = &g12a_fclk_div2p5_div.hw, - [CLKID_HIFI_PLL] = &g12a_hifi_pll.hw, - [CLKID_VCLK2_VENCI0] = &g12a_vclk2_venci0.hw, - [CLKID_VCLK2_VENCI1] = &g12a_vclk2_venci1.hw, -@@ -4575,56 +4688,56 @@ static struct clk_hw_onecell_data g12b_h - [CLKID_VCLK2_VENCLMMC] = &g12a_vclk2_venclmmc.hw, - [CLKID_VCLK2_VENCL] = &g12a_vclk2_vencl.hw, - [CLKID_VCLK2_OTHER1] = &g12a_vclk2_other1.hw, -- [CLKID_FIXED_PLL_DCO] = &g12a_fixed_pll_dco.hw, -- [CLKID_SYS_PLL_DCO] = &g12a_sys_pll_dco.hw, -- [CLKID_GP0_PLL_DCO] = &g12a_gp0_pll_dco.hw, -- [CLKID_HIFI_PLL_DCO] = &g12a_hifi_pll_dco.hw, -+ [CLKID_PRIV_FIXED_PLL_DCO] = &g12a_fixed_pll_dco.hw, -+ [CLKID_PRIV_SYS_PLL_DCO] = &g12a_sys_pll_dco.hw, -+ [CLKID_PRIV_GP0_PLL_DCO] = &g12a_gp0_pll_dco.hw, -+ [CLKID_PRIV_HIFI_PLL_DCO] = &g12a_hifi_pll_dco.hw, - [CLKID_DMA] = &g12a_dma.hw, - [CLKID_EFUSE] = &g12a_efuse.hw, - [CLKID_ROM_BOOT] = &g12a_rom_boot.hw, - [CLKID_RESET_SEC] = &g12a_reset_sec.hw, - [CLKID_SEC_AHB_APB3] = &g12a_sec_ahb_apb3.hw, -- [CLKID_MPLL_PREDIV] = &g12a_mpll_prediv.hw, -+ [CLKID_PRIV_MPLL_PREDIV] = &g12a_mpll_prediv.hw, - [CLKID_VPU_0_SEL] = &g12a_vpu_0_sel.hw, -- [CLKID_VPU_0_DIV] = &g12a_vpu_0_div.hw, -+ [CLKID_PRIV_VPU_0_DIV] = &g12a_vpu_0_div.hw, - [CLKID_VPU_0] = &g12a_vpu_0.hw, - [CLKID_VPU_1_SEL] = &g12a_vpu_1_sel.hw, -- [CLKID_VPU_1_DIV] = &g12a_vpu_1_div.hw, -+ [CLKID_PRIV_VPU_1_DIV] = &g12a_vpu_1_div.hw, - [CLKID_VPU_1] = &g12a_vpu_1.hw, - [CLKID_VPU] = &g12a_vpu.hw, - [CLKID_VAPB_0_SEL] = &g12a_vapb_0_sel.hw, -- [CLKID_VAPB_0_DIV] = &g12a_vapb_0_div.hw, -+ [CLKID_PRIV_VAPB_0_DIV] = &g12a_vapb_0_div.hw, - [CLKID_VAPB_0] = &g12a_vapb_0.hw, - [CLKID_VAPB_1_SEL] = &g12a_vapb_1_sel.hw, -- [CLKID_VAPB_1_DIV] = &g12a_vapb_1_div.hw, -+ [CLKID_PRIV_VAPB_1_DIV] = &g12a_vapb_1_div.hw, - [CLKID_VAPB_1] = &g12a_vapb_1.hw, - [CLKID_VAPB_SEL] = &g12a_vapb_sel.hw, - [CLKID_VAPB] = &g12a_vapb.hw, -- [CLKID_HDMI_PLL_DCO] = &g12a_hdmi_pll_dco.hw, -- [CLKID_HDMI_PLL_OD] = &g12a_hdmi_pll_od.hw, -- [CLKID_HDMI_PLL_OD2] = &g12a_hdmi_pll_od2.hw, -+ [CLKID_PRIV_HDMI_PLL_DCO] = &g12a_hdmi_pll_dco.hw, -+ [CLKID_PRIV_HDMI_PLL_OD] = &g12a_hdmi_pll_od.hw, -+ [CLKID_PRIV_HDMI_PLL_OD2] = &g12a_hdmi_pll_od2.hw, - [CLKID_HDMI_PLL] = &g12a_hdmi_pll.hw, - [CLKID_VID_PLL] = &g12a_vid_pll_div.hw, -- [CLKID_VID_PLL_SEL] = &g12a_vid_pll_sel.hw, -- [CLKID_VID_PLL_DIV] = &g12a_vid_pll.hw, -- [CLKID_VCLK_SEL] = &g12a_vclk_sel.hw, -+ [CLKID_PRIV_VID_PLL_SEL] = &g12a_vid_pll_sel.hw, -+ [CLKID_PRIV_VID_PLL_DIV] = &g12a_vid_pll.hw, -+ [CLKID_PRIV_VCLK_SEL] = &g12a_vclk_sel.hw, - [CLKID_VCLK2_SEL] = &g12a_vclk2_sel.hw, -- [CLKID_VCLK_INPUT] = &g12a_vclk_input.hw, -- [CLKID_VCLK2_INPUT] = &g12a_vclk2_input.hw, -- [CLKID_VCLK_DIV] = &g12a_vclk_div.hw, -- [CLKID_VCLK2_DIV] = &g12a_vclk2_div.hw, -+ [CLKID_PRIV_VCLK_INPUT] = &g12a_vclk_input.hw, -+ [CLKID_PRIV_VCLK2_INPUT] = &g12a_vclk2_input.hw, -+ [CLKID_PRIV_VCLK_DIV] = &g12a_vclk_div.hw, -+ [CLKID_PRIV_VCLK2_DIV] = &g12a_vclk2_div.hw, - [CLKID_VCLK] = &g12a_vclk.hw, - [CLKID_VCLK2] = &g12a_vclk2.hw, - [CLKID_VCLK_DIV1] = &g12a_vclk_div1.hw, -- [CLKID_VCLK_DIV2_EN] = &g12a_vclk_div2_en.hw, -- [CLKID_VCLK_DIV4_EN] = &g12a_vclk_div4_en.hw, -- [CLKID_VCLK_DIV6_EN] = &g12a_vclk_div6_en.hw, -- [CLKID_VCLK_DIV12_EN] = &g12a_vclk_div12_en.hw, -+ [CLKID_PRIV_VCLK_DIV2_EN] = &g12a_vclk_div2_en.hw, -+ [CLKID_PRIV_VCLK_DIV4_EN] = &g12a_vclk_div4_en.hw, -+ [CLKID_PRIV_VCLK_DIV6_EN] = &g12a_vclk_div6_en.hw, -+ [CLKID_PRIV_VCLK_DIV12_EN] = &g12a_vclk_div12_en.hw, - [CLKID_VCLK2_DIV1] = &g12a_vclk2_div1.hw, -- [CLKID_VCLK2_DIV2_EN] = &g12a_vclk2_div2_en.hw, -- [CLKID_VCLK2_DIV4_EN] = &g12a_vclk2_div4_en.hw, -- [CLKID_VCLK2_DIV6_EN] = &g12a_vclk2_div6_en.hw, -- [CLKID_VCLK2_DIV12_EN] = &g12a_vclk2_div12_en.hw, -+ [CLKID_PRIV_VCLK2_DIV2_EN] = &g12a_vclk2_div2_en.hw, -+ [CLKID_PRIV_VCLK2_DIV4_EN] = &g12a_vclk2_div4_en.hw, -+ [CLKID_PRIV_VCLK2_DIV6_EN] = &g12a_vclk2_div6_en.hw, -+ [CLKID_PRIV_VCLK2_DIV12_EN] = &g12a_vclk2_div12_en.hw, - [CLKID_VCLK_DIV2] = &g12a_vclk_div2.hw, - [CLKID_VCLK_DIV4] = &g12a_vclk_div4.hw, - [CLKID_VCLK_DIV6] = &g12a_vclk_div6.hw, -@@ -4633,104 +4746,106 @@ static struct clk_hw_onecell_data g12b_h - [CLKID_VCLK2_DIV4] = &g12a_vclk2_div4.hw, - [CLKID_VCLK2_DIV6] = &g12a_vclk2_div6.hw, - [CLKID_VCLK2_DIV12] = &g12a_vclk2_div12.hw, -- [CLKID_CTS_ENCI_SEL] = &g12a_cts_enci_sel.hw, -- [CLKID_CTS_ENCP_SEL] = &g12a_cts_encp_sel.hw, -- [CLKID_CTS_VDAC_SEL] = &g12a_cts_vdac_sel.hw, -- [CLKID_HDMI_TX_SEL] = &g12a_hdmi_tx_sel.hw, -+ [CLKID_PRIV_CTS_ENCI_SEL] = &g12a_cts_enci_sel.hw, -+ [CLKID_PRIV_CTS_ENCP_SEL] = &g12a_cts_encp_sel.hw, -+ [CLKID_CTS_ENCL_SEL] = &g12a_cts_encl_sel.hw, -+ [CLKID_PRIV_CTS_VDAC_SEL] = &g12a_cts_vdac_sel.hw, -+ [CLKID_PRIV_HDMI_TX_SEL] = &g12a_hdmi_tx_sel.hw, - [CLKID_CTS_ENCI] = &g12a_cts_enci.hw, - [CLKID_CTS_ENCP] = &g12a_cts_encp.hw, -+ [CLKID_CTS_ENCL] = &g12a_cts_encl.hw, - [CLKID_CTS_VDAC] = &g12a_cts_vdac.hw, - [CLKID_HDMI_TX] = &g12a_hdmi_tx.hw, -- [CLKID_HDMI_SEL] = &g12a_hdmi_sel.hw, -- [CLKID_HDMI_DIV] = &g12a_hdmi_div.hw, -+ [CLKID_PRIV_HDMI_SEL] = &g12a_hdmi_sel.hw, -+ [CLKID_PRIV_HDMI_DIV] = &g12a_hdmi_div.hw, - [CLKID_HDMI] = &g12a_hdmi.hw, - [CLKID_MALI_0_SEL] = &g12a_mali_0_sel.hw, -- [CLKID_MALI_0_DIV] = &g12a_mali_0_div.hw, -+ [CLKID_PRIV_MALI_0_DIV] = &g12a_mali_0_div.hw, - [CLKID_MALI_0] = &g12a_mali_0.hw, - [CLKID_MALI_1_SEL] = &g12a_mali_1_sel.hw, -- [CLKID_MALI_1_DIV] = &g12a_mali_1_div.hw, -+ [CLKID_PRIV_MALI_1_DIV] = &g12a_mali_1_div.hw, - [CLKID_MALI_1] = &g12a_mali_1.hw, - [CLKID_MALI] = &g12a_mali.hw, -- [CLKID_MPLL_50M_DIV] = &g12a_mpll_50m_div.hw, -+ [CLKID_PRIV_MPLL_50M_DIV] = &g12a_mpll_50m_div.hw, - [CLKID_MPLL_50M] = &g12a_mpll_50m.hw, -- [CLKID_SYS_PLL_DIV16_EN] = &g12a_sys_pll_div16_en.hw, -- [CLKID_SYS_PLL_DIV16] = &g12a_sys_pll_div16.hw, -- [CLKID_CPU_CLK_DYN0_SEL] = &g12a_cpu_clk_premux0.hw, -- [CLKID_CPU_CLK_DYN0_DIV] = &g12a_cpu_clk_mux0_div.hw, -- [CLKID_CPU_CLK_DYN0] = &g12a_cpu_clk_postmux0.hw, -- [CLKID_CPU_CLK_DYN1_SEL] = &g12a_cpu_clk_premux1.hw, -- [CLKID_CPU_CLK_DYN1_DIV] = &g12a_cpu_clk_mux1_div.hw, -- [CLKID_CPU_CLK_DYN1] = &g12a_cpu_clk_postmux1.hw, -- [CLKID_CPU_CLK_DYN] = &g12a_cpu_clk_dyn.hw, -+ [CLKID_PRIV_SYS_PLL_DIV16_EN] = &g12a_sys_pll_div16_en.hw, -+ [CLKID_PRIV_SYS_PLL_DIV16] = &g12a_sys_pll_div16.hw, -+ [CLKID_PRIV_CPU_CLK_DYN0_SEL] = &g12a_cpu_clk_premux0.hw, -+ [CLKID_PRIV_CPU_CLK_DYN0_DIV] = &g12a_cpu_clk_mux0_div.hw, -+ [CLKID_PRIV_CPU_CLK_DYN0] = &g12a_cpu_clk_postmux0.hw, -+ [CLKID_PRIV_CPU_CLK_DYN1_SEL] = &g12a_cpu_clk_premux1.hw, -+ [CLKID_PRIV_CPU_CLK_DYN1_DIV] = &g12a_cpu_clk_mux1_div.hw, -+ [CLKID_PRIV_CPU_CLK_DYN1] = &g12a_cpu_clk_postmux1.hw, -+ [CLKID_PRIV_CPU_CLK_DYN] = &g12a_cpu_clk_dyn.hw, - [CLKID_CPU_CLK] = &g12b_cpu_clk.hw, -- [CLKID_CPU_CLK_DIV16_EN] = &g12a_cpu_clk_div16_en.hw, -- [CLKID_CPU_CLK_DIV16] = &g12a_cpu_clk_div16.hw, -- [CLKID_CPU_CLK_APB_DIV] = &g12a_cpu_clk_apb_div.hw, -- [CLKID_CPU_CLK_APB] = &g12a_cpu_clk_apb.hw, -- [CLKID_CPU_CLK_ATB_DIV] = &g12a_cpu_clk_atb_div.hw, -- [CLKID_CPU_CLK_ATB] = &g12a_cpu_clk_atb.hw, -- [CLKID_CPU_CLK_AXI_DIV] = &g12a_cpu_clk_axi_div.hw, -- [CLKID_CPU_CLK_AXI] = &g12a_cpu_clk_axi.hw, -- [CLKID_CPU_CLK_TRACE_DIV] = &g12a_cpu_clk_trace_div.hw, -- [CLKID_CPU_CLK_TRACE] = &g12a_cpu_clk_trace.hw, -- [CLKID_PCIE_PLL_DCO] = &g12a_pcie_pll_dco.hw, -- [CLKID_PCIE_PLL_DCO_DIV2] = &g12a_pcie_pll_dco_div2.hw, -- [CLKID_PCIE_PLL_OD] = &g12a_pcie_pll_od.hw, -+ [CLKID_PRIV_CPU_CLK_DIV16_EN] = &g12a_cpu_clk_div16_en.hw, -+ [CLKID_PRIV_CPU_CLK_DIV16] = &g12a_cpu_clk_div16.hw, -+ [CLKID_PRIV_CPU_CLK_APB_DIV] = &g12a_cpu_clk_apb_div.hw, -+ [CLKID_PRIV_CPU_CLK_APB] = &g12a_cpu_clk_apb.hw, -+ [CLKID_PRIV_CPU_CLK_ATB_DIV] = &g12a_cpu_clk_atb_div.hw, -+ [CLKID_PRIV_CPU_CLK_ATB] = &g12a_cpu_clk_atb.hw, -+ [CLKID_PRIV_CPU_CLK_AXI_DIV] = &g12a_cpu_clk_axi_div.hw, -+ [CLKID_PRIV_CPU_CLK_AXI] = &g12a_cpu_clk_axi.hw, -+ [CLKID_PRIV_CPU_CLK_TRACE_DIV] = &g12a_cpu_clk_trace_div.hw, -+ [CLKID_PRIV_CPU_CLK_TRACE] = &g12a_cpu_clk_trace.hw, -+ [CLKID_PRIV_PCIE_PLL_DCO] = &g12a_pcie_pll_dco.hw, -+ [CLKID_PRIV_PCIE_PLL_DCO_DIV2] = &g12a_pcie_pll_dco_div2.hw, -+ [CLKID_PRIV_PCIE_PLL_OD] = &g12a_pcie_pll_od.hw, - [CLKID_PCIE_PLL] = &g12a_pcie_pll.hw, -- [CLKID_VDEC_1_SEL] = &g12a_vdec_1_sel.hw, -- [CLKID_VDEC_1_DIV] = &g12a_vdec_1_div.hw, -+ [CLKID_PRIV_VDEC_1_SEL] = &g12a_vdec_1_sel.hw, -+ [CLKID_PRIV_VDEC_1_DIV] = &g12a_vdec_1_div.hw, - [CLKID_VDEC_1] = &g12a_vdec_1.hw, -- [CLKID_VDEC_HEVC_SEL] = &g12a_vdec_hevc_sel.hw, -- [CLKID_VDEC_HEVC_DIV] = &g12a_vdec_hevc_div.hw, -+ [CLKID_PRIV_VDEC_HEVC_SEL] = &g12a_vdec_hevc_sel.hw, -+ [CLKID_PRIV_VDEC_HEVC_DIV] = &g12a_vdec_hevc_div.hw, - [CLKID_VDEC_HEVC] = &g12a_vdec_hevc.hw, -- [CLKID_VDEC_HEVCF_SEL] = &g12a_vdec_hevcf_sel.hw, -- [CLKID_VDEC_HEVCF_DIV] = &g12a_vdec_hevcf_div.hw, -+ [CLKID_PRIV_VDEC_HEVCF_SEL] = &g12a_vdec_hevcf_sel.hw, -+ [CLKID_PRIV_VDEC_HEVCF_DIV] = &g12a_vdec_hevcf_div.hw, - [CLKID_VDEC_HEVCF] = &g12a_vdec_hevcf.hw, -- [CLKID_TS_DIV] = &g12a_ts_div.hw, -+ [CLKID_PRIV_TS_DIV] = &g12a_ts_div.hw, - [CLKID_TS] = &g12a_ts.hw, -- [CLKID_SYS1_PLL_DCO] = &g12b_sys1_pll_dco.hw, -- [CLKID_SYS1_PLL] = &g12b_sys1_pll.hw, -- [CLKID_SYS1_PLL_DIV16_EN] = &g12b_sys1_pll_div16_en.hw, -- [CLKID_SYS1_PLL_DIV16] = &g12b_sys1_pll_div16.hw, -- [CLKID_CPUB_CLK_DYN0_SEL] = &g12b_cpub_clk_premux0.hw, -- [CLKID_CPUB_CLK_DYN0_DIV] = &g12b_cpub_clk_mux0_div.hw, -- [CLKID_CPUB_CLK_DYN0] = &g12b_cpub_clk_postmux0.hw, -- [CLKID_CPUB_CLK_DYN1_SEL] = &g12b_cpub_clk_premux1.hw, -- [CLKID_CPUB_CLK_DYN1_DIV] = &g12b_cpub_clk_mux1_div.hw, -- [CLKID_CPUB_CLK_DYN1] = &g12b_cpub_clk_postmux1.hw, -- [CLKID_CPUB_CLK_DYN] = &g12b_cpub_clk_dyn.hw, -+ [CLKID_PRIV_SYS1_PLL_DCO] = &g12b_sys1_pll_dco.hw, -+ [CLKID_PRIV_SYS1_PLL] = &g12b_sys1_pll.hw, -+ [CLKID_PRIV_SYS1_PLL_DIV16_EN] = &g12b_sys1_pll_div16_en.hw, -+ [CLKID_PRIV_SYS1_PLL_DIV16] = &g12b_sys1_pll_div16.hw, -+ [CLKID_PRIV_CPUB_CLK_DYN0_SEL] = &g12b_cpub_clk_premux0.hw, -+ [CLKID_PRIV_CPUB_CLK_DYN0_DIV] = &g12b_cpub_clk_mux0_div.hw, -+ [CLKID_PRIV_CPUB_CLK_DYN0] = &g12b_cpub_clk_postmux0.hw, -+ [CLKID_PRIV_CPUB_CLK_DYN1_SEL] = &g12b_cpub_clk_premux1.hw, -+ [CLKID_PRIV_CPUB_CLK_DYN1_DIV] = &g12b_cpub_clk_mux1_div.hw, -+ [CLKID_PRIV_CPUB_CLK_DYN1] = &g12b_cpub_clk_postmux1.hw, -+ [CLKID_PRIV_CPUB_CLK_DYN] = &g12b_cpub_clk_dyn.hw, - [CLKID_CPUB_CLK] = &g12b_cpub_clk.hw, -- [CLKID_CPUB_CLK_DIV16_EN] = &g12b_cpub_clk_div16_en.hw, -- [CLKID_CPUB_CLK_DIV16] = &g12b_cpub_clk_div16.hw, -- [CLKID_CPUB_CLK_DIV2] = &g12b_cpub_clk_div2.hw, -- [CLKID_CPUB_CLK_DIV3] = &g12b_cpub_clk_div3.hw, -- [CLKID_CPUB_CLK_DIV4] = &g12b_cpub_clk_div4.hw, -- [CLKID_CPUB_CLK_DIV5] = &g12b_cpub_clk_div5.hw, -- [CLKID_CPUB_CLK_DIV6] = &g12b_cpub_clk_div6.hw, -- [CLKID_CPUB_CLK_DIV7] = &g12b_cpub_clk_div7.hw, -- [CLKID_CPUB_CLK_DIV8] = &g12b_cpub_clk_div8.hw, -- [CLKID_CPUB_CLK_APB_SEL] = &g12b_cpub_clk_apb_sel.hw, -- [CLKID_CPUB_CLK_APB] = &g12b_cpub_clk_apb.hw, -- [CLKID_CPUB_CLK_ATB_SEL] = &g12b_cpub_clk_atb_sel.hw, -- [CLKID_CPUB_CLK_ATB] = &g12b_cpub_clk_atb.hw, -- [CLKID_CPUB_CLK_AXI_SEL] = &g12b_cpub_clk_axi_sel.hw, -- [CLKID_CPUB_CLK_AXI] = &g12b_cpub_clk_axi.hw, -- [CLKID_CPUB_CLK_TRACE_SEL] = &g12b_cpub_clk_trace_sel.hw, -- [CLKID_CPUB_CLK_TRACE] = &g12b_cpub_clk_trace.hw, -- [CLKID_SPICC0_SCLK_SEL] = &g12a_spicc0_sclk_sel.hw, -- [CLKID_SPICC0_SCLK_DIV] = &g12a_spicc0_sclk_div.hw, -+ [CLKID_PRIV_CPUB_CLK_DIV16_EN] = &g12b_cpub_clk_div16_en.hw, -+ [CLKID_PRIV_CPUB_CLK_DIV16] = &g12b_cpub_clk_div16.hw, -+ [CLKID_PRIV_CPUB_CLK_DIV2] = &g12b_cpub_clk_div2.hw, -+ [CLKID_PRIV_CPUB_CLK_DIV3] = &g12b_cpub_clk_div3.hw, -+ [CLKID_PRIV_CPUB_CLK_DIV4] = &g12b_cpub_clk_div4.hw, -+ [CLKID_PRIV_CPUB_CLK_DIV5] = &g12b_cpub_clk_div5.hw, -+ [CLKID_PRIV_CPUB_CLK_DIV6] = &g12b_cpub_clk_div6.hw, -+ [CLKID_PRIV_CPUB_CLK_DIV7] = &g12b_cpub_clk_div7.hw, -+ [CLKID_PRIV_CPUB_CLK_DIV8] = &g12b_cpub_clk_div8.hw, -+ [CLKID_PRIV_CPUB_CLK_APB_SEL] = &g12b_cpub_clk_apb_sel.hw, -+ [CLKID_PRIV_CPUB_CLK_APB] = &g12b_cpub_clk_apb.hw, -+ [CLKID_PRIV_CPUB_CLK_ATB_SEL] = &g12b_cpub_clk_atb_sel.hw, -+ [CLKID_PRIV_CPUB_CLK_ATB] = &g12b_cpub_clk_atb.hw, -+ [CLKID_PRIV_CPUB_CLK_AXI_SEL] = &g12b_cpub_clk_axi_sel.hw, -+ [CLKID_PRIV_CPUB_CLK_AXI] = &g12b_cpub_clk_axi.hw, -+ [CLKID_PRIV_CPUB_CLK_TRACE_SEL] = &g12b_cpub_clk_trace_sel.hw, -+ [CLKID_PRIV_CPUB_CLK_TRACE] = &g12b_cpub_clk_trace.hw, -+ [CLKID_PRIV_SPICC0_SCLK_SEL] = &g12a_spicc0_sclk_sel.hw, -+ [CLKID_PRIV_SPICC0_SCLK_DIV] = &g12a_spicc0_sclk_div.hw, - [CLKID_SPICC0_SCLK] = &g12a_spicc0_sclk.hw, -- [CLKID_SPICC1_SCLK_SEL] = &g12a_spicc1_sclk_sel.hw, -- [CLKID_SPICC1_SCLK_DIV] = &g12a_spicc1_sclk_div.hw, -+ [CLKID_PRIV_SPICC1_SCLK_SEL] = &g12a_spicc1_sclk_sel.hw, -+ [CLKID_PRIV_SPICC1_SCLK_DIV] = &g12a_spicc1_sclk_div.hw, - [CLKID_SPICC1_SCLK] = &g12a_spicc1_sclk.hw, -- [CLKID_NNA_AXI_CLK_SEL] = &sm1_nna_axi_clk_sel.hw, -- [CLKID_NNA_AXI_CLK_DIV] = &sm1_nna_axi_clk_div.hw, -+ [CLKID_PRIV_NNA_AXI_CLK_SEL] = &sm1_nna_axi_clk_sel.hw, -+ [CLKID_PRIV_NNA_AXI_CLK_DIV] = &sm1_nna_axi_clk_div.hw, - [CLKID_NNA_AXI_CLK] = &sm1_nna_axi_clk.hw, -- [CLKID_NNA_CORE_CLK_SEL] = &sm1_nna_core_clk_sel.hw, -- [CLKID_NNA_CORE_CLK_DIV] = &sm1_nna_core_clk_div.hw, -+ [CLKID_PRIV_NNA_CORE_CLK_SEL] = &sm1_nna_core_clk_sel.hw, -+ [CLKID_PRIV_NNA_CORE_CLK_DIV] = &sm1_nna_core_clk_div.hw, - [CLKID_NNA_CORE_CLK] = &sm1_nna_core_clk.hw, - [CLKID_MIPI_DSI_PXCLK_SEL] = &g12a_mipi_dsi_pxclk_sel.hw, -- [CLKID_MIPI_DSI_PXCLK_DIV] = &g12a_mipi_dsi_pxclk_div.hw, -+ [CLKID_PRIV_MIPI_DSI_PXCLK_DIV] = &g12a_mipi_dsi_pxclk_div.hw, - [CLKID_MIPI_DSI_PXCLK] = &g12a_mipi_dsi_pxclk.hw, - [NR_CLKS] = NULL, - }, -@@ -4748,8 +4863,8 @@ static struct clk_hw_onecell_data sm1_hw - [CLKID_FCLK_DIV7] = &g12a_fclk_div7.hw, - [CLKID_FCLK_DIV2P5] = &g12a_fclk_div2p5.hw, - [CLKID_GP0_PLL] = &g12a_gp0_pll.hw, -- [CLKID_MPEG_SEL] = &g12a_mpeg_clk_sel.hw, -- [CLKID_MPEG_DIV] = &g12a_mpeg_clk_div.hw, -+ [CLKID_PRIV_MPEG_SEL] = &g12a_mpeg_clk_sel.hw, -+ [CLKID_PRIV_MPEG_DIV] = &g12a_mpeg_clk_div.hw, - [CLKID_CLK81] = &g12a_clk81.hw, - [CLKID_MPLL0] = &g12a_mpll0.hw, - [CLKID_MPLL1] = &g12a_mpll1.hw, -@@ -4800,25 +4915,25 @@ static struct clk_hw_onecell_data sm1_hw - [CLKID_UART2] = &g12a_uart2.hw, - [CLKID_VPU_INTR] = &g12a_vpu_intr.hw, - [CLKID_GIC] = &g12a_gic.hw, -- [CLKID_SD_EMMC_A_CLK0_SEL] = &g12a_sd_emmc_a_clk0_sel.hw, -- [CLKID_SD_EMMC_A_CLK0_DIV] = &g12a_sd_emmc_a_clk0_div.hw, -+ [CLKID_PRIV_SD_EMMC_A_CLK0_SEL] = &g12a_sd_emmc_a_clk0_sel.hw, -+ [CLKID_PRIV_SD_EMMC_A_CLK0_DIV] = &g12a_sd_emmc_a_clk0_div.hw, - [CLKID_SD_EMMC_A_CLK0] = &g12a_sd_emmc_a_clk0.hw, -- [CLKID_SD_EMMC_B_CLK0_SEL] = &g12a_sd_emmc_b_clk0_sel.hw, -- [CLKID_SD_EMMC_B_CLK0_DIV] = &g12a_sd_emmc_b_clk0_div.hw, -+ [CLKID_PRIV_SD_EMMC_B_CLK0_SEL] = &g12a_sd_emmc_b_clk0_sel.hw, -+ [CLKID_PRIV_SD_EMMC_B_CLK0_DIV] = &g12a_sd_emmc_b_clk0_div.hw, - [CLKID_SD_EMMC_B_CLK0] = &g12a_sd_emmc_b_clk0.hw, -- [CLKID_SD_EMMC_C_CLK0_SEL] = &g12a_sd_emmc_c_clk0_sel.hw, -- [CLKID_SD_EMMC_C_CLK0_DIV] = &g12a_sd_emmc_c_clk0_div.hw, -+ [CLKID_PRIV_SD_EMMC_C_CLK0_SEL] = &g12a_sd_emmc_c_clk0_sel.hw, -+ [CLKID_PRIV_SD_EMMC_C_CLK0_DIV] = &g12a_sd_emmc_c_clk0_div.hw, - [CLKID_SD_EMMC_C_CLK0] = &g12a_sd_emmc_c_clk0.hw, -- [CLKID_MPLL0_DIV] = &g12a_mpll0_div.hw, -- [CLKID_MPLL1_DIV] = &g12a_mpll1_div.hw, -- [CLKID_MPLL2_DIV] = &g12a_mpll2_div.hw, -- [CLKID_MPLL3_DIV] = &g12a_mpll3_div.hw, -- [CLKID_FCLK_DIV2_DIV] = &g12a_fclk_div2_div.hw, -- [CLKID_FCLK_DIV3_DIV] = &g12a_fclk_div3_div.hw, -- [CLKID_FCLK_DIV4_DIV] = &g12a_fclk_div4_div.hw, -- [CLKID_FCLK_DIV5_DIV] = &g12a_fclk_div5_div.hw, -- [CLKID_FCLK_DIV7_DIV] = &g12a_fclk_div7_div.hw, -- [CLKID_FCLK_DIV2P5_DIV] = &g12a_fclk_div2p5_div.hw, -+ [CLKID_PRIV_MPLL0_DIV] = &g12a_mpll0_div.hw, -+ [CLKID_PRIV_MPLL1_DIV] = &g12a_mpll1_div.hw, -+ [CLKID_PRIV_MPLL2_DIV] = &g12a_mpll2_div.hw, -+ [CLKID_PRIV_MPLL3_DIV] = &g12a_mpll3_div.hw, -+ [CLKID_PRIV_FCLK_DIV2_DIV] = &g12a_fclk_div2_div.hw, -+ [CLKID_PRIV_FCLK_DIV3_DIV] = &g12a_fclk_div3_div.hw, -+ [CLKID_PRIV_FCLK_DIV4_DIV] = &g12a_fclk_div4_div.hw, -+ [CLKID_PRIV_FCLK_DIV5_DIV] = &g12a_fclk_div5_div.hw, -+ [CLKID_PRIV_FCLK_DIV7_DIV] = &g12a_fclk_div7_div.hw, -+ [CLKID_PRIV_FCLK_DIV2P5_DIV] = &g12a_fclk_div2p5_div.hw, - [CLKID_HIFI_PLL] = &g12a_hifi_pll.hw, - [CLKID_VCLK2_VENCI0] = &g12a_vclk2_venci0.hw, - [CLKID_VCLK2_VENCI1] = &g12a_vclk2_venci1.hw, -@@ -4839,56 +4954,56 @@ static struct clk_hw_onecell_data sm1_hw - [CLKID_VCLK2_VENCLMMC] = &g12a_vclk2_venclmmc.hw, - [CLKID_VCLK2_VENCL] = &g12a_vclk2_vencl.hw, - [CLKID_VCLK2_OTHER1] = &g12a_vclk2_other1.hw, -- [CLKID_FIXED_PLL_DCO] = &g12a_fixed_pll_dco.hw, -- [CLKID_SYS_PLL_DCO] = &g12a_sys_pll_dco.hw, -- [CLKID_GP0_PLL_DCO] = &g12a_gp0_pll_dco.hw, -- [CLKID_HIFI_PLL_DCO] = &g12a_hifi_pll_dco.hw, -+ [CLKID_PRIV_FIXED_PLL_DCO] = &g12a_fixed_pll_dco.hw, -+ [CLKID_PRIV_SYS_PLL_DCO] = &g12a_sys_pll_dco.hw, -+ [CLKID_PRIV_GP0_PLL_DCO] = &g12a_gp0_pll_dco.hw, -+ [CLKID_PRIV_HIFI_PLL_DCO] = &g12a_hifi_pll_dco.hw, - [CLKID_DMA] = &g12a_dma.hw, - [CLKID_EFUSE] = &g12a_efuse.hw, - [CLKID_ROM_BOOT] = &g12a_rom_boot.hw, - [CLKID_RESET_SEC] = &g12a_reset_sec.hw, - [CLKID_SEC_AHB_APB3] = &g12a_sec_ahb_apb3.hw, -- [CLKID_MPLL_PREDIV] = &g12a_mpll_prediv.hw, -+ [CLKID_PRIV_MPLL_PREDIV] = &g12a_mpll_prediv.hw, - [CLKID_VPU_0_SEL] = &g12a_vpu_0_sel.hw, -- [CLKID_VPU_0_DIV] = &g12a_vpu_0_div.hw, -+ [CLKID_PRIV_VPU_0_DIV] = &g12a_vpu_0_div.hw, - [CLKID_VPU_0] = &g12a_vpu_0.hw, - [CLKID_VPU_1_SEL] = &g12a_vpu_1_sel.hw, -- [CLKID_VPU_1_DIV] = &g12a_vpu_1_div.hw, -+ [CLKID_PRIV_VPU_1_DIV] = &g12a_vpu_1_div.hw, - [CLKID_VPU_1] = &g12a_vpu_1.hw, - [CLKID_VPU] = &g12a_vpu.hw, - [CLKID_VAPB_0_SEL] = &g12a_vapb_0_sel.hw, -- [CLKID_VAPB_0_DIV] = &g12a_vapb_0_div.hw, -+ [CLKID_PRIV_VAPB_0_DIV] = &g12a_vapb_0_div.hw, - [CLKID_VAPB_0] = &g12a_vapb_0.hw, - [CLKID_VAPB_1_SEL] = &g12a_vapb_1_sel.hw, -- [CLKID_VAPB_1_DIV] = &g12a_vapb_1_div.hw, -+ [CLKID_PRIV_VAPB_1_DIV] = &g12a_vapb_1_div.hw, - [CLKID_VAPB_1] = &g12a_vapb_1.hw, - [CLKID_VAPB_SEL] = &g12a_vapb_sel.hw, - [CLKID_VAPB] = &g12a_vapb.hw, -- [CLKID_HDMI_PLL_DCO] = &g12a_hdmi_pll_dco.hw, -- [CLKID_HDMI_PLL_OD] = &g12a_hdmi_pll_od.hw, -- [CLKID_HDMI_PLL_OD2] = &g12a_hdmi_pll_od2.hw, -+ [CLKID_PRIV_HDMI_PLL_DCO] = &g12a_hdmi_pll_dco.hw, -+ [CLKID_PRIV_HDMI_PLL_OD] = &g12a_hdmi_pll_od.hw, -+ [CLKID_PRIV_HDMI_PLL_OD2] = &g12a_hdmi_pll_od2.hw, - [CLKID_HDMI_PLL] = &g12a_hdmi_pll.hw, - [CLKID_VID_PLL] = &g12a_vid_pll_div.hw, -- [CLKID_VID_PLL_SEL] = &g12a_vid_pll_sel.hw, -- [CLKID_VID_PLL_DIV] = &g12a_vid_pll.hw, -- [CLKID_VCLK_SEL] = &g12a_vclk_sel.hw, -+ [CLKID_PRIV_VID_PLL_SEL] = &g12a_vid_pll_sel.hw, -+ [CLKID_PRIV_VID_PLL_DIV] = &g12a_vid_pll.hw, -+ [CLKID_PRIV_VCLK_SEL] = &g12a_vclk_sel.hw, - [CLKID_VCLK2_SEL] = &g12a_vclk2_sel.hw, -- [CLKID_VCLK_INPUT] = &g12a_vclk_input.hw, -- [CLKID_VCLK2_INPUT] = &g12a_vclk2_input.hw, -- [CLKID_VCLK_DIV] = &g12a_vclk_div.hw, -- [CLKID_VCLK2_DIV] = &g12a_vclk2_div.hw, -+ [CLKID_PRIV_VCLK_INPUT] = &g12a_vclk_input.hw, -+ [CLKID_PRIV_VCLK2_INPUT] = &g12a_vclk2_input.hw, -+ [CLKID_PRIV_VCLK_DIV] = &g12a_vclk_div.hw, -+ [CLKID_PRIV_VCLK2_DIV] = &g12a_vclk2_div.hw, - [CLKID_VCLK] = &g12a_vclk.hw, - [CLKID_VCLK2] = &g12a_vclk2.hw, - [CLKID_VCLK_DIV1] = &g12a_vclk_div1.hw, -- [CLKID_VCLK_DIV2_EN] = &g12a_vclk_div2_en.hw, -- [CLKID_VCLK_DIV4_EN] = &g12a_vclk_div4_en.hw, -- [CLKID_VCLK_DIV6_EN] = &g12a_vclk_div6_en.hw, -- [CLKID_VCLK_DIV12_EN] = &g12a_vclk_div12_en.hw, -+ [CLKID_PRIV_VCLK_DIV2_EN] = &g12a_vclk_div2_en.hw, -+ [CLKID_PRIV_VCLK_DIV4_EN] = &g12a_vclk_div4_en.hw, -+ [CLKID_PRIV_VCLK_DIV6_EN] = &g12a_vclk_div6_en.hw, -+ [CLKID_PRIV_VCLK_DIV12_EN] = &g12a_vclk_div12_en.hw, - [CLKID_VCLK2_DIV1] = &g12a_vclk2_div1.hw, -- [CLKID_VCLK2_DIV2_EN] = &g12a_vclk2_div2_en.hw, -- [CLKID_VCLK2_DIV4_EN] = &g12a_vclk2_div4_en.hw, -- [CLKID_VCLK2_DIV6_EN] = &g12a_vclk2_div6_en.hw, -- [CLKID_VCLK2_DIV12_EN] = &g12a_vclk2_div12_en.hw, -+ [CLKID_PRIV_VCLK2_DIV2_EN] = &g12a_vclk2_div2_en.hw, -+ [CLKID_PRIV_VCLK2_DIV4_EN] = &g12a_vclk2_div4_en.hw, -+ [CLKID_PRIV_VCLK2_DIV6_EN] = &g12a_vclk2_div6_en.hw, -+ [CLKID_PRIV_VCLK2_DIV12_EN] = &g12a_vclk2_div12_en.hw, - [CLKID_VCLK_DIV2] = &g12a_vclk_div2.hw, - [CLKID_VCLK_DIV4] = &g12a_vclk_div4.hw, - [CLKID_VCLK_DIV6] = &g12a_vclk_div6.hw, -@@ -4897,89 +5012,91 @@ static struct clk_hw_onecell_data sm1_hw - [CLKID_VCLK2_DIV4] = &g12a_vclk2_div4.hw, - [CLKID_VCLK2_DIV6] = &g12a_vclk2_div6.hw, - [CLKID_VCLK2_DIV12] = &g12a_vclk2_div12.hw, -- [CLKID_CTS_ENCI_SEL] = &g12a_cts_enci_sel.hw, -- [CLKID_CTS_ENCP_SEL] = &g12a_cts_encp_sel.hw, -- [CLKID_CTS_VDAC_SEL] = &g12a_cts_vdac_sel.hw, -- [CLKID_HDMI_TX_SEL] = &g12a_hdmi_tx_sel.hw, -+ [CLKID_PRIV_CTS_ENCI_SEL] = &g12a_cts_enci_sel.hw, -+ [CLKID_PRIV_CTS_ENCP_SEL] = &g12a_cts_encp_sel.hw, -+ [CLKID_CTS_ENCL_SEL] = &g12a_cts_encl_sel.hw, -+ [CLKID_PRIV_CTS_VDAC_SEL] = &g12a_cts_vdac_sel.hw, -+ [CLKID_PRIV_HDMI_TX_SEL] = &g12a_hdmi_tx_sel.hw, - [CLKID_CTS_ENCI] = &g12a_cts_enci.hw, - [CLKID_CTS_ENCP] = &g12a_cts_encp.hw, -+ [CLKID_CTS_ENCL] = &g12a_cts_encl.hw, - [CLKID_CTS_VDAC] = &g12a_cts_vdac.hw, - [CLKID_HDMI_TX] = &g12a_hdmi_tx.hw, -- [CLKID_HDMI_SEL] = &g12a_hdmi_sel.hw, -- [CLKID_HDMI_DIV] = &g12a_hdmi_div.hw, -+ [CLKID_PRIV_HDMI_SEL] = &g12a_hdmi_sel.hw, -+ [CLKID_PRIV_HDMI_DIV] = &g12a_hdmi_div.hw, - [CLKID_HDMI] = &g12a_hdmi.hw, - [CLKID_MALI_0_SEL] = &g12a_mali_0_sel.hw, -- [CLKID_MALI_0_DIV] = &g12a_mali_0_div.hw, -+ [CLKID_PRIV_MALI_0_DIV] = &g12a_mali_0_div.hw, - [CLKID_MALI_0] = &g12a_mali_0.hw, - [CLKID_MALI_1_SEL] = &g12a_mali_1_sel.hw, -- [CLKID_MALI_1_DIV] = &g12a_mali_1_div.hw, -+ [CLKID_PRIV_MALI_1_DIV] = &g12a_mali_1_div.hw, - [CLKID_MALI_1] = &g12a_mali_1.hw, - [CLKID_MALI] = &g12a_mali.hw, -- [CLKID_MPLL_50M_DIV] = &g12a_mpll_50m_div.hw, -+ [CLKID_PRIV_MPLL_50M_DIV] = &g12a_mpll_50m_div.hw, - [CLKID_MPLL_50M] = &g12a_mpll_50m.hw, -- [CLKID_SYS_PLL_DIV16_EN] = &g12a_sys_pll_div16_en.hw, -- [CLKID_SYS_PLL_DIV16] = &g12a_sys_pll_div16.hw, -- [CLKID_CPU_CLK_DYN0_SEL] = &g12a_cpu_clk_premux0.hw, -- [CLKID_CPU_CLK_DYN0_DIV] = &g12a_cpu_clk_mux0_div.hw, -- [CLKID_CPU_CLK_DYN0] = &g12a_cpu_clk_postmux0.hw, -- [CLKID_CPU_CLK_DYN1_SEL] = &g12a_cpu_clk_premux1.hw, -- [CLKID_CPU_CLK_DYN1_DIV] = &g12a_cpu_clk_mux1_div.hw, -- [CLKID_CPU_CLK_DYN1] = &g12a_cpu_clk_postmux1.hw, -- [CLKID_CPU_CLK_DYN] = &g12a_cpu_clk_dyn.hw, -+ [CLKID_PRIV_SYS_PLL_DIV16_EN] = &g12a_sys_pll_div16_en.hw, -+ [CLKID_PRIV_SYS_PLL_DIV16] = &g12a_sys_pll_div16.hw, -+ [CLKID_PRIV_CPU_CLK_DYN0_SEL] = &g12a_cpu_clk_premux0.hw, -+ [CLKID_PRIV_CPU_CLK_DYN0_DIV] = &g12a_cpu_clk_mux0_div.hw, -+ [CLKID_PRIV_CPU_CLK_DYN0] = &g12a_cpu_clk_postmux0.hw, -+ [CLKID_PRIV_CPU_CLK_DYN1_SEL] = &g12a_cpu_clk_premux1.hw, -+ [CLKID_PRIV_CPU_CLK_DYN1_DIV] = &g12a_cpu_clk_mux1_div.hw, -+ [CLKID_PRIV_CPU_CLK_DYN1] = &g12a_cpu_clk_postmux1.hw, -+ [CLKID_PRIV_CPU_CLK_DYN] = &g12a_cpu_clk_dyn.hw, - [CLKID_CPU_CLK] = &g12a_cpu_clk.hw, -- [CLKID_CPU_CLK_DIV16_EN] = &g12a_cpu_clk_div16_en.hw, -- [CLKID_CPU_CLK_DIV16] = &g12a_cpu_clk_div16.hw, -- [CLKID_CPU_CLK_APB_DIV] = &g12a_cpu_clk_apb_div.hw, -- [CLKID_CPU_CLK_APB] = &g12a_cpu_clk_apb.hw, -- [CLKID_CPU_CLK_ATB_DIV] = &g12a_cpu_clk_atb_div.hw, -- [CLKID_CPU_CLK_ATB] = &g12a_cpu_clk_atb.hw, -- [CLKID_CPU_CLK_AXI_DIV] = &g12a_cpu_clk_axi_div.hw, -- [CLKID_CPU_CLK_AXI] = &g12a_cpu_clk_axi.hw, -- [CLKID_CPU_CLK_TRACE_DIV] = &g12a_cpu_clk_trace_div.hw, -- [CLKID_CPU_CLK_TRACE] = &g12a_cpu_clk_trace.hw, -- [CLKID_PCIE_PLL_DCO] = &g12a_pcie_pll_dco.hw, -- [CLKID_PCIE_PLL_DCO_DIV2] = &g12a_pcie_pll_dco_div2.hw, -- [CLKID_PCIE_PLL_OD] = &g12a_pcie_pll_od.hw, -+ [CLKID_PRIV_CPU_CLK_DIV16_EN] = &g12a_cpu_clk_div16_en.hw, -+ [CLKID_PRIV_CPU_CLK_DIV16] = &g12a_cpu_clk_div16.hw, -+ [CLKID_PRIV_CPU_CLK_APB_DIV] = &g12a_cpu_clk_apb_div.hw, -+ [CLKID_PRIV_CPU_CLK_APB] = &g12a_cpu_clk_apb.hw, -+ [CLKID_PRIV_CPU_CLK_ATB_DIV] = &g12a_cpu_clk_atb_div.hw, -+ [CLKID_PRIV_CPU_CLK_ATB] = &g12a_cpu_clk_atb.hw, -+ [CLKID_PRIV_CPU_CLK_AXI_DIV] = &g12a_cpu_clk_axi_div.hw, -+ [CLKID_PRIV_CPU_CLK_AXI] = &g12a_cpu_clk_axi.hw, -+ [CLKID_PRIV_CPU_CLK_TRACE_DIV] = &g12a_cpu_clk_trace_div.hw, -+ [CLKID_PRIV_CPU_CLK_TRACE] = &g12a_cpu_clk_trace.hw, -+ [CLKID_PRIV_PCIE_PLL_DCO] = &g12a_pcie_pll_dco.hw, -+ [CLKID_PRIV_PCIE_PLL_DCO_DIV2] = &g12a_pcie_pll_dco_div2.hw, -+ [CLKID_PRIV_PCIE_PLL_OD] = &g12a_pcie_pll_od.hw, - [CLKID_PCIE_PLL] = &g12a_pcie_pll.hw, -- [CLKID_VDEC_1_SEL] = &g12a_vdec_1_sel.hw, -- [CLKID_VDEC_1_DIV] = &g12a_vdec_1_div.hw, -+ [CLKID_PRIV_VDEC_1_SEL] = &g12a_vdec_1_sel.hw, -+ [CLKID_PRIV_VDEC_1_DIV] = &g12a_vdec_1_div.hw, - [CLKID_VDEC_1] = &g12a_vdec_1.hw, -- [CLKID_VDEC_HEVC_SEL] = &g12a_vdec_hevc_sel.hw, -- [CLKID_VDEC_HEVC_DIV] = &g12a_vdec_hevc_div.hw, -+ [CLKID_PRIV_VDEC_HEVC_SEL] = &g12a_vdec_hevc_sel.hw, -+ [CLKID_PRIV_VDEC_HEVC_DIV] = &g12a_vdec_hevc_div.hw, - [CLKID_VDEC_HEVC] = &g12a_vdec_hevc.hw, -- [CLKID_VDEC_HEVCF_SEL] = &g12a_vdec_hevcf_sel.hw, -- [CLKID_VDEC_HEVCF_DIV] = &g12a_vdec_hevcf_div.hw, -+ [CLKID_PRIV_VDEC_HEVCF_SEL] = &g12a_vdec_hevcf_sel.hw, -+ [CLKID_PRIV_VDEC_HEVCF_DIV] = &g12a_vdec_hevcf_div.hw, - [CLKID_VDEC_HEVCF] = &g12a_vdec_hevcf.hw, -- [CLKID_TS_DIV] = &g12a_ts_div.hw, -+ [CLKID_PRIV_TS_DIV] = &g12a_ts_div.hw, - [CLKID_TS] = &g12a_ts.hw, -- [CLKID_GP1_PLL_DCO] = &sm1_gp1_pll_dco.hw, -+ [CLKID_PRIV_GP1_PLL_DCO] = &sm1_gp1_pll_dco.hw, - [CLKID_GP1_PLL] = &sm1_gp1_pll.hw, -- [CLKID_DSU_CLK_DYN0_SEL] = &sm1_dsu_clk_premux0.hw, -- [CLKID_DSU_CLK_DYN0_DIV] = &sm1_dsu_clk_premux1.hw, -- [CLKID_DSU_CLK_DYN0] = &sm1_dsu_clk_mux0_div.hw, -- [CLKID_DSU_CLK_DYN1_SEL] = &sm1_dsu_clk_postmux0.hw, -- [CLKID_DSU_CLK_DYN1_DIV] = &sm1_dsu_clk_mux1_div.hw, -- [CLKID_DSU_CLK_DYN1] = &sm1_dsu_clk_postmux1.hw, -- [CLKID_DSU_CLK_DYN] = &sm1_dsu_clk_dyn.hw, -- [CLKID_DSU_CLK_FINAL] = &sm1_dsu_final_clk.hw, -+ [CLKID_PRIV_DSU_CLK_DYN0_SEL] = &sm1_dsu_clk_premux0.hw, -+ [CLKID_PRIV_DSU_CLK_DYN0_DIV] = &sm1_dsu_clk_premux1.hw, -+ [CLKID_PRIV_DSU_CLK_DYN0] = &sm1_dsu_clk_mux0_div.hw, -+ [CLKID_PRIV_DSU_CLK_DYN1_SEL] = &sm1_dsu_clk_postmux0.hw, -+ [CLKID_PRIV_DSU_CLK_DYN1_DIV] = &sm1_dsu_clk_mux1_div.hw, -+ [CLKID_PRIV_DSU_CLK_DYN1] = &sm1_dsu_clk_postmux1.hw, -+ [CLKID_PRIV_DSU_CLK_DYN] = &sm1_dsu_clk_dyn.hw, -+ [CLKID_PRIV_DSU_CLK_FINAL] = &sm1_dsu_final_clk.hw, - [CLKID_DSU_CLK] = &sm1_dsu_clk.hw, - [CLKID_CPU1_CLK] = &sm1_cpu1_clk.hw, - [CLKID_CPU2_CLK] = &sm1_cpu2_clk.hw, - [CLKID_CPU3_CLK] = &sm1_cpu3_clk.hw, -- [CLKID_SPICC0_SCLK_SEL] = &g12a_spicc0_sclk_sel.hw, -- [CLKID_SPICC0_SCLK_DIV] = &g12a_spicc0_sclk_div.hw, -+ [CLKID_PRIV_SPICC0_SCLK_SEL] = &g12a_spicc0_sclk_sel.hw, -+ [CLKID_PRIV_SPICC0_SCLK_DIV] = &g12a_spicc0_sclk_div.hw, - [CLKID_SPICC0_SCLK] = &g12a_spicc0_sclk.hw, -- [CLKID_SPICC1_SCLK_SEL] = &g12a_spicc1_sclk_sel.hw, -- [CLKID_SPICC1_SCLK_DIV] = &g12a_spicc1_sclk_div.hw, -+ [CLKID_PRIV_SPICC1_SCLK_SEL] = &g12a_spicc1_sclk_sel.hw, -+ [CLKID_PRIV_SPICC1_SCLK_DIV] = &g12a_spicc1_sclk_div.hw, - [CLKID_SPICC1_SCLK] = &g12a_spicc1_sclk.hw, -- [CLKID_NNA_AXI_CLK_SEL] = &sm1_nna_axi_clk_sel.hw, -- [CLKID_NNA_AXI_CLK_DIV] = &sm1_nna_axi_clk_div.hw, -+ [CLKID_PRIV_NNA_AXI_CLK_SEL] = &sm1_nna_axi_clk_sel.hw, -+ [CLKID_PRIV_NNA_AXI_CLK_DIV] = &sm1_nna_axi_clk_div.hw, - [CLKID_NNA_AXI_CLK] = &sm1_nna_axi_clk.hw, -- [CLKID_NNA_CORE_CLK_SEL] = &sm1_nna_core_clk_sel.hw, -- [CLKID_NNA_CORE_CLK_DIV] = &sm1_nna_core_clk_div.hw, -+ [CLKID_PRIV_NNA_CORE_CLK_SEL] = &sm1_nna_core_clk_sel.hw, -+ [CLKID_PRIV_NNA_CORE_CLK_DIV] = &sm1_nna_core_clk_div.hw, - [CLKID_NNA_CORE_CLK] = &sm1_nna_core_clk.hw, - [CLKID_MIPI_DSI_PXCLK_SEL] = &g12a_mipi_dsi_pxclk_sel.hw, -- [CLKID_MIPI_DSI_PXCLK_DIV] = &g12a_mipi_dsi_pxclk_div.hw, -+ [CLKID_PRIV_MIPI_DSI_PXCLK_DIV] = &g12a_mipi_dsi_pxclk_div.hw, - [CLKID_MIPI_DSI_PXCLK] = &g12a_mipi_dsi_pxclk.hw, - [NR_CLKS] = NULL, - }, -@@ -5133,10 +5250,12 @@ static struct clk_regmap *const g12a_clk - &g12a_vclk2_div12_en, - &g12a_cts_enci_sel, - &g12a_cts_encp_sel, -+ &g12a_cts_encl_sel, - &g12a_cts_vdac_sel, - &g12a_hdmi_tx_sel, - &g12a_cts_enci, - &g12a_cts_encp, -+ &g12a_cts_encl, - &g12a_cts_vdac, - &g12a_hdmi_tx, - &g12a_hdmi_sel, -@@ -5246,7 +5365,7 @@ static int meson_g12a_dvfs_setup_common( - struct clk_hw *xtal; - int ret; - -- xtal = clk_hw_get_parent_by_index(hws[CLKID_CPU_CLK_DYN1_SEL], 0); -+ xtal = clk_hw_get_parent_by_index(hws[CLKID_PRIV_CPU_CLK_DYN1_SEL], 0); - - /* Setup clock notifier for cpu_clk_postmux0 */ - g12a_cpu_clk_postmux0_nb_data.xtal = xtal; -@@ -5284,7 +5403,7 @@ static int meson_g12b_dvfs_setup(struct - if (ret) - return ret; - -- xtal = clk_hw_get_parent_by_index(hws[CLKID_CPU_CLK_DYN1_SEL], 0); -+ xtal = clk_hw_get_parent_by_index(hws[CLKID_PRIV_CPU_CLK_DYN1_SEL], 0); - - /* Setup clock notifier for cpu_clk mux */ - notifier_clk = devm_clk_hw_get_clk(dev, &g12b_cpu_clk.hw, -@@ -5381,6 +5500,32 @@ static int meson_g12a_dvfs_setup(struct - return 0; - } - -+static int meson_g12a_vclk_setup(struct platform_device *pdev) -+{ -+ struct device *dev = &pdev->dev; -+ struct clk *notifier_clk; -+ int ret; -+ -+ /* Setup clock notifier for vclk2 */ -+ notifier_clk = devm_clk_hw_get_clk(dev, &g12a_vclk2.hw, DVFS_CON_ID); -+ ret = devm_clk_notifier_register(dev, notifier_clk, &g12a_vclk2_data.nb); -+ if (ret) { -+ dev_err(dev, "failed to register the vlkc2 notifier\n"); -+ return ret; -+ } -+ -+ /* Setup clock notifier for vclk2_div */ -+ notifier_clk = devm_clk_hw_get_clk(dev, &g12a_vclk2_div.hw, DVFS_CON_ID); -+ ret = devm_clk_notifier_register(dev, notifier_clk, -+ &g12a_vclk2_div_data.nb); -+ if (ret) { -+ dev_err(dev, "failed to register the vclk2_div notifier\n"); -+ return ret; -+ } -+ -+ return 0; -+} -+ - struct meson_g12a_data { - const struct meson_eeclkc_data eeclkc_data; - int (*dvfs_setup)(struct platform_device *pdev); -@@ -5403,6 +5548,10 @@ static int meson_g12a_probe(struct platf - g12a_data = container_of(eeclkc_data, struct meson_g12a_data, - eeclkc_data); - -+ ret = meson_g12a_vclk_setup(pdev); -+ if (ret) -+ return ret; -+ - if (g12a_data->dvfs_setup) - return g12a_data->dvfs_setup(pdev); - -diff -rupN linux.orig/drivers/clk/meson/g12a.h linux/drivers/clk/meson/g12a.h ---- linux.orig/drivers/clk/meson/g12a.h 2023-08-22 23:19:15.618582349 +0000 -+++ linux/drivers/clk/meson/g12a.h 2023-08-22 23:08:18.873051181 +0000 -@@ -135,138 +135,137 @@ - * to expose, such as the internal muxes and dividers of composite clocks, - * will remain defined here. - */ --#define CLKID_MPEG_SEL 8 --#define CLKID_MPEG_DIV 9 --#define CLKID_SD_EMMC_A_CLK0_SEL 63 --#define CLKID_SD_EMMC_A_CLK0_DIV 64 --#define CLKID_SD_EMMC_B_CLK0_SEL 65 --#define CLKID_SD_EMMC_B_CLK0_DIV 66 --#define CLKID_SD_EMMC_C_CLK0_SEL 67 --#define CLKID_SD_EMMC_C_CLK0_DIV 68 --#define CLKID_MPLL0_DIV 69 --#define CLKID_MPLL1_DIV 70 --#define CLKID_MPLL2_DIV 71 --#define CLKID_MPLL3_DIV 72 --#define CLKID_MPLL_PREDIV 73 --#define CLKID_FCLK_DIV2_DIV 75 --#define CLKID_FCLK_DIV3_DIV 76 --#define CLKID_FCLK_DIV4_DIV 77 --#define CLKID_FCLK_DIV5_DIV 78 --#define CLKID_FCLK_DIV7_DIV 79 --#define CLKID_FCLK_DIV2P5_DIV 100 --#define CLKID_FIXED_PLL_DCO 101 --#define CLKID_SYS_PLL_DCO 102 --#define CLKID_GP0_PLL_DCO 103 --#define CLKID_HIFI_PLL_DCO 104 --#define CLKID_VPU_0_DIV 111 --#define CLKID_VPU_1_DIV 114 --#define CLKID_VAPB_0_DIV 118 --#define CLKID_VAPB_1_DIV 121 --#define CLKID_HDMI_PLL_DCO 125 --#define CLKID_HDMI_PLL_OD 126 --#define CLKID_HDMI_PLL_OD2 127 --#define CLKID_VID_PLL_SEL 130 --#define CLKID_VID_PLL_DIV 131 --#define CLKID_VCLK_SEL 132 --#define CLKID_VCLK2_SEL 133 --#define CLKID_VCLK_INPUT 134 --#define CLKID_VCLK2_INPUT 135 --#define CLKID_VCLK_DIV 136 --#define CLKID_VCLK2_DIV 137 --#define CLKID_VCLK_DIV2_EN 140 --#define CLKID_VCLK_DIV4_EN 141 --#define CLKID_VCLK_DIV6_EN 142 --#define CLKID_VCLK_DIV12_EN 143 --#define CLKID_VCLK2_DIV2_EN 144 --#define CLKID_VCLK2_DIV4_EN 145 --#define CLKID_VCLK2_DIV6_EN 146 --#define CLKID_VCLK2_DIV12_EN 147 --#define CLKID_CTS_ENCI_SEL 158 --#define CLKID_CTS_ENCP_SEL 159 --#define CLKID_CTS_VDAC_SEL 160 --#define CLKID_HDMI_TX_SEL 161 --#define CLKID_HDMI_SEL 166 --#define CLKID_HDMI_DIV 167 --#define CLKID_MALI_0_DIV 170 --#define CLKID_MALI_1_DIV 173 --#define CLKID_MPLL_50M_DIV 176 --#define CLKID_SYS_PLL_DIV16_EN 178 --#define CLKID_SYS_PLL_DIV16 179 --#define CLKID_CPU_CLK_DYN0_SEL 180 --#define CLKID_CPU_CLK_DYN0_DIV 181 --#define CLKID_CPU_CLK_DYN0 182 --#define CLKID_CPU_CLK_DYN1_SEL 183 --#define CLKID_CPU_CLK_DYN1_DIV 184 --#define CLKID_CPU_CLK_DYN1 185 --#define CLKID_CPU_CLK_DYN 186 --#define CLKID_CPU_CLK_DIV16_EN 188 --#define CLKID_CPU_CLK_DIV16 189 --#define CLKID_CPU_CLK_APB_DIV 190 --#define CLKID_CPU_CLK_APB 191 --#define CLKID_CPU_CLK_ATB_DIV 192 --#define CLKID_CPU_CLK_ATB 193 --#define CLKID_CPU_CLK_AXI_DIV 194 --#define CLKID_CPU_CLK_AXI 195 --#define CLKID_CPU_CLK_TRACE_DIV 196 --#define CLKID_CPU_CLK_TRACE 197 --#define CLKID_PCIE_PLL_DCO 198 --#define CLKID_PCIE_PLL_DCO_DIV2 199 --#define CLKID_PCIE_PLL_OD 200 --#define CLKID_VDEC_1_SEL 202 --#define CLKID_VDEC_1_DIV 203 --#define CLKID_VDEC_HEVC_SEL 205 --#define CLKID_VDEC_HEVC_DIV 206 --#define CLKID_VDEC_HEVCF_SEL 208 --#define CLKID_VDEC_HEVCF_DIV 209 --#define CLKID_TS_DIV 211 --#define CLKID_SYS1_PLL_DCO 213 --#define CLKID_SYS1_PLL 214 --#define CLKID_SYS1_PLL_DIV16_EN 215 --#define CLKID_SYS1_PLL_DIV16 216 --#define CLKID_CPUB_CLK_DYN0_SEL 217 --#define CLKID_CPUB_CLK_DYN0_DIV 218 --#define CLKID_CPUB_CLK_DYN0 219 --#define CLKID_CPUB_CLK_DYN1_SEL 220 --#define CLKID_CPUB_CLK_DYN1_DIV 221 --#define CLKID_CPUB_CLK_DYN1 222 --#define CLKID_CPUB_CLK_DYN 223 --#define CLKID_CPUB_CLK_DIV16_EN 225 --#define CLKID_CPUB_CLK_DIV16 226 --#define CLKID_CPUB_CLK_DIV2 227 --#define CLKID_CPUB_CLK_DIV3 228 --#define CLKID_CPUB_CLK_DIV4 229 --#define CLKID_CPUB_CLK_DIV5 230 --#define CLKID_CPUB_CLK_DIV6 231 --#define CLKID_CPUB_CLK_DIV7 232 --#define CLKID_CPUB_CLK_DIV8 233 --#define CLKID_CPUB_CLK_APB_SEL 234 --#define CLKID_CPUB_CLK_APB 235 --#define CLKID_CPUB_CLK_ATB_SEL 236 --#define CLKID_CPUB_CLK_ATB 237 --#define CLKID_CPUB_CLK_AXI_SEL 238 --#define CLKID_CPUB_CLK_AXI 239 --#define CLKID_CPUB_CLK_TRACE_SEL 240 --#define CLKID_CPUB_CLK_TRACE 241 --#define CLKID_GP1_PLL_DCO 242 --#define CLKID_DSU_CLK_DYN0_SEL 244 --#define CLKID_DSU_CLK_DYN0_DIV 245 --#define CLKID_DSU_CLK_DYN0 246 --#define CLKID_DSU_CLK_DYN1_SEL 247 --#define CLKID_DSU_CLK_DYN1_DIV 248 --#define CLKID_DSU_CLK_DYN1 249 --#define CLKID_DSU_CLK_DYN 250 --#define CLKID_DSU_CLK_FINAL 251 --#define CLKID_SPICC0_SCLK_SEL 256 --#define CLKID_SPICC0_SCLK_DIV 257 --#define CLKID_SPICC1_SCLK_SEL 259 --#define CLKID_SPICC1_SCLK_DIV 260 --#define CLKID_NNA_AXI_CLK_SEL 262 --#define CLKID_NNA_AXI_CLK_DIV 263 --#define CLKID_NNA_CORE_CLK_SEL 265 --#define CLKID_NNA_CORE_CLK_DIV 266 --#define CLKID_MIPI_DSI_PXCLK_DIV 268 -+#define CLKID_PRIV_MPEG_SEL 8 -+#define CLKID_PRIV_MPEG_DIV 9 -+#define CLKID_PRIV_SD_EMMC_A_CLK0_SEL 63 -+#define CLKID_PRIV_SD_EMMC_A_CLK0_DIV 64 -+#define CLKID_PRIV_SD_EMMC_B_CLK0_SEL 65 -+#define CLKID_PRIV_SD_EMMC_B_CLK0_DIV 66 -+#define CLKID_PRIV_SD_EMMC_C_CLK0_SEL 67 -+#define CLKID_PRIV_SD_EMMC_C_CLK0_DIV 68 -+#define CLKID_PRIV_MPLL0_DIV 69 -+#define CLKID_PRIV_MPLL1_DIV 70 -+#define CLKID_PRIV_MPLL2_DIV 71 -+#define CLKID_PRIV_MPLL3_DIV 72 -+#define CLKID_PRIV_MPLL_PREDIV 73 -+#define CLKID_PRIV_FCLK_DIV2_DIV 75 -+#define CLKID_PRIV_FCLK_DIV3_DIV 76 -+#define CLKID_PRIV_FCLK_DIV4_DIV 77 -+#define CLKID_PRIV_FCLK_DIV5_DIV 78 -+#define CLKID_PRIV_FCLK_DIV7_DIV 79 -+#define CLKID_PRIV_FCLK_DIV2P5_DIV 100 -+#define CLKID_PRIV_FIXED_PLL_DCO 101 -+#define CLKID_PRIV_SYS_PLL_DCO 102 -+#define CLKID_PRIV_GP0_PLL_DCO 103 -+#define CLKID_PRIV_HIFI_PLL_DCO 104 -+#define CLKID_PRIV_VPU_0_DIV 111 -+#define CLKID_PRIV_VPU_1_DIV 114 -+#define CLKID_PRIV_VAPB_0_DIV 118 -+#define CLKID_PRIV_VAPB_1_DIV 121 -+#define CLKID_PRIV_HDMI_PLL_DCO 125 -+#define CLKID_PRIV_HDMI_PLL_OD 126 -+#define CLKID_PRIV_HDMI_PLL_OD2 127 -+#define CLKID_PRIV_VID_PLL_SEL 130 -+#define CLKID_PRIV_VID_PLL_DIV 131 -+#define CLKID_PRIV_VCLK_SEL 132 -+#define CLKID_PRIV_VCLK_INPUT 134 -+#define CLKID_PRIV_VCLK2_INPUT 135 -+#define CLKID_PRIV_VCLK_DIV 136 -+#define CLKID_PRIV_VCLK2_DIV 137 -+#define CLKID_PRIV_VCLK_DIV2_EN 140 -+#define CLKID_PRIV_VCLK_DIV4_EN 141 -+#define CLKID_PRIV_VCLK_DIV6_EN 142 -+#define CLKID_PRIV_VCLK_DIV12_EN 143 -+#define CLKID_PRIV_VCLK2_DIV2_EN 144 -+#define CLKID_PRIV_VCLK2_DIV4_EN 145 -+#define CLKID_PRIV_VCLK2_DIV6_EN 146 -+#define CLKID_PRIV_VCLK2_DIV12_EN 147 -+#define CLKID_PRIV_CTS_ENCI_SEL 158 -+#define CLKID_PRIV_CTS_ENCP_SEL 159 -+#define CLKID_PRIV_CTS_VDAC_SEL 160 -+#define CLKID_PRIV_HDMI_TX_SEL 161 -+#define CLKID_PRIV_HDMI_SEL 166 -+#define CLKID_PRIV_HDMI_DIV 167 -+#define CLKID_PRIV_MALI_0_DIV 170 -+#define CLKID_PRIV_MALI_1_DIV 173 -+#define CLKID_PRIV_MPLL_50M_DIV 176 -+#define CLKID_PRIV_SYS_PLL_DIV16_EN 178 -+#define CLKID_PRIV_SYS_PLL_DIV16 179 -+#define CLKID_PRIV_CPU_CLK_DYN0_SEL 180 -+#define CLKID_PRIV_CPU_CLK_DYN0_DIV 181 -+#define CLKID_PRIV_CPU_CLK_DYN0 182 -+#define CLKID_PRIV_CPU_CLK_DYN1_SEL 183 -+#define CLKID_PRIV_CPU_CLK_DYN1_DIV 184 -+#define CLKID_PRIV_CPU_CLK_DYN1 185 -+#define CLKID_PRIV_CPU_CLK_DYN 186 -+#define CLKID_PRIV_CPU_CLK_DIV16_EN 188 -+#define CLKID_PRIV_CPU_CLK_DIV16 189 -+#define CLKID_PRIV_CPU_CLK_APB_DIV 190 -+#define CLKID_PRIV_CPU_CLK_APB 191 -+#define CLKID_PRIV_CPU_CLK_ATB_DIV 192 -+#define CLKID_PRIV_CPU_CLK_ATB 193 -+#define CLKID_PRIV_CPU_CLK_AXI_DIV 194 -+#define CLKID_PRIV_CPU_CLK_AXI 195 -+#define CLKID_PRIV_CPU_CLK_TRACE_DIV 196 -+#define CLKID_PRIV_CPU_CLK_TRACE 197 -+#define CLKID_PRIV_PCIE_PLL_DCO 198 -+#define CLKID_PRIV_PCIE_PLL_DCO_DIV2 199 -+#define CLKID_PRIV_PCIE_PLL_OD 200 -+#define CLKID_PRIV_VDEC_1_SEL 202 -+#define CLKID_PRIV_VDEC_1_DIV 203 -+#define CLKID_PRIV_VDEC_HEVC_SEL 205 -+#define CLKID_PRIV_VDEC_HEVC_DIV 206 -+#define CLKID_PRIV_VDEC_HEVCF_SEL 208 -+#define CLKID_PRIV_VDEC_HEVCF_DIV 209 -+#define CLKID_PRIV_TS_DIV 211 -+#define CLKID_PRIV_SYS1_PLL_DCO 213 -+#define CLKID_PRIV_SYS1_PLL 214 -+#define CLKID_PRIV_SYS1_PLL_DIV16_EN 215 -+#define CLKID_PRIV_SYS1_PLL_DIV16 216 -+#define CLKID_PRIV_CPUB_CLK_DYN0_SEL 217 -+#define CLKID_PRIV_CPUB_CLK_DYN0_DIV 218 -+#define CLKID_PRIV_CPUB_CLK_DYN0 219 -+#define CLKID_PRIV_CPUB_CLK_DYN1_SEL 220 -+#define CLKID_PRIV_CPUB_CLK_DYN1_DIV 221 -+#define CLKID_PRIV_CPUB_CLK_DYN1 222 -+#define CLKID_PRIV_CPUB_CLK_DYN 223 -+#define CLKID_PRIV_CPUB_CLK_DIV16_EN 225 -+#define CLKID_PRIV_CPUB_CLK_DIV16 226 -+#define CLKID_PRIV_CPUB_CLK_DIV2 227 -+#define CLKID_PRIV_CPUB_CLK_DIV3 228 -+#define CLKID_PRIV_CPUB_CLK_DIV4 229 -+#define CLKID_PRIV_CPUB_CLK_DIV5 230 -+#define CLKID_PRIV_CPUB_CLK_DIV6 231 -+#define CLKID_PRIV_CPUB_CLK_DIV7 232 -+#define CLKID_PRIV_CPUB_CLK_DIV8 233 -+#define CLKID_PRIV_CPUB_CLK_APB_SEL 234 -+#define CLKID_PRIV_CPUB_CLK_APB 235 -+#define CLKID_PRIV_CPUB_CLK_ATB_SEL 236 -+#define CLKID_PRIV_CPUB_CLK_ATB 237 -+#define CLKID_PRIV_CPUB_CLK_AXI_SEL 238 -+#define CLKID_PRIV_CPUB_CLK_AXI 239 -+#define CLKID_PRIV_CPUB_CLK_TRACE_SEL 240 -+#define CLKID_PRIV_CPUB_CLK_TRACE 241 -+#define CLKID_PRIV_GP1_PLL_DCO 242 -+#define CLKID_PRIV_DSU_CLK_DYN0_SEL 244 -+#define CLKID_PRIV_DSU_CLK_DYN0_DIV 245 -+#define CLKID_PRIV_DSU_CLK_DYN0 246 -+#define CLKID_PRIV_DSU_CLK_DYN1_SEL 247 -+#define CLKID_PRIV_DSU_CLK_DYN1_DIV 248 -+#define CLKID_PRIV_DSU_CLK_DYN1 249 -+#define CLKID_PRIV_DSU_CLK_DYN 250 -+#define CLKID_PRIV_DSU_CLK_FINAL 251 -+#define CLKID_PRIV_SPICC0_SCLK_SEL 256 -+#define CLKID_PRIV_SPICC0_SCLK_DIV 257 -+#define CLKID_PRIV_SPICC1_SCLK_SEL 259 -+#define CLKID_PRIV_SPICC1_SCLK_DIV 260 -+#define CLKID_PRIV_NNA_AXI_CLK_SEL 262 -+#define CLKID_PRIV_NNA_AXI_CLK_DIV 263 -+#define CLKID_PRIV_NNA_CORE_CLK_SEL 265 -+#define CLKID_PRIV_NNA_CORE_CLK_DIV 266 -+#define CLKID_PRIV_MIPI_DSI_PXCLK_DIV 268 - --#define NR_CLKS 271 -+#define NR_CLKS 273 - - /* include the CLKIDs that have been made part of the DT binding */ - #include -diff -rupN linux.orig/drivers/gpu/drm/meson/Kconfig linux/drivers/gpu/drm/meson/Kconfig ---- linux.orig/drivers/gpu/drm/meson/Kconfig 2023-08-22 23:19:15.914591935 +0000 -+++ linux/drivers/gpu/drm/meson/Kconfig 2023-08-22 23:08:19.145060265 +0000 -@@ -17,3 +17,10 @@ config DRM_MESON_DW_HDMI - default y if DRM_MESON - select DRM_DW_HDMI - imply DRM_DW_HDMI_I2S_AUDIO -+ -+config DRM_MESON_DW_MIPI_DSI -+ tristate "MIPI DSI Synopsys Controller support for Amlogic Meson Display" -+ depends on DRM_MESON -+ default y if DRM_MESON -+ select DRM_DW_MIPI_DSI -+ select GENERIC_PHY_MIPI_DPHY -diff -rupN linux.orig/drivers/gpu/drm/meson/Makefile linux/drivers/gpu/drm/meson/Makefile ---- linux.orig/drivers/gpu/drm/meson/Makefile 2023-08-22 23:19:15.914591935 +0000 -+++ linux/drivers/gpu/drm/meson/Makefile 2023-08-22 23:08:19.145060265 +0000 -@@ -2,7 +2,8 @@ - meson-drm-y := meson_drv.o meson_plane.o meson_crtc.o meson_encoder_cvbs.o - meson-drm-y += meson_viu.o meson_vpp.o meson_venc.o meson_vclk.o meson_overlay.o - meson-drm-y += meson_rdma.o meson_osd_afbcd.o --meson-drm-y += meson_encoder_hdmi.o -+meson-drm-y += meson_encoder_hdmi.o meson_encoder_dsi.o - - obj-$(CONFIG_DRM_MESON) += meson-drm.o - obj-$(CONFIG_DRM_MESON_DW_HDMI) += meson_dw_hdmi.o -+obj-$(CONFIG_DRM_MESON_DW_MIPI_DSI) += meson_dw_mipi_dsi.o -diff -rupN linux.orig/drivers/gpu/drm/meson/meson_drv.c linux/drivers/gpu/drm/meson/meson_drv.c ---- linux.orig/drivers/gpu/drm/meson/meson_drv.c 2023-08-22 23:19:15.914591935 +0000 -+++ linux/drivers/gpu/drm/meson/meson_drv.c 2023-08-22 23:08:19.145060265 +0000 -@@ -34,6 +34,7 @@ - #include "meson_registers.h" - #include "meson_encoder_cvbs.h" - #include "meson_encoder_hdmi.h" -+#include "meson_encoder_dsi.h" - #include "meson_viu.h" - #include "meson_vpp.h" - #include "meson_rdma.h" -@@ -316,32 +317,40 @@ static int meson_drv_bind_master(struct - goto exit_afbcd; - - if (has_components) { -- ret = component_bind_all(drm->dev, drm); -+ ret = component_bind_all(dev, drm); - if (ret) { - dev_err(drm->dev, "Couldn't bind all components\n"); -+ /* Do not try to unbind */ -+ has_components = false; - goto exit_afbcd; - } - } - - ret = meson_encoder_hdmi_init(priv); - if (ret) -- goto unbind_all; -+ goto exit_afbcd; -+ -+ if (meson_vpu_is_compatible(priv, VPU_COMPATIBLE_G12A)) { -+ ret = meson_encoder_dsi_init(priv); -+ if (ret) -+ goto exit_afbcd; -+ } - - ret = meson_plane_create(priv); - if (ret) -- goto unbind_all; -+ goto exit_afbcd; - - ret = meson_overlay_create(priv); - if (ret) -- goto unbind_all; -+ goto exit_afbcd; - - ret = meson_crtc_create(priv); - if (ret) -- goto unbind_all; -+ goto exit_afbcd; - - ret = request_irq(priv->vsync_irq, meson_irq, 0, drm->driver->name, drm); - if (ret) -- goto unbind_all; -+ goto exit_afbcd; - - drm_mode_config_reset(drm); - -@@ -359,15 +368,19 @@ static int meson_drv_bind_master(struct - - uninstall_irq: - free_irq(priv->vsync_irq, drm); --unbind_all: -- if (has_components) -- component_unbind_all(drm->dev, drm); - exit_afbcd: - if (priv->afbcd.ops) - priv->afbcd.ops->exit(priv); - free_drm: - drm_dev_put(drm); - -+ meson_encoder_dsi_remove(priv); -+ meson_encoder_hdmi_remove(priv); -+ meson_encoder_cvbs_remove(priv); -+ -+ if (has_components) -+ component_unbind_all(dev, drm); -+ - return ret; - } - -@@ -394,6 +407,7 @@ static void meson_drv_unbind(struct devi - free_irq(priv->vsync_irq, drm); - drm_dev_put(drm); - -+ meson_encoder_dsi_remove(priv); - meson_encoder_hdmi_remove(priv); - meson_encoder_cvbs_remove(priv); - -@@ -446,10 +460,17 @@ static void meson_drv_shutdown(struct pl - drm_atomic_helper_shutdown(priv->drm); - } - --/* Possible connectors nodes to ignore */ --static const struct of_device_id connectors_match[] = { -- { .compatible = "composite-video-connector" }, -- { .compatible = "svideo-connector" }, -+/* -+ * Only devices to use as components -+ * TOFIX: get rid of components when we can finally -+ * get meson_dx_hdmi to stop using the meson_drm -+ * private structure for HHI registers. -+ */ -+static const struct of_device_id components_dev_match[] = { -+ { .compatible = "amlogic,meson-gxbb-dw-hdmi" }, -+ { .compatible = "amlogic,meson-gxl-dw-hdmi" }, -+ { .compatible = "amlogic,meson-gxm-dw-hdmi" }, -+ { .compatible = "amlogic,meson-g12a-dw-hdmi" }, - {} - }; - -@@ -467,17 +488,12 @@ static int meson_drv_probe(struct platfo - continue; - } - -- /* If an analog connector is detected, count it as an output */ -- if (of_match_node(connectors_match, remote)) { -- ++count; -- of_node_put(remote); -- continue; -- } -+ if (of_match_node(components_dev_match, remote)) { -+ component_match_add(&pdev->dev, &match, component_compare_of, remote); - -- dev_dbg(&pdev->dev, "parent %pOF remote match add %pOF parent %s\n", -- np, remote, dev_name(&pdev->dev)); -- -- component_match_add(&pdev->dev, &match, component_compare_of, remote); -+ dev_dbg(&pdev->dev, "parent %pOF remote match add %pOF parent %s\n", -+ np, remote, dev_name(&pdev->dev)); -+ } - - of_node_put(remote); - -diff -rupN linux.orig/drivers/gpu/drm/meson/meson_drv.h linux/drivers/gpu/drm/meson/meson_drv.h ---- linux.orig/drivers/gpu/drm/meson/meson_drv.h 2023-08-22 23:19:15.914591935 +0000 -+++ linux/drivers/gpu/drm/meson/meson_drv.h 2023-08-22 23:08:19.145060265 +0000 -@@ -28,6 +28,7 @@ enum vpu_compatible { - enum { - MESON_ENC_CVBS = 0, - MESON_ENC_HDMI, -+ MESON_ENC_DSI, - MESON_ENC_LAST, - }; - -diff -rupN linux.orig/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c linux/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c ---- linux.orig/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c 1970-01-01 00:00:00.000000000 +0000 -+++ linux/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c 2023-08-22 23:08:19.145060265 +0000 -@@ -0,0 +1,352 @@ -+// SPDX-License-Identifier: GPL-2.0-or-later -+/* -+ * Copyright (C) 2021 BayLibre, SAS -+ * Author: Neil Armstrong -+ * Copyright (C) 2015 Amlogic, Inc. All rights reserved. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include