From patchwork Tue May 2 14:09:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13228979 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 09BF2C77B73 for ; Tue, 2 May 2023 14:10:08 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Vr6cXKrYJapfJ1vrHKhPfXTq/nbAUcoRpPLf75fDNqk=; b=Z6kGyHQPuxAN+5 xZ6PIqO1IUduHsL2UQBtFGvni0fSI4+dBPqfGVq+UOGiwy8bHvuW8bN7LZmHMwRDE0mCFFWgcsIGj nRnvFKHZGB4jQ+OEQXBriyyqzLurMq+6NtWfJntC0tFItzhM87/zNXVcZSI/C+MK3WOi9ZsElsvXY U6JHMffApFEmOp8M+FY+KC1NMwiJVRcqTmp/SoerWwuT9naH6DlSokHG90vN5M4zLuyfzZ7nspWtL yR6VbVFViekE+sqzWVCyB+il5TMLoqiphh+aLzoN1sqx+/PISoUq+tvx0Nl6YDBGUM+RvZAhZxc16 3L6mc+p+sK3RoRM2zaJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ptqgp-001m3U-2n; Tue, 02 May 2023 14:09:11 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ptqgm-001m1u-2a for linux-arm-kernel@lists.infradead.org; Tue, 02 May 2023 14:09:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1683036548; x=1714572548; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Po284pkusD+oh26TkRbRThDBdVYfcNJXuLPkM5pnIbQ=; b=VF29x3XtPmt5+pyovNOsCyGFspMFWSGbh44VG0OShvI81CLk94JNbSJu cHd9+4ea3CHcklzQaNgVy106F/BGVJSN+z7lkEXJBGAS2FNuPVN7KY90u bu/L9PKGblYMlVzEyy38xpKTWkN0zDWKEV4rCGir61KGZHKfQ/k2m3BUH qg/RE6qoe+lPCdaUABISaB6GKiRxcpb4RbYpc7iAIA5C73Ww6zsIqMjss HfguwA2TuHbBKQm1oQd3WtlgCalu1ZEQsD15L2HI6ksxtTDZrDvzETw3g 4L2aF+72LonzVVns7Sz2CtL9ivbupk0QUef1Bz8PJ1vMY6M6Wzo6tOcAO g==; X-IronPort-AV: E=Sophos;i="5.99,244,1677538800"; d="scan'208";a="30671759" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 02 May 2023 16:09:04 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Tue, 02 May 2023 16:09:04 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Tue, 02 May 2023 16:09:04 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1683036544; x=1714572544; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Po284pkusD+oh26TkRbRThDBdVYfcNJXuLPkM5pnIbQ=; b=RFeGnDP4JGZChE7tW5kzhNXyqsTOVV3k92MZYySGSdHER9ETTrU0Pklf RjlEhujqB1r6a2jv2Ej06vX8hxPT/9nyh6b74s7/5ShbP5Md1gapsvSwg 1h52TnmC+qHhXVP+nsyaP6a7/u5yKqxTlXlKTI8JVONAbMExQbarqzuLe yfclzyMdzLiXLoJ9IoVRA4dwCXkQxudQQ0KZx4dCqb9a4p/KFjpzldQok I9lpcQV4LMQ9Sf6blhXVs4vU+aYwGPQfkSTtb0XLcb6nSiqCXQesOeCRw ltPpnHVk6XgMgFKIsm7HjoThW6I/+GLTmrZmCorFhfoP3HGUFq7+7MqlF w==; X-IronPort-AV: E=Sophos;i="5.99,244,1677538800"; d="scan'208";a="30671758" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 02 May 2023 16:09:04 +0200 Received: from steina-w.tq-net.de (unknown [10.123.53.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 1DB3F280056; Tue, 2 May 2023 16:09:04 +0200 (CEST) From: Alexander Stein To: Steve Longerbeam , Philipp Zabel , Mauro Carvalho Chehab , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: Alexander Stein , Pengutronix Kernel Team , NXP Linux Team , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/1] media: staging: media: imx6-mipi-csi2: Add log_status core callback Date: Tue, 2 May 2023 16:09:02 +0200 Message-Id: <20230502140902.2324813-1-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230502_070909_138042_7A1AE111 X-CRM114-Status: GOOD ( 14.16 ) 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 This prints all register values. Signed-off-by: Alexander Stein --- This might help when trying to figure if capturing does not work. drivers/staging/media/imx/imx6-mipi-csi2.c | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/drivers/staging/media/imx/imx6-mipi-csi2.c b/drivers/staging/media/imx/imx6-mipi-csi2.c index c07994ea6e96..ab565b4e29ec 100644 --- a/drivers/staging/media/imx/imx6-mipi-csi2.c +++ b/drivers/staging/media/imx/imx6-mipi-csi2.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -564,6 +565,49 @@ static int csi2_registered(struct v4l2_subdev *sd) V4L2_FIELD_NONE, NULL); } +/* --------------- CORE OPS --------------- */ + +static int csi2_log_status(struct v4l2_subdev *sd) +{ + struct csi2_dev *csi2 = sd_to_dev(sd); + + v4l2_info(sd, "-----MIPI CSI status-----\n"); + v4l2_info(sd, "VERSION: 0x%x\n", + readl(csi2->base + CSI2_VERSION)); + v4l2_info(sd, "N_LANES: 0x%x\n", + readl(csi2->base + CSI2_N_LANES)); + v4l2_info(sd, "PHY_SHUTDOWNZ: 0x%x\n", + readl(csi2->base + CSI2_PHY_SHUTDOWNZ)); + v4l2_info(sd, "DPHY_RSTZ: 0x%x\n", + readl(csi2->base + CSI2_DPHY_RSTZ)); + v4l2_info(sd, "RESETN: 0x%x\n", + readl(csi2->base + CSI2_RESETN)); + v4l2_info(sd, "PHY_STATE: 0x%x\n", + readl(csi2->base + CSI2_PHY_STATE)); + v4l2_info(sd, "DATA_IDS_1: 0x%x\n", + readl(csi2->base + CSI2_DATA_IDS_1)); + v4l2_info(sd, "DATA_IDS_2: 0x%x\n", + readl(csi2->base + CSI2_DATA_IDS_2)); + v4l2_info(sd, "ERR1: 0x%x\n", + readl(csi2->base + CSI2_ERR1)); + v4l2_info(sd, "ERR2: 0x%x\n", + readl(csi2->base + CSI2_ERR2)); + v4l2_info(sd, "MSK1: 0x%x\n", + readl(csi2->base + CSI2_MSK1)); + v4l2_info(sd, "MSK2: 0x%x\n", + readl(csi2->base + CSI2_MSK2)); + v4l2_info(sd, "PHY_TST_CTRL0: 0x%x\n", + readl(csi2->base + CSI2_PHY_TST_CTRL0)); + v4l2_info(sd, "PHY_TST_CTRL1: 0x%x\n", + readl(csi2->base + CSI2_PHY_TST_CTRL1)); + + return 0; +} + +static const struct v4l2_subdev_core_ops csi2_core_ops = { + .log_status = csi2_log_status, +}; + static const struct media_entity_operations csi2_entity_ops = { .link_setup = csi2_link_setup, .link_validate = v4l2_subdev_link_validate, @@ -581,6 +625,7 @@ static const struct v4l2_subdev_pad_ops csi2_pad_ops = { }; static const struct v4l2_subdev_ops csi2_subdev_ops = { + .core = &csi2_core_ops, .video = &csi2_video_ops, .pad = &csi2_pad_ops, };