From: Marco Felsch <m.felsch@pengutronix.de>
To: mchehab@kernel.org, sakari.ailus@linux.intel.com,
robh+dt@kernel.org, mark.rutland@arm.com
Cc: enrico.scholz@sigma-chemnitz.de, akinobu.mita@gmail.com,
linux-media@vger.kernel.org, devicetree@vger.kernel.org,
graphics@pengutronix.de
Subject: [PATCH v2 1/6] media: mt9m111: add s_stream callback
Date: Mon, 29 Oct 2018 19:24:05 +0100 [thread overview]
Message-ID: <20181029182410.18783-2-m.felsch@pengutronix.de> (raw)
In-Reply-To: <20181029182410.18783-1-m.felsch@pengutronix.de>
Add callback to check if we are already streaming. Now other callbacks
can check the state and return -EBUSY if we already streaming.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
drivers/media/i2c/mt9m111.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c
index 1395986a07bb..e0ac5aa6ea64 100644
--- a/drivers/media/i2c/mt9m111.c
+++ b/drivers/media/i2c/mt9m111.c
@@ -217,6 +217,7 @@ struct mt9m111 {
int power_count;
const struct mt9m111_datafmt *fmt;
int lastpage; /* PageMap cache value */
+ bool is_streaming;
#ifdef CONFIG_MEDIA_CONTROLLER
struct media_pad pad;
#endif
@@ -879,6 +880,14 @@ static int mt9m111_enum_mbus_code(struct v4l2_subdev *sd,
return 0;
}
+static int mt9m111_s_stream(struct v4l2_subdev *sd, int enable)
+{
+ struct mt9m111 *mt9m111 = container_of(sd, struct mt9m111, subdev);
+
+ mt9m111->is_streaming = !!enable;
+ return 0;
+}
+
static int mt9m111_g_mbus_config(struct v4l2_subdev *sd,
struct v4l2_mbus_config *cfg)
{
@@ -892,6 +901,7 @@ static int mt9m111_g_mbus_config(struct v4l2_subdev *sd,
static const struct v4l2_subdev_video_ops mt9m111_subdev_video_ops = {
.g_mbus_config = mt9m111_g_mbus_config,
+ .s_stream = mt9m111_s_stream,
};
static const struct v4l2_subdev_pad_ops mt9m111_subdev_pad_ops = {
--
2.19.1
next prev parent reply other threads:[~2018-10-30 3:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-29 18:24 [PATCH v2 0/6] media: mt9m111 features Marco Felsch
2018-10-29 18:24 ` Marco Felsch [this message]
2018-10-29 18:24 ` [PATCH v2 2/6] media: mt9m111: add streaming check to set_fmt Marco Felsch
2018-10-29 18:24 ` [PATCH v2 3/6] media: mt9m111: add support to select formats and fps for {Q,SXGA} Marco Felsch
2018-11-16 13:26 ` Sakari Ailus
2018-11-16 13:31 ` Hans Verkuil
2018-11-16 13:33 ` Sakari Ailus
2018-11-26 16:01 ` Marco Felsch
2018-10-29 18:24 ` [PATCH v2 4/6] media: mt9m111: allow to setup pixclk polarity Marco Felsch
2018-11-16 13:32 ` Sakari Ailus
2018-11-26 14:16 ` Marco Felsch
2018-10-29 18:24 ` [PATCH v2 5/6] dt-bindings: media: mt9m111: adapt documentation to be more clear Marco Felsch
2018-10-30 22:30 ` Rob Herring
2018-10-29 18:24 ` [PATCH v2 6/6] dt-bindings: media: mt9m111: add pclk-sample property Marco Felsch
2018-10-30 22:31 ` Rob Herring
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=20181029182410.18783-2-m.felsch@pengutronix.de \
--to=m.felsch@pengutronix.de \
--cc=akinobu.mita@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=enrico.scholz@sigma-chemnitz.de \
--cc=graphics@pengutronix.de \
--cc=linux-media@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mchehab@kernel.org \
--cc=robh+dt@kernel.org \
--cc=sakari.ailus@linux.intel.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;
as well as URLs for NNTP newsgroup(s).