Whenever I try to set any writable camera parameter, the kernel driver ends up in “g_volatile_ctrl()” instead of “s_ctrl()” function and fails with “INVALID ARGUMENT”. What am I doing wrong here?
Excerpts from a test program as follows:
…
cam_fd = open(“/dev/v4l-subdev0”, O_RDWR);
if (cam_fd < 0)
{
printf("Unable to open video0 device, errno = %x\n", errno);
exit(-1);
}
…
err = pffc_ctrl_do_ioctl(cam_fd, V4L2_CID_SATURATION, val);
…
static int pffc_ctrl_do_ioctl(int fd, uint32_t id, uint32_t val)
{
struct v4l2_control control;
// Validate device handle
if (fd < 0)
return(-1);
// Run IOCTL
memset(&control, 0, sizeof (control));
control.id = id;
control.value = val;
if (-1 == ioctl(fd, VIDIOC_S_CTRL, &control))
{
perror("VIDIOC_S_CTRL");
printf("do-ioctl ID %x, val = %x\n", id, val);
return(-1);
}
return(0);
}