From 9bcf86770aa7014e4ed53816b215c3ed94a33879 Mon Sep 17 00:00:00 2001 From: Jon Lin Date: Sun, 2 Mar 2025 15:47:14 +0800 Subject: [PATCH 01/23] mtd: spinand: esmt: Change to esmt_c8_spinand_manufacturer Change-Id: I9ef43450a9fd68a98993580c0cca379f31698a81 Signed-off-by: Jon Lin --- drivers/mtd/nand/spi/core.c | 2 +- drivers/mtd/nand/spi/esmt.c | 15 ++++++++------- include/linux/mtd/spinand.h | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index 0eb65ca35b73..7c61d0a228d7 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -961,7 +961,7 @@ static const struct spinand_manufacturer *spinand_manufacturers[] = { &dosilicon_spinand_manufacturer, #endif #ifdef CONFIG_MTD_SPI_NAND_ESMT - &esmt_spinand_manufacturer, + &esmt_c8_spinand_manufacturer, #endif #ifdef CONFIG_MTD_SPI_NAND_ETRON &etron_spinand_manufacturer, diff --git a/drivers/mtd/nand/spi/esmt.c b/drivers/mtd/nand/spi/esmt.c index f658de8777dc..21afcfe3eec2 100644 --- a/drivers/mtd/nand/spi/esmt.c +++ b/drivers/mtd/nand/spi/esmt.c @@ -10,7 +10,8 @@ #include #include -#define SPINAND_MFR_ESMT 0xC8 +/* ESMT uses GigaDevice 0xc8 JECDEC ID on some SPI NANDs */ +#define SPINAND_MFR_ESMT_C8 0xc8 static SPINAND_OP_VARIANTS(read_cache_variants, SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0), @@ -111,7 +112,7 @@ static int f50l2g41ka_ecc_ecc_get_status(struct spinand_device *spinand, return -EBADMSG; } -static const struct spinand_info esmt_spinand_table[] = { +static const struct spinand_info esmt_c8_spinand_table[] = { SPINAND_INFO("F50L1G41LB", SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x01), NAND_MEMORG(1, 2048, 64, 64, 1024, 20, 1, 1, 1), @@ -135,10 +136,10 @@ static const struct spinand_info esmt_spinand_table[] = { static const struct spinand_manufacturer_ops esmt_spinand_manuf_ops = { }; -const struct spinand_manufacturer esmt_spinand_manufacturer = { - .id = SPINAND_MFR_ESMT, - .name = "esmt", - .chips = esmt_spinand_table, - .nchips = ARRAY_SIZE(esmt_spinand_table), +const struct spinand_manufacturer esmt_c8_spinand_manufacturer = { + .id = SPINAND_MFR_ESMT_C8, + .name = "ESMT", + .chips = esmt_c8_spinand_table, + .nchips = ARRAY_SIZE(esmt_c8_spinand_table), .ops = &esmt_spinand_manuf_ops, }; diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h index 861ce3ee6ef0..a23803857219 100644 --- a/include/linux/mtd/spinand.h +++ b/include/linux/mtd/spinand.h @@ -264,7 +264,7 @@ struct spinand_manufacturer { extern const struct spinand_manufacturer ato_spinand_manufacturer; extern const struct spinand_manufacturer biwin_spinand_manufacturer; extern const struct spinand_manufacturer dosilicon_spinand_manufacturer; -extern const struct spinand_manufacturer esmt_spinand_manufacturer; +extern const struct spinand_manufacturer esmt_c8_spinand_manufacturer; extern const struct spinand_manufacturer etron_spinand_manufacturer; extern const struct spinand_manufacturer fmsh_spinand_manufacturer; extern const struct spinand_manufacturer foresee_spinand_manufacturer; From cd2391de5617333ce8cd6df4a0b18e9f7d33e497 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Mon, 3 Mar 2025 14:20:59 +0800 Subject: [PATCH 02/23] video: rockchip: iep: avoid -Wempty-body warning Building with 'make W=1' shows a harmless -Wempty-body warning: drivers/video/rockchip/iep/hw_iep_reg.c: In function 'iep_soft_rst': drivers/video/rockchip/iep/hw_iep_reg.c:1313:49: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 1313 | IEP_DBG("soft reset timeout.\n"); | ^ Change the empty debug macros to no_printk(), which avoids the warnings and adds useful format string checks. Signed-off-by: Tao Huang Change-Id: Ifff86aeab7cc988d5af694d8709fb4b9c634b044 --- drivers/video/rockchip/iep/iep.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/rockchip/iep/iep.h b/drivers/video/rockchip/iep/iep.h index 94e372e6a471..5a39409d9cd0 100644 --- a/drivers/video/rockchip/iep/iep.h +++ b/drivers/video/rockchip/iep/iep.h @@ -75,7 +75,7 @@ struct IEP_CAP { #if IEP_DEBUG #define IEP_DBG(format, args...) printk("%s: " format, DRIVER_NAME, ## args) #else -#define IEP_DBG(format, args...) +#define IEP_DBG(format, args...) no_printk("%s: " format, DRIVER_NAME, ## args) #endif #define IEP_INFORMATION 1 From a3cce2eecf719fdca17010caa973aa2112c56694 Mon Sep 17 00:00:00 2001 From: Yanjun Liao Date: Mon, 3 Mar 2025 16:52:30 +0800 Subject: [PATCH 03/23] video: rockchip: mpp: rkvenc2: Fix u32 overflow Change-Id: I1dae138bcb57283d6c609bd73068c8714e8ce990 Signed-off-by: Yanjun Liao --- drivers/video/rockchip/mpp/mpp_rkvenc2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/rockchip/mpp/mpp_rkvenc2.c b/drivers/video/rockchip/mpp/mpp_rkvenc2.c index 7098e338803f..4001fb802b66 100644 --- a/drivers/video/rockchip/mpp/mpp_rkvenc2.c +++ b/drivers/video/rockchip/mpp/mpp_rkvenc2.c @@ -1365,9 +1365,9 @@ static void rkvenc2_calc_timeout_thd(struct mpp_dev *mpp) * else use x1024 core clk cycles */ if (hw->vepu_type == RKVENC_VEPU_510) - timeout_thd |= timeout_ms * clk_get_rate(enc->core_clk_info.clk) / 256000; + timeout_thd |= timeout_ms * (clk_get_rate(enc->core_clk_info.clk) / 256000); else - timeout_thd |= timeout_ms * clk_get_rate(enc->core_clk_info.clk) / 1024000; + timeout_thd |= timeout_ms * (clk_get_rate(enc->core_clk_info.clk) / 1024000); mpp_write(mpp, RKVENC_WDG, timeout_thd); } From 8f49f308e9312760b97ada941438a0445014e585 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Fri, 28 Feb 2025 20:13:15 +0800 Subject: [PATCH 04/23] ASoC: rockchip: multi-dais: Explicitly include of_platform.h for of_find_device_by_node Signed-off-by: Tao Huang Change-Id: I00cc4dd24ced61a44d93f1a0a9b47cb6da55de05 --- sound/soc/rockchip/rockchip_multi_dais.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/rockchip/rockchip_multi_dais.c b/sound/soc/rockchip/rockchip_multi_dais.c index b32f8ef01a51..8d7f09d09039 100644 --- a/sound/soc/rockchip/rockchip_multi_dais.c +++ b/sound/soc/rockchip/rockchip_multi_dais.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include From bca38bc9b41acb9b17ff611f5e49e0e6fef71a4f Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Fri, 28 Feb 2025 20:16:22 +0800 Subject: [PATCH 05/23] clk: rockchip: Explicitly include platform_device.h Signed-off-by: Tao Huang Change-Id: I3b0c8956236f16ff9e264032ac46bc5c3be2e476 --- drivers/clk/rockchip/clk.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/rockchip/clk.h b/drivers/clk/rockchip/clk.h index 7441b7e604b8..9215d45e84bc 100644 --- a/drivers/clk/rockchip/clk.h +++ b/drivers/clk/rockchip/clk.h @@ -20,6 +20,7 @@ #include #include #include +#include struct clk; From e6782dab44ce1fed9e70a782058d8cea99bc6e13 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Fri, 28 Feb 2025 20:23:23 +0800 Subject: [PATCH 06/23] video: rockchip: dvbm: Explicitly include of.h for of_match_ptr Signed-off-by: Tao Huang Change-Id: I82a7507af51b29b5ec79112d883f0c3da1cc3f18 --- drivers/video/rockchip/dvbm/rockchip_dvbm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/rockchip/dvbm/rockchip_dvbm.c b/drivers/video/rockchip/dvbm/rockchip_dvbm.c index 93760d3f3f48..db90191b121c 100644 --- a/drivers/video/rockchip/dvbm/rockchip_dvbm.c +++ b/drivers/video/rockchip/dvbm/rockchip_dvbm.c @@ -8,6 +8,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include +#include #include #include From a14e67109d4dc00dffe1094399a7a5012ba7bd58 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Fri, 28 Feb 2025 20:24:27 +0800 Subject: [PATCH 07/23] soc: rockchip: thunderboot_sfc: Explicitly include of_platform.h for of_platform_device_create Signed-off-by: Tao Huang Change-Id: Iac58bd3d9e725f7cfde9e04eb15969915eeda80a --- drivers/soc/rockchip/rockchip_thunderboot_sfc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/rockchip/rockchip_thunderboot_sfc.c b/drivers/soc/rockchip/rockchip_thunderboot_sfc.c index ed88da11bcdf..c1ced4905ff8 100644 --- a/drivers/soc/rockchip/rockchip_thunderboot_sfc.c +++ b/drivers/soc/rockchip/rockchip_thunderboot_sfc.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include From 0d9a55e1bf7c49e1d1f5e16618bf159da45c476f Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Fri, 28 Feb 2025 20:25:34 +0800 Subject: [PATCH 08/23] soc: rockchip: thunderboot_mmc: Explicitly include of_platform.h for of_platform_device_create Signed-off-by: Tao Huang Change-Id: Ie5bd3676d93de96de87c3145f9d2d66a975e7a02 --- drivers/soc/rockchip/rockchip_thunderboot_mmc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/rockchip/rockchip_thunderboot_mmc.c b/drivers/soc/rockchip/rockchip_thunderboot_mmc.c index 10618811f0e9..588677256a96 100644 --- a/drivers/soc/rockchip/rockchip_thunderboot_mmc.c +++ b/drivers/soc/rockchip/rockchip_thunderboot_mmc.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include From aaa8ff59ac4bd496c65744298824ce04f7580fbd Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Fri, 28 Feb 2025 20:27:23 +0800 Subject: [PATCH 09/23] soc: rockchip: decompress: Explicitly include of_platform.h for of_platform_device_create Signed-off-by: Tao Huang Change-Id: Ie44d7c000fa200b061cc344481b584ad6bc001f1 --- drivers/soc/rockchip/rockchip_decompress.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/rockchip/rockchip_decompress.c b/drivers/soc/rockchip/rockchip_decompress.c index eca36c64cd69..2d8befd474e1 100644 --- a/drivers/soc/rockchip/rockchip_decompress.c +++ b/drivers/soc/rockchip/rockchip_decompress.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include From 5dc7e05b74eb095a56ac0c28c61a9082e8f7b142 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Fri, 28 Feb 2025 20:28:39 +0800 Subject: [PATCH 10/23] regulator: rk801: Explicitly include platform_device.h Signed-off-by: Tao Huang Change-Id: Ib5ed20b0152d1e88f97de1bf7c81939b195b19f6 --- drivers/regulator/rk801-regulator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/regulator/rk801-regulator.c b/drivers/regulator/rk801-regulator.c index 703db41c2bf3..fa8aaa549e79 100644 --- a/drivers/regulator/rk801-regulator.c +++ b/drivers/regulator/rk801-regulator.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include From c0d7c9e3a730c21a3adbb821ba0634ed2dac96fa Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Fri, 28 Feb 2025 20:31:44 +0800 Subject: [PATCH 11/23] media: rockchip: isp: Explicitly include platform_device.h Signed-off-by: Tao Huang Change-Id: I4cc3a2c082ac0507f205e50afb2116aaeac4efda --- drivers/media/platform/rockchip/isp/rkisp_tb_helper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/platform/rockchip/isp/rkisp_tb_helper.c b/drivers/media/platform/rockchip/isp/rkisp_tb_helper.c index c78493f0144c..3d361d4c5aac 100644 --- a/drivers/media/platform/rockchip/isp/rkisp_tb_helper.c +++ b/drivers/media/platform/rockchip/isp/rkisp_tb_helper.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include From d958a0ed01ee089e4268171b9a83ab44593f7a25 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Mon, 3 Mar 2025 14:35:01 +0800 Subject: [PATCH 12/23] spi: rockchip-slave: Explicitly include pinctrl/consumer.h for pinctrl_pm_select_sleep_state Signed-off-by: Tao Huang Change-Id: I75124e3a45d39120389326d683bce7dbd94b9014 --- drivers/spi/spi-rockchip-slave.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-rockchip-slave.c b/drivers/spi/spi-rockchip-slave.c index 7b12392b9481..9ec9657b4fd7 100644 --- a/drivers/spi/spi-rockchip-slave.c +++ b/drivers/spi/spi-rockchip-slave.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include From 1aa8a27380f5915ee9671ac9515fc0d67ea967ed Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Mon, 3 Mar 2025 14:46:10 +0800 Subject: [PATCH 13/23] ASoC: codecs: rk_dsm: Explicitly include pinctrl/consumer.h for devm_pinctrl_get Signed-off-by: Tao Huang Change-Id: Ic9aba2db95c6f9a349a71b2a2c8b3365c9010a67 --- sound/soc/codecs/rk_dsm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/codecs/rk_dsm.c b/sound/soc/codecs/rk_dsm.c index 7ebb4341e407..b62f02d95478 100644 --- a/sound/soc/codecs/rk_dsm.c +++ b/sound/soc/codecs/rk_dsm.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include From 287cbd63d00c61291ac5bcb3564c3d5478dcabfb Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Mon, 3 Mar 2025 14:49:10 +0800 Subject: [PATCH 14/23] net: rfkill: bt: Explicitly include pinctrl/consumer.h for pinctrl_select_state Signed-off-by: Tao Huang Change-Id: I2160807931525e0893b8a8c003a74224b9349588 --- net/rfkill/rfkill-bt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/rfkill/rfkill-bt.c b/net/rfkill/rfkill-bt.c index 95e56553e2b6..b020d7362f3e 100644 --- a/net/rfkill/rfkill-bt.c +++ b/net/rfkill/rfkill-bt.c @@ -40,6 +40,7 @@ #include #include #endif +#include #if 0 #define DBG(x...) pr_info("[BT_RFKILL]: " x) From 59bcd15ac070c0c4925397bb359de96fe580b0c2 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Mon, 3 Mar 2025 14:51:35 +0800 Subject: [PATCH 15/23] drm/rockchip: dw_hdmi: Explicitly include pinctrl/consumer.h for devm_pinctrl_get Signed-off-by: Tao Huang Change-Id: Ia9f8242cd2723faa6406f7a1d4e96db6ee6f180a --- drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c index 5f5de41e25bc..ba111d994a19 100644 --- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include From 7a4dc023a4c73058d86cf8501dba6b8c92c6b02f Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 4 Mar 2025 14:23:18 +0800 Subject: [PATCH 16/23] net: phy: Convert to use sysfs_emit_at() API Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Fixes: ea074eb6278f ("net: phy: add sysfs node for reading PHY's registers") Signed-off-by: Tao Huang Change-Id: I642da13c8e4b9351b13592a817c9bf9a9b5c34a7 --- drivers/net/phy/phy_device.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 389f4e5256fa..c0056c391c7e 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -568,12 +568,13 @@ phy_registers_show(struct device *dev, struct device_attribute *attr, char *buf) { struct phy_device *phydev = to_phy_device(dev); int index; + int len = 0; for (index = 0; index < 32; index++) - sprintf(buf, "%s%2d: 0x%x\n", buf, index, - phy_read(phydev, index)); + len += sysfs_emit_at(buf, len, "%2d: 0x%x\n", index, + phy_read(phydev, index)); - return strlen(buf); + return len; } static ssize_t From ac1d6418f5602b1c16357805d984383a756e2172 Mon Sep 17 00:00:00 2001 From: Finley Xiao Date: Tue, 25 Feb 2025 19:24:08 +0800 Subject: [PATCH 17/23] soc: rockchip: system_monitor: Add support to limit cpu max freq when play 1080p video Change-Id: I1a3e3a043b8a3827c807e869250625ba7f8a2cd8 Signed-off-by: Finley Xiao --- drivers/soc/rockchip/rockchip_system_monitor.c | 13 ++++++++++--- include/soc/rockchip/rockchip_system_monitor.h | 4 +++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/soc/rockchip/rockchip_system_monitor.c b/drivers/soc/rockchip/rockchip_system_monitor.c index a4d8266178f3..2639f5eeb61a 100644 --- a/drivers/soc/rockchip/rockchip_system_monitor.c +++ b/drivers/soc/rockchip/rockchip_system_monitor.c @@ -831,6 +831,8 @@ static int monitor_device_parse_status_config(struct device_node *np, ret = of_property_read_u32(np, "rockchip,early-suspend-freq", &info->early_suspend_freq); + ret &= of_property_read_u32(np, "rockchip,video-1080p-freq", + &info->video_1080p_freq); ret &= of_property_read_u32(np, "rockchip,video-4k-freq", &info->video_4k_freq); ret &= of_property_read_u32(np, "rockchip,reboot-freq", @@ -1675,9 +1677,14 @@ static void rockchip_system_status_cpu_limit_freq(struct monitor_dev_info *info, if (info->early_suspend_freq && (status & SYS_STATUS_SUSPEND)) target_freq = info->early_suspend_freq; - - if (info->video_4k_freq && (status & SYS_STATUS_VIDEO_4K)) - target_freq = info->video_4k_freq; + if (info->video_1080p_freq && (status & SYS_STATUS_VIDEO_1080P)) { + if (!target_freq || target_freq > info->video_1080p_freq) + target_freq = info->video_1080p_freq; + } + if (info->video_4k_freq && (status & SYS_STATUS_VIDEO_4K)) { + if (!target_freq || target_freq > info->video_4k_freq) + target_freq = info->video_4k_freq; + } if (target_freq == info->status_max_limit) return; diff --git a/include/soc/rockchip/rockchip_system_monitor.h b/include/soc/rockchip/rockchip_system_monitor.h index 6ee14d5d8d5f..83b61ba3ac70 100644 --- a/include/soc/rockchip/rockchip_system_monitor.h +++ b/include/soc/rockchip/rockchip_system_monitor.h @@ -80,7 +80,8 @@ struct temp_opp_table { * @low_temp_min_volt: Minimum voltage of OPPs when low temperature, in * microvolt * @high_temp_max_volt: Maximum voltage when high temperature, in microvolt - * @video_4k_freq: Maximum frequency when paly 4k video, in KHz + * @video_1080p_freq: Maximum frequency when play 1080p video, in KHz + * @video_4k_freq: Maximum frequency when play 4k video, in KHz * @reboot_freq: Limit maximum and minimum frequency when reboot, in KHz * @status_min_limit: Minimum frequency of some status frequency, in KHz * @status_max_limit: Minimum frequency of all status frequency, in KHz @@ -111,6 +112,7 @@ struct monitor_dev_info { unsigned long low_temp_min_volt; unsigned long high_temp_max_volt; unsigned int early_suspend_freq; + unsigned int video_1080p_freq; unsigned int video_4k_freq; unsigned int reboot_freq; unsigned int status_min_limit; From 1dd2cac363249e3f0f1b75f0aed2ad0e832f478e Mon Sep 17 00:00:00 2001 From: Finley Xiao Date: Tue, 25 Feb 2025 19:26:42 +0800 Subject: [PATCH 18/23] arm64: dts: rockchip: rk3518: Add rockchip,video-1080p-freq for cpu opp table Change-Id: I820e1311233d54aa3e10f5e5101161d9b6339f9c Signed-off-by: Finley Xiao --- arch/arm64/boot/dts/rockchip/rk3518.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3518.dtsi b/arch/arm64/boot/dts/rockchip/rk3518.dtsi index 973e69654dcc..3e0f14864949 100644 --- a/arch/arm64/boot/dts/rockchip/rk3518.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3518.dtsi @@ -23,7 +23,7 @@ }; &cpu0_opp_table { - rockchip,video-4k-freq = <1200000>; + rockchip,video-1080p-freq = <1200000>; rockchip,pvtm-voltage-sel = < 0 1420 0 1410 1444 1 From 7b0e4b864b4799cfa58ccbc2bd7120c7f61b9347 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 4 Mar 2025 18:31:21 +0800 Subject: [PATCH 19/23] ASoC: rk312x: Fix missing prototypes sound/soc/codecs/rk312x_codec.c:604:5: error: no previous prototype for rk312x_codec_mute_dac [-Werror=missing-prototypes] sound/soc/codecs/rk312x_codec.c:2412:6: error: no previous prototype for rk312x_platform_shutdown [-Werror=missing-prototypes] Signed-off-by: Tao Huang Change-Id: I5faa117a8fb6a803bfeffc5c20473e362f4f7ed9 --- sound/soc/codecs/rk312x_codec.c | 2 +- sound/soc/codecs/rk312x_codec.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/rk312x_codec.c b/sound/soc/codecs/rk312x_codec.c index 9be8e49c11d8..9c3d5216df2c 100644 --- a/sound/soc/codecs/rk312x_codec.c +++ b/sound/soc/codecs/rk312x_codec.c @@ -2409,7 +2409,7 @@ static int rk312x_platform_remove(struct platform_device *pdev) return 0; } -void rk312x_platform_shutdown(struct platform_device *pdev) +static void rk312x_platform_shutdown(struct platform_device *pdev) { unsigned int val = 0; DBG("%s\n", __func__); diff --git a/sound/soc/codecs/rk312x_codec.h b/sound/soc/codecs/rk312x_codec.h index 0924088681ba..c9ba1c2cc477 100644 --- a/sound/soc/codecs/rk312x_codec.h +++ b/sound/soc/codecs/rk312x_codec.h @@ -563,4 +563,6 @@ struct rk312x_codec_pdata { int delay_time; }; +int rk312x_codec_mute_dac(int mute); + #endif /* __RK312x_CODEC_H__ */ From 1d9e4abff37da56c2f30f95b72838cea2ed2fd0f Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 4 Mar 2025 18:55:30 +0800 Subject: [PATCH 20/23] input: sensors: accel: dmard10: Make gsensor_reset() static Signed-off-by: Tao Huang Change-Id: I7c9cfa2e71278757e13ca38a6e4ab53650a20ddd --- drivers/input/sensors/accel/dmard10.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/sensors/accel/dmard10.c b/drivers/input/sensors/accel/dmard10.c index d1931947666a..dea42f86449d 100644 --- a/drivers/input/sensors/accel/dmard10.c +++ b/drivers/input/sensors/accel/dmard10.c @@ -178,7 +178,7 @@ struct sensor_axis_average { }; static struct sensor_axis_average axis_average; -int gsensor_reset(struct i2c_client *client){ +static int gsensor_reset(struct i2c_client *client){ char buffer[7], buffer2[2]; /* 1. check D10 , VALUE_STADR = 0x55 , VALUE_STAINT = 0xAA */ buffer[0] = REG_STADR; From e9fd48e4a9cbd55489240f5368c878f0c59d1824 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 4 Mar 2025 19:15:41 +0800 Subject: [PATCH 21/23] input: sensors: avoid -Wempty-body warning drivers/input/sensors/accel/bma2xx.c:2093:47: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 2093 | DBG("set bandwidth failed!\n"); | ^ Change the empty debug macros to no_printk(), which avoids the warnings and adds useful format string checks. Signed-off-by: Tao Huang Change-Id: I41d3b2eb23fef6f37a7680e869858be27ece3250 --- include/linux/sensor-dev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/sensor-dev.h b/include/linux/sensor-dev.h index bfe204ca3062..fba76914234c 100644 --- a/include/linux/sensor-dev.h +++ b/include/linux/sensor-dev.h @@ -270,7 +270,7 @@ extern int sensor_unregister_device(struct i2c_client *client, extern void sensor_shutdown(struct i2c_client *client); extern const struct dev_pm_ops sensor_pm_ops; -#define DBG(x...) +#define DBG(x...) no_printk(x) #define GSENSOR_IOCTL_MAGIC 'a' #define GBUFF_SIZE 12 /* Rx buffer size */ From e4a7f591fe65571164ea8fa93b9739070399393f Mon Sep 17 00:00:00 2001 From: Zhang Yubing Date: Thu, 27 Feb 2025 10:42:31 +0800 Subject: [PATCH 22/23] drm/rockchip: vop2: set dsc config done in crtc post enable DSC has strict constraint with timing output from VOP. If vp reset dclk after DSC ready, something will be wrong with DSC. To avoid this issue, it need set dsc config done after dclk reset. Fixes: fdcec7349c51 ("drm/rockchip: vop2: reset dclk after config stream output") Change-Id: Ied1cddc381eacd86771ae52af82f31f887fdbf89 Signed-off-by: Zhang Yubing --- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index 6ce9c900672f..7fea1044df54 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -1073,6 +1073,7 @@ static const struct drm_bus_format_enum_list drm_bus_format_enum_list[] = { static DRM_ENUM_NAME_FN(drm_get_bus_format_name, drm_bus_format_enum_list) +static inline void rk3588_vop2_dsc_cfg_done(struct drm_crtc *crtc); static inline void vop2_cfg_done(struct drm_crtc *crtc); static void vop2_wait_for_fs_by_done_bit_status(struct vop2_video_port *vp); static int vop2_clk_reset(struct reset_control *rstc); @@ -1260,6 +1261,7 @@ static void vop2_crtc_output_post_enable(struct drm_crtc *crtc, int intf) { struct vop2_video_port *vp = to_vop2_video_port(crtc); struct vop2 *vop2 = vp->vop2; + struct rockchip_crtc_state *vcstate = to_rockchip_crtc_state(crtc->state); if (intf & VOP_OUTPUT_IF_DP0) VOP_CTRL_SET(vop2, dp0_en, 1); @@ -1276,6 +1278,15 @@ static void vop2_crtc_output_post_enable(struct drm_crtc *crtc, int intf) if (!vp->loader_protect) vop2_clk_reset(vp->dclk_rst); + /* + * DSC has strict constraint with timing output from VOP. + * If vp reset dclk after DSC ready, something will be + * wrong with DSC. To avoid this issue, it need set dsc + * config done after dclk reset. + */ + if (vcstate->dsc_enable) + rk3588_vop2_dsc_cfg_done(crtc); + drm_info(vop2, "vop enable intf:%x\n", intf); } @@ -10415,8 +10426,6 @@ static void vop2_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_sta vop3_mcu_mode_setup(crtc); } - if (vcstate->dsc_enable) - rk3588_vop2_dsc_cfg_done(crtc); drm_crtc_vblank_on(crtc); /* * restore the lut table. From 46e88d6992bcc068485615445a8eed7263fde764 Mon Sep 17 00:00:00 2001 From: Zhang Yubing Date: Thu, 27 Feb 2025 11:20:37 +0800 Subject: [PATCH 23/23] drm/rockchip: dsi2: add crtc post enable and pre disable callback Add crtc post enable and pre disable callback. Setting dsc config done in crtc post enable callback if dsc is enable. Change-Id: I6eb5e3c14ba70c90d2f3337c22754a3a7a96ea81 Signed-off-by: Zhang Yubing Signed-off-by: Guochun Huang --- .../gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c index eab63327b6de..92a19144dbae 100644 --- a/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c +++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi2-rockchip.c @@ -502,6 +502,7 @@ static void dw_mipi_dsi2_encoder_atomic_disable(struct drm_encoder *encoder, struct rockchip_crtc_state *s = to_rockchip_crtc_state(encoder->crtc->state); struct drm_crtc *new_crtc; struct drm_crtc_state *new_crtc_state = NULL; + int output_if; new_crtc = dw_mipi_dsi2_get_new_crtc(dsi2, old_state); if (new_crtc) @@ -530,6 +531,13 @@ static void dw_mipi_dsi2_encoder_atomic_disable(struct drm_encoder *encoder, dw_mipi_dsi2_post_disable(dsi2); + if (dsi2->slave) + output_if = VOP_OUTPUT_IF_MIPI0 | VOP_OUTPUT_IF_MIPI1; + else + output_if = dsi2->id ? VOP_OUTPUT_IF_MIPI1 : VOP_OUTPUT_IF_MIPI0; + + rockchip_drm_crtc_output_pre_disable(encoder->crtc, output_if); + dsi2->enabled = false; if (dsi2->slave) dsi2->slave->enabled = false; @@ -1013,7 +1021,7 @@ static void dw_mipi_dsi2_encoder_atomic_enable(struct drm_encoder *encoder, struct dw_mipi_dsi2 *dsi2 = encoder_to_dsi2(encoder); struct drm_crtc *crtc; struct drm_crtc_state *old_crtc_state = NULL; - int ret; + int output_if, ret; crtc = dw_mipi_dsi2_get_new_crtc(dsi2, state); if (crtc) @@ -1050,6 +1058,13 @@ static void dw_mipi_dsi2_encoder_atomic_enable(struct drm_encoder *encoder, if (old_crtc_state && old_crtc_state->self_refresh_active) rockchip_drm_crtc_standby(encoder->crtc, 0); + if (dsi2->slave) + output_if = VOP_OUTPUT_IF_MIPI0 | VOP_OUTPUT_IF_MIPI1; + else + output_if = dsi2->id ? VOP_OUTPUT_IF_MIPI1 : VOP_OUTPUT_IF_MIPI0; + + rockchip_drm_crtc_output_post_enable(encoder->crtc, output_if); + dsi2->enabled = true; if (dsi2->slave) dsi2->slave->enabled = true;