From patchwork Fri Dec 9 12:35:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Hecht X-Patchwork-Id: 9469951 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 38FD860476 for ; Mon, 12 Dec 2016 00:58:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2ACB3283C2 for ; Mon, 12 Dec 2016 00:58:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FA3A283F3; Mon, 12 Dec 2016 00:58:54 +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]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DAA09283C2 for ; Mon, 12 Dec 2016 00:58:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 06FEB6E25B; Mon, 12 Dec 2016 00:58:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wj0-x242.google.com (mail-wj0-x242.google.com [IPv6:2a00:1450:400c:c01::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id E167A6E9A3 for ; Fri, 9 Dec 2016 12:35:24 +0000 (UTC) Received: by mail-wj0-x242.google.com with SMTP id he10so2305140wjc.2 for ; Fri, 09 Dec 2016 04:35:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=yMHieUH9n1hpBQwkRsVFgjtA6D3z74hjaHQ1WxMtQ5U=; b=eElFzePJ0vduVkA6+HszMSeBi2e1q3p6T/1iUU+5j6M1yk3GBINWkxPtb8aAGkIzYK iUrt27gJQy+FoKYuySesO0Eb59YFUrQo+zahTcmdFIhi3D0VB4triys6ruUyMSupeNYe G1IgiR7X4bLlyu2FKasWF3JsfCYEiE5NICGEVGJvXA+3YdsQZZnoU3F5Z1LnesZX4bHf 6XW9NgK4X4YcJNOMyx9tCYHge/9TaehkdQCKhsQtblkFoFNdnjxb8z/pGh26pTJ79rVH TQHADkGIjczlrvnxnzQv5nNx6VH1w2YnSkPLkesAVcIDF1MDhedHIHCsqB/732PQFP7E uEDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=yMHieUH9n1hpBQwkRsVFgjtA6D3z74hjaHQ1WxMtQ5U=; b=m2xVHyznV5IQL9eKnCXMsC6CT00TVJ4aYAqSwGRTqKCE7m0lXncogcAOusY09GgVZD B/LC+LP8jzqEkDwHcLZmV3aRKVddvRtc7ikHFPkxIrVFQhUM09FrQuPjnzdu9tjObsGy N/WiOHogm7mRYFWE7QQmse2XHjVLwl7Mwk3QvtWmciOKW0zkaZ0zhJrR9qZsgcSIdNAG PIfV+rjel/Grvm7VxZniDUP/6lRARkab+2yboXvjFBV0mnAjGd3EUKsstn3IElEcI6lq EZunFjRwhy1GL6pnAAYjQoIZm/VZ/iKaZ3AA/HPipDQvdyvNFN7DKx31tzOTeIolObsB nDJQ== X-Gm-Message-State: AKaTC00L+xSdCdSAAjLqJ3S+Mnndn6IqvfqnnSensIYOL4eKvi15lqMkXCaafLgHhVpWiw== X-Received: by 10.194.122.101 with SMTP id lr5mr67767546wjb.210.1481286923319; Fri, 09 Dec 2016 04:35:23 -0800 (PST) Received: from groucho.site (ipbcc17b88.dynamic.kabel-deutschland.de. [188.193.123.136]) by smtp.gmail.com with ESMTPSA id x140sm20360920wme.19.2016.12.09.04.35.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Dec 2016 04:35:22 -0800 (PST) From: Ulrich Hecht To: linux-renesas-soc@vger.kernel.org Subject: [PATCH v1.5 2/6] v4l: rcar-fcp: Add an API to retrieve the FCP device Date: Fri, 9 Dec 2016 13:35:08 +0100 Message-Id: <1481286912-16555-3-git-send-email-ulrich.hecht+renesas@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481286912-16555-1-git-send-email-ulrich.hecht+renesas@gmail.com> References: <1481286912-16555-1-git-send-email-ulrich.hecht+renesas@gmail.com> X-Mailman-Approved-At: Mon, 12 Dec 2016 00:58:03 +0000 Cc: Laurent Pinchart , magnus.damm@gmail.com, laurent.pinchart@ideasonboard.com, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.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 From: Laurent Pinchart The new rcar_fcp_get_device() function retrieves the struct device related to the FCP device. This is useful to handle DMA mapping through the right device. Signed-off-by: Laurent Pinchart --- drivers/media/platform/rcar-fcp.c | 6 ++++++ include/media/rcar-fcp.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/drivers/media/platform/rcar-fcp.c b/drivers/media/platform/rcar-fcp.c index e9f609e..2988031 100644 --- a/drivers/media/platform/rcar-fcp.c +++ b/drivers/media/platform/rcar-fcp.c @@ -78,6 +78,12 @@ void rcar_fcp_put(struct rcar_fcp_device *fcp) } EXPORT_SYMBOL_GPL(rcar_fcp_put); +struct device *rcar_fcp_get_device(struct rcar_fcp_device *fcp) +{ + return fcp->dev; +} +EXPORT_SYMBOL_GPL(rcar_fcp_get_device); + /** * rcar_fcp_enable - Enable an FCP * @fcp: The FCP instance diff --git a/include/media/rcar-fcp.h b/include/media/rcar-fcp.h index 8723f05..b60a7b1 100644 --- a/include/media/rcar-fcp.h +++ b/include/media/rcar-fcp.h @@ -19,6 +19,7 @@ struct rcar_fcp_device; #if IS_ENABLED(CONFIG_VIDEO_RENESAS_FCP) struct rcar_fcp_device *rcar_fcp_get(const struct device_node *np); void rcar_fcp_put(struct rcar_fcp_device *fcp); +struct device *rcar_fcp_get_device(struct rcar_fcp_device *fcp); int rcar_fcp_enable(struct rcar_fcp_device *fcp); void rcar_fcp_disable(struct rcar_fcp_device *fcp); #else @@ -27,6 +28,10 @@ static inline struct rcar_fcp_device *rcar_fcp_get(const struct device_node *np) return ERR_PTR(-ENOENT); } static inline void rcar_fcp_put(struct rcar_fcp_device *fcp) { } +static inline struct device *rcar_fcp_get_device(struct rcar_fcp_device *fcp) +{ + return NULL; +} static inline int rcar_fcp_enable(struct rcar_fcp_device *fcp) { return 0;