Skip to content

Commit

Permalink
drivers: media: imx296: Updated imx296 driver for external trigger
Browse files Browse the repository at this point in the history
Updated imx296 driver to support external trigger mode via XTR pin.
Added module parameter to control this mode.

Signed-off-by: Ben Benson <[email protected]>
  • Loading branch information
Ben Benson authored and popcornmix committed Aug 17, 2023
1 parent b320cef commit 12406c0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/media/i2c/imx296.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
#include <media/v4l2-fwnode.h>
#include <media/v4l2-subdev.h>

static int trigger_mode;
module_param(trigger_mode, int, 0644);
MODULE_PARM_DESC(trigger_mode, "Set trigger mode: 0=default, 1=XTRIG");

#define IMX296_PIXEL_ARRAY_WIDTH 1456
#define IMX296_PIXEL_ARRAY_HEIGHT 1088

Expand Down Expand Up @@ -578,6 +582,12 @@ static int imx296_stream_on(struct imx296 *sensor)

imx296_write(sensor, IMX296_CTRL00, 0, &ret);
usleep_range(2000, 5000);

if (trigger_mode == 1) {
imx296_write(sensor, IMX296_CTRL0B, IMX296_CTRL0B_TRIGEN, &ret);
imx296_write(sensor, IMX296_LOWLAGTRG, IMX296_LOWLAGTRG_FAST, &ret);
}

imx296_write(sensor, IMX296_CTRL0A, 0, &ret);

return ret;
Expand Down

0 comments on commit 12406c0

Please sign in to comment.