Autofocus on OV5640 and i.MX6 ULL

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Autofocus on OV5640 and i.MX6 ULL

1,545 Views
glauco76
Contributor I

Hi All,

We are trying to implement Autofocus and exposure control  for an OV5640 module connected with an i.MX6 ULL EVK.

The AF implementation is derived from this one: OV5642 auto-focus on i.MX6 - Boundary Devices 

We have just the CSI interface (no MIPI) and no IPU.

The drivers being used are:

- mx6s_capture.ko (from /drivers/media/platform/mxc/subdev/mx6s_capture.c)

- ov5640_camera.ko (from /drivers/media/platform/mxc/subdev/ov5640.c)

The above drivers create a V4L2 device under /dev/video1, which points to the mx6s_capture, while ov5640_capture is a subdev of it.

So fare we have integrated the AF controls in the ov5640.c driver and the kernel builds just fine and we are able to get a regular video stream from gstreamer.

However, the added controls are not visible at all (actually NONE of the available controls are visible).

Tried with

v4l2-ctl -l -d /dev/video1

but nothing happens.

We have notices that in the ov5640.c driver in the "subdev" directory the handler function for get_controls and set_controls are entirely missing. At this point we can't exactly figure out which is the correct modifications to be done to 

1. have "v4l-ctl -l" show the actual ov5640 driver capabilities (available IOCTLs, should handle the VIDIOC_G_CTRL call), which is currently not showing at all (not even with the unmodified driver)

2. handle the requests for a new IOCTL in addition to those already implemented in the NXP driver

Do you have any advice for us?

Labels (3)
Tags (1)
0 Kudos
4 Replies

933 Views
jimmychan
NXP TechSupport
NXP TechSupport

linux-imx kernel is not fully v4l2-compliance. v4l2-ctl use the "VIDIOC_QUERYCTRL". But this VIDIOC_QUERYCTRL is not support in the drivers/media/video/mxc/capture/mxc_v4l2_capture.c.

0 Kudos

933 Views
glauco76
Contributor I

OK thanks for the advice. We are not using the "capture" driver, but the "subdev" driver (drivers/media/platform/mxc/subdev).

Is there any way to implement the QUERYCTRL handler or any different way other then v4l2-ctl to understand what are the implemented and available IOCTLs of a driver in the IMX kernel?

So far we have added the handler for additional controls (autofocus, shutter, gain), but we can't really figure out where in the IMX code these handlers are supposed to be called. The video4linux standard headers in the kernel (include/linux/videodev2.h and the others) already include a reference to all the possible IOCTLs, including autofocus, but the way the IOCTLs handlers are exposed from the drivers is absolutely unclear.

Any advice will be welcome!

0 Kudos

933 Views
jimmychan
NXP TechSupport
NXP TechSupport

One more information is the V4L2 driver details in the Linux Reference manual. You can download the documentation from here: i.MX Software|NXP 

0 Kudos

933 Views
jimmychan
NXP TechSupport
NXP TechSupport
0 Kudos