From patchwork Tue Jun 14 22:49:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9177145 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 6B24F6021C for ; Tue, 14 Jun 2016 22:53:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BFB128307 for ; Tue, 14 Jun 2016 22:53:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50DA12833E; Tue, 14 Jun 2016 22:53:21 +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 05B7428307 for ; Tue, 14 Jun 2016 22:53:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752977AbcFNWvN (ORCPT ); Tue, 14 Jun 2016 18:51:13 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35583 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752404AbcFNWvJ (ORCPT ); Tue, 14 Jun 2016 18:51:09 -0400 Received: by mail-pf0-f196.google.com with SMTP id t190so301570pfb.2 for ; Tue, 14 Jun 2016 15:51:08 -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=Etu80GHkbp+vkiHRtzhH7atgXd7nSf5zOmFOQFhbae+dspRD1j1qJTeGv7FFacOIK8 cKlB+UurjM50ZZmCZfzwieYjVpm36E2APz+q/x9aNmo97gHTlcNdngfKrBbcDHGS1pCU 7NpkQcII/YM7b1zH3uLCXS98hQ0XslRuSIAuIlCeLuWV0tRTmXs8RB9yVt8szDhwvaA4 SpkY5s3V5uUpFzW3i5fuYfcKWQNqRkUBXouZ8oEHBUuMINaeGMugsDeHqPKXoMmthdJ2 YFt0Qs2+7gI8MDdOoJVJ3y+6ycgQ4EXDe+Pr2G1JGCx8kMsEGXI7t8tu6lOPk+ih0mRG 0U4w== 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=IHPWPSaIguMmW5cp0fLIdN9L7cgf0pnQHQu3XqR6rG5OOEtmXJkYwxvAdDFheidwh6 5Bi5dMo602ZOetgizsDWlSATxCAQR70DhW1TcdTpJAeX2ukajywG69ClJS6gPDWzcD5n UU/W05+QpUHIwNcldw/qKYiGelnrHhBr/6NOR1FuweknCaBbPGIxV7MSeOOFO9J8vu1b i5el9AofRcop7qDqQh23NPfSKR9mqiTP/4RcoeH4mlChtrinDCD6VNscMeq0I6pkq+SB 1AfcnOs+xVnYELTdO8Obfu5iV2yIA9nAU0FgHfxcireKfWbDwGPR0iBDH6kYzwQgjKEC wpHQ== X-Gm-Message-State: ALyK8tI2043WiTAWYl4AH5YTwWJwztVPZFZvlVAURCQ/yAnsQ8/unJZBTRru+JYGp3tNGQ== X-Received: by 10.66.25.231 with SMTP id f7mr37620pag.65.1465944668535; Tue, 14 Jun 2016 15:51:08 -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 v184sm47829999pfb.24.2016.06.14.15.51.07 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 14 Jun 2016 15:51:08 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: linux-media@vger.kernel.org Cc: Steve Longerbeam Subject: [PATCH 06/38] gpu: ipu-v3: Add ipu_set_vdi_src_mux() Date: Tue, 14 Jun 2016 15:49:02 -0700 Message-Id: <1465944574-15745-7-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465944574-15745-1-git-send-email-steve_longerbeam@mentor.com> References: <1465944574-15745-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); /*