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>
This commit is contained in:
committed by
Hans Verkuil
parent
ff0fcda15f
commit
0e7f68fe16
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user