[PATCH 61/72] imx-drm: hdmi: Save ipu/di mux for later iomux setup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Store the ipu/di mux in struct imx_hdmi during imx_hdmi_encoder_prepare().
imx_hdmi_encoder_commit() can then use the mux when setting the iomux
instead of looking it up again via imx_drm_encoder_get_mux_id().

Signed-off-by: Steve Longerbeam <steve_longerbeam@xxxxxxxxxx>
---
 drivers/staging/imx-drm/imx-hdmi.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/imx-drm/imx-hdmi.c b/drivers/staging/imx-drm/imx-hdmi.c
index d97fa18..2503237 100644
--- a/drivers/staging/imx-drm/imx-hdmi.c
+++ b/drivers/staging/imx-drm/imx-hdmi.c
@@ -124,6 +124,7 @@ struct imx_hdmi {
 	struct hdmi_data_info hdmi_data;
 	int vic;
 	int irq;
+	int mux;
 
 	u8 edid[HDMI_EDID_LEN];
 	bool cable_plugin;
@@ -1454,12 +1455,13 @@ static void imx_hdmi_encoder_dpms(struct drm_encoder *encoder, int mode)
 static void imx_hdmi_encoder_prepare(struct drm_encoder *encoder)
 {
 	struct imx_hdmi *hdmi = container_of(encoder, struct imx_hdmi, encoder);
-	int mux = imx_drm_encoder_get_mux_id(hdmi->dev->of_node, encoder);
+
+	hdmi->mux = imx_drm_encoder_get_mux_id(hdmi->dev->of_node, encoder);
 
 	imx_hdmi_poweroff(hdmi);
 
 	/* set DI clock mux to DI pre clock mux */
-	clk_set_parent(hdmi->di_sel[mux], hdmi->di_pre_sel[mux]);
+	clk_set_parent(hdmi->di_sel[hdmi->mux], hdmi->di_pre_sel[hdmi->mux]);
 
 	imx_drm_panel_format(encoder, V4L2_PIX_FMT_RGB24, NULL);
 }
@@ -1467,9 +1469,8 @@ static void imx_hdmi_encoder_prepare(struct drm_encoder *encoder)
 static void imx_hdmi_encoder_commit(struct drm_encoder *encoder)
 {
 	struct imx_hdmi *hdmi = container_of(encoder, struct imx_hdmi, encoder);
-	int mux = imx_drm_encoder_get_mux_id(hdmi->dev->of_node, encoder);
 
-	imx_hdmi_set_ipu_di_mux(hdmi, mux);
+	imx_hdmi_set_ipu_di_mux(hdmi, hdmi->mux);
 
 	imx_hdmi_poweron(hdmi);
 }
-- 
1.7.9.5

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux