From a41b37cce25eff86fa855e4be7236b0e4a68feac Mon Sep 17 00:00:00 2001 From: Zefa Chen Date: Thu, 25 May 2023 11:37:06 +0800 Subject: [PATCH] phy: rockchip: csi2-dphy: fixes build error for kernel 6.1 Signed-off-by: Zefa Chen Change-Id: I12808b5d617789d87fe4e528d8335fdb5ac5b4be --- drivers/phy/rockchip/phy-rockchip-csi2-dphy.c | 45 +++++-------------- 1 file changed, 10 insertions(+), 35 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-csi2-dphy.c b/drivers/phy/rockchip/phy-rockchip-csi2-dphy.c index 1fa8d3aea989..97e236cf10f2 100644 --- a/drivers/phy/rockchip/phy-rockchip-csi2-dphy.c +++ b/drivers/phy/rockchip/phy-rockchip-csi2-dphy.c @@ -121,22 +121,13 @@ static int csi2_dphy_update_sensor_mbus(struct v4l2_subdev *sd) return ret; sensor->mbus = mbus; - switch (mbus.flags & V4L2_MBUS_CSI2_LANES) { - case V4L2_MBUS_CSI2_1_LANE: - sensor->lanes = 1; - break; - case V4L2_MBUS_CSI2_2_LANE: - sensor->lanes = 2; - break; - case V4L2_MBUS_CSI2_3_LANE: - sensor->lanes = 3; - break; - case V4L2_MBUS_CSI2_4_LANE: - sensor->lanes = 4; - break; - default: - return -EINVAL; - } + + if (mbus.type == V4L2_MBUS_CSI2_DPHY || + mbus.type == V4L2_MBUS_CSI2_CPHY) + sensor->lanes = mbus.bus.mipi_csi2.num_data_lanes; + else if (mbus.type == V4L2_MBUS_CCP2) + sensor->lanes = mbus.bus.mipi_csi1.data_lane; + if (dphy->drv_data->vendor == PHY_VENDOR_INNO) { ret = v4l2_subdev_call(sensor_sd, core, ioctl, RKMODULE_GET_BUS_CONFIG, &bus_config); @@ -491,9 +482,10 @@ static int rockchip_csi2_dphy_fwnode_parse(struct device *dev, return -EINVAL; } - if (vep->bus_type == V4L2_MBUS_CSI2_DPHY) { + if (vep->bus_type == V4L2_MBUS_CSI2_DPHY || + vep->bus_type == V4L2_MBUS_CSI2_CPHY) { config->type = V4L2_MBUS_CSI2_DPHY; - config->flags = vep->bus.mipi_csi2.flags; + config->bus.mipi_csi2.flags = vep->bus.mipi_csi2.flags; s_asd->lanes = vep->bus.mipi_csi2.num_data_lanes; } else if (vep->bus_type == V4L2_MBUS_CCP2) { config->type = V4L2_MBUS_CCP2; @@ -503,23 +495,6 @@ static int rockchip_csi2_dphy_fwnode_parse(struct device *dev, return -EINVAL; } - switch (s_asd->lanes) { - case 1: - config->flags |= V4L2_MBUS_CSI2_1_LANE; - break; - case 2: - config->flags |= V4L2_MBUS_CSI2_2_LANE; - break; - case 3: - config->flags |= V4L2_MBUS_CSI2_3_LANE; - break; - case 4: - config->flags |= V4L2_MBUS_CSI2_4_LANE; - break; - default: - return -EINVAL; - } - return 0; }