From patchwork Thu May 11 17:21:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 9722613 X-Patchwork-Delegate: geert@linux-m68k.org 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 CA94860364 for ; Thu, 11 May 2017 17:27:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1108201A4 for ; Thu, 11 May 2017 17:27:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B608F2029C; Thu, 11 May 2017 17:27:29 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable 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 75E56201A4 for ; Thu, 11 May 2017 17:27:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933267AbdEKR1Y (ORCPT ); Thu, 11 May 2017 13:27:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:36120 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932712AbdEKR1U (ORCPT ); Thu, 11 May 2017 13:27:20 -0400 Received: from CookieMonster.cookiemonster.local (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2C9A4239AB; Thu, 11 May 2017 17:21:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C9A4239AB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=kbingham@kernel.org From: Kieran Bingham To: laurent.pinchart@ideasonboard.com, niklas.soderlund@ragnatech.se, sakari.ailus@iki.fi Cc: linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org, Kieran Bingham Subject: [RFC PATCH v2 4/4] rcar-csi2: Map to fwnode endpoints rather than port parents Date: Thu, 11 May 2017 18:21:23 +0100 Message-Id: <186d73c1b32bd8648dfc22f42154c083f6a4dd83.1494523203.git-series.kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kieran Bingham To support multiple async subdevices on a single device, we need to identify which subdevice maps directly for each connection. Instead of mapping the port parent to the async notifier, use the fwnode of the direct endpoint node. This will use a DT path which includes the port, and allow correct matching of the correct subdevice. Signed-off-by: Kieran Bingham --- drivers/media/platform/rcar-vin/rcar-csi2.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/rcar-vin/rcar-csi2.c b/drivers/media/platform/rcar-vin/rcar-csi2.c index 3400c0783c8e..0ddb25cb661b 100644 --- a/drivers/media/platform/rcar-vin/rcar-csi2.c +++ b/drivers/media/platform/rcar-vin/rcar-csi2.c @@ -648,7 +648,7 @@ static const struct v4l2_subdev_internal_ops rcar_csi2_internal_ops = { static int rcar_csi2_parse_dt_subdevice(struct rcar_csi2 *priv) { - struct device_node *remote, *ep, *rp; + struct device_node *ep, *rp; struct v4l2_fwnode_endpoint v4l2_ep; int ret; @@ -675,18 +675,10 @@ static int rcar_csi2_parse_dt_subdevice(struct rcar_csi2 *priv) rp = of_parse_phandle(ep, "remote-endpoint", 0); of_graph_parse_endpoint(rp, &priv->remote.endpoint); - remote = of_graph_get_remote_port_parent(ep); - of_node_put(ep); - if (!remote) { - dev_err(priv->dev, "No subdevice found for endpoint '%s'\n", - of_node_full_name(ep)); - return -EINVAL; - } - - priv->remote.asd.match.fwnode.fwnode = of_fwnode_handle(remote); + priv->remote.asd.match.fwnode.fwnode = of_fwnode_handle(rp); priv->remote.asd.match_type = V4L2_ASYNC_MATCH_FWNODE; - dev_dbg(priv->dev, "Found '%s'\n", of_node_full_name(remote)); + dev_dbg(priv->dev, "Found '%s'\n", of_node_full_name(rp)); return 0; }