From: Akinobu Mita <akinobu.mita@gmail.com>
To: linux-media@vger.kernel.org, devicetree@vger.kernel.org
Cc: Akinobu Mita <akinobu.mita@gmail.com>,
Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: [PATCH v2 10/13] media: mt9m001: register to V4L2 asynchronous subdevice framework
Date: Tue, 8 Jan 2019 23:51:47 +0900 [thread overview]
Message-ID: <1546959110-19445-11-git-send-email-akinobu.mita@gmail.com> (raw)
In-Reply-To: <1546959110-19445-1-git-send-email-akinobu.mita@gmail.com>
Register a sub-device to the asynchronous subdevice framework, and also
create subdevice device node.
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.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>
---
* v2
- Remove redundant Kconfig dependency
- Preserve subdev flags set by v4l2_i2c_subdev_init().
drivers/media/i2c/Kconfig | 3 +--
drivers/media/i2c/mt9m001.c | 9 ++++++++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index 2d13898..be8166d 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -859,9 +859,8 @@ config VIDEO_VS6624
config VIDEO_MT9M001
tristate "mt9m001 support"
- depends on I2C && VIDEO_V4L2
+ depends on I2C && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
depends on MEDIA_CAMERA_SUPPORT
- depends on MEDIA_CONTROLLER
help
This driver supports MT9M001 cameras from Micron, monochrome
and colour models.
diff --git a/drivers/media/i2c/mt9m001.c b/drivers/media/i2c/mt9m001.c
index 3b55aa85..5e93c7d 100644
--- a/drivers/media/i2c/mt9m001.c
+++ b/drivers/media/i2c/mt9m001.c
@@ -720,6 +720,7 @@ static int mt9m001_probe(struct i2c_client *client,
return PTR_ERR(mt9m001->reset_gpio);
v4l2_i2c_subdev_init(&mt9m001->subdev, client, &mt9m001_subdev_ops);
+ mt9m001->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
v4l2_ctrl_handler_init(&mt9m001->hdl, 4);
v4l2_ctrl_new_std(&mt9m001->hdl, &mt9m001_ctrl_ops,
V4L2_CID_VFLIP, 0, 1, 1, 0);
@@ -768,10 +769,16 @@ static int mt9m001_probe(struct i2c_client *client,
if (ret)
goto error_power_off;
+ ret = v4l2_async_register_subdev(&mt9m001->subdev);
+ if (ret)
+ goto error_entity_cleanup;
+
pm_runtime_idle(&client->dev);
return 0;
+error_entity_cleanup:
+ media_entity_cleanup(&mt9m001->subdev.entity);
error_power_off:
pm_runtime_disable(&client->dev);
pm_runtime_set_suspended(&client->dev);
@@ -788,9 +795,9 @@ static int mt9m001_remove(struct i2c_client *client)
{
struct mt9m001 *mt9m001 = to_mt9m001(client);
- v4l2_device_unregister_subdev(&mt9m001->subdev);
pm_runtime_get_sync(&client->dev);
+ v4l2_async_unregister_subdev(&mt9m001->subdev);
media_entity_cleanup(&mt9m001->subdev.entity);
pm_runtime_disable(&client->dev);
--
2.7.4
next prev parent reply other threads:[~2019-01-08 14:52 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-08 14:51 [PATCH v2 00/13] media: mt9m001: switch soc_mt9m001 to a standard subdev sensor driver Akinobu Mita
2019-01-08 14:51 ` [PATCH v2 01/13] media: i2c: mt9m001: copy mt9m001 soc_camera " Akinobu Mita
2019-01-08 14:51 ` [PATCH v2 02/13] media: i2c: mt9m001: dt: add binding for mt9m001 Akinobu Mita
2019-01-15 20:59 ` Rob Herring
2019-01-08 14:51 ` [PATCH v2 03/13] media: mt9m001: convert to SPDX license identifer Akinobu Mita
2019-01-08 14:51 ` [PATCH v2 04/13] media: mt9m001: sort headers alphabetically Akinobu Mita
2019-01-08 14:51 ` [PATCH v2 05/13] media: mt9m001: add of_match_table Akinobu Mita
2019-01-08 14:51 ` [PATCH v2 06/13] media: mt9m001: introduce multi_reg_write() Akinobu Mita
2019-01-08 14:51 ` [PATCH v2 07/13] media: mt9m001: switch s_power callback to runtime PM Akinobu Mita
2019-01-08 14:51 ` [PATCH v2 08/13] media: mt9m001: remove remaining soc_camera specific code Akinobu Mita
2019-01-08 15:40 ` Akinobu Mita
2019-01-09 14:00 ` Sakari Ailus
2019-01-09 15:07 ` [PATCH v2.1 " Akinobu Mita
2019-01-08 14:51 ` [PATCH v2 09/13] media: mt9m001: add media controller support Akinobu Mita
2019-01-08 14:51 ` Akinobu Mita [this message]
2019-01-08 14:51 ` [PATCH v2 11/13] media: mt9m001: support log_status ioctl and event interface Akinobu Mita
2019-01-08 14:51 ` [PATCH v2 12/13] media: mt9m001: make VIDIOC_SUBDEV_G_FMT ioctl work with V4L2_SUBDEV_FORMAT_TRY Akinobu Mita
2019-01-08 14:51 ` [PATCH v2 13/13] media: mt9m001: set all mbus format field when G_FMT and S_FMT ioctls Akinobu Mita
2019-02-04 9:05 ` [PATCH v2 00/13] media: mt9m001: switch soc_mt9m001 to a standard subdev sensor driver Sakari Ailus
2019-02-05 13:39 ` Akinobu Mita
2019-02-06 13:24 ` Sakari Ailus
2019-02-08 14:56 ` [PATCH] MAINTAINERS: media: add entries for mt9m001 and mt9m111 drivers 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=1546959110-19445-11-git-send-email-akinobu.mita@gmail.com \
--to=akinobu.mita@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=g.liakhovetski@gmx.de \
--cc=linux-media@vger.kernel.org \
--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