-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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: Move the sensors to their dedicated directory #73013
drivers: video: Move the sensors to their dedicated directory #73013
Conversation
Now we have more drivers, maybe we should have a |
a3f6020
to
ce289c7
Compare
ce289c7
to
ad9e425
Compare
Thank you taking the time to review! I will fix the conflicts and other CI issues, rebase, and wait that the few ongoing video driver PRs are merged to reduce friction then apply the exact same changes to the new drivers, and finally un-draft it. |
I will keep the Good to be sharing the hierarchy with Linux: that makes things easier to understand for Linux users. Also, "I2C" makes it very easy to decide/find where drivers go/are: if it is on-i2c-bus, then it is in this directory. This might be for all the external parts not inside the same SoC (since I2C is used to control them). |
2216c68
to
4181bb3
Compare
Just rebased and put on top of I2C. It is tempting to merge #66994 first to avoid delaying it further. |
4181bb3
to
988c355
Compare
Video processing devices sometimes include external chips often configured on I2C: sensors, flash, motors, decoders, ISPs... This commit groups the sensor on a new I2C directory layout akin to Linux's drivers/media/i2c. The Kconfig CMakeLists.txt is slightly adjusted for the occasion, to look like the other drivers directories. Signed-off-by: Josuah Demangeon <[email protected]>
988c355
to
6fe7821
Compare
Force push to rebase. @loicpoulain this is currently using the |
I am not sure I understand the rationale for the change (as in: I am saying this because I really don't understand, not because I am passive-aggressively questioning the fact this might be the right thing to do :)) Thanks! |
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.
Tagging @ceolin because this is becoming a mess, sensors has folders for manufacturers, so does boards, and this is grouping by interface? Why? Why is this needed? What other drivers are going to make their own groupings up? If drivers should be grouped then they should be grouped as existing things are - by manufacturer, otherwise not grouped at all. Tagged @ceolin for possible process meeting discussion
I'm guessing you meant to tag @keith-zephyr? |
Right you are, my bad. |
I tried to illustrate some very frequent situation of video drivers here: As illustrated, it is frequent to have a set of I2C-controlled peripherals that drive a fast data feed, but whose drivers are not directly interacting with the data, instead handled by a separate DMA I/O core such as MIPI or DMCI. They use a different subset of the video API:
For instance, the ArduCam Mega abstract all the sensor features including the zoom level, and offer a single video interface for both data and control [1]. Having a separate zoom motor could conveniently be interfaced to a video driver using that same zoom control ID. I would make sure to ask when this situation surfaces.
I do not think this is needed. Looking that other driver classes sometimes had sub-directories ( Now that I look again, I notice that all drivers that have a sub-directory (other than per-vendor), actually implement a different
Thank you for the insights. [1]: Good counter-example of a sensor that uses SPI for both control and data and does not fit in any of the category I was proposing... rookie mistake! |
Closing this as I AFAIU there is no grouping needed at all. Thank you for the feedback and apologies or the needless noise! |
I always think grouping video device drivers into two categories is necessary :
As pointed out by @josuah, currently all the video drivers are placed in the same folder and the current video API are made for all kinds of video devices (which should not). Perhaps not now but in long terms, we should categrorize the APIs and do the grouping. As an example, the set/get_ctrl API should concern only the external devices (sensors) not the internal ones. |
All right, re-opening for the sake of discussion then! |
Should the current sensors get a |
We're already in video directory, so it does not bring any useful info. Yeah some other drivers use that prefix... |
It feels like this should be closed given some of the recent comments? |
Given the feedback, I do not see something that can be immediately done regarding the naming of sensors. |
This allows to have a more immediate insight of the different kinds of video drivers present in this directory, as well as help maintenance of a whole group at once i.e. during refactors.
I still need to test building it and run it on hardware...
I understand that these kind of modifications might not be desired for backward compatibility reasons, or avoid breaking ongoing pull requests.