ODROID-COMMON: drm/panel: ilitek-ili9881c: add to set dsi format from device tree

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: Iec012fe3a1bf8ff79a0fda62a02c0753e972e33e
This commit is contained in:
Dongjin Kim
2021-06-15 07:54:03 +00:00
parent 9f0173adbd
commit 7cf0beff43

View File

@@ -867,6 +867,7 @@ static const struct drm_panel_funcs ili9881c_funcs = {
static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
{
struct ili9881c *ctx;
u32 val;
int ret;
ctx = devm_kzalloc(&dsi->dev, sizeof(*ctx), GFP_KERNEL);
@@ -897,9 +898,14 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi)
drm_panel_add(&ctx->panel);
dsi->mode_flags = MIPI_DSI_MODE_VIDEO_SYNC_PULSE;
dsi->format = MIPI_DSI_FMT_RGB888;
dsi->lanes = 4;
ret = of_property_read_u32(dsi->dev.of_node, "dsi,flags", &val);
dsi->mode_flags = ret ? MIPI_DSI_MODE_VIDEO_SYNC_PULSE : val;
ret = of_property_read_u32(dsi->dev.of_node, "dsi,format", &val);
dsi->format = ret ? MIPI_DSI_FMT_RGB888 : val;
ret = of_property_read_u32(dsi->dev.of_node, "dsi,lanes", &val);
dsi->lanes = ret ? 4 : val;
return mipi_dsi_attach(dsi);
}