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 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; 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; 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 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. 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; 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 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/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index c29700fff507..670b47836c98 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 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 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 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/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 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 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 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 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 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); } 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; 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 */ 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; 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) 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__ */ 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 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