Skip to content

s5k3l6xx: add the absolute lens focus control

Fixes: https://source.puri.sm/Librem5/linux-next/-/issues/280

on the new drivers, on top of https://source.puri.sm/Librem5/linux-next/-/merge_requests/430 this adds the focus driver to the rear-cam media device node topology:

Device topology
- entity 1: csi (2 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
            device node name /dev/v4l-subdev0
	pad0: Sink
		[fmt:UYVY8_2X8/800x600 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
		<- "imx8mq-mipi-csi2 30b60000.csi":1 [ENABLED,IMMUTABLE]
	pad1: Source
		[fmt:UYVY8_2X8/800x600 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
		-> "csi capture":0 [ENABLED,IMMUTABLE]

- entity 4: csi capture (1 pad, 1 link)
            type Node subtype V4L flags 0
            device node name /dev/video1
	pad0: Sink
		<- "csi":1 [ENABLED,IMMUTABLE]

- entity 10: imx8mq-mipi-csi2 30b60000.csi (2 pads, 2 links)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev1
	pad0: Sink
		[fmt:SGBRG10_1X10/640x480 field:none colorspace:raw xfer:none ycbcr:601 quantization:lim-range]
		<- "S5K3L6-CIS 3-002d":0 [ENABLED,IMMUTABLE]
	pad1: Source
		[fmt:SGBRG10_1X10/640x480 field:none colorspace:raw xfer:none ycbcr:601 quantization:lim-range]
		-> "csi":0 [ENABLED,IMMUTABLE]

- entity 15: S5K3L6-CIS 3-002d (1 pad, 1 link)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev2
	pad0: Source
		[fmt:unknown/0x0]
		-> "imx8mq-mipi-csi2 30b60000.csi":0 [ENABLED,IMMUTABLE]

- entity 19: dw9714 3-000c (0 pad, 0 link)
             type V4L2 subdev subtype Lens flags 0
             device node name /dev/v4l-subdev3

and inspecting the dw9714 device shows the control:

v4l2-ctl -d /dev/v4l-subdev3 -L

Camera Controls

                 focus_absolute 0x009a090a (int)    : min=0 max=1023 step=1 default=0 value=0

on the old drivers, I didn't see where the control would be available (can you find it?), but it definitely doesn't hurt to merge, even if it will only work after switching to the new drivers.

as a small bonus, set the "orientation" static board property (that it's the camera on the back, not front)

Edited by Martin Kepplinger

Merge request reports