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: 9238637 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 CC67C6075D for ; Wed, 20 Jul 2016 01:14:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD60426253 for ; Wed, 20 Jul 2016 01:14:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1EB526A4D; Wed, 20 Jul 2016 01:14:40 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 478462624C for ; Wed, 20 Jul 2016 01:14:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753382AbcGTBOA (ORCPT ); Tue, 19 Jul 2016 21:14:00 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:33393 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753200AbcGTBL1 (ORCPT ); Tue, 19 Jul 2016 21:11:27 -0400 Received: by mail-pa0-f65.google.com with SMTP id q2so2246192pap.0; Tue, 19 Jul 2016 18:11:27 -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=D5jN8+Omow3n8mp8G8t/+H/kkjH5mvbZ0e39U32N9oS5KXak6/dLI/xafQnL6UE5ud mzx5NtscbfGmvSdxS0b56ocDXkJJun3xBeE2Yg0rBQ8znT+UvjoRGJYX6IxgbQtHGgXm gmj/+ZHsGQsmWQtpKWKUBaCNCJ1mkrPF42a0JdKJJQ7Jb9wTjHZBC8/RbwOZ5oycgD5/ yKv6E/EBB2tiqcgIhFM7rThQbdnPemngWEUDdNWNlHG4T2LXF7s4iWtcLG5KJRdtqadk xXU9n3zpcZZK1dmvy0DlP7cwByhFuWNQznGFQOcqhG9BJ3VmA0liF8wEfV79coMm7p+7 7ULg== X-Gm-Message-State: ALyK8tIs1Ne8n4QIZnvMn0LZfIDBCV/3ty0uleNGrkQ0Q3fZexfiCN/z2sijKk3+N1cA+Q== 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 Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Steve Longerbeam 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> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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); /*