MIPI Sensor V4L2 Ctrl CIDs

Hey,

After wading through the kernel a bit, I have found plenty of sensor drivers that implement the custom tegra v4l2_ctrl controls (such as TEGRA_CAMERA_CID_GAIN). I can’t see any currently that implement any of the standard controls (such as V4L2_CID_SATURATION, but also V4L2_CID_GAIN).

I have a need to implement V4L2_CID_HFLIP, V4L2_CID_VFLIP and V4L2_CID_ZOOM_ABSOLUTE, among a bunch of other controls. Should I be doing this by adding an _init_controls() function and using v4l2_ctrl_new_std() within? Or will this conflict with the existing TEGRA_CAMERA controls? (I had a bit of a look up the chain of files, and couldn’t see anything specifically that screamed no at me).

Any advice would be welcome.

Nathan

@youngy
You can add any function you like, but for current sensor driver design some control that may need involve ISP that couldn’t support it like SATURATION.

ShaneCCC,

I’ve looked into this further now that I have the sensor available to use. Unfortunately, I cannot see a way to add additional or even standard V4L2_CIDs. I have a whole bunch of functions that I would like to make available through the v4l2 interface, including white balance, brightness, contrast, saturation, gamma, sharpness, etc.

The way I would do this in other kernels is using s_ctrl within v4l2_ctrl_ops (and also g_volatile_ctrl to read some of them back). However, your implementation of s_ctrl calls tegracam_s_ctrl(), which calls tegracam_set_ctrls() which has a fixed list of CIDs which it supports, but cannot be expanded.

Is there a standard way of doing this that I cannot see, or do I have to modify tegracam_ctrls.c to allow myself to add additional CIDs?

Thanks,

Nathan

It could be easy to extend the CID from the teracamera_ctrls.c

Cool! Thanks very much.