Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: i2c: imx290: Check for availability in probe()

Currently, the V4L2 subdevice is also created when the device is not
available/connected. From userspace perspective, there is no visible
difference between a working and not-working subdevice (except when
trying it out).

This commit adds a simple preparation step, which includes an
availability check, before the subdev is initialized.

Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Benjamin Bara and committed by
Mauro Carvalho Chehab
9755343c a92651b8

+10
+10
drivers/media/i2c/imx290.c
··· 1589 1589 pm_runtime_set_autosuspend_delay(dev, 1000); 1590 1590 pm_runtime_use_autosuspend(dev); 1591 1591 1592 + /* 1593 + * Make sure the sensor is available, in STANDBY and not streaming 1594 + * before the V4L2 subdev is initialized. 1595 + */ 1596 + ret = imx290_stop_streaming(imx290); 1597 + if (ret) { 1598 + ret = dev_err_probe(dev, ret, "Could not initialize device\n"); 1599 + goto err_pm; 1600 + } 1601 + 1592 1602 /* Initialize the V4L2 subdev. */ 1593 1603 ret = imx290_subdev_init(imx290); 1594 1604 if (ret)