From patchwork Wed Jul 6 23:06:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9217325 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 56A90607D9 for ; Wed, 6 Jul 2016 23:07:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47AF328522 for ; Wed, 6 Jul 2016 23:07:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3CA8B28524; Wed, 6 Jul 2016 23:07:52 +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=ham 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 DE31028522 for ; Wed, 6 Jul 2016 23:07:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932667AbcGFXHt (ORCPT ); Wed, 6 Jul 2016 19:07:49 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:35919 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932486AbcGFXH2 (ORCPT ); Wed, 6 Jul 2016 19:07:28 -0400 Received: by mail-pf0-f195.google.com with SMTP id i123so95188pfg.3 for ; Wed, 06 Jul 2016 16:07:28 -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=/DD0ChJ0HNHAWf0YyePG3MPoqJU4Qe79YnrqbkQsGJE=; b=Egdg90pNVn418A9yoCrrzjprH2yxKaaXhwhRko7Q6LcsoZzC+I3bYOyYqgsy7zNrRa fTZzTPaS7fxrKqJF9yBUymin2i3maaPDuJdNscJzDH1PtWk3/snvBhhTkAewO7KbhULk w1wj9pg3TtXjTT7JoQeclu1e8A/VUnx0nsgwsZ/QBEfP1yRXfexfNpZV2C8HWsZ9dVGr 2KQQEyMLW1Fbrx7wYxHl7NhJYANxjWt1daDF4EXHlPDYRyKzpzE702fkfi35M5EtGrZp Kl8qooFJWL2UC6TEBUhJuoyefN78yEN4RmNOQX+txOKOlFQynpy2HXwbqq+W7vhck+p7 Ip3A== 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=/DD0ChJ0HNHAWf0YyePG3MPoqJU4Qe79YnrqbkQsGJE=; b=U7A/zDuO/ArOVHZ9HeWV9dTUeBW3rf5uJ0Bv7DIiBHPXNKLdpz7YxaZZbEx3KZ80+8 aMxhsNpiUsGTtIwWt6LYbwlQoEWQibY3a+TEibmyB6gAUSJtgs0LoBGwV3w5UQJhKcO3 F8jzbtKRl6kPCNq+7lcFm/1rpIIz5WtyKVgHFykJ9NcELmiQJ9iAEYBDMPy29i1ZuD8j V4NdaJ0UFikz4xtnz3p9FkQXxzNywSrVutL4FzRlWYKeg3XdxOOuKbd8ZFoW6mCVHqwi lO9Jmv3Cve13WP3ztMkLst3knWp7xF9YqEszaqT+sPhXA2Mslpom08J081aIxIqCmkS9 +YwQ== X-Gm-Message-State: ALyK8tIpSLCWDG23SQxUTkSPjhiWfrM9OlOr22WMqQpEvJn1jVeRh11aByEAZW2DNcj/hA== X-Received: by 10.98.70.144 with SMTP id o16mr46895092pfi.126.1467846447858; Wed, 06 Jul 2016 16:07:27 -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 c189sm6724125pfg.19.2016.07.06.16.07.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Jul 2016 16:07:27 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: linux-media@vger.kernel.org Cc: Steve Longerbeam Subject: [PATCH 06/28] gpu: ipu-v3: Add ipu_set_vdi_src_mux() Date: Wed, 6 Jul 2016 16:06:36 -0700 Message-Id: <1467846418-12913-7-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467846418-12913-1-git-send-email-steve_longerbeam@mentor.com> References: <1465944574-15745-1-git-send-email-steve_longerbeam@mentor.com> <1467846418-12913-1-git-send-email-steve_longerbeam@mentor.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 --- 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); /*