diff mbox

[17/72] gpu: ipu-v3: Add ipu_di_uninit_sync_panel()

Message ID 1414796095-10107-18-git-send-email-steve_longerbeam@mentor.com (mailing list archive)
State New, archived
Headers show

Commit Message

Steve Longerbeam Oct. 31, 2014, 10:54 p.m. UTC
Adds ipu_di_uninit_sync_panel() which tears down ipu_di_init_sync_panel().

Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
---
 drivers/gpu/ipu-v3/ipu-di.c |   18 ++++++++++++++++++
 include/video/imx-ipu-v3.h  |    1 +
 2 files changed, 19 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/ipu-v3/ipu-di.c b/drivers/gpu/ipu-v3/ipu-di.c
index 35ee345..9841419 100644
--- a/drivers/gpu/ipu-v3/ipu-di.c
+++ b/drivers/gpu/ipu-v3/ipu-di.c
@@ -639,6 +639,24 @@  int ipu_di_init_sync_panel(struct ipu_di *di, struct ipu_di_signal_cfg *sig)
 }
 EXPORT_SYMBOL_GPL(ipu_di_init_sync_panel);
 
+void ipu_di_uninit_sync_panel(struct ipu_di *di)
+{
+	u32 reg, di_gen;
+
+	mutex_lock(&di_mutex);
+
+	di_gen = ipu_di_read(di, DI_GENERAL);
+	di_gen |= 0x3ff | DI_GEN_POLARITY_DISP_CLK;
+	ipu_di_write(di, di_gen, DI_GENERAL);
+
+	reg = ipu_di_read(di, DI_POL);
+	reg |= 0x3ffffff;
+	ipu_di_write(di, reg, DI_POL);
+
+	mutex_unlock(&di_mutex);
+}
+EXPORT_SYMBOL(ipu_di_uninit_sync_panel);
+
 int ipu_di_enable(struct ipu_di *di)
 {
 	int ret;
diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h
index 1665a17..01ab5e0 100644
--- a/include/video/imx-ipu-v3.h
+++ b/include/video/imx-ipu-v3.h
@@ -260,6 +260,7 @@  int ipu_di_disable(struct ipu_di *);
 int ipu_di_enable(struct ipu_di *);
 int ipu_di_get_num(struct ipu_di *);
 int ipu_di_init_sync_panel(struct ipu_di *, struct ipu_di_signal_cfg *sig);
+void ipu_di_uninit_sync_panel(struct ipu_di *di);
 
 /*
  * IPU Display Multi FIFO Controller (dmfc) functions