From patchwork Wed Nov 9 14:18:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 17592 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp361388wru; Wed, 9 Nov 2022 06:22:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf43BVtyryCIQ2i3Z8RQ6TDvp4ExgcCaVy8xr/30bAuTU4ZM1OHWJ6jYCCam6czPyl2spj8U X-Received: by 2002:a17:906:748:b0:7ae:8d01:8202 with SMTP id z8-20020a170906074800b007ae8d018202mr2899699ejb.384.1668003777865; Wed, 09 Nov 2022 06:22:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668003777; cv=none; d=google.com; s=arc-20160816; b=K0A6XYJP1davjjwWY9aMBsthYkD3ZUzlI8ze+LDfTRXQgP1Z1toMq+iBkpfQi7B/xV oLQsG9boD+UtdnXiY2VWgYI7boxf2y3gRtLSe6JLLgNvskj9A1HdtbqyQzuG7Hvmx7i5 LyIAW2csE/QzDHsYXWv0MUeFV+NzB6fNooSxvpHuIhioeZuoi4uASIg1mKVQPUIwVCpK m3p2ugOoIfegJM4AVFKSr32X2fQCT7JqQ8CLdlTvMkqKjZK60yNvIcFQsolsddHkw3py rN8qAudPob7DkgKvcOEIOdB21IyfMgX4nztYgnnPhgLTMDjyggpBnMRRhd/VjV7pCJKL NGMw== 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=WqadaQ7yXjv/t0SavSa/yt7ba9txtNTuK1AiW/yRmsI=; b=QgdyReTGvYYdPKT4QyfvdF1zf4i0JLaT2OJZgxcwwUN91svLjTegcI7U8rxIwJ9E34 Ur2S6MevJpluuFpvPgMQhRzHiKpIR4AloPBWHyWuurBuyCsvZYtma24vRJ7QVcTNHzlX PLkB+CBuHMLh8xEldnhna38sOO/jPH4mvmRsybtRQQp3ttgd6Iy0UNkJqk+XRw8BSCC8 qqDQJ9LspvQpbxrmwWn0n4BgepzgQvXSeTYczotcCH3g+IVEoddjJzBYe5jYxrWbgSyL I3h6ftqvuf5x2M9Mkf4hFNMrFCLKo1ri/ZmYj1oaHBzAvKRkJfG3g8yHpJJnyT80at3c 9FGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=KQg2bF+9; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m17-20020a056402511100b0045cfb63a033si19142534edd.551.2022.11.09.06.22.34; Wed, 09 Nov 2022 06:22:57 -0800 (PST) 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=KQg2bF+9; 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 S231426AbiKIOV3 (ORCPT + 99 others); Wed, 9 Nov 2022 09:21:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231407AbiKIOUo (ORCPT ); Wed, 9 Nov 2022 09:20:44 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9ECE21F9CA; Wed, 9 Nov 2022 06:20:07 -0800 (PST) Received: from booty.fritz.box (unknown [77.244.183.192]) (Authenticated sender: luca.ceresoli@bootlin.com) by mail.gandi.net (Postfix) with ESMTPA id 65DDCFF80A; Wed, 9 Nov 2022 14:20:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1668003603; 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=WqadaQ7yXjv/t0SavSa/yt7ba9txtNTuK1AiW/yRmsI=; b=KQg2bF+92M9dGL/Jc82k7ZMsuv/EInDiLTZ64PwJkkakvn2TAfYiSFF/kn0L4bBS1LX6ut v2ETBf0Es1FnH+CZSnVxyUg4fsUaCZwqPJMizdu5JvDODlGWOjyxyfi2ACjoVghepyKnSp tNTAqWB2EeAIhC4KWJT5qZoF3bB/iJL0iZqqksn5E2C5ly+CIFeMdzx76G2dwE1iCIjNWX N6jGvJkdfg9QvbbnE00xGS3Wd6v2fbWnyjc3GydNwvL9ytsbpgSY3UUM6A7uLj3zsBGcDq bDP4cSD08hL/u3UXmnDL6nCRHTsQL6dEy1ipeHVtCL7xBB6TeJ0+pHYbKOJx7g== From: luca.ceresoli@bootlin.com To: David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Mauro Carvalho Chehab , Greg Kroah-Hartman , Hans Verkuil , Dmitry Osipenko Cc: Luca Ceresoli , linux-media@vger.kernel.org, linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Thomas Petazzoni , Richard Leitner Subject: [PATCH 17/23] staging: media: tegra-video: add a per-soc enable/disable op Date: Wed, 9 Nov 2022 15:18:46 +0100 Message-Id: <20221109141852.729246-18-luca.ceresoli@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221109141852.729246-1-luca.ceresoli@bootlin.com> References: <20221109141852.729246-1-luca.ceresoli@bootlin.com> MIME-Version: 1.0 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_H2,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749028729271441594?= X-GMAIL-MSGID: =?utf-8?q?1749028729271441594?= From: Luca Ceresoli The Tegra20 VI needs an additional operation to enable the VI, add an operation for that. Signed-off-by: Luca Ceresoli --- drivers/staging/media/tegra-video/vi.c | 7 +++++++ drivers/staging/media/tegra-video/vi.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c index 2dd3c6c944a2..d0c387873d4e 100644 --- a/drivers/staging/media/tegra-video/vi.c +++ b/drivers/staging/media/tegra-video/vi.c @@ -1853,6 +1853,9 @@ static int tegra_vi_probe(struct platform_device *pdev) vi->client.ops = &vi_client_ops; vi->client.dev = &pdev->dev; + if (vi->ops->vi_enable) + vi->ops->vi_enable(vi, true); + ret = host1x_client_register(&vi->client); if (ret < 0) { dev_err(&pdev->dev, @@ -1863,6 +1866,8 @@ static int tegra_vi_probe(struct platform_device *pdev) return 0; rpm_disable: + if (vi->ops->vi_enable) + vi->ops->vi_enable(vi, false); pm_runtime_disable(&pdev->dev); return ret; } @@ -1879,6 +1884,8 @@ static int tegra_vi_remove(struct platform_device *pdev) return err; } + if (vi->ops->vi_enable) + vi->ops->vi_enable(vi, false); pm_runtime_disable(&pdev->dev); return 0; diff --git a/drivers/staging/media/tegra-video/vi.h b/drivers/staging/media/tegra-video/vi.h index 879547073371..851c4f3fcb91 100644 --- a/drivers/staging/media/tegra-video/vi.h +++ b/drivers/staging/media/tegra-video/vi.h @@ -37,8 +37,11 @@ enum tegra_vi_pg_mode { TEGRA_VI_PG_PATCH, }; +struct tegra_vi; + /** * struct tegra_vi_ops - Tegra VI operations + * @vi_enable: soc-specific operations needed to enable/disable the VI peripheral * @vi_fmt_align: modify `pix` to fit the hardware alignment * requirements and fill image geometry * @vi_start_streaming: starts media pipeline, subdevice streaming, sets up @@ -48,6 +51,7 @@ enum tegra_vi_pg_mode { * back any queued buffers. */ struct tegra_vi_ops { + int (*vi_enable)(struct tegra_vi *vi, bool on); void (*vi_fmt_align)(struct v4l2_pix_format *pix, unsigned int bpp); int (*vi_start_streaming)(struct vb2_queue *vq, u32 count); void (*vi_stop_streaming)(struct vb2_queue *vq);