diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2023-11-01 11:22:20 +0300 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-12-04 13:21:46 +0300 |
commit | 0e7f68fe16022fc424fc7244287fe23c7c2fe862 (patch) | |
tree | c2bed03bf82d8c9d587c069b0ce39d3fe72f9ead /drivers | |
parent | ff0fcda15feb4cc1815656fecbe15bd33f37c4f2 (diff) | |
download | linux-0e7f68fe16022fc424fc7244287fe23c7c2fe862.tar.xz |
media: imx319: Enable runtime PM before registering async sub-device
As the sensor may be accessible right after its async sub-device is
registered, enable runtime PM before doing so.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/i2c/imx319.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/media/i2c/imx319.c b/drivers/media/i2c/imx319.c index 420984382173..e47eff672e0c 100644 --- a/drivers/media/i2c/imx319.c +++ b/drivers/media/i2c/imx319.c @@ -2463,19 +2463,21 @@ static int imx319_probe(struct i2c_client *client) goto error_handler_free; } - ret = v4l2_async_register_subdev_sensor(&imx319->sd); - if (ret < 0) - goto error_media_entity; - /* Set the device's state to active if it's in D0 state. */ if (full_power) pm_runtime_set_active(&client->dev); pm_runtime_enable(&client->dev); pm_runtime_idle(&client->dev); + ret = v4l2_async_register_subdev_sensor(&imx319->sd); + if (ret < 0) + goto error_media_entity_pm; + return 0; -error_media_entity: +error_media_entity_pm: + pm_runtime_disable(&client->dev); + pm_runtime_set_suspended(&client->dev); media_entity_cleanup(&imx319->sd.entity); error_handler_free: |