I attempted to connect a MIPI display to the DSI interface exposed on the AM62L and expected it to function properly. However, the driver exits abnormally during probe, and the mipi_dsi_attach
function returns an error code. From the function code, I can see that the error occurs because the ops
(operations) function pointer in the DSI device structure’s host
field is NULL. Could this be due to an issue in my device tree configuration causing the attach operation to fail?&dss {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&main_dpi_pins_default>;
bootph-all;
};
&dss_ports {
port@0 {
reg = <0>;
dpi_out: endpoint {
remote-endpoint = <&panel_in>;
};
};
};
&dphy_tx0 {
status = "okay";
bootph-all;
};
&dsi0 {
status = "okay";
bootph-all;
panel@0 {
compatible = "amelin,aml070wxii4006";
reg = <0>;
vcc-lcd-supply = <&vcc_3v3_sys>;
pinctrl-names = "default";
pinctrl-0 = <&mipi_lcd_rst>;
reset-gpio = <&main_gpio0 50 GPIO_ACTIVE_LOW>;
backlight = <&mipi_dsi_backlight>;
status = "okay";
port {
panel_in: endpoint {
remote-endpoint = <&dpi_out>;
};
};
};
};
And this is the edit part base on k3-am62l3-evm.dts
static int aml070_panel_dsi_probe(struct mipi_dsi_device *dsi)
{
struct aml070_panel *ctx;
int ret;
u32 video_mode;
ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;
ctx->supply = devm_regulator_get(&dsi->dev, "vcc-lcd");
if (IS_ERR(ctx->supply))
return PTR_ERR(ctx->supply);
mipi_dsi_set_drvdata(dsi, ctx);
ctx->dsi = dsi;
drm_panel_init(&ctx->panel, &dsi->dev, &aml070_panel_funcs, DRM_MODE_CONNECTOR_DSI);
ctx->gpios.reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(ctx->gpios.reset)) {
dev_err(&dsi->dev, "Couldn't get our reset GPIO\n");
return PTR_ERR(ctx->gpios.reset);
}
ctx->backlight = devm_of_find_backlight(&dsi->dev);
if (IS_ERR(ctx->backlight)) {
dev_err(&dsi->dev, "Couldn't get our backlight\n");
return PTR_ERR(ctx->backlight);
}
drm_panel_add(&ctx->panel);
dsi->format = MIPI_DSI_FMT_RGB888;
dsi->lanes = 4;
dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | MIPI_DSI_MODE_VIDEO_HSE | MIPI_DSI_MODE_LPM;
ret = of_property_read_u32(dsi->dev.of_node, "video-mode", &video_mode);
if (!ret) {
dsi->mode_flags = video_mode;
}
dev_info(&dsi->dev, "dsi video mode[0x%lx]\n", dsi->mode_flags);
return mipi_dsi_attach(dsi);
}
this is the probe func,
and it just print the error code then exit