From b775c1381533f21c1e616c22ed77d7614f356fb3 Mon Sep 17 00:00:00 2001 From: Yandong Lin Date: Mon, 26 Feb 2024 19:41:34 +0800 Subject: [PATCH 1/9] arm64: dts: rockchip: rk3576: add rkvdec_sram support Signed-off-by: Yandong Lin Change-Id: Ibb3b7d6ab0a6950d2ffd897d0bb28885826b725d --- arch/arm64/boot/dts/rockchip/rk3576.dtsi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3576.dtsi b/arch/arm64/boot/dts/rockchip/rk3576.dtsi index 0a222f836349..b3561c32e3d0 100644 --- a/arch/arm64/boot/dts/rockchip/rk3576.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3576.dtsi @@ -2534,6 +2534,9 @@ rockchip,srv = <&mpp_srv>; rockchip,task-capacity = <8>; rockchip,taskqueue-node = <5>; + rockchip,sram = <&rkvdec_sram>; + rockchip,rcb-iova = <0x10000000 0x78000>; + rockchip,rcb-min-width = <512>; power-domains = <&power RK3576_PD_VDEC>; status = "disabled"; }; @@ -5268,6 +5271,20 @@ status = "okay"; }; + sram: sram@3ff88000 { + compatible = "mmio-sram"; + reg = <0x0 0x3ff88000 0x0 0x78000>; + + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x0 0x3ff88000 0x78000>; + + /* start address and size should be 4k align */ + rkvdec_sram: rkvdec-sram@0 { + reg = <0x0 0x78000>; + }; + }; + scmi_shmem: scmi-shmem@4010f000 { compatible = "arm,scmi-shmem"; reg = <0x0 0x4010f000 0x0 0x100>; From d21de2cd703b963bbe3ce4c9bfa30e2fec298c05 Mon Sep 17 00:00:00 2001 From: Algea Cao Date: Mon, 13 May 2024 15:41:47 +0800 Subject: [PATCH 2/9] drm/bridge: dw-hdmi-qp-hdcp: Fix timeout for ksv list ready CTS requires a minimum timeout period of 5s. Change-Id: I6312d3334acb9171a81c13e4eda6900b7fb429da Signed-off-by: Algea Cao --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp-hdcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp-hdcp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp-hdcp.c index 388890d60c46..568f92658e38 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp-hdcp.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp-hdcp.c @@ -563,10 +563,10 @@ static void dw_hdmi_qp_hdcp(struct work_struct *p_work) { struct dw_qp_hdcp *hdcp = container_of(p_work, struct dw_qp_hdcp, work); u32 val; - int i = 500; + int i = 700; while (i--) { - usleep_range(7000, 8000); + usleep_range(7200, 8000); mutex_lock(&hdcp->mutex); if (hdcp->status == DW_HDCP_DISABLED) { From f8f1fb7c3f32faf9b311ff2545bf509f903ad24a Mon Sep 17 00:00:00 2001 From: Hu Kejun Date: Sat, 11 May 2024 11:14:09 +0800 Subject: [PATCH 3/9] media: i2c: ov13855: support get otp info Signed-off-by: Hu Kejun Change-Id: Idd9f3fe23249ebfbe85d5ea714c0136b53b023ba --- drivers/media/i2c/ov13855.c | 121 ++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) diff --git a/drivers/media/i2c/ov13855.c b/drivers/media/i2c/ov13855.c index 14296b7efe5f..da53a275776c 100644 --- a/drivers/media/i2c/ov13855.c +++ b/drivers/media/i2c/ov13855.c @@ -31,6 +31,7 @@ #include #include #include +#include "otp_eeprom.h" #define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x04) @@ -145,6 +146,8 @@ struct ov13855 { const char *module_facing; const char *module_name; const char *len_name; + + struct otp_info *otp; }; #define to_ov13855(sd) container_of(sd, struct ov13855, subdev) @@ -1217,14 +1220,97 @@ static int ov13855_g_frame_interval(struct v4l2_subdev *sd, return 0; } +static void ov13855_get_otp(struct otp_info *otp, + struct rkmodule_inf *inf) +{ + u32 i, j; + u32 w, h; + + /* awb */ + if (otp->awb_data.flag) { + inf->awb.flag = 1; + inf->awb.r_value = otp->awb_data.r_ratio; + inf->awb.b_value = otp->awb_data.b_ratio; + inf->awb.gr_value = otp->awb_data.g_ratio; + inf->awb.gb_value = 0x0; + + inf->awb.golden_r_value = otp->awb_data.r_golden; + inf->awb.golden_b_value = otp->awb_data.b_golden; + inf->awb.golden_gr_value = otp->awb_data.g_golden; + inf->awb.golden_gb_value = 0x0; + } + + /* lsc */ + if (otp->lsc_data.flag) { + inf->lsc.flag = 1; + inf->lsc.width = otp->basic_data.size.width; + inf->lsc.height = otp->basic_data.size.height; + inf->lsc.table_size = otp->lsc_data.table_size; + + for (i = 0; i < 289; i++) { + inf->lsc.lsc_r[i] = (otp->lsc_data.data[i * 2] << 8) | + otp->lsc_data.data[i * 2 + 1]; + inf->lsc.lsc_gr[i] = (otp->lsc_data.data[i * 2 + 578] << 8) | + otp->lsc_data.data[i * 2 + 579]; + inf->lsc.lsc_gb[i] = (otp->lsc_data.data[i * 2 + 1156] << 8) | + otp->lsc_data.data[i * 2 + 1157]; + inf->lsc.lsc_b[i] = (otp->lsc_data.data[i * 2 + 1734] << 8) | + otp->lsc_data.data[i * 2 + 1735]; + } + } + + /* pdaf */ + if (otp->pdaf_data.flag) { + inf->pdaf.flag = 1; + inf->pdaf.gainmap_width = otp->pdaf_data.gainmap_width; + inf->pdaf.gainmap_height = otp->pdaf_data.gainmap_height; + inf->pdaf.pd_offset = otp->pdaf_data.pd_offset; + inf->pdaf.dcc_mode = otp->pdaf_data.dcc_mode; + inf->pdaf.dcc_dir = otp->pdaf_data.dcc_dir; + inf->pdaf.dccmap_width = otp->pdaf_data.dccmap_width; + inf->pdaf.dccmap_height = otp->pdaf_data.dccmap_height; + w = otp->pdaf_data.gainmap_width; + h = otp->pdaf_data.gainmap_height; + for (i = 0; i < h; i++) { + for (j = 0; j < w; j++) { + inf->pdaf.gainmap[i * w + j] = + (otp->pdaf_data.gainmap[(i * w + j) * 2] << 8) | + otp->pdaf_data.gainmap[(i * w + j) * 2 + 1]; + } + } + w = otp->pdaf_data.dccmap_width; + h = otp->pdaf_data.dccmap_height; + for (i = 0; i < h; i++) { + for (j = 0; j < w; j++) { + inf->pdaf.dccmap[i * w + j] = + (otp->pdaf_data.dccmap[(i * w + j) * 2] << 8) | + otp->pdaf_data.dccmap[(i * w + j) * 2 + 1]; + } + } + } + + /* af */ + if (otp->af_data.flag) { + inf->af.flag = 1; + inf->af.dir_cnt = 1; + inf->af.af_otp[0].vcm_start = otp->af_data.af_inf; + inf->af.af_otp[0].vcm_end = otp->af_data.af_macro; + inf->af.af_otp[0].vcm_dir = 0; + } +} + static void ov13855_get_module_inf(struct ov13855 *ov13855, struct rkmodule_inf *inf) { + struct otp_info *otp = ov13855->otp; + memset(inf, 0, sizeof(*inf)); strscpy(inf->base.sensor, OV13855_NAME, sizeof(inf->base.sensor)); strscpy(inf->base.module, ov13855->module_name, sizeof(inf->base.module)); strscpy(inf->base.lens, ov13855->len_name, sizeof(inf->base.lens)); + if (otp) + ov13855_get_otp(otp, inf); } static long ov13855_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) @@ -1819,6 +1905,10 @@ static int ov13855_probe(struct i2c_client *client, { struct device *dev = &client->dev; struct device_node *node = dev->of_node; + struct i2c_client *eeprom_ctrl_client; + struct device_node *eeprom_ctrl_node; + struct v4l2_subdev *eeprom_ctrl; + struct otp_info *otp_ptr; struct ov13855 *ov13855; struct v4l2_subdev *sd; char facing[2]; @@ -1904,6 +1994,37 @@ static int ov13855_probe(struct i2c_client *client, if (ret) goto err_power_off; + eeprom_ctrl_node = of_parse_phandle(node, "eeprom-ctrl", 0); + if (eeprom_ctrl_node) { + eeprom_ctrl_client = + of_find_i2c_device_by_node(eeprom_ctrl_node); + of_node_put(eeprom_ctrl_node); + if (IS_ERR_OR_NULL(eeprom_ctrl_client)) { + dev_err(dev, "can not get node\n"); + goto continue_probe; + } + eeprom_ctrl = i2c_get_clientdata(eeprom_ctrl_client); + if (IS_ERR_OR_NULL(eeprom_ctrl)) { + dev_err(dev, "can not get eeprom i2c client\n"); + } else { + otp_ptr = devm_kzalloc(dev, sizeof(*otp_ptr), GFP_KERNEL); + if (!otp_ptr) { + put_device(&eeprom_ctrl_client->dev); + goto continue_probe; + } + ret = v4l2_subdev_call(eeprom_ctrl, + core, ioctl, 0, otp_ptr); + if (!ret) { + ov13855->otp = otp_ptr; + } else { + ov13855->otp = NULL; + devm_kfree(dev, otp_ptr); + } + } + put_device(&eeprom_ctrl_client->dev); + } + +continue_probe: #ifdef CONFIG_VIDEO_V4L2_SUBDEV_API sd->internal_ops = &ov13855_internal_ops; sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; From c135a425bc8f8ce7217293ce89081d3b8fff2fde Mon Sep 17 00:00:00 2001 From: Hu Kejun Date: Sat, 11 May 2024 16:21:41 +0800 Subject: [PATCH 4/9] media: i2c: dw9763: support set max logical pos ioctl Signed-off-by: Hu Kejun Change-Id: Id83b55310426b3a526036496b888b559df8f3db6 --- drivers/media/i2c/dw9763.c | 98 ++++++++++++++++++++++++-------------- 1 file changed, 63 insertions(+), 35 deletions(-) diff --git a/drivers/media/i2c/dw9763.c b/drivers/media/i2c/dw9763.c index d3d0173fb90e..56c0dda37002 100644 --- a/drivers/media/i2c/dw9763.c +++ b/drivers/media/i2c/dw9763.c @@ -50,6 +50,7 @@ MODULE_PARM_DESC(debug, "debug level (0-2)"); /* dw9763 device structure */ struct dw9763_device { struct v4l2_ctrl_handler ctrls_vcm; + struct v4l2_ctrl *focus; struct i2c_client *client; struct v4l2_subdev sd; struct v4l2_device vdev; @@ -58,13 +59,14 @@ struct dw9763_device { struct gpio_desc *power_gpio; unsigned short current_related_pos; unsigned short current_lens_pos; + unsigned int max_current; unsigned int start_current; unsigned int rated_current; - unsigned int step; unsigned int step_mode; unsigned int vcm_movefull_t; unsigned int t_src; unsigned int t_div; + unsigned int max_logicalpos; struct __kernel_old_timeval start_move_tv; struct __kernel_old_timeval end_move_tv; @@ -73,7 +75,6 @@ struct dw9763_device { u32 module_index; const char *module_facing; struct rk_cam_vcm_cfg vcm_cfg; - int max_ma; struct mutex lock; struct regulator *supply; bool power_on; @@ -277,22 +278,25 @@ static int dw9763_get_pos(struct dw9763_device *dev_vcm, unsigned int *cur_pos) { struct i2c_client *client = dev_vcm->client; + unsigned int dac, position, range; int ret; - unsigned int abs_step; - ret = dw9763_read_reg(client, 0x03, 2, &abs_step); + range = dev_vcm->rated_current - dev_vcm->start_current; + ret = dw9763_read_reg(client, 0x03, 2, &dac); if (ret != 0) goto err; - if (abs_step <= dev_vcm->start_current) - abs_step = VCMDRV_MAX_LOG; - else if ((abs_step > dev_vcm->start_current) && - (abs_step <= dev_vcm->rated_current)) - abs_step = (dev_vcm->rated_current - abs_step) / dev_vcm->step; - else - abs_step = 0; + if (dac <= dev_vcm->start_current) { + position = dev_vcm->max_logicalpos; + } else if ((dac > dev_vcm->start_current) && + (dac <= dev_vcm->rated_current)) { + position = (dac - dev_vcm->start_current) * dev_vcm->max_logicalpos / range; + position = dev_vcm->max_logicalpos - position; + } else { + position = 0; + } - *cur_pos = abs_step; + *cur_pos = position; v4l2_dbg(1, debug, &dev_vcm->sd, "%s: get position %d\n", __func__, *cur_pos); return 0; @@ -305,14 +309,16 @@ err: static int dw9763_set_pos(struct dw9763_device *dev_vcm, unsigned int dest_pos) { + unsigned int position; + unsigned int range; int ret; - unsigned int position = 0; - if (dest_pos >= VCMDRV_MAX_LOG) + range = dev_vcm->rated_current - dev_vcm->start_current; + if (dest_pos >= dev_vcm->max_logicalpos) position = dev_vcm->start_current; else position = dev_vcm->start_current + - (dev_vcm->step * (VCMDRV_MAX_LOG - dest_pos)); + (range * (dev_vcm->max_logicalpos - dest_pos) / dev_vcm->max_logicalpos); if (position > DW9763_MAX_REG) position = DW9763_MAX_REG; @@ -350,10 +356,10 @@ static int dw9763_set_ctrl(struct v4l2_ctrl *ctrl) if (ctrl->id == V4L2_CID_FOCUS_ABSOLUTE) { - if (dest_pos > VCMDRV_MAX_LOG) { + if (dest_pos > dev_vcm->max_logicalpos) { dev_info(&client->dev, "%s dest_pos is error. %d > %d\n", - __func__, dest_pos, VCMDRV_MAX_LOG); + __func__, dest_pos, dev_vcm->max_logicalpos); return -EINVAL; } @@ -489,28 +495,31 @@ static const struct v4l2_subdev_internal_ops dw9763_int_ops = { static void dw9763_update_vcm_cfg(struct dw9763_device *dev_vcm) { struct i2c_client *client = dev_vcm->client; - int cur_dist; - if (dev_vcm->max_ma == 0) { + if (dev_vcm->max_current == 0) { dev_err(&client->dev, "max current is zero"); return; } - cur_dist = dev_vcm->vcm_cfg.rated_ma - dev_vcm->vcm_cfg.start_ma; - cur_dist = cur_dist * DW9763_MAX_REG / dev_vcm->max_ma; - dev_vcm->step = (cur_dist + (VCMDRV_MAX_LOG - 1)) / VCMDRV_MAX_LOG; + if (dev_vcm->vcm_cfg.start_ma == dev_vcm->vcm_cfg.rated_ma) { + dev_err(&client->dev, + "start current %d can not equal to rated current %d", + dev_vcm->vcm_cfg.start_ma, dev_vcm->vcm_cfg.rated_ma); + return; + } + dev_vcm->start_current = dev_vcm->vcm_cfg.start_ma * - DW9763_MAX_REG / dev_vcm->max_ma; + DW9763_MAX_REG / dev_vcm->max_current; dev_vcm->rated_current = dev_vcm->vcm_cfg.rated_ma * - DW9763_MAX_REG / dev_vcm->max_ma; + DW9763_MAX_REG / dev_vcm->max_current; dev_vcm->step_mode = dev_vcm->vcm_cfg.step_mode; dev_info(&client->dev, - "vcm_cfg: %d, %d, %d, max_ma %d\n", + "vcm_cfg: %d, %d, %d, max_current %d\n", dev_vcm->vcm_cfg.start_ma, dev_vcm->vcm_cfg.rated_ma, dev_vcm->vcm_cfg.step_mode, - dev_vcm->max_ma); + dev_vcm->max_current); } static long dw9763_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) @@ -519,6 +528,7 @@ static long dw9763_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) struct i2c_client *client = dev_vcm->client; struct rk_cam_vcm_tim *vcm_tim; struct rk_cam_vcm_cfg *vcm_cfg; + unsigned int max_logicalpos; int ret = 0; if (cmd == RK_VIDIOC_VCM_TIMEINFO) { @@ -554,6 +564,16 @@ static long dw9763_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) dev_vcm->vcm_cfg.rated_ma = vcm_cfg->rated_ma; dev_vcm->vcm_cfg.step_mode = vcm_cfg->step_mode; dw9763_update_vcm_cfg(dev_vcm); + } else if (cmd == RK_VIDIOC_SET_VCM_MAX_LOGICALPOS) { + max_logicalpos = *(unsigned int *)arg; + + if (max_logicalpos > 0) { + dev_vcm->max_logicalpos = max_logicalpos; + __v4l2_ctrl_modify_range(dev_vcm->focus, + 0, dev_vcm->max_logicalpos, 1, dev_vcm->max_logicalpos); + } + dev_dbg(&client->dev, + "max_logicalpos %d\n", max_logicalpos); } else { dev_err(&client->dev, "cmd 0x%x not supported\n", cmd); @@ -573,6 +593,7 @@ static long dw9763_compat_ioctl32(struct v4l2_subdev *sd, struct rk_cam_compat_vcm_tim compat_vcm_tim; struct rk_cam_vcm_tim vcm_tim; struct rk_cam_vcm_cfg vcm_cfg; + unsigned int max_logicalpos; long ret; if (cmd == RK_VIDIOC_COMPAT_VCM_TIMEINFO) { @@ -605,6 +626,12 @@ static long dw9763_compat_ioctl32(struct v4l2_subdev *sd, ret = dw9763_ioctl(sd, cmd, &vcm_cfg); else ret = -EFAULT; + } else if (cmd == RK_VIDIOC_SET_VCM_MAX_LOGICALPOS) { + ret = copy_from_user(&max_logicalpos, up, sizeof(max_logicalpos)); + if (!ret) + ret = dw9763_ioctl(sd, cmd, &max_logicalpos); + else + ret = -EFAULT; } else { dev_err(&client->dev, "cmd 0x%x not supported\n", cmd); @@ -641,8 +668,8 @@ static int dw9763_init_controls(struct dw9763_device *dev_vcm) v4l2_ctrl_handler_init(hdl, 1); - v4l2_ctrl_new_std(hdl, ops, V4L2_CID_FOCUS_ABSOLUTE, - 0, VCMDRV_MAX_LOG, 1, 32); + dev_vcm->focus = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_FOCUS_ABSOLUTE, + 0, dev_vcm->max_logicalpos, 1, dev_vcm->max_logicalpos); if (hdl->error) dev_err(dev_vcm->sd.dev, "%s fail error: 0x%x\n", @@ -793,7 +820,7 @@ static int dw9763_probe(struct i2c_client *client, { struct device_node *np = of_node_get(client->dev.of_node); struct dw9763_device *dw9763_dev; - unsigned int max_ma, start_ma, rated_ma, step_mode; + unsigned int max_current, start_ma, rated_ma, step_mode; unsigned int t_src, t_div; struct v4l2_subdev *sd; char facing[2]; @@ -802,14 +829,14 @@ static int dw9763_probe(struct i2c_client *client, dev_info(&client->dev, "probing...\n"); if (of_property_read_u32(np, OF_CAMERA_VCMDRV_MAX_CURRENT, - (unsigned int *)&max_ma)) { - max_ma = DW9763_MAX_CURRENT; + (unsigned int *)&max_current)) { + max_current = DW9763_MAX_CURRENT; dev_info(&client->dev, "could not get module %s from dts!\n", OF_CAMERA_VCMDRV_MAX_CURRENT); } - if (max_ma == 0) - max_ma = DW9763_MAX_CURRENT; + if (max_current == 0) + max_current = DW9763_MAX_CURRENT; if (of_property_read_u32(np, OF_CAMERA_VCMDRV_START_CURRENT, @@ -886,6 +913,7 @@ static int dw9763_probe(struct i2c_client *client, dw9763_dev->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; dw9763_dev->sd.internal_ops = &dw9763_int_ops; + dw9763_dev->max_logicalpos = VCMDRV_MAX_LOG; ret = dw9763_init_controls(dw9763_dev); if (ret) goto err_cleanup; @@ -914,13 +942,13 @@ static int dw9763_probe(struct i2c_client *client, if (ret) dev_err(&client->dev, "v4l2 async register subdev failed\n"); - dw9763_dev->max_ma = max_ma; + dw9763_dev->max_current = max_current; dw9763_dev->vcm_cfg.start_ma = start_ma; dw9763_dev->vcm_cfg.rated_ma = rated_ma; dw9763_dev->vcm_cfg.step_mode = step_mode; dw9763_update_vcm_cfg(dw9763_dev); dw9763_dev->move_us = 0; - dw9763_dev->current_related_pos = VCMDRV_MAX_LOG; + dw9763_dev->current_related_pos = dw9763_dev->max_logicalpos; dw9763_dev->start_move_tv = ns_to_kernel_old_timeval(ktime_get_ns()); dw9763_dev->end_move_tv = ns_to_kernel_old_timeval(ktime_get_ns()); From 1edcb4fdaa4b2a2e692688a58435c14aff49a84d Mon Sep 17 00:00:00 2001 From: Liang Chen Date: Mon, 13 May 2024 17:58:58 +0800 Subject: [PATCH 5/9] arm64: dts: rockchip: rk3568: remove rockchip,max-volt for cpu0_opp_table The property rockchip,max-volt is not used for cpu0_opp_table, so remove it. Signed-off-by: Liang Chen Change-Id: If0493c7029a8c67a790771cadff93e26e0f2df08 --- arch/arm64/boot/dts/rockchip/rk356x.dtsi | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi index c2003ec653d1..f20c2fe95127 100644 --- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi @@ -128,7 +128,6 @@ nvmem-cell-names = "leakage", "pvtm", "mbist-vmin", "opp-info", "specification_serial_number", "remark_spec_serial_number"; rockchip,supported-hw; - rockchip,max-volt = <1150000>; rockchip,pvtm-voltage-sel = < 0 84000 0 84001 87000 1 From 784edc6ed9cd88f245f4b73e7a0e8a9dedf3876d Mon Sep 17 00:00:00 2001 From: Jon Lin Date: Mon, 13 May 2024 15:18:26 +0800 Subject: [PATCH 6/9] spi: rockchip-test: Add spi_rockchip_test_spi_ids id_table Change-Id: I9bc509aca655f05e6a91c014da8b6cffbf91853f Signed-off-by: Jon Lin --- drivers/spi/spi-rockchip-test.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/spi/spi-rockchip-test.c b/drivers/spi/spi-rockchip-test.c index 62246e9f8894..213064be62bb 100644 --- a/drivers/spi/spi-rockchip-test.c +++ b/drivers/spi/spi-rockchip-test.c @@ -399,6 +399,21 @@ MODULE_DEVICE_TABLE(of, rockchip_spi_test_dt_match); #endif /* CONFIG_OF */ +static const struct spi_device_id spi_rockchip_test_spi_ids[] = { + { .name = "spi_test_bus0_cs0" }, + { .name = "spi_test_bus0_cs1" }, + { .name = "spi_test_bus1_cs0" }, + { .name = "spi_test_bus1_cs1" }, + { .name = "spi_test_bus2_cs0" }, + { .name = "spi_test_bus2_cs1" }, + { .name = "spi_test_bus3_cs0" }, + { .name = "spi_test_bus3_cs1" }, + { .name = "spi_test_bus4_cs0" }, + { .name = "spi_test_bus4_cs1" }, + {}, +}; +MODULE_DEVICE_TABLE(spi, spi_rockchip_test_spi_ids); + static struct spi_driver spi_rockchip_test_driver = { .driver = { .name = "spi_test", @@ -407,6 +422,7 @@ static struct spi_driver spi_rockchip_test_driver = { }, .probe = rockchip_spi_test_probe, .remove = rockchip_spi_test_remove, + .id_table = spi_rockchip_test_spi_ids, }; static int __init spi_rockchip_test_init(void) From 3fc825d3b10db3f8b0edfa26b3064cb23bcd25af Mon Sep 17 00:00:00 2001 From: Damon Ding Date: Sat, 11 May 2024 18:27:31 +0800 Subject: [PATCH 7/9] drm/panel: panel-simple: add panel_simple_spi_ids id_table Add panel_simple_spi_ids to fix the unexpected warning because of the check of SPI devices autoloading. The warning may be like: [ 1.607343] SPI driver panel-simple-spi has no spi_device_id for simple-panel-spi See the following commit for details: commit 5fa6863ba692 ("spi: Check we have a spi_device_id for each DT compatible") In addition, add compatible "panel-simple-spi" for naming consistency. Change-Id: I89a72abc75e0537e98166265376afa1c94eab600 Signed-off-by: Damon Ding --- drivers/gpu/drm/panel/panel-simple.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 57ab19e66fdb..a6bad7c63048 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -5197,11 +5197,19 @@ static int panel_simple_spi_write(struct device *dev, const u8 *data, size_t len } static const struct of_device_id panel_simple_spi_of_match[] = { + { .compatible = "panel-simple-spi", .data = NULL }, { .compatible = "simple-panel-spi", .data = NULL }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, panel_simple_spi_of_match); +static const struct spi_device_id panel_simple_spi_ids[] = { + { .name = "panel-simple-spi" }, + { .name = "simple-panel-spi" }, + {}, +}; +MODULE_DEVICE_TABLE(spi, panel_simple_spi_ids); + static int panel_simple_spi_probe(struct spi_device *spi) { struct device *dev = &spi->dev; @@ -5264,6 +5272,7 @@ static struct spi_driver panel_simple_spi_driver = { .probe = panel_simple_spi_probe, .remove = panel_simple_spi_remove, .shutdown = panel_simple_spi_shutdown, + .id_table = panel_simple_spi_ids, }; static int __init panel_simple_init(void) From 59bf7790886ae1e5558b5508fc3e250ccd028d69 Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Tue, 14 May 2024 10:49:33 +0800 Subject: [PATCH 8/9] ASoC: rockchip-spi-codec: Silence no spi_device_id warning SPI devices use the spi_device_id for module autoloading even on systems using device tree, after commit 5fa6863ba692 ("spi: Check we have a spi_device_id for each DT compatible"), kernel warns as follows since the spi_device_id is missing: SPI driver spi_codec has no spi_device_id for rockchip,spi-codec Add spi_device_id entries to silence the warning, and ensure driver module autoloading works. Signed-off-by: Tao Huang Change-Id: Ie33ffd25261376f55a16ae5a34ee0fafdb6e6cd6 --- sound/soc/codecs/rockchip-spi-codec.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/rockchip-spi-codec.c b/sound/soc/codecs/rockchip-spi-codec.c index bc89f8a9198c..457891df7d7c 100644 --- a/sound/soc/codecs/rockchip-spi-codec.c +++ b/sound/soc/codecs/rockchip-spi-codec.c @@ -351,12 +351,19 @@ static const struct of_device_id spi_codec_device_id[] = { }; MODULE_DEVICE_TABLE(of, spi_codec_device_id); +static const struct spi_device_id spi_codec_id[] = { + { "spi-codec" }, + {} +}; +MODULE_DEVICE_TABLE(spi, spi_codec_id); + static struct spi_driver spi_codec_driver = { .driver = { - .name = "spi_codec", + .name = "spi-codec", .owner = THIS_MODULE, .of_match_table = of_match_ptr(spi_codec_device_id), }, + .id_table = spi_codec_id, .probe = spi_codec_probe, .remove = spi_codec_remove, }; From a6950c52636737132b15e13ee172a2c42f594a4d Mon Sep 17 00:00:00 2001 From: Zhang Yubing Date: Mon, 13 May 2024 16:26:21 +0800 Subject: [PATCH 9/9] phy: rockchip: usbdp: update phy parameters for SI test Change-Id: If6da3936e35fd0dffec83b71bc6d48fb2871218d Signed-off-by: Zhang Yubing --- drivers/phy/rockchip/phy-rockchip-usbdp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c index c4f2c4f7717d..3d448cb3d2d0 100644 --- a/drivers/phy/rockchip/phy-rockchip-usbdp.c +++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c @@ -1629,8 +1629,8 @@ static const struct rockchip_udphy_cfg rk3576_udphy_cfgs = { }, }, .dp_tx_ctrl_cfg = { - rk3588_dp_tx_drv_ctrl_rbr_hbr, - rk3588_dp_tx_drv_ctrl_rbr_hbr, + rk3588_dp_tx_drv_ctrl_rbr_hbr_typec, + rk3588_dp_tx_drv_ctrl_rbr_hbr_typec, rk3588_dp_tx_drv_ctrl_hbr2, rk3588_dp_tx_drv_ctrl_hbr3, },