@@ -131,6 +131,19 @@ static bool imx_ldb_encoder_mode_fixup(struct drm_encoder *encoder,
return true;
}
+static int imx_ldb_get_mux_id(struct imx_ldb_channel *channel)
+{
+ /*
+ * If there is no mux in between the mapping from lvds channel number
+ * to display interface number is 1:1
+ */
+ if (channel->ldb->lvds_mux)
+ return imx_drm_encoder_get_mux_id(channel->child,
+ &channel->encoder);
+ else
+ return channel->chno;
+}
+
static void imx_ldb_set_clock(struct imx_ldb *ldb, int mux, int chno,
unsigned long serial_clk, unsigned long di_clk)
{
@@ -195,7 +208,7 @@ static void imx_ldb_encoder_commit(struct drm_encoder *encoder)
struct imx_ldb_channel *imx_ldb_ch = enc_to_imx_ldb_ch(encoder);
struct imx_ldb *ldb = imx_ldb_ch->ldb;
int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN;
- int mux = imx_drm_encoder_get_mux_id(imx_ldb_ch->child, encoder);
+ int mux = imx_ldb_get_mux_id(imx_ldb_ch);
if (dual) {
clk_prepare_enable(ldb->clk[0]);
@@ -241,7 +254,7 @@ static void imx_ldb_encoder_mode_set(struct drm_encoder *encoder,
int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN;
unsigned long serial_clk;
unsigned long di_clk = mode->clock * 1000;
- int mux = imx_drm_encoder_get_mux_id(imx_ldb_ch->child, encoder);
+ int mux = imx_ldb_get_mux_id(imx_ldb_ch);
if (mode->clock > 170000) {
dev_warn(ldb->dev,