Skip to content

Conversation

@gabrielstedman
Copy link

media: i2c: ov5693: add rotation control and apply 180° quirk for OVTI5693

The OVTI5693 module used in the Surface Pro 9 front camera is mounted upside‑down. libcamera ignores HFLIP/VFLIP and relies on V4L2_CID_CAMERA_SENSOR_ROTATION to determine sensor orientation, but the OV5693 driver did not expose this control.

This patch adds a rotation control to the driver and applies a 180° default for the OVTI5693 ACPI‑matched variant.

@qzed
Copy link
Member

qzed commented Jan 15, 2026

If I understand correctly, this would rotate all OV5693 senors, regardless of the actual device / mounting. Is there some way to get the mounting orientation from ACPI?

@djrscally maybe you know more?

@gabrielstedman
Copy link
Author

I could remove the auto-rotation and leave the rotation control implemented if that's better?
Then user would need to issue v4l2-ctl --device to set rotation property.
It would be nice if this could be done automatically.

@gabrielstedman
Copy link
Author

gabrielstedman commented Jan 17, 2026

Switched default rotation to 0:

	ctrls->rotation = v4l2_ctrl_new_std(&ctrls->handler, ops,
					V4L2_CID_CAMERA_SENSOR_ROTATION, 0, 270, 90, 0);

Copy link
Member

@qzed qzed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, looks good to me now.

I'm still a bit concerned about the rotation being applied for all OVTI5693 matches. I have the feeling that that somehow should be specified in some ACPI method, but that might need some reverse engineering to figure out. At least from the ACPI dumps it looks like the older devices all use the INT33BE match, so for now this should not create problems changing the orientation on those. I still want to give it a test first before I merge though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants