From patchwork Tue Jun 14 22:49:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9177081 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 6552B6021C for ; Tue, 14 Jun 2016 22:51:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A4A8282F9 for ; Tue, 14 Jun 2016 22:51:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F2822833B; Tue, 14 Jun 2016 22:51:18 +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 CFCFC282F9 for ; Tue, 14 Jun 2016 22:51:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752982AbcFNWvO (ORCPT ); Tue, 14 Jun 2016 18:51:14 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35578 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751529AbcFNWvI (ORCPT ); Tue, 14 Jun 2016 18:51:08 -0400 Received: by mail-pf0-f193.google.com with SMTP id t190so301510pfb.2 for ; Tue, 14 Jun 2016 15:51:07 -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=6POHquoI9CiSwlTGd4ju0VSq4M7yNnECfaMDRfAoBkQ=; b=yyNN+7yXEZ5Ids7W3rL3hbXuSrl4AVV2EChR8zeyqdWCSJnaKKMFxAtOGkYgS+19Zo V34qOUKndcYHzciBB960xjHY8uymugzHGBEXB4DonMS6C6Uwo+s9xHWKdWD89/QWfmnf EQcr8iccBsTJ6HcFwmSl3pQQPJ0DXNTksBH4nPe5MlBVXDAyldL7VP3f+4TC1CVB3IPI Td7QFvfp5eMUPzSTvYSTBnYp9hcFj5EFucza4mj3BYflrUqSNToViZd2c8lq4AnAd8ny jbnOl9+7sVYZRHeM6qB+QG9bgGZyRwz/1O8gxghMiq+63USNw1r4LHhzSE3SE60KN1r5 iTQw== 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=6POHquoI9CiSwlTGd4ju0VSq4M7yNnECfaMDRfAoBkQ=; b=iFh/lmkLpPe1sobERdRVAGvS4ud6P60jW+LJ8fy2XnmY8IVzIHZdAaOHhfHQQowKya bHfvP4JfQyU+3qfPZtXWtKtXmtdhCk0EH2ffDbRZZMK6kfJCk9IcwGVhp7mUjY/vhdnD YI3AvUPWR+Ll/pCvht9DUPmyhVWrqNGoKL/r2mHOchFuL4Uh9LphXTc6xRfZ6k3HWBiH ulvYlcDpEiTN1o8dKngW5q8r2tbPi/aruMcp56Lfhn8kwamCt4WC3zpzS7/zoWBNiAxa iKBVttByZq9eilEHtRYHI0j2cVlN6BPkyZ2GdevsG3ht3hiX1eacyvF/+AAf5WioJfHw EZzA== X-Gm-Message-State: ALyK8tKcryZbeSOBoTRUn+s3Za5qebsurMk5ai7rpkq7WcsyTf0n5TSPb7Co85Op6TYSeA== X-Received: by 10.98.75.146 with SMTP id d18mr57394pfj.19.1465944667029; Tue, 14 Jun 2016 15:51:07 -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.06 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 14 Jun 2016 15:51:06 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: linux-media@vger.kernel.org Cc: Steve Longerbeam Subject: [PATCH 04/38] gpu: ipu-v3: Add ipu_get_num() Date: Tue, 14 Jun 2016 15:49:00 -0700 Message-Id: <1465944574-15745-5-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 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 60540ead..b174f8a 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);