Hi Sakari,
On 2017-03-26 10:31 AM, Sakari Ailus wrote:
Hi Helen,
...
+static int vimc_cap_enum_input(struct file *file, void *priv,
+ struct v4l2_input *i)
+{
+ /* We only have one input */
+ if (i->index > 0)
+ return -EINVAL;
+
+ i->type = V4L2_INPUT_TYPE_CAMERA;
+ strlcpy(i->name, "VIMC capture", sizeof(i->name));
+
+ return 0;
+}
+
+static int vimc_cap_g_input(struct file *file, void *priv, unsigned int *i)
+{
+ /* We only have one input */
+ *i = 0;
+ return 0;
+}
+
+static int vimc_cap_s_input(struct file *file, void *priv, unsigned int i)
+{
+ /* We only have one input */
+ return i ? -EINVAL : 0;
+}
You can drop the input IOCTLs altogether here. If you had e.g. a TV
tuner, it'd be the TV tuner driver's responsibility to implement them.
input IOCTLs seems to be mandatory from v4l2-compliance when capability
V4L2_CAP_VIDEO_CAPTURE is set (which is the case):
https://git.linuxtv.org/v4l-utils.git/tree/utils/v4l2-compliance/v4l2-test-input-output.cpp#n418
https://git.linuxtv.org/v4l-utils.git/tree/utils/v4l2-compliance/v4l2-compliance.cpp#n989
Helen