About "Inappropriate ioctl for device" error

I use the jetson TX1 R28.2
I run"v4l2-ctl --list-dev",then it have some error.

How can fix this?

root@tegra-ubuntu:~# v4l2-ctl --list-dev
VIDIOC_QUERYCAP: failed: Inappropriate ioctl for device
VIDIOC_QUERYCAP: failed: Inappropriate ioctl for device
vi-output, imx219 6-0010 (platform:54080000.vi:0):
	/dev/video0
	/dev/v4l-subdev1
	/dev/v4l-subdev0

I’ve seen that before but I don’t remember specifically what caused it.

I’d compare your camera_common and v4l2_subdev ops with the ones in the examples. Try to use the camera common versions for as many as you can. For example this one:

static struct v4l2_subdev_pad_ops mt9m021_subdev_pad_ops = {
    .get_fmt                = mt9m021_get_format,
    .set_fmt                = mt9m021_set_format,
    .enum_mbus_code         = camera_common_enum_mbus_code,
    .enum_frame_size        = camera_common_enum_framesizes,
    .enum_frame_interval    = camera_common_enum_frameintervals,
};

Also have you tried running v4l2-compliance for your sensor? That should tell you which one specifically is failing.