From patchwork Thu Jun 26 01:05:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 4425261 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B026CBEEAA for ; Thu, 26 Jun 2014 01:08:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D762F2037F for ; Thu, 26 Jun 2014 01:08:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF6422037B for ; Thu, 26 Jun 2014 01:08:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757574AbaFZBHS (ORCPT ); Wed, 25 Jun 2014 21:07:18 -0400 Received: from mail-pb0-f50.google.com ([209.85.160.50]:50554 "EHLO mail-pb0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757489AbaFZBHR (ORCPT ); Wed, 25 Jun 2014 21:07:17 -0400 Received: by mail-pb0-f50.google.com with SMTP id rp16so2401396pbb.23 for ; Wed, 25 Jun 2014 18:07:16 -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=qWw2r1JTHRLdGb49TQyyIn/kIBDwr0p506qzOL34cm0=; b=lJJD0MDW9NsgEaOgXOjc3AFHmkp+5cIcJLEw14wDavHZHN8F5uAD6eRJGpgiaDd/al Oy4R9atTcqdUp4A9qaVzptbQ6t/PnSTuGUEofLzHzzIfKXJjYGoazePejpFvZbofs5fz ldNKNppG2UnfYb2LMN2RoxzFX/OH/U7LH0Zw14v0G8/eqA8uq4Je7RYAMKUVRRqXAskv Xiuhyq/iNeb+GvCNbxcxeEmgldg3xhXGXnkbXA2XBUPEuRphMewuVeQLJvxIHXwUJ+Of UIUUXBw8wuR0fLVJh/Ogc13Gkqff4hH7fmiBojDGmTZWVNlEOo4/iLYjYc4Vcof+V6FD DRQA== X-Received: by 10.68.254.70 with SMTP id ag6mr16464556pbd.33.1403744836583; Wed, 25 Jun 2014 18:07:16 -0700 (PDT) Received: from mothership.mgc.mentorg.com (c-50-152-159-227.hsd1.ca.comcast.net. [50.152.159.227]) by mx.google.com with ESMTPSA id gg3sm7139010pbc.34.2014.06.25.18.07.15 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 25 Jun 2014 18:07:16 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: linux-media@vger.kernel.org Cc: Steve Longerbeam Subject: [PATCH 02/28] gpu: ipu-v3: Add ipu_get_num() Date: Wed, 25 Jun 2014 18:05:29 -0700 Message-Id: <1403744755-24944-3-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1403744755-24944-1-git-send-email-steve_longerbeam@mentor.com> References: <1403744755-24944-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=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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(). ipu_get_num() is used to select inputs to CSI units in IOMUXC. It is also used to select an SMFC channel for video capture. 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 | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c index 04e7b2e..a92f48b 100644 --- a/drivers/gpu/ipu-v3/ipu-common.c +++ b/drivers/gpu/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; @@ -1205,6 +1211,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; @@ -1233,6 +1240,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 c93f50e..55ae20c 100644 --- a/drivers/gpu/ipu-v3/ipu-prv.h +++ b/drivers/gpu/ipu-v3/ipu-prv.h @@ -166,6 +166,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/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h index 3e43e22..739d204 100644 --- a/include/video/imx-ipu-v3.h +++ b/include/video/imx-ipu-v3.h @@ -93,6 +93,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);