-
Notifications
You must be signed in to change notification settings - Fork 7.3k
drivers: video: ov7725: add sensor driver for ov7725 #30744
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: ov7725: add sensor driver for ov7725 #30744
Conversation
@lgl88911, It looks interesting, but could you please split it in several commits, at least one for the dts changes, one for the new ov driver and one for the sample. |
|
No, keep one branch and one PR/MR, don't need to close this one, I just wanted you split your changes in multiple git commits not in multiple branches. |
ed5e1a3
to
707d55a
Compare
@loicpoulain Thanks for your explain, I split it to three commits, Please help review again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, it looks good, just few comments to address.
707d55a
to
7916ec0
Compare
7916ec0
to
fcf562e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @lgl88911 !
msgs[1].len = 1; | ||
msgs[1].flags = I2C_MSG_WRITE | I2C_MSG_STOP; | ||
|
||
return i2c_transfer(drv_data->i2c, msgs, 2, drv_data->i2c_addr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason you can't use i2c_reg_write_byte()
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although i2c_reg_write_byte can achieve the same purpose, I hope it is the similar as ov7725_read_reg.
msgs[1].len = 1; | ||
msgs[1].flags = I2C_MSG_READ | I2C_MSG_STOP | I2C_MSG_RESTART; | ||
|
||
return i2c_transfer(drv_data->i2c, msgs, 2, drv_data->i2c_addr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace with i2c_reg_read_byte()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OV7725 uses SCCB to communicate. SCCB is similar to I2C, but not exactly the same. When SCCB reads the register, an I2C stop bit is required after the register address of OV7725 is written, and then the read operation can be performed. i2c_reg_read_byte call i2c_write_read, Its implementation lacks a stop bit
{
struct i2c_msg msg[2];
msg[0].buf = (uint8_t *)write_buf;
msg[0].len = num_write;
msg[0].flags = I2C_MSG_WRITE;
msg[1].buf = (uint8_t *)read_buf;
msg[1].len = num_read;
msg[1].flags = I2C_MSG_RESTART | I2C_MSG_READ | I2C_MSG_STOP;
return i2c_transfer(dev, msg, 2, addr);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to add the SCCB explanation as an inline comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for suggest, Added it.
fcf562e
to
5dae473
Compare
5dae473
to
de347aa
Compare
This patch adds the driver for Omnivision OV7725 Color CMOS VGA Sensor. The driver currently provides a simple capture function, the output format only provides RGB565,640x480. Signed-off-by: Frank Li <lgl88911@163.com>
Move the unrelated whitespace and Modify line break alignment. Signed-off-by: Frank Li <lgl88911@163.com>
Add camera support, use OV7725 CMOS sensor. Signed-off-by: Frank Li <lgl88911@163.com>
Add the ov7725 senser example, which can run normally on mm_swiftio. Signed-off-by: Frank Li <lgl88911@163.com>
de347aa
to
b812b33
Compare
@MaureenHelm Can you help review again,Thanks |
This patch adds the driver for Omnivision OV7725
Color CMOS VGA Sensor.
The driver currently provides a simple capture
function, the output format only provides
RGB565,640x480.
Signed-off-by: Frank Li lgl88911@163.com