Skip to content

Conversation

mjs513
Copy link

@mjs513 mjs513 commented Sep 20, 2025

This PR is a clean PR of video: ov7675: add Omnivision OV7675 sensor support and basic controls PR per your request.

@avolmat-st
Copy link

@mjs513

Please do not add a commit to fix review comments. You have to update the existing commits in order to fix the issue related to what is in each commit.
Moreover, the code you are providing does not compile and add new structures that are not used within the driver.

Please fix that before requesting again a new review.

@mjs513
Copy link
Author

mjs513 commented Sep 22, 2025

@avolmat-st

Thought you would want it as new commit - going to be a pain to do it in the separate commits. In addition other than the 0x20 comment they seemed to all apply to the combined version

As for not compiling for you - not sure why. I tested with both the OV7675 and OV7670 using zephyr directly and via the arduino ide. Both versions compiled without an issue. But will double check anyway

@avolmat-st
Copy link

Thought you would want it as new commit - going to be a pain to do it in the separate commits. In addition other than the 0x20 comment they seemed to all apply to the combined version

Only commits which have been reviewed and are corrects will be merged into the tree. We do not merge series of commits fixing each others within the same PR.

Cf https://docs.zephyrproject.org/latest/contribute/contributor_expectations.html

Especially this section:https://docs.zephyrproject.org/latest/contribute/contributor_expectations.html#pr-requirements, point 3 (Squash Intermediary or Non-Final Development History) and 4 (Ensure Clean History Before Submission)

@mjs513 mjs513 force-pushed the Add-New-OV7675-Driver branch 6 times, most recently from 6874e05 to a1a7b03 Compare September 24, 2025 12:47
@avolmat-st
Copy link

Hi @mjs513,

I will have a look at the code itself. I don't know how to make comment on the commit log itself so I write it here.
This is how it looks like now:

commit a1a7b03c47f93c32a6a947523fe5a017c377c430 (HEAD -> Add-New-OV7675-Driver)
Author: Mike S <[email protected]>
Date:   Sat Sep 20 10:13:23 2025 -0400

    drivers: video: Commit adds the OV7675 driver to the existing OV7670 driver
    
    drivers: video: Commit adds the OV7675 driver to the existing OV7670 driver
    
    Updates ov7670.c to incorporate the OV7675 driver into the OV7670 driver.
    
    Signed-off-by: Michael Smorto <[email protected]>

commit 4a441e429ef5164938660da1587d391791d1d00a
Author: Mike S <[email protected]>
Date:   Sat Sep 20 10:04:29 2025 -0400

    drivers: video: ov7670 driver changes in prep for adding OV7675
    
    drivers: video: ov7670 driver changes in prep for adding OV7675
    
    Updates ov7670.c in prep for incorporation of OV7675. See previous PR.
    
    Signed-off-by: Michael Smorto <[email protected]>

Aka, the short message like (first line) is repeated again within the commit log. Could you fix that ?
Moreover, only commits remains, so it is not possible to have See previous PR in a commit log. You need to describe what the commit does.

@mjs513 mjs513 requested a review from avolmat-st September 24, 2025 12:55
@mjs513
Copy link
Author

mjs513 commented Sep 24, 2025

@avolmat-st - @KurtE

All changes incorporated but can not seem to update the com10 register in prep commit (drivers: video: ov7670 driver changes in prep for adding OV7675) but it is fixed in the full commit.

I did manage to fix dual camera mode so should be ready to try when PRs are incorporated for multiple streams.

Tested on the GIGA - you are getting compile errors let me know what you are seeing.

@avolmat-st
Copy link

@mjs513
I only reviewed the first commit but since it seems like some of the comment I made before are valid again, I didn't proceed with the 2nd patch. I'll do that once this one is fixed.

@mjs513 mjs513 force-pushed the Add-New-OV7675-Driver branch from a1a7b03 to d2f5e51 Compare September 24, 2025 13:09
@mjs513
Copy link
Author

mjs513 commented Sep 24, 2025

Morning @avolmat-st

Thanks really strange. I am using Github desktop to push changes but I am not seeing that and using amend to make the change. So for

commit a1a7b03c47f93c32a6a947523fe5a017c377c430 (HEAD -> Add-New-OV7675-Driver)
Author: Mike S <[email protected]>
Date:   Sat Sep 20 10:13:23 2025 -0400

    drivers: video: Commit adds the OV7675 driver to the existing OV7670 driver
    
    drivers: video: Commit adds the OV7675 driver to the existing OV7670 driver
    
    Updates ov7670.c to incorporate the OV7675 driver into the OV7670 driver.
    
    Signed-off-by: Michael Smorto <[email protected]>

the only thing I am seeing after I do the amend (I am als updating for changes here)

…
drivers: video: Commit adds the OV7675 driver to the existing OV7670 driver

Updates ov7670.c to incorporate the OV7675 driver into the OV7670 driver + resolve initial comments + fixes for dual camera support.

Signed-off-by: Michael Smorto <[email protected]>

This is all I am seeing for the other commit

drivers: video: ov7670 driver changes in prep for adding OV7675

Updates ov7670.c in prep for incorporation of OV7675. See previous PR.

Signed-off-by: Michael Smorto <[email protected]>

So not sure how to fix that one

UPDATE: NOW FIXED

@avolmat-st
Copy link

Morning @avolmat-st

Thanks really strange. I am using Github desktop to push changes but I am not seeing that and using amend to make the change. So for

So not sure how to fix that one

I can't help with Github desktop, never used that.

@mjs513
Copy link
Author

mjs513 commented Sep 24, 2025

I can't help with Github desktop, never used that.
Playing with just using command line - any hints

Think I figured it out now to see about making changes

@mjs513
Copy link
Author

mjs513 commented Sep 25, 2025

@avolmat-st

Tried to incorporate changes to the 1st commit, i.e.,

drivers: video: ov7670 driver changes in prep for adding OV7675
4a441e429ef5164938660da1587d391791d1d00a

but things were getting so corrupted with updating the file had to stop the trying to do the updates.

Wondering if it would be better to temporarily delete the second commit

drivers: video: Commit adds the OV7675 driver to the existing OV7670 driver
d2f5e51bf3ecd07c3d301a76ad7208a0703cfb0e

and finish off any changes to the first and then resubmit the second commit?

UPDATE: Sorry went ahead and did this so should be easier to make the changes

@mjs513 mjs513 force-pushed the Add-New-OV7675-Driver branch 2 times, most recently from 2770d45 to d34d077 Compare September 25, 2025 15:39
@mjs513 mjs513 force-pushed the Add-New-OV7675-Driver branch 2 times, most recently from 190faae to edcc6b6 Compare September 25, 2025 16:06
@mjs513 mjs513 requested a review from avolmat-st September 25, 2025 16:09
@mjs513 mjs513 force-pushed the Add-New-OV7675-Driver branch 6 times, most recently from 96ef7e9 to 60697fa Compare September 27, 2025 14:05
Copy link

@avolmat-st avolmat-st left a comment

Choose a reason for hiding this comment

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

Hi @mjs513,
thanks for the update. Functionally this looks good to me. However some modifications are introduced within this commit which doesn't have to be I think.
This commit is all about switching to the CCI interface for talking to the sensor hence modification should stick to this.

@mjs513 mjs513 force-pushed the Add-New-OV7675-Driver branch from 60697fa to bb2fea6 Compare September 28, 2025 11:54
@mjs513 mjs513 requested a review from avolmat-st September 28, 2025 11:57
Copy link

@avolmat-st avolmat-st left a comment

Choose a reason for hiding this comment

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

Hi @mjs513,
sorry I may sound very annoying with my reviews, however as I said previously, commit should be focused on one kind of modifications (this is also explained in the Zephyr contribution page but is also a general good thing when dealing with commits).
Here for example, the OV7670_INIT maybe sounds like actually just changing the indentation but turned out that there were a change that I didn't noticed at first:

struct ov7670_data ov7670_data_##inst

got replaced by

static struct ov7670_data ov7670_data_##inst

@mjs513 mjs513 force-pushed the Add-New-OV7675-Driver branch 2 times, most recently from 974b001 to 358c772 Compare October 4, 2025 21:52
@mjs513 mjs513 requested a review from avolmat-st October 5, 2025 11:17
@josuah
Copy link
Contributor

josuah commented Oct 5, 2025

At fist, the request was to squash everything into a single commit... This helps! Though, a second step after "merging all WIP commits" might be "re-splitting the changes".

So how to split the commit?

First, find the commit you want to split with for instance git log.

Then, start an "interactive rebase" to modify the git history (pretty much the only command to remember for git) with 1122334455aabb your commit hash of choice:

git rebase -i 1122334455aabb~1

You would see a menu opening in a text editor, in which you can find your the commit you need (here just one in the list) replacing pick by edit, then exiting the text editor.

You will now be having your files at the state just before the big commit to split, and there you can the changes you want to split away from the big commit. You can do git diff 1122334455aabb, to see the changes you can import in a new commit.

The changes of your new commit will be visible with git diff.
The changes of your next big commit will be visible with git diff 1122334455aabb.
And you can edit the files until the git diff 1122334455aabb gets small enough to your liking.

For instance, once git diff shows only changes related to the CCI API, you can run git add . and git commit -s to add an extra commit the normal way.

Finally, you can run this and you would have your big commit split:

git rebase --continue

Reviewing again that everything is fine with git log -c, and finally a git push -f to update this PR: you would be done!

Copy link

@avolmat-st avolmat-st left a comment

Choose a reason for hiding this comment

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

Can you also update the commit message. You can simplify it by mentioning the move to the cci helpers ?
Thanks a lot.

@mjs513 mjs513 force-pushed the Add-New-OV7675-Driver branch from 358c772 to bda249e Compare October 5, 2025 17:59
drivers: video: Restructure OV760.c driver before adding OV7675 support

Modifications for use of video cci helpers in video_common.h.

Signed-off-by: Mike S <[email protected]>
@mjs513 mjs513 force-pushed the Add-New-OV7675-Driver branch from bda249e to 518132a Compare October 5, 2025 21:04
@mjs513 mjs513 requested a review from avolmat-st October 5, 2025 21:05
@mjs513
Copy link
Author

mjs513 commented Oct 5, 2025

@avolmat-st
What would you like to see in the next commit - was thinking
commit 1. Change things like ov7670_config to ov767x_config without adding in the ov7675 stuff. This would include moding the define slightly. No change to using #define OV767X_INIT yet
commit 2. Add in #if DT_HAS_COMPAT_STATUS_OKAY(ovti_ov7670) where necessary in prep
commit 3. Make changes to the defihe: #define OV767X_INIT(inst, id) to use id.
commit 4. Final commit add in the OV7675 and necessary changes to rest of driver for using the ov7675.

Copy link

sonarqubecloud bot commented Oct 5, 2025

@josuah
Copy link
Contributor

josuah commented Oct 6, 2025

What would you like to see in the next commit - was thinking

  1. Code reformatting changes usually take their own commit, unless these are just 1 very small change nearby a line modified
  2. Here there was also a conversion for using the CCI function family (thank you!) which is unrelated to the conversion of the driver (even though it helps), and could take their own commit
  3. Then there is the transformation of the driver happening, which can be a single commit, or if you wish, segment it further in smaller steps, and the sequence you proposed sounds reasonable. It is also possible to have just 2 commits for this step: (3.) make the driver support multiple similar sensors, (4.) add the extra OV7675 sensor using the newly introduced setup.

This will be the first Zephyr driver to support multiple sensors, so the time spent on isolating a commit that add another sensor to an existing driver will help the next users, so it is a bit like writing a step-by-step tutorial on how to do it where every step is a commit in a way.

Thanks all for your patience!

@mjs513
Copy link
Author

mjs513 commented Oct 6, 2025

@josuah

This will be the first Zephyr driver to support multiple sensors, so the time spent on isolating a commit that add another sensor to an existing driver will help the next users, so it is a bit like writing a step-by-step tutorial on how to do it where every step is a commit in a way.

Think I am probably going to do the OV7675 changes necessary for the driver increaments. Should be easier to review. Then at the end do a squash of the incremental changes so at the end there will only 2 be 2 commits - 1 for the cci and the 2nd for the ov7675

Also should I rename the driver to ov767x.c?

thanks
mikd

@KurtE
Copy link
Contributor

KurtE commented Oct 6, 2025

This will be the first Zephyr driver to support multiple sensors, so the time spent on isolating a commit that add another sensor to an existing driver will help the next users, so it is a bit like writing a step-by-step tutorial on how to do it where every step is a commit in a way.

Know the feeling. I thought I would do a simple diversion from cameras and add support for the is31fl3197 LED driver as there
is one on the Arduino Giga Display Shield. But then it was decided it should be combined with the is31fl3194 driver and
rename all of it to is31fl319x, and split up all of the changes into different commits (#96821).
Hopefully, I will be done soon with this diversion, so I can get back to the others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Video Video subsystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants