From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: rmfrfs@gmail.com, martink@posteo.de, kernel@puri.sm,
mchehab@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de,
kernel@pengutronix.de, festevam@gmail.com
Cc: guoniu.zhou@oss.nxp.com, imx@lists.linux.dev,
linux-media@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] media: imx8mq-mipi-csi2: Drop stream stop/restart at suspend/resume time
Date: Sun, 29 Sep 2024 16:43:52 +0300 [thread overview]
Message-ID: <20240929134354.20735-2-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20240929134354.20735-1-laurent.pinchart@ideasonboard.com>
The imx8mq-mipi-csi2 driver stops streaming at suspend time, and
restarts it at resume time, in both the runtime and system
suspend/resume handlers. This isn't needed:
- The device is runtime resumed only from the .s_stream() handler,
before starting streaming, and runtime suspended in the same function,
after stopping streaming.
- For system suspend/resume, the whole capture pipeline is stopped and
restarted in a controlled manner by the top-level driver (the CSI
bridge in this case). When the system suspend handler is called,
streaming will have been stopped already.
Drop stream stop/restart from the PM handlers.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/media/platform/nxp/imx8mq-mipi-csi2.c | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/drivers/media/platform/nxp/imx8mq-mipi-csi2.c b/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
index d4a6c5532969..8eb9c7049425 100644
--- a/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
+++ b/drivers/media/platform/nxp/imx8mq-mipi-csi2.c
@@ -64,7 +64,6 @@
enum {
ST_POWERED = 1,
- ST_STREAMING = 2,
ST_SUSPENDED = 4,
};
@@ -420,12 +419,9 @@ static int imx8mq_mipi_csi_s_stream(struct v4l2_subdev *sd, int enable)
ret = v4l2_subdev_call(state->src_sd, video, s_stream, 1);
if (ret < 0)
goto unlock;
-
- state->state |= ST_STREAMING;
} else {
v4l2_subdev_call(state->src_sd, video, s_stream, 0);
imx8mq_mipi_csi_stop_stream(state);
- state->state &= ~ST_STREAMING;
}
unlock:
@@ -668,7 +664,6 @@ static int imx8mq_mipi_csi_pm_resume(struct device *dev)
{
struct v4l2_subdev *sd = dev_get_drvdata(dev);
struct csi_state *state = mipi_sd_to_csi2_state(sd);
- struct v4l2_subdev_state *sd_state;
int ret = 0;
mutex_lock(&state->lock);
@@ -677,17 +672,9 @@ static int imx8mq_mipi_csi_pm_resume(struct device *dev)
state->state |= ST_POWERED;
ret = imx8mq_mipi_csi_clk_enable(state);
}
- if (state->state & ST_STREAMING) {
- sd_state = v4l2_subdev_lock_and_get_active_state(sd);
- ret = imx8mq_mipi_csi_start_stream(state, sd_state);
- v4l2_subdev_unlock_state(sd_state);
- if (ret)
- goto unlock;
- }
state->state &= ~ST_SUSPENDED;
-unlock:
mutex_unlock(&state->lock);
return ret ? -EAGAIN : 0;
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2024-09-29 13:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-29 13:43 [PATCH 0/3] media: imx8mq-mipi-csi2: Simplify power management handling Laurent Pinchart
2024-09-29 13:43 ` Laurent Pinchart [this message]
2024-09-29 13:43 ` [PATCH 2/3] media: imx8mq-mipi-csi2: Drop ST_SUSPENDED guard Laurent Pinchart
2024-09-29 13:43 ` [PATCH 3/3] media: imx8mq-mipi-csi2: Drop system suspend/resume handlers Laurent Pinchart
2024-09-30 7:08 ` [PATCH 0/3] media: imx8mq-mipi-csi2: Simplify power management handling G.N. Zhou (OSS)
2024-09-30 7:21 ` Laurent Pinchart
2024-09-30 7:51 ` G.N. Zhou (OSS)
2024-10-07 21:43 ` Laurent Pinchart
2024-10-09 8:30 ` G.N. Zhou (OSS)
2024-10-07 10:44 ` Martin Kepplinger
-- strict thread matches above, loose matches on Subject: below --
2024-09-29 13:36 Laurent Pinchart
2024-09-29 13:36 ` [PATCH 1/3] media: imx8mq-mipi-csi2: Drop stream stop/restart at suspend/resume time Laurent Pinchart
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=20240929134354.20735-2-laurent.pinchart@ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=festevam@gmail.com \
--cc=guoniu.zhou@oss.nxp.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=kernel@puri.sm \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=martink@posteo.de \
--cc=mchehab@kernel.org \
--cc=rmfrfs@gmail.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
/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
all inboxes | Powered by JetHome®