From patchwork Thu Dec 29 13:32:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 37401 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2403241wrt; Thu, 29 Dec 2022 05:34:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXteqcMuOB1Z/DNF7FnjOpFkoJ1qNrSLOaxRGzqOU/Vi6ZL/mVGVYI7g+GEaxelSCAW74gai X-Received: by 2002:a17:902:e054:b0:189:da57:be3d with SMTP id x20-20020a170902e05400b00189da57be3dmr26663714plx.51.1672320880149; Thu, 29 Dec 2022 05:34:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672320880; cv=none; d=google.com; s=arc-20160816; b=QveerHgz1cHQ783pO4+fFNTBZPHsbbXhPZuuWvc50gZmogJgeylVq0ML5ETNtVuL/Y 9NstE03/3p9lv+8AfWOHDNVBZ03IRRQ8evxiOWsfFzewG0t8BtdxjWJ60yNVAwqO3XX1 XcO+MVjHx8rvg7Y3hsYV8K+fN7i3y+7VQVeQFs5znYAyUUHTxeT9Sy9ln05QVlof5fYh b9M4kEEz/UkQjvdC+5DI44o0nNKHMrv4MyAV+wI9h+RtKrQbkn057lEweSjpM2RDIK6c syfsPWhDPKZ9NldvJA/chM7vfOKR7ZYq4m5KH2LTZbkN5EGRSv0fj7tPoJZ2AxFGGULL NleQ== 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=EZCL6q95y8D550Hzr4bmsZG2h4Gj8Umd37yboOQuCjQ=; b=vq2aHwK+7q2/2WeXv53WJKLU9VqCWa7fFCm8h+ZhafgqiTATBiJatfg5DZagpT4kTj Y8Fp/9kv5MDh6SeyNkatOz41tBbMFMiqCIjBowtlk2t/TASmJHR9/8U6FxGlRyZ2LGWp 8HGt65g+dmWG0615MXGkFoThkPAR0xkbSUjHgINE1mLczw8/7BhkyQmhkyUJyaDtpuVd 0b+DQOLsNPC04Cej+x4b61MGLE026S8M3d3a3LpELd6hHdkN9RlZUrx44CEBxLvCbFJn WLJ+fAZAl/MWs8Df0Fe+M1fhOpmcvc6VbSVxzW4WPvkLSVzxm49Q7Cpe23FMC4EpdLkr hKnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=AoGiwJkn; 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 p13-20020a170902ebcd00b00189b908dd2esi18262533plg.469.2022.12.29.05.34.28; Thu, 29 Dec 2022 05:34:40 -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=AoGiwJkn; 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 S233608AbiL2Ndx (ORCPT + 99 others); Thu, 29 Dec 2022 08:33:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233538AbiL2Ndb (ORCPT ); Thu, 29 Dec 2022 08:33:31 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21EA012602; Thu, 29 Dec 2022 05:32:58 -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 84017FF80F; Thu, 29 Dec 2022 13:32:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1672320777; 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=EZCL6q95y8D550Hzr4bmsZG2h4Gj8Umd37yboOQuCjQ=; b=AoGiwJknhnXDqyhyIBsmlxVbtQZwiDP0yFQLlvEbs2pYoFm+oFkJQ4RSVI+JuV3gOGZDXy ulYhdWiJO9Vh14vf31T6vMNjrszmdl2Q+iEFObvvprEn9tgvB0TwV2P31c/ztda1YQfWin mJiYh22/IUlRN0bYc/Nz3EgNYuuVz9uXNiHqCPei87x+ZBGWMrKt2GXNZpdO9D1k5S0zeO anxnA5SvNdcWBnfOMOx4mAn2cHczq2JGIxJ2yb6S2iAKUCLKiVZ3MD3WO89M9xazLUNZp5 X5OYVMMJXsOt3GreeZqTCWaag+CUxw2owybu4IyRTjXhEeOHhQVFds806eIwRQ== From: Luca Ceresoli To: Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , Luca Ceresoli , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Mauro Carvalho Chehab , Greg Kroah-Hartman , Dmitry Osipenko , Hans Verkuil Cc: 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 , Paul Kocialkowski , Richard Leitner Subject: [PATCH v3 16/21] staging: media: tegra-video: add a per-soc enable/disable op Date: Thu, 29 Dec 2022 14:32:00 +0100 Message-Id: <20221229133205.981397-17-luca.ceresoli@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221229133205.981397-1-luca.ceresoli@bootlin.com> References: <20221229133205.981397-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,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?1753555539698894987?= X-GMAIL-MSGID: =?utf-8?q?1753555539698894987?= The Tegra20 VI needs an additional operation to enable the VI, add an operation for that. Signed-off-by: Luca Ceresoli --- No changes in v3 No changes in v2 --- 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 a26eb1ca869f..22f6d6478d3e 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);