Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6018200rwl; Thu, 29 Dec 2022 06:26:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXs1g4zgjXS0xvIQ25qfoCT+kTFVDb9vIXJnmhrXNVj8U3GCd+I0+titJ6HMgqyN0jHmso2s X-Received: by 2002:a17:903:4055:b0:192:8641:c196 with SMTP id n21-20020a170903405500b001928641c196mr10115489pla.14.1672323980888; Thu, 29 Dec 2022 06:26:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672323980; cv=none; d=google.com; s=arc-20160816; b=nLofmrJhw2n8lVcc+7r2rp02AgNOhmngKjTUix3uPdpxa7pOYqVw9ZkZvm47J/4HcZ c6joFWcTIFsRk/tzLfQjProykrYdrDx9qIpm6HiSKxjYf/s5A9dIia47mseqO6KP/vuX 2ZQe6DEQSZ0jsMmdUOJfoHJhxpb1LjL/54SoLbnluRgjWigWSPnP9ftGxXRKyKCRxHL0 Brxt72GvuBHkdH2l+adHHcGaBLpy23bA9HEfF3btq5hc5+DQokE7p+GU+flBVsqPW2jk u2itt929AaEhmqmTUnUDwp9f+NRIxHI/DazIHUwv202WEGHnrTsHnC/7S94R+XjdLwXD gMkg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u6-20020a17090341c600b0018c166e2391si20036333ple.392.2022.12.29.06.26.12; Thu, 29 Dec 2022 06:26:20 -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 + 61 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 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,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 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); -- 2.34.1