Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1854479rwi; Thu, 3 Nov 2022 09:47:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM74wovk+E+tOxWX8aqcC3KkJKMBE0FDdk7sNtPj3gNx2TJckg78bCxlyoQfzXVPUcDOdsTw X-Received: by 2002:a17:906:9fc1:b0:761:9192:504f with SMTP id hj1-20020a1709069fc100b007619192504fmr30179239ejc.116.1667494039845; Thu, 03 Nov 2022 09:47:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667494039; cv=none; d=google.com; s=arc-20160816; b=fq9hl5pA1G0uf1c1lm8ZWuRjQ8OIJIM8e7wbJ1Vdc2plcVYCg5o9/vYtumVLWCSexe iMVD09XUL3XvcEpEwVanIhNLezW8TN+Y6pwkMFTijjHvR5LBAPt0buvyvTQo0QGYvJFP 7TgFGgsjCk5H/WG7zt5Y3TgVRQEeFlu3QWvWFXLgAO3Qtk3tQ2F1JCngDZZU6riJwyAE bPmQ+toS53pso1LrESZOM0nhNbFP+W1TVThY7bDYRNWZWvBKxIDuz/QFunoMxP52m6QZ GDlV/Brzc8J3+vSSOF3XtOXqulOhuo/Bx5eRg5xe1MxLbt1pMmVx4ok/IN9RXmck2Cnj DPIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=in7uetC4h5WySD5rMh6Pq2uXdKtNked87BK2BfLbx8Q=; b=ddlvlJF5IascaUHD07Xv3C4pD7q1cUc3an2w8HDjhY3wE0+nmPhw5Yaid8RD+ySamh HQbxVYEHM97kSZkAjZah5ntc31RGF1djBwKTd0YuCAHKY2G07PaUnLu8KvmaZOytA2vm tMcIDiD90FuawRbFh2Mkj+d7J80HRdrsIBSCmpOyPOt3dYDjvyuPSU0uhSkVXZnfp9fe FNkALC5N/J5mdyu7kbhGt5B505q3DxIL2Y45UbLytJbu4NhfZiULSdZ6WjzOJvav48PT R7aB3oP+A13BTiUaVK2g/VJXK03rol5z8/MOb1Wmr5BQcoChOayblbo2eyCTfOYoVv20 epnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=bzVs7SoX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i7-20020a50fc07000000b0045d2727331csi1420469edr.282.2022.11.03.09.46.53; Thu, 03 Nov 2022 09:47:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=bzVs7SoX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232415AbiKCQdb (ORCPT + 97 others); Thu, 3 Nov 2022 12:33:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232017AbiKCQcM (ORCPT ); Thu, 3 Nov 2022 12:32:12 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9280CF12; Thu, 3 Nov 2022 09:32:10 -0700 (PDT) Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 7D723240007; Thu, 3 Nov 2022 16:32:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1667493129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=in7uetC4h5WySD5rMh6Pq2uXdKtNked87BK2BfLbx8Q=; b=bzVs7SoXQt8RVIsA3hRbJOjlKZW2m5pidNhyhjSV7tICLEqlWLsubnjPpWd2D857Hq9vep A3aLyADFA6z+uPFKIXEvAOs2HEriZTu2CAkqHuQSs8wJSvi/rVg63hSg0Za2WfOKHVcMmn DU2bgHF6NCuJcGaToZd3/PKRPVceqoAgnV/BRs4yYly+N+fjRxW1Dc1ERL7OHmoQK/XHxg jt3WtV/uUYjsqQrqprZ/nQJ3mUJBeQ7Pk4oSrqfgen4Oo8Jynm/d4HOmAS2ghKI2QMFYNS hRvGH+P/3zRoVF03l15V7iSzFuiyahnA1AJXKcl/mLujyHw3UfGXKL6SLjCBtw== From: Paul Kocialkowski To: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev Cc: Yong Deng , Paul Kocialkowski , Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Laurent Pinchart , Maxime Ripard , Thomas Petazzoni Subject: [PATCH v7 20/28] media: sun6i-csi: Get bridge subdev directly in capture stream ops Date: Thu, 3 Nov 2022 17:31:05 +0100 Message-Id: <20221103163113.245462-21-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221103163113.245462-1-paul.kocialkowski@bootlin.com> References: <20221103163113.245462-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The remote subdev connected to the capture video device is always our bridge, so get the bridge subdev directly instead of using a dedicated helper (which is removed by this commit). Signed-off-by: Paul Kocialkowski Acked-by: Jernej Skrabec --- .../sunxi/sun6i-csi/sun6i_csi_capture.c | 30 ++----------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c index 35a30fcbad98..e59a219ca480 100644 --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c @@ -42,22 +42,6 @@ void sun6i_csi_capture_format(struct sun6i_csi_device *csi_dev, *field = csi_dev->capture.format.fmt.pix.field; } -static struct v4l2_subdev * -sun6i_csi_capture_remote_subdev(struct sun6i_csi_capture *capture, u32 *pad) -{ - struct media_pad *remote; - - remote = media_pad_remote_pad_first(&video->pad); - - if (!remote || !is_media_entity_v4l2_subdev(remote->entity)) - return NULL; - - if (pad) - *pad = remote->index; - - return media_entity_to_v4l2_subdev(remote->entity); -} - /* Format */ static const struct sun6i_csi_capture_format sun6i_csi_capture_formats[] = { @@ -822,8 +806,8 @@ static int sun6i_csi_capture_start_streaming(struct vb2_queue *queue, struct sun6i_csi_capture *capture = &csi_dev->capture; struct sun6i_csi_capture_state *state = &capture->state; struct video_device *video_dev = &capture->video_dev; + struct v4l2_subdev *subdev = &csi_dev->bridge.subdev; struct device *dev = csi_dev->dev; - struct v4l2_subdev *subdev; int ret; state->sequence = 0; @@ -832,12 +816,6 @@ static int sun6i_csi_capture_start_streaming(struct vb2_queue *queue, if (ret < 0) goto error_state; - subdev = sun6i_csi_capture_remote_subdev(capture, NULL); - if (!subdev) { - ret = -EINVAL; - goto error_media_pipeline; - } - /* PM */ ret = pm_runtime_resume_and_get(dev); @@ -886,12 +864,10 @@ static void sun6i_csi_capture_stop_streaming(struct vb2_queue *queue) { struct sun6i_csi_device *csi_dev = vb2_get_drv_priv(queue); struct sun6i_csi_capture *capture = &csi_dev->capture; + struct v4l2_subdev *subdev = &csi_dev->bridge.subdev; struct device *dev = csi_dev->dev; - struct v4l2_subdev *subdev; - subdev = sun6i_csi_capture_remote_subdev(capture, NULL); - if (subdev) - v4l2_subdev_call(subdev, video, s_stream, 0); + v4l2_subdev_call(subdev, video, s_stream, 0); sun6i_csi_capture_disable(csi_dev); sun6i_csi_capture_irq_disable(csi_dev); -- 2.38.1