drivers: mipi_dsi: add support for mipi_dsi_detach to dsi_mcux_2l
Add support for mipi_dsi_detach API to dsi_mcux_2l driver, and update RT5xx SOC interface to enable halting clocks for the MIPI DPHY. Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit is contained in:
parent
4cc12cb112
commit
5854821b65
|
@ -227,6 +227,8 @@ static int dsi_mcux_attach(const struct device *dev,
|
|||
dsi_config.autoInsertEoTp = config->auto_insert_eotp;
|
||||
dsi_config.enableNonContinuousHsClk = config->noncontinuous_hs_clk;
|
||||
|
||||
imxrt_pre_init_display_interface();
|
||||
|
||||
/* Init the DSI module. */
|
||||
DSI_Init(config->base, &dsi_config);
|
||||
|
||||
|
@ -344,6 +346,24 @@ static int dsi_mcux_attach(const struct device *dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int dsi_mcux_detach(const struct device *dev, uint8_t channel,
|
||||
const struct mipi_dsi_device *mdev)
|
||||
{
|
||||
const struct mcux_mipi_dsi_config *config = dev->config;
|
||||
|
||||
/* Enable DPHY auto power down */
|
||||
DSI_DeinitDphy(config->base);
|
||||
/* Fully power off DPHY */
|
||||
config->base->PD_DPHY = 0x1;
|
||||
/* Deinit MIPI */
|
||||
DSI_Deinit(config->base);
|
||||
/* Call IMX RT clock function to gate clocks and power at SOC level */
|
||||
imxrt_deinit_display_interface();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static ssize_t dsi_mcux_transfer(const struct device *dev, uint8_t channel,
|
||||
struct mipi_dsi_msg *msg)
|
||||
{
|
||||
|
@ -434,6 +454,7 @@ static ssize_t dsi_mcux_transfer(const struct device *dev, uint8_t channel,
|
|||
|
||||
static struct mipi_dsi_driver_api dsi_mcux_api = {
|
||||
.attach = dsi_mcux_attach,
|
||||
.detach = dsi_mcux_detach,
|
||||
.transfer = dsi_mcux_transfer,
|
||||
};
|
||||
|
||||
|
@ -449,8 +470,6 @@ static int mcux_mipi_dsi_init(const struct device *dev)
|
|||
|
||||
k_sem_init(&data->transfer_sem, 0, 1);
|
||||
|
||||
imxrt_pre_init_display_interface();
|
||||
|
||||
if (!device_is_ready(config->bit_clk_dev) ||
|
||||
!device_is_ready(config->esc_clk_dev) ||
|
||||
!device_is_ready(config->pixel_clk_dev)) {
|
||||
|
|
|
@ -473,6 +473,17 @@ void __weak imxrt_post_init_display_interface(void)
|
|||
/* Deassert MIPI DPHY reset. */
|
||||
RESET_ClearPeripheralReset(kMIPI_DSI_PHY_RST_SHIFT_RSTn);
|
||||
}
|
||||
|
||||
void __weak imxrt_deinit_display_interface(void)
|
||||
{
|
||||
/* Assert MIPI DPHY and DSI reset */
|
||||
RESET_SetPeripheralReset(kMIPI_DSI_PHY_RST_SHIFT_RSTn);
|
||||
RESET_SetPeripheralReset(kMIPI_DSI_CTRL_RST_SHIFT_RSTn);
|
||||
/* Remove clock from DPHY */
|
||||
CLOCK_AttachClk(kNONE_to_MIPI_DPHY_CLK);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
|
|
@ -80,6 +80,8 @@
|
|||
void imxrt_pre_init_display_interface(void);
|
||||
|
||||
void imxrt_post_init_display_interface(void);
|
||||
|
||||
void imxrt_deinit_display_interface(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue