diff mbox

[12/72] gpu: ipu-v3: Add ipu_dp_uninit_channel()

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

Commit Message

Steve Longerbeam Oct. 31, 2014, 10:53 p.m. UTC
Adds the function ipu_dp_uninit_channel() which tears down
ipu_dp_setup_channel().

Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Muzaffar Mahmood <muzaffar_mahmood@mentor.com>
---
 drivers/gpu/ipu-v3/ipu-dp.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-dp.c b/drivers/gpu/ipu-v3/ipu-dp.c
index 472acd6..626f738 100644
--- a/drivers/gpu/ipu-v3/ipu-dp.c
+++ b/drivers/gpu/ipu-v3/ipu-dp.c
@@ -302,6 +302,16 @@  static void ipu_dp_csc_init(struct ipu_flow *flow,
 	writel(reg, flow->base + DP_COM_CONF);
 }
 
+static void ipu_dp_csc_disable(struct ipu_flow *flow)
+{
+	writel(0, flow->base + DP_CSC_A_0);
+	writel(0, flow->base + DP_CSC_A_1);
+	writel(0, flow->base + DP_CSC_A_2);
+	writel(0, flow->base + DP_CSC_A_3);
+	writel(0, flow->base + DP_CSC_0);
+	writel(0, flow->base + DP_CSC_1);
+}
+
 int ipu_dp_setup_channel(struct ipu_dp *dp,
 		enum ipu_color_space in,
 		enum ipu_color_space out)
@@ -344,6 +354,14 @@  int ipu_dp_setup_channel(struct ipu_dp *dp,
 }
 EXPORT_SYMBOL_GPL(ipu_dp_setup_channel);
 
+void ipu_dp_uninit_channel(struct ipu_dp *dp)
+{
+	struct ipu_flow *flow = to_flow(dp);
+
+	ipu_dp_csc_disable(flow);
+}
+EXPORT_SYMBOL_GPL(ipu_dp_uninit_channel);
+
 int ipu_dp_enable(struct ipu_soc *ipu)
 {
 	struct ipu_dp_priv *priv = ipu->dp_priv;
diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h
index 36309b9..567ac41 100644
--- a/include/video/imx-ipu-v3.h
+++ b/include/video/imx-ipu-v3.h
@@ -292,6 +292,7 @@  void ipu_dp_disable_channel(struct ipu_dp *dp);
 void ipu_dp_disable(struct ipu_soc *ipu);
 int ipu_dp_setup_channel(struct ipu_dp *dp,
 		enum ipu_color_space in, enum ipu_color_space out);
+void ipu_dp_uninit_channel(struct ipu_dp *dp);
 int ipu_dp_set_window_pos(struct ipu_dp *, u16 x_pos, u16 y_pos);
 int ipu_dp_set_global_alpha(struct ipu_dp *dp, bool enable, u8 alpha,
 		bool bg_chan);