From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-media@vger.kernel.org
Cc: Akinobu Mita <akinobu.mita@gmail.com>,
Enrico Scholz <enrico.scholz@sigma-chemnitz.de>,
Michael Grzeschik <m.grzeschik@pengutronix.de>,
Marco Felsch <m.felsch@pengutronix.de>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: [PATCH 2/4] media: mt9m111: add VIDEO_V4L2_SUBDEV_API dependency
Date: Fri, 8 Feb 2019 23:52:43 +0900 [thread overview]
Message-ID: <1549637565-32096-3-git-send-email-akinobu.mita@gmail.com> (raw)
In-Reply-To: <1549637565-32096-1-git-send-email-akinobu.mita@gmail.com>
This driver currently supports MC and V4L2 sub-device uAPI, so add
related dependency and remove unneeded ifdefs.
Just adding VIDEO_V4L2_SUBDEV_API dependency is enough, because
VIDEO_V4L2_SUBDEV_API depends on MEDIA_CONTROLLER.
Suggested-by: Marco Felsch <m.felsch@pengutronix.de>
Cc: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Cc: Michael Grzeschik <m.grzeschik@pengutronix.de>
Cc: Marco Felsch <m.felsch@pengutronix.de>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
drivers/media/i2c/Kconfig | 2 +-
drivers/media/i2c/mt9m111.c | 13 +------------
2 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index 12d7e52..71c7433 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -876,7 +876,7 @@ config VIDEO_MT9M032
config VIDEO_MT9M111
tristate "mt9m111, mt9m112 and mt9m131 support"
- depends on I2C && VIDEO_V4L2
+ depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
select V4L2_FWNODE
help
This driver supports MT9M111, MT9M112 and MT9M131 cameras from
diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c
index 5168bb5..55e2f46 100644
--- a/drivers/media/i2c/mt9m111.c
+++ b/drivers/media/i2c/mt9m111.c
@@ -246,9 +246,7 @@ struct mt9m111 {
bool is_streaming;
/* user point of view - 0: falling 1: rising edge */
unsigned int pclk_sample:1;
-#ifdef CONFIG_MEDIA_CONTROLLER
struct media_pad pad;
-#endif
};
static const struct mt9m111_mode_info mt9m111_mode_data[MT9M111_NUM_MODES] = {
@@ -529,13 +527,9 @@ static int mt9m111_get_fmt(struct v4l2_subdev *sd,
return -EINVAL;
if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
-#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
mf = v4l2_subdev_get_try_format(sd, cfg, format->pad);
format->format = *mf;
return 0;
-#else
- return -ENOTTY;
-#endif
}
mf->width = mt9m111->width;
@@ -1109,7 +1103,6 @@ static int mt9m111_s_stream(struct v4l2_subdev *sd, int enable)
static int mt9m111_init_cfg(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg)
{
-#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
struct v4l2_mbus_framefmt *format =
v4l2_subdev_get_try_format(sd, cfg, 0);
@@ -1121,7 +1114,7 @@ static int mt9m111_init_cfg(struct v4l2_subdev *sd,
format->ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT;
format->quantization = V4L2_QUANTIZATION_DEFAULT;
format->xfer_func = V4L2_XFER_FUNC_DEFAULT;
-#endif
+
return 0;
}
@@ -1293,13 +1286,11 @@ static int mt9m111_probe(struct i2c_client *client,
goto out_clkput;
}
-#ifdef CONFIG_MEDIA_CONTROLLER
mt9m111->pad.flags = MEDIA_PAD_FL_SOURCE;
mt9m111->subdev.entity.function = MEDIA_ENT_F_CAM_SENSOR;
ret = media_entity_pads_init(&mt9m111->subdev.entity, 1, &mt9m111->pad);
if (ret < 0)
goto out_hdlfree;
-#endif
mt9m111->current_mode = &mt9m111_mode_data[MT9M111_MODE_SXGA_15FPS];
mt9m111->frame_interval.numerator = 1;
@@ -1328,10 +1319,8 @@ static int mt9m111_probe(struct i2c_client *client,
return 0;
out_entityclean:
-#ifdef CONFIG_MEDIA_CONTROLLER
media_entity_cleanup(&mt9m111->subdev.entity);
out_hdlfree:
-#endif
v4l2_ctrl_handler_free(&mt9m111->hdl);
out_clkput:
v4l2_clk_put(mt9m111->clk);
--
2.7.4
next prev parent reply other threads:[~2019-02-08 14:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-08 14:52 [PATCH 0/4] media: i2c: tweak Kconfig dependencies Akinobu Mita
2019-02-08 14:52 ` [PATCH 1/4] media: ov2640: add VIDEO_V4L2_SUBDEV_API dependency Akinobu Mita
2019-02-08 14:52 ` Akinobu Mita [this message]
[not found] ` <201902090047.fTZ02W0h%fengguang.wu@intel.com>
2019-02-09 11:54 ` [PATCH 2/4] media: mt9m111: " Akinobu Mita
2019-02-09 15:31 ` Sakari Ailus
2019-02-09 21:02 ` kbuild test robot
2019-02-08 14:52 ` [PATCH 3/4] media: i2c: add missing MEDIA_CAMERA_SUPPORT Akinobu Mita
2019-02-08 14:52 ` [PATCH 4/4] media: i2c: remove redundant MEDIA_CONTROLLER dependency Akinobu Mita
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=1549637565-32096-3-git-send-email-akinobu.mita@gmail.com \
--to=akinobu.mita@gmail.com \
--cc=enrico.scholz@sigma-chemnitz.de \
--cc=linux-media@vger.kernel.org \
--cc=m.felsch@pengutronix.de \
--cc=m.grzeschik@pengutronix.de \
--cc=mchehab@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).