From patchwork Sat Jun 7 21:56:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 4316471 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A2B199F170 for ; Sat, 7 Jun 2014 21:59:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CAA7920225 for ; Sat, 7 Jun 2014 21:59:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F14DA20222 for ; Sat, 7 Jun 2014 21:59:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753330AbaFGV7a (ORCPT ); Sat, 7 Jun 2014 17:59:30 -0400 Received: from mail-pb0-f47.google.com ([209.85.160.47]:48519 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753313AbaFGV5D (ORCPT ); Sat, 7 Jun 2014 17:57:03 -0400 Received: by mail-pb0-f47.google.com with SMTP id rp16so3896700pbb.6 for ; Sat, 07 Jun 2014 14:57:02 -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=Sw7JYfvQb2oZRMswGWCNJrhX/KVWCBP86XLxq9PEz3A=; b=QPDM3uBdtkx0cfq6nb/Dh3ZM2QuFdYwsZBgM3O32Z6E2O0jV+PvnhGMrYR51MYKZ9C k7MgbH+UjA9hMSLV7znDARkKiUu93amXg4bBQLuNe4PA+oHaALVTI2WlkUvkGH++w3xk saHJ3Y/Lxp+I+ZMIR42zTlOs/qDTyc+o7LfxD2BY4yGfcUiu3iR58GOLRmc062wSwNKT ZcvjPc4Y4sBi1HFprqRFIJdhboQvuTDsv0uIBjQlP/zHljWmdMaXYnAGqkd/JnCVdYSA w4oGUNIU07xpMSmqUqr7L6EQAzGrL1cp+/tYkCSzkIiWy2KrJuQTnmyIJzHDLIuORsFL dzHw== X-Received: by 10.68.220.103 with SMTP id pv7mr15882461pbc.17.1402178222713; Sat, 07 Jun 2014 14:57:02 -0700 (PDT) Received: from slongerb-fremont-linux.mgc.mentorg.com (c-98-248-118-71.hsd1.ca.comcast.net. [98.248.118.71]) by mx.google.com with ESMTPSA id fx5sm52769595pbb.62.2014.06.07.14.57.01 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 07 Jun 2014 14:57:02 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: linux-media@vger.kernel.org Cc: Steve Longerbeam Subject: [PATCH 03/43] imx-drm: ipu-v3: Add ipu_get_num() Date: Sat, 7 Jun 2014 14:56:05 -0700 Message-Id: <1402178205-22697-4-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1402178205-22697-1-git-send-email-steve_longerbeam@mentor.com> References: <1402178205-22697-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-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.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/staging/imx-drm/ipu-v3/ipu-common.c | 8 ++++++++ drivers/staging/imx-drm/ipu-v3/ipu-prv.h | 1 + include/linux/platform_data/imx-ipu-v3.h | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-common.c b/drivers/staging/imx-drm/ipu-v3/ipu-common.c index 2aca7dd..f8e8c56 100644 --- a/drivers/staging/imx-drm/ipu-v3/ipu-common.c +++ b/drivers/staging/imx-drm/ipu-v3/ipu-common.c @@ -55,6 +55,12 @@ static inline void ipu_idmac_write(struct ipu_soc *ipu, u32 value, writel(value, ipu->idmac_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; @@ -1104,6 +1110,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; @@ -1132,6 +1139,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/staging/imx-drm/ipu-v3/ipu-prv.h b/drivers/staging/imx-drm/ipu-v3/ipu-prv.h index 40211f6..9e4cf4b 100644 --- a/drivers/staging/imx-drm/ipu-v3/ipu-prv.h +++ b/drivers/staging/imx-drm/ipu-v3/ipu-prv.h @@ -164,6 +164,7 @@ struct ipu_soc { void __iomem *idmac_reg; struct ipu_ch_param __iomem *cpmem_base; + int id; int usecount; struct clk *clk; diff --git a/include/linux/platform_data/imx-ipu-v3.h b/include/linux/platform_data/imx-ipu-v3.h index c083a2a..ca91dd9 100644 --- a/include/linux/platform_data/imx-ipu-v3.h +++ b/include/linux/platform_data/imx-ipu-v3.h @@ -92,6 +92,11 @@ int ipu_idmac_channel_irq(struct ipu_soc *ipu, struct ipuv3_channel *channel, #define IPU_IRQ_VSYNC_PRE_1 (448 + 15) /* + * IPU Common functions + */ +int ipu_get_num(struct ipu_soc *ipu); + +/* * IPU Image DMA Controller (idmac) functions */ struct ipuv3_channel *ipu_idmac_get(struct ipu_soc *ipu, unsigned channel);