From patchwork Wed May 25 19:06:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Kocialkowski X-Patchwork-Id: 12861660 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 29CC2C433EF for ; Wed, 25 May 2022 19:33:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VLN7ED9XZH5sF9at15d4/WE5OzXjk+kEgDiSjkT69pc=; b=fXqJthnzj3bQER ClmEC5h19gLc/fUeRVk+VaF26eFBiIRl+J3mxtT955KY2iq5jl8JkCT1NeH60FH0k4oBzVhgL0uf5 5QUW/DmwuBaMYtFfqnZuOO9iuKYEDsFB+cSgeYTudSg/6+uhlN4tHsN6uUa/y/gdVUvPa02pyp0sI q+iswNUqf44hTfvuSzGsPk+nreZdgXNlR5k9nXW8B9Rq2tokGIMnLcSGoElIsHroAcb6FqzbPSLm6 sp1H5CeP3jP5vIpZHZ6UgIU7BsbmzzNah4/B3H9j5wkvLgRZSg23fm7tfE8hy/un5A6zilhRPGGwe Di+EEvllAHPpN7TnT71Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntwjL-00CNzH-BE; Wed, 25 May 2022 19:31:39 +0000 Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntwLf-00CESc-KD for linux-arm-kernel@lists.infradead.org; Wed, 25 May 2022 19:07:22 +0000 Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 5B88A1C0004; Wed, 25 May 2022 19:07:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1653505629; 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=KF7V5wdhEBZbE0QI6TdidIoE0fuNLaf9TH4sI5llwP4=; b=jrG5TuryZ6Jg/QtnlMPOBWdQxETTG+ixlt1cpBR0hn2DmMs5i7Lf0jm4cwoZwgOpB6rXzx HMxkcMuvvydis/yLCTb02dvAFDRrb0+WLtbkvT9pFKFMfzR/R1b+ud8scTmKF9zx8D8TOz SRGduVOCSFQdaNFeaFIZn6IkjqfXDxfbKJQp4HlFXQs0GwjRRGH6r4NBqWTtIqHJ2EGFZ7 +VzYequoHXLYeo+B5SdOML8L2ZDUR0PFgB3JIUnu89ONQqVdo69ze04DrR5Usa3AVQrI5p NdYSlcyKLp5LAITJJRm1iLDyaNUTB10bEnyEA4uJPr7Zu20LJ9GLSGP99fDegQ== 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 v5 36/44] media: sun6i-csi: Get bridge subdev directly in capture stream ops Date: Wed, 25 May 2022 21:06:09 +0200 Message-Id: <20220525190617.696344-37-paul.kocialkowski@bootlin.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220525190617.696344-1-paul.kocialkowski@bootlin.com> References: <20220525190617.696344-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220525_120712_000689_3455A032 X-CRM114-Status: GOOD ( 14.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 be52ff679831..b91b6ad44ba1 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_entity_remote_pad(&capture->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);