Commit 0d5078c7 authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by Mauro Carvalho Chehab

media: imx: mipi csi-2: Don't fail if initial state times-out

Not all sensors will be able to guarantee a proper initial state.
This may be either because the driver is not properly written,
or (probably unlikely) because the hardware won't support it.

While the right solution in the former case is to fix the sensor
driver, the real world not always allows right solutions, due to lack
of available documentation and support on these sensors.

Let's relax this requirement, and allow the driver to support stream start,
even if the sensor initial sequence wasn't the expected.

Also improve the warning message to better explain the problem and provide
a hint that the sensor driver needs to be fixed.
Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
Signed-off-by: default avatarFabio Estevam <festevam@gmail.com>
Reviewed-by: default avatarSteve Longerbeam <slongerbeam@gmail.com>
Reviewed-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 9bf656e1
...@@ -243,7 +243,7 @@ static int __maybe_unused csi2_dphy_wait_ulp(struct csi2_dev *csi2) ...@@ -243,7 +243,7 @@ static int __maybe_unused csi2_dphy_wait_ulp(struct csi2_dev *csi2)
} }
/* Waits for low-power LP-11 state on data and clock lanes. */ /* Waits for low-power LP-11 state on data and clock lanes. */
static int csi2_dphy_wait_stopstate(struct csi2_dev *csi2) static void csi2_dphy_wait_stopstate(struct csi2_dev *csi2)
{ {
u32 mask, reg; u32 mask, reg;
int ret; int ret;
...@@ -254,11 +254,9 @@ static int csi2_dphy_wait_stopstate(struct csi2_dev *csi2) ...@@ -254,11 +254,9 @@ static int csi2_dphy_wait_stopstate(struct csi2_dev *csi2)
ret = readl_poll_timeout(csi2->base + CSI2_PHY_STATE, reg, ret = readl_poll_timeout(csi2->base + CSI2_PHY_STATE, reg,
(reg & mask) == mask, 0, 500000); (reg & mask) == mask, 0, 500000);
if (ret) { if (ret) {
v4l2_err(&csi2->sd, "LP-11 timeout, phy_state = 0x%08x\n", reg); v4l2_warn(&csi2->sd, "LP-11 wait timeout, likely a sensor driver bug, expect capture failures.\n");
return ret; v4l2_warn(&csi2->sd, "phy_state = 0x%08x\n", reg);
} }
return 0;
} }
/* Wait for active clock on the clock lane. */ /* Wait for active clock on the clock lane. */
...@@ -316,9 +314,7 @@ static int csi2_start(struct csi2_dev *csi2) ...@@ -316,9 +314,7 @@ static int csi2_start(struct csi2_dev *csi2)
csi2_enable(csi2, true); csi2_enable(csi2, true);
/* Step 5 */ /* Step 5 */
ret = csi2_dphy_wait_stopstate(csi2); csi2_dphy_wait_stopstate(csi2);
if (ret)
goto err_assert_reset;
/* Step 6 */ /* Step 6 */
ret = v4l2_subdev_call(csi2->src_sd, video, s_stream, 1); ret = v4l2_subdev_call(csi2->src_sd, video, s_stream, 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment