From patchwork Sun Jul 31 19:42:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9253581 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 93DC860865 for ; Mon, 1 Aug 2016 01:29:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8524F28405 for ; Mon, 1 Aug 2016 01:29:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79C6428408; Mon, 1 Aug 2016 01:29:13 +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 07FB128405 for ; Mon, 1 Aug 2016 01:29:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 477806E188; Mon, 1 Aug 2016 01:28:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 99B756E180 for ; Sun, 31 Jul 2016 19:42:45 +0000 (UTC) Received: by mail-pf0-x241.google.com with SMTP id i6so8903967pfe.0 for ; Sun, 31 Jul 2016 12:42:45 -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=hu67zJhO2FHzcMFio/SRLv6d6KvlMFwLk6MVepqNUAU=; b=MigI8nNXnQFFo5OXI9Mtg3yU6JIZwxzl0wdsvW4iEM/iJf3WW0YtNK7wIgeiL07Ev/ GQOyz4gdZ//1cUFIZnUywIHjzbreSxUEUapOUcuQJ92KQUnSKAPSGURYS0SbXx3+jPsx 3zeoC7JgnDTFzRwKa2G/u6T5Oo9+ikwytNi2hUaktEhHmFjwMcQE5U877Ty6p0l9YOzX mrUvn4TPgVNt5Ks+LEqROLD0IE0wS3aPlRGvTErqjkh7phAE856wNBD7IjER39vonCoa Z7sYUmu8J0n215/zIea7BACxBL3mf+IyRKXcsSR+JYkbN0IJca61y4QuwYbPt2GYtV9H TDLg== 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=hu67zJhO2FHzcMFio/SRLv6d6KvlMFwLk6MVepqNUAU=; b=IujPosbCDuZnyZQq8mYuczeS1TK8IINMgVGqETeorlH7/ztsieVlUqtLUO2uwBj3q5 8jLcxkCbUag+0kagioQ7BWWN4GxhjF1HyqqjtnKI2SZ+baCuW5rg+XP+hYQwhI7lI4H0 lw92yuYVUMpEfcVYq7piOjtQnkKZbTAQgN4yqdV9oun6kN/cjwRrnSKDbanayspOLord /83OL+bjtodPDaxVBw1jENOV7biJpIGDzaF2IQZS+aSPdBIF6LdpDxKTzyEIfXUMeXpE d1vECUAvTp0AqSJBccCkhLnorckTwmYRQSRHp9s2YyUAXxBUYuWeIOfELoJ/uF/U+++R iA3A== X-Gm-Message-State: AEkoouurv2leuXCv4K4XROVt8gjJShjXdt7xNSLhHYbs34zImZWpO8dV7wVd0TuE0lceRg== X-Received: by 10.98.81.1 with SMTP id f1mr89101582pfb.35.1469994163564; Sun, 31 Jul 2016 12:42:43 -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 wp4sm39906381pab.15.2016.07.31.12.42.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 31 Jul 2016 12:42:43 -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 v3 03/12] gpu: ipu-v3: Add ipu_get_num() Date: Sun, 31 Jul 2016 12:42:18 -0700 Message-Id: <1469994147-17549-4-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1469994147-17549-1-git-send-email-steve_longerbeam@mentor.com> References: <1469994147-17549-1-git-send-email-steve_longerbeam@mentor.com> X-Mailman-Approved-At: Mon, 01 Aug 2016 01:28:21 +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 --- v3: no changes v2: no changes --- 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 99dcacf..d697cd5 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; @@ -1209,6 +1215,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; @@ -1237,6 +1244,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 bfb1e8a..fd47f8f 100644 --- a/drivers/gpu/ipu-v3/ipu-prv.h +++ b/drivers/gpu/ipu-v3/ipu-prv.h @@ -152,6 +152,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 8c4312d..ef54634 100644 --- a/include/video/imx-ipu-v3.h +++ b/include/video/imx-ipu-v3.h @@ -138,6 +138,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);