Repository navigation
drivers: media: i2c Updated imx296 driver for external trigger - #5560
Conversation
Updated imx296 driver to support external trigger mode via XTR pin. Added module parameter to control this mode. Signed-off-by: Ben Benson <ben.benson@raspberrypi.com>
|
LGTM. |
|
Checkpatch is complaining that you've not followed the kernel coding style w.r.t. brace placement. Other than that it looks good. |
|
Thanks! |
|
I know this has been merged, but a minor comment that PM_RUNTIME is optional and is also using autosuspend. That means there is no guarantee that the sensor will be reset before each stream_on, and a module parameter can be changed dynamically. Once set into XTRIG mode there is no way to come back out of it unless PM_RUNTIME performs a shutdown on the sensor via the regulator framework. The datasheet also implies that this isn't just a simple external trigger for changing frame rate. For fast trigger mode it states: |
True. We can fix this on top, but I'm not too concerned right now as I doubt users will be switching into and out of this mode at runtime just yet.
Yes it does work as expected. The pulse width sets the exposure time, and we fix the shutter speed in libcamera and the AGC will auto adjust gain as it needs. All very cool! |
|
Ah, I hadn't noted the Signed-of-by, so had assumed this was a 3rd party contribution.
That isn't how I expect it to work. You still have an active V4L2_CID_EXPOSURE control when in this mode, so I'd expect that to determine the exposure time, not some external trigger. It is permitted to have a module parameter that is only checked at probe, so you could remove that control or make it read only at a nominal value if the module parameter is in external trigger mode. I wonder if there a master mode where an IMX296 will generate a suitable trigger based on the configured exposure? I don't see anything obvious in the datasheet. |
|
Removing the control is a no-go as libcamera expects V4L2_CID_EXPOSURE to be available. We can make it read-only with a nominal (but really meaningless) value.
There is a "stereo mode" operation that sort of does this, but it's not exactly what this trigger mode does, and does not seem to be fully deterministic in behavior. |
kernel: drivers: media: i2c Updated imx296 driver for external trigger See: raspberrypi/linux#5560 kernel: overlays: Add bmp380 to i2c-sensor overlay See: raspberrypi/linux#5558 kernel: drivers: media: imx296: Add standby delay during probe See: raspberrypi/linux#5555 kernel: can: isotp: add module parameter for maximum pdu size See: raspberrypi/linux#5557 kernel: media: dt-bindings: imx258: Fix alternate compatible strings
kernel: drivers: media: i2c Updated imx296 driver for external trigger See: raspberrypi/linux#5560 kernel: overlays: Add bmp380 to i2c-sensor overlay See: raspberrypi/linux#5558 kernel: drivers: media: imx296: Add standby delay during probe See: raspberrypi/linux#5555 kernel: can: isotp: add module parameter for maximum pdu size See: raspberrypi/linux#5557 kernel: media: dt-bindings: imx258: Fix alternate compatible strings
Updated imx296 driver to support external trigger mode via XTR pin. Added module parameter to control this mode.