Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: video: ov7670: introduce driver for ov7670 camera #72826

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

danieldegrasse
Copy link
Collaborator

Introduce driver for ov7670 camera, supporting QCIF,QVGA,CIF, and VGA
resolution in YUV and RGB mode.

Copy link
Collaborator

@loicpoulain loicpoulain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat! For the record, could you add in the commit message the board/devkit with wich you tested this.

@danieldegrasse
Copy link
Collaborator Author

neat! For the record, could you add in the commit message the board/devkit with wich you tested this.

Sure- it was tested on the FRDM-MCXN947, but that support requires PR #72827, which is dependent on this driver. I can add something like the following to the commit message:

Support was verified on the FRDM-MCXN947, using the SmartDMA camera engine, which is enabled in the following PR: #72827

Would this work?

@loicpoulain
Copy link
Collaborator

Support was verified on the FRDM-MCXN947, using the SmartDMA camera engine, which is enabled in the following PR: #72827

Would this work?

Sure.

Introduce driver for ov7670 camera, supporting QCIF,QVGA,CIF, and VGA
resolution in YUV and RGB mode.

Support was verified on the FRDM-MCXN947, using the SmartDMA camera
engine, which is enabled in the following PR:
zephyrproject-rtos#72827

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Add ov7670 camera driver to build test for video drivers

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
@danieldegrasse
Copy link
Collaborator Author

@loicpoulain could you revisit this PR when you get a chance? I've updated the commit message as requested

Copy link
Collaborator

@loicpoulain loicpoulain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks

@danieldegrasse
Copy link
Collaborator Author

@ngphibang or @josuah, FYI in case either of you would like to provide feedback.

@danieldegrasse
Copy link
Collaborator Author

@decsny would you be willing to review this when you have a chance (or @galak, I'd just like someone to take a look at this from the DTS side based on the assignee the bot selected)

@decsny
Copy link
Member

decsny commented May 31, 2024

the binding is fairly trivial, reassigning to video area

@decsny decsny assigned loicpoulain and unassigned galak and loicpoulain May 31, 2024
#endif
#if DT_ANY_INST_HAS_PROP_STATUS_OKAY(reset_gpios)
/* Reset camera module */
if (gpio_is_ready_dt(&config->reset)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the reset gpio is not ready, the sensor will not intialize, we shouldn't continue and should return -ENODEV ?


#if DT_ANY_INST_HAS_PROP_STATUS_OKAY(pwdn_gpios)
/* Power up camera module */
if (gpio_is_ready_dt(&config->pwdn)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the pwdn gpio is not ready, the sensor will not intialize, we shouldn't continue and should return -ENODEV ?

fmt.pixelformat = VIDEO_PIX_FMT_YUYV;
fmt.width = 640;
fmt.height = 480;
fmt.pitch = 640 * 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. fmt.pitch = fmt.width * 2; is better ?

type: phandle-array
description: |
The RESETn pin is asserted to disable the sensor causing a hard
reset. The sensor receives this as an active-low signal.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. . The sensor receives this as an active-low signal. one extra space here

uint8_t i = 0U;

if (fmt->pixelformat != VIDEO_PIX_FMT_RGB565 && fmt->pixelformat != VIDEO_PIX_FMT_YUYV) {
LOG_ERR("Only RGB565 and YUV supported!");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. LOG_ERR("Only RGB565 and YUYV supported!"); is more precise as we have several "YUV" formats.

return -ENODEV;
}

/* Set default camera format (QVGA, YUV) */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. /* Set default camera format (QVGA, YUYV) */ is more precise as we have several "YUV" formats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Devicetree Binding PR modifies or adds a Device Tree binding area: Video Video subsystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants