Skip to content

Commit cb7a91d

Browse files
committed
video: esp32: initialize video format
Make sure the driver initializes with the sensors default format. Signed-off-by: Armin Kessler <[email protected]>
1 parent 9f181b6 commit cb7a91d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/video/video_esp32_dvp.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,16 @@ static int video_esp32_init(const struct device *dev)
386386
return -ENODEV;
387387
}
388388

389+
if (!device_is_ready(cfg->source_dev)) {
390+
LOG_ERR("Source device not ready");
391+
return -ENODEV;
392+
}
393+
394+
if (video_get_format(cfg->source_dev, &data->video_format) < 0) {
395+
LOG_ERR("Failed to get format from source device");
396+
return -EINVAL;
397+
}
398+
389399
return 0;
390400
}
391401

0 commit comments

Comments
 (0)