From 5fcf0c4d992973037d3424e60b61d2ff78cb2440 Mon Sep 17 00:00:00 2001 From: jiabinhe Date: Mon, 11 Nov 2024 13:45:21 +0800 Subject: [PATCH] media: fix s3 issue patch 3 Signed-off-by: jiabinhe --- drivers/media/i2c/ti960-des.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ti960-des.c b/drivers/media/i2c/ti960-des.c index a06813da0946..1e910db62882 100644 --- a/drivers/media/i2c/ti960-des.c +++ b/drivers/media/i2c/ti960-des.c @@ -904,7 +904,11 @@ static int ti960_registered(struct v4l2_subdev *subdev) if (rval) continue; - reset_sensor(va, &va->sub_devs[k], &va->subdev_pdata[k]); + rval = reset_sensor(va, &va->sub_devs[k], &va->subdev_pdata[k]); + if (rval) { + dev_err(va->sd.dev, "sensor failed to reset.\n"); + return rval; + } /* Map slave I2C address. */ rval = ti960_map_i2c_slave(va, &va->sub_devs[k], @@ -1935,6 +1939,12 @@ static int ti960_resume(struct device *dev) rval = ti960_config_ser(va, client, i, sensor_subdev, pdata); if (rval) dev_warn(va->sd.dev, "resume: failed config subdev"); + + rval = reset_sensor(va, &va->sub_devs[i], &va->subdev_pdata[i]); + if (rval) { + dev_err(va->sd.dev, "sensor failed to reset.\n"); + return rval; + } } return 0;