summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMarco Felsch <m.felsch@pengutronix.de>2018-11-27 05:02:48 -0500
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-12-05 06:37:55 -0500
commit7784b1d2789816d3e5cef7243b6b6b4d7185ca3d (patch)
treefcba989f2fc46f9b5eebfb052cd839dc98f108bc /drivers
parent4f9d7225c70dd9d3f406b79e60f8dbd2cd5ae743 (diff)
downloadlinux-7784b1d2789816d3e5cef7243b6b6b4d7185ca3d.tar.bz2
media: mt9m111: add s_stream callback
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> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/i2c/mt9m111.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c
index 58d134dcdf44..03559669de9f 100644
--- a/drivers/media/i2c/mt9m111.c
+++ b/drivers/media/i2c/mt9m111.c
@@ -220,6 +220,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
@@ -910,6 +911,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)
{
@@ -923,6 +932,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 = {