Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e89e1ee
media: ipu-bridge: Add ipu_bridge_get_ipu6()
Sep 7, 2026
914dff4
media: i2c: ov5693: Gate the MIPI clock lane for non-continuous clock
femito1 Sep 2, 2026
d44e42b
media: ipu-bridge: Assign endpoint property indices dynamically
femito1 Sep 2, 2026
8040935
media: ipu-bridge: Match sensor configs per IPU and add config flags
femito1 Sep 2, 2026
508f319
media: ipu-bridge: Request non-continuous clock for ov5693 on IPU6
femito1 Sep 2, 2026
a0327cc
media: ipu-bridge: Keep the clock-noncontinuous property name out of …
femito1 Sep 13, 2026
0db0257
media: i2c: ov13858: add horizontal and vertical flip controls
Sep 30, 2026
d61d55d
media: i2c: ov5693: Program the mode registers on stream start
rylos Oct 15, 2026
8d7660a
media: Surface Pro 5: fix front and rear camera orientation
rylos Oct 15, 2026
915bef9
media: i2c: ov7251: Drive the Surface IR illuminator via STROBE
rylos Oct 15, 2026
bed99d9
media: i2c: ov5693: make the 2x2-binned mode stream on IPU6
dmanresa-saes Aug 27, 2026
1c5b33f
media: i2c: ov5693: Surface Pro 5: upright front image by default
rylos Oct 15, 2026
1f16689
media: i2c: ov8865: Reset VBLANK on mode change, 30 fps default on Su…
rylos Oct 15, 2026
e3976f2
media: i2c: ov8865: Fix the VTS high byte mask
rylos Oct 16, 2026
233239b
media: i2c: ov8865: Allow fine analogue gain steps
rylos Oct 16, 2026
f1c8495
media: i2c: ov5693: 30 fps binned readout values
rylos Oct 16, 2026
ece47ea
media: i2c: ov7251: Surface IR strobe pulse follows the exposure
rylos Oct 16, 2026
f8850d8
media: Surface Pro 4: same camera orientation quirks as the Pro 5
rylos Nov 5, 2026
469453c
media: i2c: ov7251: Surface Pro 6: enable the IR illuminator strobe
rylos Nov 23, 2026
1ba4255
media: Surface Book 2: same camera orientation quirks as the Pro 5
rylos Dec 3, 2026
f89440a
media: i2c: ov7251: Surface Book 2: enable the IR illuminator strobe
rylos Dec 3, 2026
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
50 changes: 50 additions & 0 deletions drivers/media/i2c/ov13858.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@
#define OV13858_DGTL_GAIN_DEFAULT 1024 /* Default gain = 1 X */
#define OV13858_DGTL_GAIN_STEP 1 /* Each step = 1/1024 */

/* Readout direction */
#define OV13858_REG_FORMAT1 0x3820
#define OV13858_FORMAT1_VFLIP BIT(4)
/* Horizontal flip, active low: every mode table sets this bit */
#define OV13858_FORMAT1_HFLIP_N BIT(3)

/* Test Pattern Control */
#define OV13858_REG_TEST_PATTERN 0x4503
#define OV13858_TEST_PATTERN_ENABLE BIT(7)
Expand Down Expand Up @@ -1051,6 +1057,8 @@ struct ov13858 {
struct v4l2_ctrl *vblank;
struct v4l2_ctrl *hblank;
struct v4l2_ctrl *exposure;
struct v4l2_ctrl *hflip;
struct v4l2_ctrl *vflip;

/* Current mode */
const struct ov13858_mode *cur_mode;
Expand Down Expand Up @@ -1331,6 +1339,31 @@ static int ov13858_enable_test_pattern(struct ov13858 *ov13858, u32 pattern)
OV13858_REG_VALUE_08BIT, val);
}

static int ov13858_update_flips(struct ov13858 *ov13858)
{
u32 val;
int ret;

ret = ov13858_read_reg(ov13858, OV13858_REG_FORMAT1,
OV13858_REG_VALUE_08BIT, &val);
if (ret)
return ret;

if (ov13858->vflip->val)
val |= OV13858_FORMAT1_VFLIP;
else
val &= ~OV13858_FORMAT1_VFLIP;

/* The mirror bit is active low, as it is on ov13b10. */
if (ov13858->hflip->val)
val &= ~OV13858_FORMAT1_HFLIP_N;
else
val |= OV13858_FORMAT1_HFLIP_N;

return ov13858_write_reg(ov13858, OV13858_REG_FORMAT1,
OV13858_REG_VALUE_08BIT, val);
}

static int ov13858_set_ctrl(struct v4l2_ctrl *ctrl)
{
struct ov13858 *ov13858 = container_of(ctrl->handler,
Expand Down Expand Up @@ -1377,6 +1410,10 @@ static int ov13858_set_ctrl(struct v4l2_ctrl *ctrl)
ov13858->cur_mode->height
+ ctrl->val);
break;
case V4L2_CID_HFLIP:
case V4L2_CID_VFLIP:
ret = ov13858_update_flips(ov13858);
break;
case V4L2_CID_TEST_PATTERN:
ret = ov13858_enable_test_pattern(ov13858, ctrl->val);
break;
Expand Down Expand Up @@ -1603,6 +1640,13 @@ static int ov13858_set_stream(struct v4l2_subdev *sd, int enable)
pm_runtime_put(ov13858->dev);
}

/*
* Do not let the flips change while streaming. ov13858->mutex is the
* control handler's own lock and is held here, hence the __ form.
*/
__v4l2_ctrl_grab(ov13858->hflip, enable);
__v4l2_ctrl_grab(ov13858->vflip, enable);

mutex_unlock(&ov13858->mutex);

return ret;
Expand Down Expand Up @@ -1745,6 +1789,12 @@ static int ov13858_init_controls(struct ov13858 *ov13858)
OV13858_DGTL_GAIN_MIN, OV13858_DGTL_GAIN_MAX,
OV13858_DGTL_GAIN_STEP, OV13858_DGTL_GAIN_DEFAULT);

ov13858->hflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov13858_ctrl_ops,
V4L2_CID_HFLIP, 0, 1, 1, 0);
ov13858->vflip = v4l2_ctrl_new_std(ctrl_hdlr, &ov13858_ctrl_ops,
V4L2_CID_VFLIP, 0, 1, 1, 0);
v4l2_ctrl_cluster(2, &ov13858->hflip);

v4l2_ctrl_new_std_menu_items(ctrl_hdlr, &ov13858_ctrl_ops,
V4L2_CID_TEST_PATTERN,
ARRAY_SIZE(ov13858_test_pattern_menu) - 1,
Expand Down
Loading