From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753969AbcGGXFb (ORCPT ); Thu, 7 Jul 2016 19:05:31 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35180 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753774AbcGGXES (ORCPT ); Thu, 7 Jul 2016 19:04:18 -0400 From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: p.zabel@pengutronix.de Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Steve Longerbeam Subject: [PATCH 06/16] gpu: ipu-v3: Add ipu_set_vdi_src_mux() Date: Thu, 7 Jul 2016 16:03:31 -0700 Message-Id: <1467932621-358-7-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467932621-358-1-git-send-email-steve_longerbeam@mentor.com> References: <1467932621-358-1-git-send-email-steve_longerbeam@mentor.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adds ipu_set_vdi_src_mux() that selects the VDIC input (from CSI or memory). Signed-off-by: Steve Longerbeam --- drivers/gpu/ipu-v3/ipu-common.c | 20 ++++++++++++++++++++ include/video/imx-ipu-v3.h | 1 + 2 files changed, 21 insertions(+) diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c index 6d1676e..374100e 100644 --- a/drivers/gpu/ipu-v3/ipu-common.c +++ b/drivers/gpu/ipu-v3/ipu-common.c @@ -730,6 +730,26 @@ void ipu_set_ic_src_mux(struct ipu_soc *ipu, int csi_id, bool vdi) } EXPORT_SYMBOL_GPL(ipu_set_ic_src_mux); +/* + * Set the source for the VDIC. Selects either from CSI[01] or memory. + */ +void ipu_set_vdi_src_mux(struct ipu_soc *ipu, bool csi) +{ + unsigned long flags; + u32 val; + + spin_lock_irqsave(&ipu->lock, flags); + + val = ipu_cm_read(ipu, IPU_FS_PROC_FLOW1); + val &= ~(0x3 << 28); + if (csi) + val |= (0x01 << 28); + ipu_cm_write(ipu, val, IPU_FS_PROC_FLOW1); + + spin_unlock_irqrestore(&ipu->lock, flags); +} +EXPORT_SYMBOL_GPL(ipu_set_vdi_src_mux); + /* IDMAC Channel Linking */ diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h index 0a39c64..586979e 100644 --- a/include/video/imx-ipu-v3.h +++ b/include/video/imx-ipu-v3.h @@ -152,6 +152,7 @@ int ipu_idmac_channel_irq(struct ipu_soc *ipu, struct ipuv3_channel *channel, int ipu_get_num(struct ipu_soc *ipu); void ipu_set_csi_src_mux(struct ipu_soc *ipu, int csi_id, bool mipi_csi2); void ipu_set_ic_src_mux(struct ipu_soc *ipu, int csi_id, bool vdi); +void ipu_set_vdi_src_mux(struct ipu_soc *ipu, bool csi); void ipu_dump(struct ipu_soc *ipu); /* -- 1.9.1