From patchwork Wed Jul 20 01:11:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9239033 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6269C600CB for ; Wed, 20 Jul 2016 07:52:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55981275A2 for ; Wed, 20 Jul 2016 07:52:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A62C2793D; Wed, 20 Jul 2016 07:52:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03269275A2 for ; Wed, 20 Jul 2016 07:52:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E72116E795; Wed, 20 Jul 2016 07:51:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-x242.google.com (mail-pa0-x242.google.com [IPv6:2607:f8b0:400e:c03::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 579D16E3A8 for ; Wed, 20 Jul 2016 01:11:29 +0000 (UTC) Received: by mail-pa0-x242.google.com with SMTP id hh10so2261091pac.1 for ; Tue, 19 Jul 2016 18:11:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BaRJSYWtwHWPbL5QduVymMJKQvzPQ8A+yjhPtlNyBfc=; b=NIULPL1OQsOY1efPMHK30xDpq2q7LMNxOdPqH/M0grO1KJ23hN6+jVCocLVHA5nKP4 yZf0q3+AINwScaZWQhylOeZ9bzH7V4KjnMLdrjJuFQqyYeIpbRmUfBDoucv5FyOTesq7 sSS7t2yvfk4iIMv+Eey/UIKT7TwuGAfaYvYnKQNCGyhOPuwasJnmbtzwRjYEFJQXWA17 2Co6MdwFrseum+8cNevGqIiBPb0PFHOjmTLp+dO6HqVCi6lMU/8fjkDiwHdrfKPsuCI0 b7lA/aSU1BMRdgJova4dYH5w4HC4DsaOBERit3kXJshHsO2YJnbgfKi+mple3rlm2uwb nHXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BaRJSYWtwHWPbL5QduVymMJKQvzPQ8A+yjhPtlNyBfc=; b=KB1bG6TeFXAp7zg4bEiqZhQzZdFFeU1Cp+FIPeJ9Uz40KwzM21rq92SEi0pv9rQ8cq wTuYGm4VFJV/4/h5+9baOPpEW/8BthTY/JjzWnSkoo10zj+TvwUzokfJqbitsw7331VX OeOt2tvlaxrK8vbydFUWMJiWK7WjlH35WL2jGIN2m1y33bccd8jdKqQtvW6a2/DJ1z4z xTz2gB48naK6p1HTWeZjVCJREA80FkL2jHYhqUfyPQxKHtEcWfsFFpV+CX1UqLfIV0mQ tdNMlrxlNJ+GlCa/wvK9ecGWYokApLeY89n4ZaSNiys90NVIFxUGv6UZvY4wRcYofrez 3GEw== X-Gm-Message-State: ALyK8tKmhMJ6++UHwORtCFnf4tPWhwDWJ8LbXt2ChA83x69XlkrF7Sk1SvfqMBRQGLwpDw== X-Received: by 10.66.230.195 with SMTP id ta3mr22204239pac.89.1468977086613; Tue, 19 Jul 2016 18:11:26 -0700 (PDT) Received: from mothership.sklembedded.com (c-73-241-2-21.hsd1.ca.comcast.net. [73.241.2.21]) by smtp.googlemail.com with ESMTPSA id d1sm84277pas.48.2016.07.19.18.11.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jul 2016 18:11:26 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: p.zabel@pengutronix.de, plagnioj@jcrosoft.com, tomi.valkeinen@ti.com Subject: [PATCH v2 06/13] gpu: ipu-v3: Add ipu_set_vdi_src_mux() Date: Tue, 19 Jul 2016 18:11:04 -0700 Message-Id: <1468977071-29240-7-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1468977071-29240-1-git-send-email-steve_longerbeam@mentor.com> References: <1467932621-358-1-git-send-email-steve_longerbeam@mentor.com> <1468977071-29240-1-git-send-email-steve_longerbeam@mentor.com> X-Mailman-Approved-At: Wed, 20 Jul 2016 07:51:13 +0000 Cc: linux-fbdev@vger.kernel.org, Steve Longerbeam , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Adds ipu_set_vdi_src_mux() that selects the VDIC input (from CSI or memory). Signed-off-by: Steve Longerbeam --- v2: - added macros for the VDI source select bits in register IPU_FS_PROC_FLOW1. --- drivers/gpu/ipu-v3/ipu-common.c | 20 ++++++++++++++++++++ drivers/gpu/ipu-v3/ipu-prv.h | 6 ++++++ include/video/imx-ipu-v3.h | 1 + 3 files changed, 27 insertions(+) diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c index 1c5aff4..bb0377b 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 &= ~FS_VDI_SRC_SEL_MASK; + if (csi) + val |= FS_VDI_SRC_SEL_CSI_DIRECT; + 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/drivers/gpu/ipu-v3/ipu-prv.h b/drivers/gpu/ipu-v3/ipu-prv.h index 02057d8..74445fb 100644 --- a/drivers/gpu/ipu-v3/ipu-prv.h +++ b/drivers/gpu/ipu-v3/ipu-prv.h @@ -78,6 +78,12 @@ struct ipu_soc; #define IPU_DI0_COUNTER_RELEASE (1 << 24) #define IPU_DI1_COUNTER_RELEASE (1 << 25) +/* IPU_FS_PROC_FLOW1 */ +#define FS_VDI_SRC_SEL_OFFSET 28 +#define FS_VDI_SRC_SEL_MASK (0x3 << 28) +#define FS_VDI_SRC_SEL_CSI_DIRECT (0x1 << 28) +#define FS_VDI_SRC_SEL_VDOA (0x2 << 28) + #define IPU_IDMAC_REG(offset) (offset) #define IDMAC_CONF IPU_IDMAC_REG(0x0000) diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h index b252cb4..74d3059 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); /*