difos/target/linux/bcm27xx/patches-6.12/950-0139-drivers-media-imx296-Updated-imx296-driver-for-exter.patch
Álvaro Fernández Rojas 8f9e91ad03 bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-05-21 11:32:18 +02:00

40 lines
1.2 KiB
Diff

From e98c4a406240cbcac935e233f37136103b384db1 Mon Sep 17 00:00:00 2001
From: Ben Benson <ben.benson@raspberrypi.com>
Date: Fri, 21 Jul 2023 15:59:51 +0100
Subject: [PATCH] drivers: media: imx296: Updated imx296 driver for external
trigger
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>
---
drivers/media/i2c/imx296.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/drivers/media/i2c/imx296.c
+++ b/drivers/media/i2c/imx296.c
@@ -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
@@ -578,6 +582,12 @@ static int imx296_stream_on(struct imx29
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;