Merge commit '28b543390dbd2ddd56f189d59525a383bed2e77d'

* commit '28b543390dbd2ddd56f189d59525a383bed2e77d':
  arm64: configs: rockchip_linux: Update by savedefconfig
  dmaengine: pl330: Fix pos calculation on interleaved dma
  ASoC: rockchip: i2s: Use device_property_* API
  media: rockchip: vicap add support format of RGB888 with different order
  ARM: dts: rockchip: rv1106-evb-cam: add imx415
  media: i2c: lt8619c: set default timings when driver probe
  media: rockchip: isp: fix image effect for rv1106 4k

Change-Id: Ia9b69005c2b21668ad1a6f4cda4cf297fde75592
This commit is contained in:
Tao Huang
2023-10-24 09:57:13 +08:00
6 changed files with 61 additions and 9 deletions

View File

@@ -50,6 +50,11 @@
remote-endpoint = <&sc3338_out>;
data-lanes = <1 2>;
};
csi_dphy_input6: endpoint@6 {
reg = <6>;
remote-endpoint = <&imx415_out>;
data-lanes = <1 2 3 4>;
};
};
port@1 {
@@ -202,6 +207,28 @@
};
};
};
imx415: imx415@1a {
compatible = "sony,imx415";
status = "okay";
reg = <0x1a>;
clocks = <&cru MCLK_REF_MIPI0>;
clock-names = "xvclk";
reset-gpios = <&gpio3 RK_PC5 GPIO_ACTIVE_LOW>;
pwdn-gpios = <&gpio3 RK_PD2 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&mipi_refclk_out0>;
rockchip,camera-module-index = <0>;
rockchip,camera-module-facing = "back";
rockchip,camera-module-name = "CMK-OT2022-PX1";
rockchip,camera-module-lens-name = "IR0147-36IRC-8M-F20";
port {
imx415_out: endpoint {
remote-endpoint = <&csi_dphy_input6>;
data-lanes = <1 2 3 4>;
};
};
};
};
&mipi0_csi2 {

View File

@@ -2921,7 +2921,7 @@ static struct dma_async_tx_descriptor *pl330_prep_interleaved_dma(
struct dma_pl330_desc *desc = NULL;
struct dma_pl330_chan *pch = to_pchan(chan);
dma_addr_t dst = 0, src = 0;
size_t size, src_icg, dst_icg, period_bytes, buffer_bytes;
size_t size, src_icg, dst_icg, period_bytes, buffer_bytes, full_buffer_bytes;
size_t nump = 0, numf = 0;
if (!xt->numf || !xt->sgl[0].size || xt->frame_size != 1)
@@ -2957,17 +2957,19 @@ static struct dma_async_tx_descriptor *pl330_prep_interleaved_dma(
desc->rqcfg.dst_inc = 0;
src = xt->src_start;
dst = pch->fifo_dma;
full_buffer_bytes = (size + src_icg) * numf;
} else {
desc->rqcfg.src_inc = 0;
desc->rqcfg.dst_inc = 1;
src = pch->fifo_dma;
dst = xt->dst_start;
full_buffer_bytes = (size + dst_icg) * numf;
}
desc->rqtype = xt->dir;
desc->rqcfg.brst_size = pch->burst_sz;
desc->rqcfg.brst_len = pch->burst_len;
desc->bytes_requested = buffer_bytes;
desc->bytes_requested = full_buffer_bytes;
desc->sgl.size = size;
desc->sgl.src_icg = src_icg;
desc->sgl.dst_icg = dst_icg;

View File

@@ -1727,6 +1727,8 @@ static int lt8619c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct device *dev = &client->dev;
struct v4l2_dv_timings default_timing =
V4L2_DV_BT_CEA_640X480P59_94;
struct lt8619c *lt8619c;
struct v4l2_subdev *sd;
char facing[2];
@@ -1743,6 +1745,7 @@ static int lt8619c_probe(struct i2c_client *client,
sd = &lt8619c->sd;
lt8619c->i2c_client = client;
lt8619c->timings = default_timing;
lt8619c->cur_mode = &supported_modes[0];
lt8619c->mbus_fmt_code = MEDIA_BUS_FMT_UYVY8_2X8;

View File

@@ -514,6 +514,10 @@ static const struct cif_input_fmt in_fmts[] = {
.mbus_code = MEDIA_BUS_FMT_BGR888_1X24,
.csi_fmt_val = CSI_WRDDR_TYPE_RGB888,
.field = V4L2_FIELD_NONE,
}, {
.mbus_code = MEDIA_BUS_FMT_GBR888_1X24,
.csi_fmt_val = CSI_WRDDR_TYPE_RGB888,
.field = V4L2_FIELD_NONE,
}, {
.mbus_code = MEDIA_BUS_FMT_RGB565_1X16,
.csi_fmt_val = CSI_WRDDR_TYPE_RGB565,
@@ -611,6 +615,7 @@ static int rkcif_output_fmt_check(struct rkcif_stream *stream,
break;
case MEDIA_BUS_FMT_RGB888_1X24:
case MEDIA_BUS_FMT_BGR888_1X24:
case MEDIA_BUS_FMT_GBR888_1X24:
if (output_fmt->fourcc == V4L2_PIX_FMT_RGB24 ||
output_fmt->fourcc == V4L2_PIX_FMT_BGR24)
ret = 0;
@@ -801,6 +806,7 @@ static unsigned char get_data_type(u32 pixelformat, u8 cmd_mode_en, u8 dsi_input
return 0x1e;
case MEDIA_BUS_FMT_RGB888_1X24:
case MEDIA_BUS_FMT_BGR888_1X24:
case MEDIA_BUS_FMT_GBR888_1X24:
if (dsi_input) {
if (cmd_mode_en) /* dsi command mode*/
return 0x39;
@@ -4681,7 +4687,9 @@ static int rkcif_create_dummy_buf(struct rkcif_stream *stream)
pad, enum_frame_interval,
NULL, &fie);
if (!ret) {
if (fie.code == MEDIA_BUS_FMT_RGB888_1X24)
if (fie.code == MEDIA_BUS_FMT_RGB888_1X24 ||
fie.code == MEDIA_BUS_FMT_BGR888_1X24 ||
fie.code == MEDIA_BUS_FMT_GBR888_1X24)
size = fie.width * fie.height * 3;
else
size = fie.width * fie.height * 2;
@@ -4704,7 +4712,9 @@ static int rkcif_create_dummy_buf(struct rkcif_stream *stream)
ret = v4l2_subdev_call(dev->terminal_sensor.sd,
pad, get_fmt, NULL, &fmt);
if (!ret) {
if (fmt.format.code == MEDIA_BUS_FMT_RGB888_1X24)
if (fmt.format.code == MEDIA_BUS_FMT_RGB888_1X24 ||
fmt.format.code == MEDIA_BUS_FMT_BGR888_1X24 ||
fmt.format.code == MEDIA_BUS_FMT_GBR888_1X24)
size = fmt.format.width * fmt.format.height * 3;
else
size = fmt.format.width * fmt.format.height * 2;

View File

@@ -740,6 +740,16 @@ run_next:
writel(val, hw->base_addr + ISP3X_DRC_EXPLRATIO);
if (hw->unite == ISP_UNITE_TWO)
writel(val, hw->base_next_addr + ISP3X_DRC_EXPLRATIO);
val = rkisp_read_reg_cache(dev, ISP3X_YNR_GLOBAL_CTRL);
writel(val, hw->base_addr + ISP3X_YNR_GLOBAL_CTRL);
if (hw->unite == ISP_UNITE_TWO)
writel(val, hw->base_next_addr + ISP3X_YNR_GLOBAL_CTRL);
if (dev->isp_ver == ISP_V21 || dev->isp_ver == ISP_V30) {
val = rkisp_read_reg_cache(dev, ISP3X_CNR_CTRL);
writel(val, hw->base_addr + ISP3X_CNR_CTRL);
if (hw->unite == ISP_UNITE_TWO)
writel(val, hw->base_next_addr + ISP3X_CNR_CTRL);
}
} else {
/* the frame first running to off mi to save bandwidth */
rkisp_multi_overflow_hdl(dev, false);

View File

@@ -1003,7 +1003,7 @@ static int rockchip_i2s_init_dai(struct rk_i2s_dev *i2s, struct resource *res,
i2s->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
i2s->playback_dma_data.maxburst = 8;
if (!of_property_read_u32(node, "rockchip,playback-channels", &val)) {
if (!device_property_read_u32(i2s->dev, "rockchip,playback-channels", &val)) {
if (val >= 2 && val <= 8)
dai->playback.channels_max = val;
}
@@ -1025,14 +1025,14 @@ static int rockchip_i2s_init_dai(struct rk_i2s_dev *i2s, struct resource *res,
i2s->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
i2s->capture_dma_data.maxburst = 8;
if (!of_property_read_u32(node, "rockchip,capture-channels", &val)) {
if (!device_property_read_u32(i2s->dev, "rockchip,capture-channels", &val)) {
if (val >= 2 && val <= 8)
dai->capture.channels_max = val;
}
}
i2s->clk_trcm = I2S_CKR_TRCM_TXRX;
if (!of_property_read_u32(node, "rockchip,clk-trcm", &val)) {
if (!device_property_read_u32(i2s->dev, "rockchip,clk-trcm", &val)) {
if (val >= 0 && val <= 2) {
i2s->clk_trcm = val << I2S_CKR_TRCM_SHIFT;
if (i2s->clk_trcm)
@@ -1147,7 +1147,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, i2s);
i2s->mclk_calibrate =
of_property_read_bool(node, "rockchip,mclk-calibrate");
device_property_read_bool(&pdev->dev, "rockchip,mclk-calibrate");
if (i2s->mclk_calibrate) {
i2s->mclk_root = devm_clk_get(&pdev->dev, "i2s_clk_root");
if (IS_ERR(i2s->mclk_root))
@@ -1216,7 +1216,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
goto err_suspend;
}
if (of_property_read_bool(node, "rockchip,no-dmaengine")) {
if (device_property_read_bool(&pdev->dev, "rockchip,no-dmaengine")) {
dev_info(&pdev->dev, "Used for Multi-DAI\n");
return 0;
}