@@ -1732,6 +1732,12 @@ static int vgxy61_power_on(struct device *dev)
}
}
+ ret = vgxy61_detect(sensor);
+ if (ret) {
+ dev_err(&client->dev, "sensor detect failed %d\n", ret);
+ goto disable_clock;
+ }
+
ret = vgxy61_patch(sensor);
if (ret) {
dev_err(&client->dev, "sensor patch failed %d\n", ret);
@@ -1858,12 +1864,6 @@ static int vgxy61_probe(struct i2c_client *client)
if (ret)
return ret;
- ret = vgxy61_detect(sensor);
- if (ret) {
- dev_err(&client->dev, "sensor detect failed %d\n", ret);
- return ret;
- }
-
vgxy61_fill_sensor_param(sensor);
vgxy61_fill_framefmt(sensor, sensor->current_mode, &sensor->fmt,
VGXY61_MEDIA_BUS_FMT_DEF);
Previously the device detection was performed after patching. Move it right after the reset to make sure we have the correct sensor before trying to patch it. Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> --- drivers/media/i2c/st-vgxy61.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)