On Mon, Aug 31, 2020 at 01:46:00PM -0700, Sowjanya Komatineni wrote:
On 8/31/20 1:23 PM, Sakari Ailus wrote:Indeed.
Do you mean to remove stop stream during remove()?@@ -1968,19 +2087,45 @@ static int imx274_remove(struct i2c_client *client)This really shouldn't happen and the driver isn't expected to handle it
struct v4l2_subdev *sd = i2c_get_clientdata(client);
struct stimx274 *imx274 = to_imx274(sd);
+ pm_runtime_get_sync(&imx274->client->dev);
+
/* stop stream */
either.
Stop stream is not part of this change and as writes to sensor can't happen
when power off, added pm_runtime_get_sync
But there certainly isn't a need to power the sensor on to stream off, is
there?
imx274_write_table(imx274, imx274_stop);
v4l2_async_unregister_subdev(sd);
v4l2_ctrl_handler_free(&imx274->ctrls.handler);
+
+ pm_runtime_put(&client->dev);
+ pm_runtime_disable(&client->dev);
+ pm_runtime_set_suspended(&client->dev);
+
media_entity_cleanup(&sd->entity);
mutex_destroy(&imx274->lock);
return 0;
}