drivers: mipi_dsi: dsi_mcux: make DPI mode optional
Only setup DPI input from LCDIF if MODE_VIDEO is set, as this is the the only case where input from the LCDIF would be required to drive the display. Do not populate the dpi_config structure unless a reference the the NXP LCDIF device is provided, since this is the output device providing DPI data. Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit is contained in:
parent
21469a30d2
commit
d1ef34440e
|
@ -198,10 +198,20 @@ static int dsi_mcux_attach(const struct device *dev,
|
|||
|
||||
mipi_dsi_dphy_bit_clk_hz = DSI_InitDphy((MIPI_DSI_Type *)&config->base,
|
||||
&dphy_config, mipi_dsi_dphy_ref_clk_hz);
|
||||
|
||||
LOG_DBG("DPHY clock set to %u", mipi_dsi_dphy_bit_clk_hz);
|
||||
/*
|
||||
* If nxp,lcdif node is present, then the MIPI DSI driver will
|
||||
* accept input on the DPI port from the LCDIF, and convert the output
|
||||
* to DSI data. This is useful for video mode, where the LCDIF can
|
||||
* constantly refresh the MIPI panel.
|
||||
*/
|
||||
if (mdev->mode_flags & MIPI_DSI_MODE_VIDEO) {
|
||||
/* Init DPI interface. */
|
||||
DSI_SetDpiConfig((MIPI_DSI_Type *)&config->base, &config->dpi_config, mdev->data_lanes,
|
||||
DSI_SetDpiConfig((MIPI_DSI_Type *)&config->base,
|
||||
&config->dpi_config, mdev->data_lanes,
|
||||
mipi_dsi_dpi_clk_hz, mipi_dsi_dphy_bit_clk_hz);
|
||||
}
|
||||
|
||||
imxrt_post_init_display_interface();
|
||||
|
||||
|
@ -288,16 +298,9 @@ static int display_mcux_mipi_dsi_init(const struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#define MCUX_MIPI_DSI_DEVICE(id) \
|
||||
static const struct display_mcux_mipi_dsi_config display_mcux_mipi_dsi_config_##id = { \
|
||||
.base = { \
|
||||
.host = (DSI_HOST_Type *)DT_INST_REG_ADDR_BY_IDX(id, 0), \
|
||||
.dpi = (DSI_HOST_DPI_INTFC_Type *)DT_INST_REG_ADDR_BY_IDX(id, 1), \
|
||||
.apb = (DSI_HOST_APB_PKT_IF_Type *)DT_INST_REG_ADDR_BY_IDX(id, 2), \
|
||||
.dphy = (DSI_HOST_NXP_FDSOI28_DPHY_INTFC_Type *) \
|
||||
DT_INST_REG_ADDR_BY_IDX(id, 3), \
|
||||
}, \
|
||||
.dpi_config = { \
|
||||
#define MCUX_DSI_DPI_CONFIG(id) \
|
||||
IF_ENABLED(DT_NODE_HAS_PROP(DT_DRV_INST(id), nxp_lcdif), \
|
||||
(.dpi_config = { \
|
||||
.dpiColorCoding = DT_INST_ENUM_IDX(id, dpi_color_coding), \
|
||||
.pixelPacket = DT_INST_ENUM_IDX(id, dpi_pixel_packet), \
|
||||
.videoMode = DT_INST_ENUM_IDX(id, dpi_video_mode), \
|
||||
|
@ -320,7 +323,18 @@ static int display_mcux_mipi_dsi_init(const struct device *dev)
|
|||
display_timings), vfront_porch), \
|
||||
.vbp = DT_PROP(DT_CHILD(DT_INST_PHANDLE(id, nxp_lcdif), \
|
||||
display_timings), vback_porch), \
|
||||
},))
|
||||
|
||||
#define MCUX_MIPI_DSI_DEVICE(id) \
|
||||
static const struct display_mcux_mipi_dsi_config display_mcux_mipi_dsi_config_##id = { \
|
||||
.base = { \
|
||||
.host = (DSI_HOST_Type *)DT_INST_REG_ADDR_BY_IDX(id, 0), \
|
||||
.dpi = (DSI_HOST_DPI_INTFC_Type *)DT_INST_REG_ADDR_BY_IDX(id, 1), \
|
||||
.apb = (DSI_HOST_APB_PKT_IF_Type *)DT_INST_REG_ADDR_BY_IDX(id, 2), \
|
||||
.dphy = (DSI_HOST_NXP_FDSOI28_DPHY_INTFC_Type *) \
|
||||
DT_INST_REG_ADDR_BY_IDX(id, 3), \
|
||||
}, \
|
||||
MCUX_DSI_DPI_CONFIG(id) \
|
||||
.auto_insert_eotp = DT_INST_PROP(id, autoinsert_eotp), \
|
||||
.phy_clock = DT_INST_PROP(id, phy_clock), \
|
||||
}; \
|
||||
|
|
|
@ -15,9 +15,9 @@ properties:
|
|||
|
||||
nxp,lcdif:
|
||||
type: phandle
|
||||
required: true
|
||||
description:
|
||||
Instance of the LCDIF peripheral.
|
||||
Instance of the LCDIF peripheral. Only required when using the MIPI
|
||||
DSI in video mode.
|
||||
|
||||
dpi-color-coding:
|
||||
type: string
|
||||
|
|
Loading…
Reference in a new issue