diff options
author | Benjamin Mugnier <benjamin.mugnier@foss.st.com> | 2023-02-01 15:04:15 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2023-03-20 00:36:05 +0100 |
commit | 985ed1d7432eb0a28be190e2b855050cf1f926fd (patch) | |
tree | f08e132fc02db37a6af63e02c290a14619d04c49 /drivers | |
parent | 5a6cf0871265ae89090453e5eab1cb4a5a8ace0c (diff) |
media: i2c: st-vgxy61: Move 'detect' call to 'power_on'
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>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/i2c/st-vgxy61.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/i2c/st-vgxy61.c b/drivers/media/i2c/st-vgxy61.c index 9c0284f83413..60f7974fc3bf 100644 --- a/drivers/media/i2c/st-vgxy61.c +++ b/drivers/media/i2c/st-vgxy61.c @@ -1734,6 +1734,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); @@ -1860,12 +1866,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); |