Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -2816,6 +2816,7 @@ Params: rotation Mounting rotation of the camera sensor (0 or
(the default), 37125000 or 74250000.
always-on Leave the regulator powered up, to stop the
camera clamping I/Os such as XTRIG to 0V.
sync-sink Configure as synchronisation sink.


Name: imx327
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/imx296-overlay.dts
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,6 @@
<&imx296>, "avdd-supply:0=",<&cam0_reg>;
clock-frequency = <&clk_over>, "clock-frequency:0";
always-on = <0>, "+99";
sync-sink = <&imx296>,"trigger-mode:0";
};
};
13 changes: 10 additions & 3 deletions drivers/media/i2c/imx296.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ struct imx296 {

const struct imx296_clk_params *clk_params;
bool mono;
int trigger_mode_of;

struct v4l2_subdev subdev;
struct media_pad pad;
Expand Down Expand Up @@ -645,16 +646,17 @@ static int imx296_setup(struct imx296 *sensor, struct v4l2_subdev_state *state)

static int imx296_stream_on(struct imx296 *sensor)
{
int ret = 0;
int ret = 0, tm;

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

/* external trigger mode: 0=normal, 1=triggered */
tm = (sensor->trigger_mode_of >= 0) ? sensor->trigger_mode_of : trigger_mode;
imx296_write(sensor, IMX296_CTRL0B,
(trigger_mode == 1) ? IMX296_CTRL0B_TRIGEN : 0, &ret);
(tm == 1) ? IMX296_CTRL0B_TRIGEN : 0, &ret);
imx296_write(sensor, IMX296_LOWLAGTRG,
(trigger_mode == 1) ? IMX296_LOWLAGTRG_FAST : 0, &ret);
(tm == 1) ? IMX296_LOWLAGTRG_FAST : 0, &ret);

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

Expand Down Expand Up @@ -1079,6 +1081,7 @@ static int imx296_probe(struct i2c_client *client)
unsigned long clk_rate;
struct imx296 *sensor;
unsigned int i;
u32 tm_of;
int ret;

if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) {
Expand Down Expand Up @@ -1145,6 +1148,10 @@ static int imx296_probe(struct i2c_client *client)
if (ret < 0)
goto err_power;

/* Default the trigger mode from OF to -1, which means invalid */
ret = of_property_read_u32(client->dev.of_node, "trigger-mode", &tm_of);
sensor->trigger_mode_of = (ret == 0) ? tm_of : -1;

/* Initialize the V4L2 subdev. */
ret = imx296_subdev_init(sensor);
if (ret < 0)
Expand Down
Loading