-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Add mipi csi2 rx driver #71859
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
Add mipi csi2 rx driver #71859
Conversation
16dfe24
to
d474a98
Compare
@danieldegrasse , @decsny Thanks. Is it ok for you now ? |
Which PR has the devicetree definition for the CSI2RX on the RT11xx after the initial PR was split? At the very least, the SOC devicetree definition can be added here (I know we may need to wait on the board definition until #71854 merges) |
d474a98
to
098c6ea
Compare
@danieldegrasse : Ok. Added the commit that adds MIPI CSI2Rx node. BTW, it depend on #72420, not #71854 |
bool "NXP MIPI CSI-2 Rx driver" | ||
default y | ||
depends on DT_HAS_NXP_MIPI_CSI2RX_ENABLED | ||
select VIDEO_MCUX_CSI |
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.
VIDEO_MCUX_CSI
currently depends on HAS_MCUX_CSI
, which we don't select for the RT11xx. Perhaps the best choice is to remove the dependency on HAS_MCUX_CSI
in #72420?
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.
Yes, it is already done in #71860 as a "misc fix".
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.
Otherwise, this does not relate to this PR, right ?
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.
Sorry, I missed that PR- it does relate, because the select VIDEO_MCUX_CSI
statement here will trigger a Kconfig error on the RT11xx series when building the CSI2X driver, because VIDEO_MCUX_CSI
currently has a dependency on HAS_MCUX_CSI
. All this means is that this PR is dependent on #71860, as far as I can tell
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.
But this CSI2Rx driver doesn't build. Both CSI and CSI2Rx will build only when there is a camera sensor connected to them and the build is triggered in the camera sensor overlay (another PR). By default, CSI2Rx and CSI nodes are disabled.
BTW, this PR is dependent on #72420 because of the change from "sensor" to "sdev".
So, there is a mutual dependency here ...
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.
@danieldegrasse : So, is it better to move the commit b226ded to #71860 or make it a standalone PR ? I think the first option is better
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.
I'm fine to move b226dedfbc2c4cbcf37dd1c86e85895a4660afa3 into #71860.
But this CSI2Rx driver doesn't build. Both CSI and CSI2Rx will build only when there is a camera sensor connected to them and the build is triggered in the camera sensor overlay (another PR). By default, CSI2Rx and CSI nodes are disabled.
Maybe I'm not following here- are you saying that since the CSI2Rx driver does not build as part of this PR, there is no dependency on #71860? Generally, we want to be able to build code that is introduced with a PR as part of that PR. Finding out there is a build error later on means we have to fix something in the tree, which is less clean than getting it right the first time around
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.
Okay ...
- Added a commit as build test for the mipi csi2rx driver
- Split drivers: video: csi: Change sensor dev to source dev #72623 from Modify NXP's CSI driver to support both rt11xx and rt10xx #72420 to avoid mutual dependency
This PR is now dependent on #72623 and #71854 as #71860 is merged.
Is it ok for you now ?
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.
Yes, I think this is ok. To make sure I understand the dependency chain here:
#72623: no dependencies
#71854: no dependencies
#71859: dependent on #72623 and #71854
#72420: dependent on #71859 (and its dependencies)
#72434: dependent on #72420 (and its dependencies)
#72632: dependent on #72434 (and its dependencies)
Is this all accurate? I'm not clear why this PR depends on #71854, but you know this code best
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.
@danieldegrasse It's nearly correct. The dependency chain are:
#72435: no dependencies
#71854: no dependencies
#72623: no dependencies (merged)
#72631: no dependencies (merged)
#71859: dependent on #72623 (merged) and #71854
#72420: dependent on #71859 (and its dependencies)
#72434: dependent on #71859 (and its dependencies)
#72633: dependent on #72434 (and its dependencies)
af82217
to
3337b63
Compare
3337b63
to
4b81687
Compare
Updated "sdev" => "source" according the change in #72623 (which is merged) |
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.
LGTM.
@ngphibang can you rebase this PR now that the dependencies are merged? |
* more common and more performant but single lane is also supported. | ||
*/ | ||
#define DEFAULT_MIPI_CSI_NUM_LANES 2 | ||
#define DEFAULT_CAMERA_FRAME_RATE 30 |
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 value to making this a Kconfig. Write now the user has to edit this driver file to change the default frame rate.
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.
@mmahadevan108 : This has been explained to Daniel. Similar to format, framerate setting needs a runtime accordance and depends on capacity of multiple elements along the camera pipeline. That means which framerate can be supported depends on not only the mipi csi2rx but also other elements (e.g. the camera sensor). It also depends on which format is chosen at runtime.
That's why simply putting this setting in devicetree or Kconfig will not work. I made this PR to add framerate APIs. The ov5640 camera sensor driver will need to be changed as well to support framerate changing. When these things are done and merged, we will be able improve this driver to add support for framerate changing.
4b81687
to
bb8fc9b
Compare
@danieldegrasse yes, rebased now. Could you approve ? Then, I will need @loicpoulain to approve it again (sorry for this inconvenience... I couldn't rebase it earlier as yesterday is a bank holiday in France). BTW, the html documentation CI build failure is not related to my change, I think.
|
Add bindings for NXP MIPI CSI-2 Rx which is a MIPI CSI-2 receiver connecting a camera sensor to the NXP CSI. Signed-off-by: Phi Bang Nguyen <[email protected]>
Add driver to support NXP MIPI CSI-2 Rx which is a MIPI CSI-2 receiver connecting a camera sensor to the NXP CSI. This IP is present in the i.MX RT11XX series. Signed-off-by: Phi Bang Nguyen <[email protected]>
Enable power and clocks for MIPI CSI-2 Rx. Configure Video Mux to connect it to CSI. Signed-off-by: Phi Bang Nguyen <[email protected]>
Add a node for MIPI CSI-2 Rx in i.MX RT11xx devicetree and connect it to the CSI node. Signed-off-by: Phi Bang Nguyen <[email protected]>
c210aba
to
9446cc4
Compare
Add test case for mipi csi2rx driver. As this driver selects the csi driver, the csi node has to be enabled as well. Signed-off-by: Phi Bang Nguyen <[email protected]>
9446cc4
to
3d13f14
Compare
This PR adds mipi csi2 rx driver. It is splitted from #69810 to ease the review process.
Comments from Daniel Degrasse are addressed (at my best).