From 13787c3f307ae06af86117b6e985f472fc442e25 Mon Sep 17 00:00:00 2001 From: Sugar Zhang Date: Tue, 24 Dec 2024 20:18:45 +0800 Subject: [PATCH 1/6] ASoC: es8323: Fix power consumption Signed-off-by: Sugar Zhang Change-Id: I50718cb52ec7fd0fa827c1cd856ec4cbdc978433 --- sound/soc/codecs/es8323.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/es8323.c b/sound/soc/codecs/es8323.c index 3506add7ba6e..9c023c752390 100644 --- a/sound/soc/codecs/es8323.c +++ b/sound/soc/codecs/es8323.c @@ -755,6 +755,9 @@ static int es8323_resume(struct snd_soc_component *component) snd_soc_component_write(component, 0x31, es8323_DEF_VOL); snd_soc_component_write(component, 0x30, es8323_DEF_VOL); snd_soc_component_write(component, 0x19, 0x02); + + es8323_set_bias_level(component, SND_SOC_BIAS_OFF); + return 0; } @@ -818,7 +821,7 @@ static int es8323_probe(struct snd_soc_component *component) usleep_range(18000, 20000); snd_soc_component_write(component, 0x04, 0x3C); - es8323_set_bias_level(component, SND_SOC_BIAS_STANDBY); + es8323_set_bias_level(component, SND_SOC_BIAS_OFF); return 0; } From 7e3f5258ddf10855bc30ecba502e33c10265e3f3 Mon Sep 17 00:00:00 2001 From: Finley Xiao Date: Wed, 19 Feb 2025 19:07:47 +0800 Subject: [PATCH 2/6] arm64: dts: rockchip: rk3528: Add 324MHz and 666MHz for dmc Change-Id: I4a00da54462f95e64252ecb4f4e081eedad8458f Signed-off-by: Finley Xiao --- arch/arm64/boot/dts/rockchip/rk3528.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3528.dtsi b/arch/arm64/boot/dts/rockchip/rk3528.dtsi index 80202bd4609a..dc84aa15de78 100644 --- a/arch/arm64/boot/dts/rockchip/rk3528.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3528.dtsi @@ -405,6 +405,14 @@ 29 254 4 >; + opp-324000000 { + opp-hz = /bits/ 64 <324000000>; + opp-microvolt = <850000 850000 1000000>; + }; + opp-666000000 { + opp-hz = /bits/ 64 <666000000>; + opp-microvolt = <850000 850000 1000000>; + }; opp-920000000 { opp-hz = /bits/ 64 <920000000>; opp-microvolt = <850000 850000 1000000>; From 4c0e96c036cbf6df20bfd976e6d7f277ed8242bc Mon Sep 17 00:00:00 2001 From: Finley Xiao Date: Wed, 19 Feb 2025 11:45:58 +0800 Subject: [PATCH 3/6] PM / devfreq: rockchip_dmc: Use new api to adjust opp table for rk3528 Change-Id: I3f1889870675d143281ab52d9205edb76cbaee31 Signed-off-by: Finley Xiao --- drivers/devfreq/rockchip_dmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/devfreq/rockchip_dmc.c b/drivers/devfreq/rockchip_dmc.c index 3526ebc1ecc7..9e67caa73493 100644 --- a/drivers/devfreq/rockchip_dmc.c +++ b/drivers/devfreq/rockchip_dmc.c @@ -1849,7 +1849,7 @@ static __maybe_unused int rk3528_dmc_init(struct platform_device *pdev, return -ENOMEM; } - ret = rockchip_get_freq_info(dmcfreq); + ret = rockchip_dmcfreq_adjust_opp_table(dmcfreq); if (ret < 0) { dev_err(&pdev->dev, "cannot get frequency info\n"); return ret; From 3066221fd529f0bf6509d1ce3f04bfd2e563c917 Mon Sep 17 00:00:00 2001 From: Zefa Chen Date: Thu, 20 Feb 2025 16:15:43 +0800 Subject: [PATCH 4/6] media: rockchip: vicap fixes error of parse data type Signed-off-by: Zefa Chen Change-Id: I02b1fe620312ce3b6fdae08da6eea993f141cfc0 --- drivers/media/platform/rockchip/cif/capture.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/rockchip/cif/capture.c b/drivers/media/platform/rockchip/cif/capture.c index b9cf3bf9685c..875ba821f007 100644 --- a/drivers/media/platform/rockchip/cif/capture.c +++ b/drivers/media/platform/rockchip/cif/capture.c @@ -4422,11 +4422,12 @@ static void rkcif_modify_frame_skip_config(struct rkcif_stream *stream) } } -static u32 rkcif_get_parse_type_rk3576(const struct cif_input_fmt *cif_fmt_in) +static u32 rkcif_get_parse_type_rk3576(const struct cif_input_fmt *cif_fmt_in, + struct csi_channel_info *channel) { u32 parse_type = 0; - switch (cif_fmt_in->csi_fmt_val) { + switch (channel->csi_fmt_val) { case CSI_WRDDR_TYPE_RAW8: parse_type = CSI_WRDDR_TYPE_RAW8 << 3; break; @@ -4701,7 +4702,7 @@ static int rkcif_csi_channel_set_v1(struct rkcif_stream *stream, if (dev->chip_id > CHIP_RK3562_CIF) { val = CSI_ENABLE_CAPTURE | dma_en | CSI_ENABLE_CROP_RK3576; - val |= rkcif_get_parse_type_rk3576(stream->cif_fmt_in); + val |= rkcif_get_parse_type_rk3576(stream->cif_fmt_in, channel); val |= rkcif_csi_get_output_type_mask_rk3576(stream); val |= stream->cif_fmt_in->csi_yuv_order >> 4; if (stream->is_high_align) From 2e44c5c06e44a705bc20cc9c45b458a111847975 Mon Sep 17 00:00:00 2001 From: Sugar Zhang Date: Wed, 19 Feb 2025 22:38:48 +0800 Subject: [PATCH 5/6] ASoC: rk312x: Remove unused code Signed-off-by: Sugar Zhang Change-Id: Iab76cb375c1b855a4619da302927e85dfa001d1d --- sound/soc/codecs/rk312x_codec.c | 51 --------------------------------- 1 file changed, 51 deletions(-) diff --git a/sound/soc/codecs/rk312x_codec.c b/sound/soc/codecs/rk312x_codec.c index aba53c198407..9be8e49c11d8 100644 --- a/sound/soc/codecs/rk312x_codec.c +++ b/sound/soc/codecs/rk312x_codec.c @@ -94,10 +94,6 @@ struct rk312x_codec_priv { struct gpio_desc *hp_ctl_gpio; int spk_mute_delay; int hp_mute_delay; - int spk_hp_switch_gpio; - /* 1 spk; */ - /* 0 hp; */ - enum of_gpio_flags spk_io; /* 0 for box; */ /* 1 default for mid; */ @@ -275,30 +271,6 @@ static int rk312x_codec_ctl_gpio(int gpio, int level) return 0; } -#if 0 -static int switch_to_spk(int enable) -{ - if (!rk312x_priv) { - DBG(KERN_ERR"%s : rk312x is NULL\n", __func__); - return -EINVAL; - } - if (enable) { - if (rk312x_priv->spk_hp_switch_gpio != INVALID_GPIO) { - gpio_set_value(rk312x_priv->spk_hp_switch_gpio, rk312x_priv->spk_io); - DBG(KERN_INFO"%s switch to spk\n", __func__); - msleep(rk312x_priv->spk_mute_delay); - } - } else { - if (rk312x_priv->spk_hp_switch_gpio != INVALID_GPIO) { - gpio_set_value(rk312x_priv->spk_hp_switch_gpio, !rk312x_priv->spk_io); - DBG(KERN_INFO"%s switch to hp\n", __func__); - msleep(rk312x_priv->hp_mute_delay); - } - } - return 0; -} -#endif - static int rk312x_reset(struct snd_soc_component *component) { DBG("%s\n", __func__); @@ -2292,29 +2264,6 @@ static int rk312x_platform_probe(struct platform_device *pdev) platform_set_drvdata(pdev, rk312x); rk312x->dev = &pdev->dev; -#if 0 - rk312x->spk_hp_switch_gpio = of_get_named_gpio_flags(rk312x_np, - "spk_hp_switch_gpio", 0, &rk312x->spk_io); - rk312x->spk_io = !rk312x->spk_io; - if (!gpio_is_valid(rk312x->spk_hp_switch_gpio)) { - dbg_codec(2, "invalid spk hp switch_gpio : %d\n", - rk312x->spk_hp_switch_gpio); - rk312x->spk_hp_switch_gpio = INVALID_GPIO; - /* ret = -ENOENT; */ - /* goto err__; */ - } - DBG("%s : spk_hp_switch_gpio %d spk active_level %d \n", __func__, - rk312x->spk_hp_switch_gpio, rk312x->spk_io); - - if(rk312x->spk_hp_switch_gpio != INVALID_GPIO) { - ret = devm_gpio_request(&pdev->dev, rk312x->spk_hp_switch_gpio, "spk_hp_switch"); - if (ret < 0) { - dbg_codec(2, "rk312x_platform_probe spk_hp_switch_gpio fail\n"); - /* goto err__; */ - rk312x->spk_hp_switch_gpio = INVALID_GPIO; - } - } -#endif rk312x->edev = devm_extcon_dev_allocate(&pdev->dev, headset_extcon_cable); if (IS_ERR(rk312x->edev)) { dev_err(&pdev->dev, "failed to allocate extcon device\n"); From bb4832d4dc32476eac184ee48b1c05572a01bc8a Mon Sep 17 00:00:00 2001 From: Jianwei Fan Date: Mon, 17 Feb 2025 16:36:55 +0800 Subject: [PATCH 6/6] media: i2c: rk628: post process add yuv2020 to rgb Change-Id: Ic40174bae631bf40e1f48927e6ff5454fe4e76a8 Signed-off-by: Jianwei Fan --- drivers/media/i2c/rk628/rk628_post_process.c | 39 ++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/drivers/media/i2c/rk628/rk628_post_process.c b/drivers/media/i2c/rk628/rk628_post_process.c index d1197444b076..66bf979fa568 100644 --- a/drivers/media/i2c/rk628/rk628_post_process.c +++ b/drivers/media/i2c/rk628/rk628_post_process.c @@ -80,6 +80,8 @@ enum rk_pq_csc_mode { RK_PQ_CSC_RGBL2RGBL, /* RGB LIMIT->RGB LIMIT */ RK_PQ_CSC_RGB2RGB, /* RGB FULL->RGB FULL */ RK_PQ_CSC_YUV2RGB_2020, /* YUV 2020 FULL->RGB 2020 FULL */ + RK_PQ_CSC_YUV2RGB_2020_LIMIT2FULL, /* YUV 2020 LIMIT->RGB 2020 FULL */ + RK_PQ_CSC_YUV2RGB_2020_LIMIT, /* YUV 2020 LIMIT->RGB 2020 LIMIT */ RK_PQ_CSC_RGB2YUV2020_LIMIT2FULL, /* BT2020RGBLIMIT -> BT2020YUVFULL */ RK_PQ_CSC_RGB2YUV2020_LIMIT, /* BT2020RGBLIMIT -> BT2020YUVLIMIT */ RK_PQ_CSC_RGB2YUV2020_FULL2LIMIT, /* BT2020RGBFULL -> BT2020YUVLIMIT */ @@ -713,6 +715,27 @@ static const struct rk_pq_csc_dc_coef rk_dc_csc_table_adobe_yuv_limit_to_yuv_lim -64, -512, -512, 64, 512, 512 }; +// 2020 YUV LIMIT -> RGB FULL +static const struct rk_pq_csc_coef rk_csc_table_identity_yuv_limit_to_rgb_full_2020 = { + 1196, 0, 1724, + 1196, -192, -668, + 1196, 2200, 0, +}; +static const struct rk_pq_csc_dc_coef rk_dc_csc_table_identity_yuv_limit_to_rgb_full_2020 = { + -64, -512, -512, + 0, 0, 0 +}; + +// 2020 YUV LIMIT -> RGB LIMIT +static const struct rk_pq_csc_coef rk_csc_table_identity_yuv_limit_to_rgb_limit_2020 = { + 1024, 0, 1476, + 1024, -165, -572, + 1024, 1884, 0, +}; +static const struct rk_pq_csc_dc_coef rk_dc_csc_table_identity_yuv_limit_to_rgb_limit_2020 = { + -64, -512, -512, + 64, 64, 64 +}; /* *CSC Param Struct */ @@ -981,6 +1004,22 @@ static const struct rk_csc_mode_coef g_mode_csc_coef[] = { OPTM_CS_E_XV_YCC_2020, OPTM_CS_E_RGB_2020, true, true } }, + { + RK_PQ_CSC_YUV2RGB_2020_LIMIT2FULL, "YUV2020 L->RGB2020 F", + &rk_csc_table_identity_yuv_limit_to_rgb_full_2020, + &rk_dc_csc_table_identity_yuv_limit_to_rgb_full_2020, + { + OPTM_CS_E_XV_YCC_2020, OPTM_CS_E_RGB_2020, false, true + } + }, + { + RK_PQ_CSC_YUV2RGB_2020_LIMIT, "YUV2020 L->RGB2020 L", + &rk_csc_table_identity_yuv_limit_to_rgb_limit_2020, + &rk_dc_csc_table_identity_yuv_limit_to_rgb_limit_2020, + { + OPTM_CS_E_XV_YCC_2020, OPTM_CS_E_RGB_2020, false, false + } + }, { RK_PQ_CSC_RGB2YUV2020_LIMIT2FULL, "RGB2020 L->YUV2020 F", &rk_csc_table_identity_rgb_limit_to_yuv_full_2020,