From: Jacopo Mondi <jacopo@jmondi.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Rui Miguel Silva <rmfrfs@gmail.com>,
Steve Longerbeam <slongerbeam@gmail.com>,
Philipp Zabel <p.zabel@pengutronix.de>
Cc: Jacopo Mondi <jacopo@jmondi.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org
Subject: [PATCH 1/2] staging: media: imx: imx7-mipi-csic: Resume on debug
Date: Wed, 19 Jan 2022 12:20:23 +0100 [thread overview]
Message-ID: <20220119112024.11339-2-jacopo@jmondi.org> (raw)
In-Reply-To: <20220119112024.11339-1-jacopo@jmondi.org>
The mipi_csis_dump_regs() function reads and printout the interface
registers for debugging purposes.
Trying to access the registers without proper powering up the interface
causes the chip to hang.
Fix that by increasing the pm runtime usage count which, if necessary,
resumes the interface.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
drivers/staging/media/imx/imx7-mipi-csis.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c
index 2b73fa55c938..cb54bb7491d9 100644
--- a/drivers/staging/media/imx/imx7-mipi-csis.c
+++ b/drivers/staging/media/imx/imx7-mipi-csis.c
@@ -780,11 +780,15 @@ static int mipi_csis_dump_regs(struct csi_state *state)
dev_info(state->dev, "--- REGISTERS ---\n");
+ pm_runtime_resume_and_get(state->dev);
+
for (i = 0; i < ARRAY_SIZE(registers); i++) {
cfg = mipi_csis_read(state, registers[i].offset);
dev_info(state->dev, "%14s: 0x%08x\n", registers[i].name, cfg);
}
+ pm_runtime_put(state->dev);
+
return 0;
}
--
2.34.1
next prev parent reply other threads:[~2022-01-19 11:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-19 11:20 [PATCH 0/2] staging: media: imx7-mipi-csis: Two small fixes Jacopo Mondi
2022-01-19 11:20 ` Jacopo Mondi [this message]
2022-01-19 14:24 ` [PATCH 1/2] staging: media: imx: imx7-mipi-csic: Resume on debug Laurent Pinchart
2022-01-25 3:18 ` Laurent Pinchart
2022-01-25 10:22 ` Jacopo Mondi
2022-01-26 0:28 ` Laurent Pinchart
2022-01-19 11:20 ` [PATCH 2/2] staging: media: imx: imx7-mipi-csic: Set PIXEL_MODE for YUV422 Jacopo Mondi
2022-01-19 14:26 ` Laurent Pinchart
2022-01-19 16:21 ` [PATCH 0/2] staging: media: imx7-mipi-csis: Two small fixes Rui Miguel Silva
2022-01-21 8:29 ` Jacopo Mondi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220119112024.11339-2-jacopo@jmondi.org \
--to=jacopo@jmondi.org \
--cc=jbrunet@baylibre.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=rmfrfs@gmail.com \
--cc=slongerbeam@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox