From patchwork Thu Jul 7 23:03:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9220033 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 5766560574 for ; Fri, 8 Jul 2016 05:26:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49E9D2840B for ; Fri, 8 Jul 2016 05:26:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EEA228411; Fri, 8 Jul 2016 05:26:46 +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 02AA92840B for ; Fri, 8 Jul 2016 05:26:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 34F456E87B; Fri, 8 Jul 2016 05:26:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 839896E0CF for ; Thu, 7 Jul 2016 23:04:18 +0000 (UTC) Received: by mail-pf0-x243.google.com with SMTP id 66so2921668pfy.1 for ; Thu, 07 Jul 2016 16:04:18 -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=qtyizvYJefku5i+sKhPrMcc5sckCMJUfWECwzcGT66v/P9NMGf3b+VqTKI5xXha6ry OfDYxU2BFgork3t1jxbNzWkHmt9QWBmoprVyJN1Mgen/yZLXI/zNmGj0b/C3h74w2R0M PnLxYrGjje/q+cTaKYdxm1LEsaznDSlGoJmftlpmDEqfdzZVO0VT4l/RxT0wBQVoNcVD 3vYNzru4qFI3qtslaC36fpWszDPiQTMM46K6Qxp0LpWzzTTo0xKKfcGoRTJs8cPORDfs Y4d5SxjhR88YoTU7ZSwrWApMzE+fjlXF5aQQHkJkNzBCBjUKtN0IQZGzHXlYRbh8rayh pfWw== 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=hOOMmFudqXVoUkLKiD9+KCLAjs9JK4/99t2OH0gH0PsGiPHe9Qta6vsCa0SEZRvvzz Z/EhZC9nIfuJJMl4sNAv8vEHGAkV9DYSkRtBW0+gX0C3GQl7YXkKKkQ9parVNy7AA1Ag 0OwpysMU01IsVA6kuF8uHxs/2l1D1YF0nDA7rLS5AXi+YDYcVHBSO4K/teyJq3CH6Act 3GOIj+RLF19CX2a/kohq6lUTi9G8O7NUEhdmZ/zuaeOp4QmwyMnB+lVJ/ec9o/T+4/gi DsWXX/bXFWVGdA3DQobAD3TobpqCKCieXoamVS7EJOpYb7imRVlbiMaoNDgnM2L6MJG4 yb5g== X-Gm-Message-State: ALyK8tIzKQfPJyMRT6JafrmKBXYSEfIdbK2FKBWBbQRtU/R7X5n/3uM5Nxa8TOLAjvdpnQ== X-Received: by 10.98.94.135 with SMTP id s129mr4457112pfb.31.1467932657770; Thu, 07 Jul 2016 16:04:17 -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 z29sm6846719pff.0.2016.07.07.16.04.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jul 2016 16:04:17 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: p.zabel@pengutronix.de 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> X-Mailman-Approved-At: Fri, 08 Jul 2016 05:26:19 +0000 Cc: 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 --- 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); /*