From patchwork Wed Jul 20 01:11: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: 9239017 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 A42E0600CB for ; Wed, 20 Jul 2016 07:51:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 964C3275A2 for ; Wed, 20 Jul 2016 07:51:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8ADE62787C; Wed, 20 Jul 2016 07:51:41 +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 4A4EF275A2 for ; Wed, 20 Jul 2016 07:51:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4F4626E78B; Wed, 20 Jul 2016 07:51:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-x244.google.com (mail-pa0-x244.google.com [IPv6:2607:f8b0:400e:c03::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9327A6E3A9 for ; Wed, 20 Jul 2016 01:11:26 +0000 (UTC) Received: by mail-pa0-x244.google.com with SMTP id hh10so2261046pac.1 for ; Tue, 19 Jul 2016 18:11:26 -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=0ra3mOA9lVnaj3eLS4j+NP7CAQCvMuEMga8ogC7J75o=; b=S11XRCPYxqg5/zXZPyMwN+3gV8xiCLV/Fg2p76IbMHqW81CjsjQVfQkzMGsHtm7rMV Tq7D7LfKfwoRWnXqJdo0lECfUyCDH1Q/BYkIPOpNcTjeBcGM2laH9k/dI+0vG0QIU2wQ EpRkvAzZtlPo97oTsAL763BBfZHMm1WHb0LE7qr98wNcnZ5L2AZq2tlG8zbgUGdU6Lrm dFMpwB5oqu1SaQ6zY6+W9Nn89NWKAwGjrJiXQwtEwqv8luGsEB8ZGciUxuR/aZ53QPF/ i1sFx80xsjK9eMA5/rtl/GTopVgYAvIqMP38DNc5Wp42vAzXsxdOugahZ/Tyn9HdxZXN yg2g== 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=0ra3mOA9lVnaj3eLS4j+NP7CAQCvMuEMga8ogC7J75o=; b=UQFk8SI1dFrjiisoeUsZvjG4fJczh1Jj4H1BIVkro8tPbzJeTSFRXk28rqF86QBW8h UZhn3gbmCl+v/onw/cObIVqH1YOA1ew25VJt/C8aCKXYtNAEVRSMD4uoIEPghnMQwG8I g6eSeAGwwjU2B5DP97ITdGNIKZP4zncE+y0ao3fj4KDH4t1Ul5aIJMRtfDJumzaQ5GpY 2eGBdhx4zrusbqfwNR2jO0+HjPdqHfDbwicC8vDq+0m7l1gseWfX8/AFQC6uB1PeKNg9 6h1IHkrHlPUsG616ikVQYcjj71h2My6tOu5sxveIXU4QCI4Ob0rOqvkaxHJC5kSprsiP DqPw== X-Gm-Message-State: ALyK8tL+gubbSPvMcDMhmzYfbXi9NJnp8J5LXw7zrrpb5lmj6hZ1AHAnpdOw7h6LNBooYQ== X-Received: by 10.66.74.103 with SMTP id s7mr5013475pav.1.1468977084791; Tue, 19 Jul 2016 18:11:24 -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.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jul 2016 18:11:24 -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 04/13] gpu: ipu-v3: Add ipu_get_num() Date: Tue, 19 Jul 2016 18:11:02 -0700 Message-Id: <1468977071-29240-5-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 of-alias id to ipu_soc and retrieve with ipu_get_num(). Signed-off-by: Steve Longerbeam --- drivers/gpu/ipu-v3/ipu-common.c | 8 ++++++++ drivers/gpu/ipu-v3/ipu-prv.h | 1 + include/video/imx-ipu-v3.h | 1 + 3 files changed, 10 insertions(+) diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c index 30dc115..49af121 100644 --- a/drivers/gpu/ipu-v3/ipu-common.c +++ b/drivers/gpu/ipu-v3/ipu-common.c @@ -45,6 +45,12 @@ static inline void ipu_cm_write(struct ipu_soc *ipu, u32 value, unsigned offset) writel(value, ipu->cm_reg + offset); } +int ipu_get_num(struct ipu_soc *ipu) +{ + return ipu->id; +} +EXPORT_SYMBOL_GPL(ipu_get_num); + void ipu_srm_dp_sync_update(struct ipu_soc *ipu) { u32 val; @@ -1220,6 +1226,7 @@ static int ipu_probe(struct platform_device *pdev) { const struct of_device_id *of_id = of_match_device(imx_ipu_dt_ids, &pdev->dev); + struct device_node *np = pdev->dev.of_node; struct ipu_soc *ipu; struct resource *res; unsigned long ipu_base; @@ -1248,6 +1255,7 @@ static int ipu_probe(struct platform_device *pdev) ipu->channel[i].ipu = ipu; ipu->devtype = devtype; ipu->ipu_type = devtype->type; + ipu->id = of_alias_get_id(np, "ipu"); spin_lock_init(&ipu->lock); mutex_init(&ipu->channel_lock); diff --git a/drivers/gpu/ipu-v3/ipu-prv.h b/drivers/gpu/ipu-v3/ipu-prv.h index 845f64c..02057d8 100644 --- a/drivers/gpu/ipu-v3/ipu-prv.h +++ b/drivers/gpu/ipu-v3/ipu-prv.h @@ -153,6 +153,7 @@ struct ipu_soc { void __iomem *cm_reg; void __iomem *idmac_reg; + int id; int usecount; struct clk *clk; diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h index 5d59739..8a6ccaa 100644 --- a/include/video/imx-ipu-v3.h +++ b/include/video/imx-ipu-v3.h @@ -148,6 +148,7 @@ int ipu_idmac_channel_irq(struct ipu_soc *ipu, struct ipuv3_channel *channel, /* * IPU Common functions */ +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_dump(struct ipu_soc *ipu);