diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c index 9384b33af28d5d65acc54ad3a5a51acfd726b11a..58b7319c97c899a0193e2b288ef627eaccf4033a 100644 --- a/drivers/gpu/drm/imx/imx-ldb.c +++ b/drivers/gpu/drm/imx/imx-ldb.c @@ -510,17 +510,26 @@ static void imx_ldb_encoder_enable(struct drm_encoder *encoder) if (imx_ldb_ch == &ldb->channel[0] || dual) { ldb->ldb_ctrl &= ~LDB_CH0_MODE_EN_MASK; - if (mux == 0 || ldb->lvds_mux) + if (ldb->has_mux) { + if (mux == 0 || ldb->lvds_mux) + ldb->ldb_ctrl |= LDB_CH0_MODE_EN_TO_DI0; + else if (mux == 1) + ldb->ldb_ctrl |= LDB_CH0_MODE_EN_TO_DI1; + } else { ldb->ldb_ctrl |= LDB_CH0_MODE_EN_TO_DI0; - else if (mux == 1) - ldb->ldb_ctrl |= LDB_CH0_MODE_EN_TO_DI1; + } } if (imx_ldb_ch == &ldb->channel[1] || dual) { ldb->ldb_ctrl &= ~LDB_CH1_MODE_EN_MASK; - if (mux == 1 || ldb->lvds_mux) - ldb->ldb_ctrl |= LDB_CH1_MODE_EN_TO_DI1; - else if (mux == 0) - ldb->ldb_ctrl |= LDB_CH1_MODE_EN_TO_DI0; + if (ldb->has_mux) { + if (mux == 1 || ldb->lvds_mux) + ldb->ldb_ctrl |= LDB_CH1_MODE_EN_TO_DI1; + else if (mux == 0) + ldb->ldb_ctrl |= LDB_CH1_MODE_EN_TO_DI0; + } else { + ldb->ldb_ctrl |= dual ? + LDB_CH1_MODE_EN_TO_DI0 : LDB_CH1_MODE_EN_TO_DI1; + } } if (ldb->lvds_mux) {