From patchwork Mon Jan 30 14:15:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 50317 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2204293wrn; Mon, 30 Jan 2023 06:20:10 -0800 (PST) X-Google-Smtp-Source: AK7set85RvLB8n9QYKOZ30DfRit+BNtpbFW1CHHtzMXl0ruuBsRrAKtR6d+ZXF/Xs6MPzR0jP430 X-Received: by 2002:a17:907:b686:b0:887:74b2:811 with SMTP id vm6-20020a170907b68600b0088774b20811mr5862827ejc.74.1675088409800; Mon, 30 Jan 2023 06:20:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675088409; cv=none; d=google.com; s=arc-20160816; b=vRgiZK5cjjiWegoMXNIgwbwNMPMnbIy3tGZWRGx1T4sWpelLuiyJSnC3/NHw3f4Ysi 9KdNNfJeRRCZu9BzjTXRvuE4yroYqZCE4P0z+m31ZPchcGCGUdGYk7+kAFjBvFVROOFb ahUMHrsNdqk4v7mmcDEGe5G2WsFVjhjERxB57zimv7iQnl7g+IuD/edGHUMQTnOjVTqh WqSpqWJ0p5A8uqe1KBwEvB1hSQlAAhPnigwrnU08Mgj3TxI6tBH3K2kLos1cc6RjSx/4 8zepN5U3N1NEEgeaSFMYnDvcq19f185jgIQzbm5feMTmpNbuWCCvJTmGM6wCXGfXjjba 5hLg== 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=+JiyEr0aLb/Un5/rTb5g/3dOFycMN8fKhuwYurKD+kM=; b=e4NFeT15XmHHmarWILSDlUyWE/q+DgoaWIhucZz8gmqYbmzpfRNB3hplIVfwu+1ef3 2YBA3eyn3GBpeuSWEIouBzwl+eqNcUqqELehwy0v4IhsLiYIjIPbfcjMJlofHdUwDY1F ogiMACS+64smVFgRO9YFJnuN/AI2+dMeMeTcGX9gSt19YI+9Jah4GmGM8ixPWJRdgyr3 WVeN2WZx1PAf5OCQQXpC/EmfEsRpM2TVmFTVjI50xie1sbHEBlr0j/22cLuEN7sFgtI/ IxSCML2RjtSjrBUt0g+yEfzzsgqTrFIgkvr6GzZ4h8Bx+fkJS6tommAsdNSskew9IY9J gYxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=Q2alLPKS; 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 fx24-20020a1709069e9800b00886b18c2fabsi4625929ejc.24.2023.01.30.06.19.46; Mon, 30 Jan 2023 06:20:09 -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=Q2alLPKS; 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 S237624AbjA3OTS (ORCPT + 99 others); Mon, 30 Jan 2023 09:19:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237626AbjA3OSl (ORCPT ); Mon, 30 Jan 2023 09:18:41 -0500 Received: from relay11.mail.gandi.net (relay11.mail.gandi.net [IPv6:2001:4b98:dc4:8::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB8727EC6; Mon, 30 Jan 2023 06:17:50 -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 8C948100026; Mon, 30 Jan 2023 14:17:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1675088263; 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=+JiyEr0aLb/Un5/rTb5g/3dOFycMN8fKhuwYurKD+kM=; b=Q2alLPKSjV0u7YeUhE92cBuyDDiYgGZ7rMrYJGcejPWB7xpuhP6BH6iz2N1D224W89yPZz ZpY0k3YzZHEIUgfjaECAczCALAUPv3CULq+Vvzh97qKIRzA+htqowbdV0Ki/v2UhTEcpXf QWWRxMAi4jxRCGCg4SaAB+t8T3Q5AfCupY0taQUYJ97HQh8YBpVBhpcIU38viNvLAb7gHJ +7UcguIMwPQg8cy9LfV9+z7ObS5OjepPKeawpPp1fV395S31HMcGprROuA17/xObLA821l 0jXzdg/4fFBHo1ADNOnDaeULOgN05Otv6A342tdsWeDzKYVPmYOmTUmtQwRySg== From: Luca Ceresoli To: Thierry Reding , Jonathan Hunter , Sowjanya Komatineni , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Mauro Carvalho Chehab , Greg Kroah-Hartman , Dmitry Osipenko , Hans Verkuil 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 , Paul Kocialkowski , Richard Leitner Subject: [PATCH v4 16/21] staging: media: tegra-video: add a per-soc enable/disable op Date: Mon, 30 Jan 2023 15:15:58 +0100 Message-Id: <20230130141603.323221-17-luca.ceresoli@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230130141603.323221-1-luca.ceresoli@bootlin.com> References: <20230130141603.323221-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?1756457504394158414?= X-GMAIL-MSGID: =?utf-8?q?1756457504394158414?= The Tegra20 VI needs an additional operation to enable the VI, add an operation for that. Signed-off-by: Luca Ceresoli Reviewed-by: Dmitry Osipenko --- Changed in v4: - Added review tags 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);