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@s-opensource.com>
Subject: [PATCH 09/12] media: mt9m001: register to V4L2 asynchronous subdevice framework
Date: Sun, 23 Dec 2018 02:12:51 +0900 [thread overview]
Message-ID: <1545498774-11754-10-git-send-email-akinobu.mita@gmail.com> (raw)
In-Reply-To: <1545498774-11754-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@s-opensource.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
---
drivers/media/i2c/Kconfig | 2 +-
drivers/media/i2c/mt9m001.c | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index 5e30ad3..a6d8416 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -845,7 +845,7 @@ 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
diff --git a/drivers/media/i2c/mt9m001.c b/drivers/media/i2c/mt9m001.c
index e31fb7d..b4deec3 100644
--- a/drivers/media/i2c/mt9m001.c
+++ b/drivers/media/i2c/mt9m001.c
@@ -716,6 +716,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);
@@ -765,10 +766,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_put_sync(&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);
@@ -785,9 +792,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:[~2018-12-22 17:13 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-22 17:12 [PATCH 00/12] media: mt9m001: switch soc_mt9m001 to a standard subdev sensor driver Akinobu Mita
2018-12-22 17:12 ` [PATCH 01/12] media: i2c: mt9m001: copy mt9m001 soc_camera " Akinobu Mita
2018-12-22 17:12 ` [PATCH 02/12] media: i2c: mt9m001: dt: add binding for mt9m001 Akinobu Mita
2019-01-03 21:12 ` Rob Herring
2019-01-05 15:09 ` Akinobu Mita
2018-12-22 17:12 ` [PATCH 03/12] media: mt9m001: convert to SPDX license identifer Akinobu Mita
2019-01-07 11:37 ` Sakari Ailus
2019-01-07 14:20 ` Akinobu Mita
2019-01-07 15:15 ` Sakari Ailus
2018-12-22 17:12 ` [PATCH 04/12] media: mt9m001: add of_match_table Akinobu Mita
2018-12-22 17:12 ` [PATCH 05/12] media: mt9m001: introduce multi_reg_write() Akinobu Mita
2018-12-22 17:12 ` [PATCH 06/12] media: mt9m001: switch s_power callback to runtime PM Akinobu Mita
[not found] ` <20190107100034.po3jsnc3rdj37l4x@kekkonen.localdomain>
2019-01-07 14:07 ` Akinobu Mita
2019-01-07 14:10 ` Sakari Ailus
2018-12-22 17:12 ` [PATCH 07/12] media: mt9m001: remove remaining soc_camera specific code Akinobu Mita
2019-01-07 11:29 ` Sakari Ailus
2019-01-07 14:13 ` Akinobu Mita
2018-12-22 17:12 ` [PATCH 08/12] media: mt9m001: add media controller support Akinobu Mita
2018-12-22 17:12 ` Akinobu Mita [this message]
2019-01-07 11:27 ` [PATCH 09/12] media: mt9m001: register to V4L2 asynchronous subdevice framework Sakari Ailus
2019-01-07 14:09 ` Akinobu Mita
2018-12-22 17:12 ` [PATCH 10/12] media: mt9m001: support log_status ioctl and event interface Akinobu Mita
2018-12-22 17:12 ` [PATCH 11/12] media: mt9m001: make VIDIOC_SUBDEV_G_FMT ioctl work with V4L2_SUBDEV_FORMAT_TRY Akinobu Mita
2019-01-07 11:30 ` Sakari Ailus
2019-01-07 14:15 ` Akinobu Mita
2018-12-22 17:12 ` [PATCH 12/12] media: mt9m001: set all mbus format field when G_FMT and S_FMT ioctls Akinobu Mita
2019-01-07 11:32 ` Sakari Ailus
2019-01-07 14:18 ` Akinobu Mita
2019-01-07 15:16 ` Sakari Ailus
2019-01-07 9:36 ` [PATCH 00/12] media: mt9m001: switch soc_mt9m001 to a standard subdev sensor driver Sakari Ailus
2019-01-07 9:48 ` Sakari Ailus
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=1545498774-11754-10-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@s-opensource.com \
--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).