-
Notifications
You must be signed in to change notification settings - Fork 5.2k
media: ov9282: Add external trigger mode support #6954
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
base: rpi-6.12.y
Are you sure you want to change the base?
Conversation
Please squash your ov9282 commits into one, then split that in two - one for the driver changes and one for the overlay changes. You can then run With those changes, I presume you are happy with this @6by9? |
Any comments or progress on this? |
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 for the delay in reviewing.
drivers/media/i2c/ov9282.c
Outdated
/* Start streaming */ | ||
ret = ov9282_write_reg(ov9282, OV9282_REG_MODE_SELECT, | ||
1, OV9282_MODE_STREAMING); | ||
1, OV9282_MODE_STREAMING); |
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.
Odd whitespace change for no reason
@@ -992,15 +1060,25 @@ static int ov9282_start_streaming(struct ov9282 *ov9282) | |||
} | |||
|
|||
/* Setup handler will write actual exposure and gain */ | |||
ret = __v4l2_ctrl_handler_setup(ov9282->sd.ctrl_handler); | |||
ret = __v4l2_ctrl_handler_setup(ov9282->sd.ctrl_handler); |
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.
Whitespace change
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.
Looking again I'll acknowledge that it's wrong in the original, but changing it should be a separate patch.
drivers/media/i2c/ov9282.c
Outdated
|
||
/* 1 frame per trigger */ | ||
ov9282_write_reg(ov9282, OV9282_REG_NUM_FRAME_ON_TRIG, 1, 0x01); | ||
if (ret) { |
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.
You've not saved the result of ov9282_write_reg
to ret
, so this will never fail.
Ditto subsequent calls.
I need external trigger in order to capture laser light reflected from a moving mirror, so I tried this code with:
It works. Tested with CAM-MIPIOV9281V2 (Innomaker) on a Raspberry 5. Thank you. |
Adds DT property `trigger-mode` to enable FSIN-triggered frame capture. Includes overlay and README update for ov9281_trig. Signed-off-by: Omer Faruk Edemen <[email protected]> Signed-off-by: omer <[email protected]>
This patch adds support for external FSIN-triggered snapshot mode to the OmniVision OV9282 sensor driver. It enables frame capture synchronized with an external hardware trigger signal. Signed-off-by: omer <[email protected]>
Sorry for the latency. @stalinbeltran i am glad it worked for you. |
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 but this seems to be worse than last time.
You haven't address pelwell's comment
Please squash your ov9282 commits into one, then split that in two - one for the driver changes and one for the overlay changes.
We have a number of whitespace changes. One is correct, but whitespace cleanups should never be merged into the same commit as functional changes.
@@ -992,15 +1060,25 @@ static int ov9282_start_streaming(struct ov9282 *ov9282) | |||
} | |||
|
|||
/* Setup handler will write actual exposure and gain */ | |||
ret = __v4l2_ctrl_handler_setup(ov9282->sd.ctrl_handler); | |||
ret = __v4l2_ctrl_handler_setup(ov9282->sd.ctrl_handler); |
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.
Looking again I'll acknowledge that it's wrong in the original, but changing it should be a separate patch.
/* Start streaming */ | ||
ret = ov9282_write_reg(ov9282, OV9282_REG_MODE_SELECT, | ||
1, OV9282_MODE_STREAMING); | ||
ret = ov9282_write_reg(ov9282, OV9282_REG_MODE_SELECT, 1, OV9282_MODE_STREAMING); |
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.
Again a whitespace change, and this one breaks the linux-media coding standard of max 80 chars per line. https://www.kernel.org/doc/html/latest/driver-api/media/maintainer-entry-profile.html#coding-style-addendum
ret = ov9282_write_reg(ov9282, OV9282_REG_MODE_SELECT, 1,
OV9282_MODE_STREAMING);
would be permitted and cleaner, but again it shouldn't be mixed in with a functional change.
drivers/media/i2c/ov9282.c
Outdated
@@ -964,13 +1023,12 @@ static int ov9282_start_streaming(struct ov9282 *ov9282) | |||
{OV9282_REG_ANA_CORE_2, OV9282_ANA_CORE2_RAW8}, | |||
} | |||
}; | |||
const struct ov9282_reg_list *reg_list; | |||
struct ov9282_reg_list *reg_list; |
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.
Why have we lost the const
?
And then we regain it in your second patch.
/dts-v1/; | ||
/plugin/; | ||
|
||
#include <dt-bindings/gpio/gpio.h> |
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.
Why is this required? I don't see any references in the overlay to defines that it provides.
Adds DT property
trigger-mode
to enable FSIN-triggered frame capture. Includes overlay and README update for ov9281_trig.#5349 (comment)