From patchwork Fri Jan 13 09:54:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tretter X-Patchwork-Id: 13100412 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 252D3C54EBD for ; Fri, 13 Jan 2023 09:57:09 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uJoxRGn5u1Eo8rto+kNY5KBWV/lN7WT0xhHUn33DUCs=; b=PzpcxL0yCf4ruv SZAZsAParv2NEDnHz45eOEkLcHNSSCjbBcCV3SnXBj0otVGL5E9E8Etuv0IpchHOAaIXTk+dr3STZ WbkSblX710d0vK3XLfSHx3gWXQxZh4j1DByt8La5MlTWd07vICSxV6LHb711ee/wSxCxO1SUmmgi0 M9WOfjYtN+blEIUvJWN92NmrNzWEgJbjpcaoWnsplncePQeqXNG3SLHwmi2YrpD11MpOFW6OrHwGz OH1aEOAqxvemt5rbFk/J+wMEFBnECQ7o9PmKYntF80y47SMkVv2qTQuaIU+V5ybG1bIHmob4wBSTE 29ogFweGEurllZq0wfug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGGnB-001adL-E8; Fri, 13 Jan 2023 09:56:09 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pGGlV-001ZoI-Uk for linux-arm-kernel@lists.infradead.org; Fri, 13 Jan 2023 09:54:29 +0000 Received: from dude05.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::54]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1pGGlH-0003cp-5b; Fri, 13 Jan 2023 10:54:11 +0100 From: Michael Tretter Date: Fri, 13 Jan 2023 10:54:08 +0100 Subject: [PATCH v2 02/16] media: imx-pxp: detect PXP version MIME-Version: 1.0 Message-Id: <20230112-imx-pxp-v2-2-e2281da1db55@pengutronix.de> References: <20230112-imx-pxp-v2-0-e2281da1db55@pengutronix.de> In-Reply-To: <20230112-imx-pxp-v2-0-e2281da1db55@pengutronix.de> To: linux-media@vger.kernel.org, devicetree@vger.kernel.org, Philipp Zabel , Laurent Pinchart Cc: Michael Tretter , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Fabio Estevam , Alexander Stein , kernel@pengutronix.de, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.11.2 X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::54 X-SA-Exim-Mail-From: m.tretter@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230113_015426_083402_BDE73514 X-CRM114-Status: GOOD ( 13.13 ) 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 Different versions of the Pixel Pipeline have different blocks and their routing may be different. Read the PXP_HW_VERSION register to determine the version of the PXP and print it to the log for debugging purposes. Signed-off-by: Michael Tretter Reviewed-by: Laurent Pinchart Reviewed-by: Philipp Zabel --- Changelog: v2: - reduce debug level for version to dev_dbg - drop hw_version field from struct pxp_dev --- drivers/media/platform/nxp/imx-pxp.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/media/platform/nxp/imx-pxp.c b/drivers/media/platform/nxp/imx-pxp.c index 689ae5e6ac62..5b671c6e5cae 100644 --- a/drivers/media/platform/nxp/imx-pxp.c +++ b/drivers/media/platform/nxp/imx-pxp.c @@ -10,6 +10,7 @@ * Pawel Osciak, * Marek Szyprowski, */ +#include #include #include #include @@ -52,6 +53,11 @@ MODULE_PARM_DESC(debug, "activates debug info"); #define MEM2MEM_HFLIP (1 << 0) #define MEM2MEM_VFLIP (1 << 1) +#define PXP_VERSION_MAJOR(version) \ + FIELD_GET(BM_PXP_VERSION_MAJOR, version) +#define PXP_VERSION_MINOR(version) \ + FIELD_GET(BM_PXP_VERSION_MINOR, version) + #define dprintk(dev, fmt, arg...) \ v4l2_dbg(1, debug, &dev->v4l2_dev, "%s: " fmt, __func__, ## arg) @@ -1665,6 +1671,7 @@ static int pxp_probe(struct platform_device *pdev) struct pxp_dev *dev; struct video_device *vfd; int irq; + u32 hw_version; int ret; dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); @@ -1705,6 +1712,10 @@ static int pxp_probe(struct platform_device *pdev) goto err_clk; } + hw_version = readl(dev->mmio + HW_PXP_VERSION); + dev_dbg(&pdev->dev, "PXP Version %u.%u\n", + PXP_VERSION_MAJOR(hw_version), PXP_VERSION_MINOR(hw_version)); + ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev); if (ret) goto err_clk;