linux-stable/drivers/media
Hans Verkuil 9f582f0418 media: uvcvideo: Check for INACTIVE in uvc_ctrl_is_accessible()
Check for inactive controls in uvc_ctrl_is_accessible().

Use the new value for the master_id controls if present, otherwise
use the existing value to determine if it is OK to set the control.
Doing this here avoids attempting to set an inactive control, which
will return an error from the USB device, which returns an invalid
errorcode.

This fixes:
  warn: v4l2-test-controls.cpp(483): s_ctrl returned EIO
  warn: v4l2-test-controls.cpp(483): s_ctrl returned EIO
test VIDIOC_G/S_CTRL: OK
  warn: v4l2-test-controls.cpp(739): s_ext_ctrls returned EIO
  warn: v4l2-test-controls.cpp(739): s_ext_ctrls returned EIO
  warn: v4l2-test-controls.cpp(816): s_ext_ctrls returned EIO
test VIDIOC_G/S/TRY_EXT_CTRLS: OK

Tested with:
v4l2-ctl -c auto_exposure=1
OK
v4l2-ctl -c exposure_time_absolute=251
OK
v4l2-ctl -c auto_exposure=3
OK
v4l2-ctl -c exposure_time_absolute=251
VIDIOC_S_EXT_CTRLS: failed: Input/output error
exposure_time_absolute: Input/output error
ERROR
v4l2-ctl -c auto_exposure=3,exposure_time_absolute=251,auto_exposure=1
v4l2-ctl -C auto_exposure,exposure_time_absolute  
auto_exposure: 1
exposure_time_absolute: 251

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-01-15 23:45:11 +02:00
..
cec media: Switch to use dev_err_probe() helper 2022-12-07 17:58:46 +01:00
common MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
dvb-core Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08:00
dvb-frontends media updates for v6.2-rc1 2022-12-13 11:36:58 -08:00
firewire
i2c Merge tag 'br-v6.2i' of git://linuxtv.org/hverkuil/media_tree into media_stage 2022-12-07 17:58:47 +01:00
mc media: mc: convert pipeline funcs to take media_pad 2022-09-24 09:22:30 +02:00
mmc
pci treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
platform media updates for v6.2-rc1 2022-12-21 09:44:41 -08:00
radio media: si470x: Fix use-after-free in si470x_int_in_callback() 2022-12-07 17:58:47 +01:00
rc Driver Core changes for 6.2-rc1 2022-12-16 03:54:54 -08:00
spi
test-drivers media updates for v6.2-rc1 2022-12-13 11:36:58 -08:00
tuners Tag branch 2022-11-25 07:55:21 +00:00
usb media: uvcvideo: Check for INACTIVE in uvc_ctrl_is_accessible() 2023-01-15 23:45:11 +02:00
v4l2-core media updates for v6.2-rc1 2022-12-21 09:44:41 -08:00
Kconfig media: Kconfig: Make DVB_CORE=m possible when MEDIA_SUPPORT=y 2022-12-07 17:58:46 +01:00
Makefile