Skip to content
Commit 86419686 authored by Daniel Schaefer's avatar Daniel Schaefer Committed by Laurent Pinchart
Browse files

media: uvcvideo: Override default flags



When the UVC device has a control that is readonly it doesn't set the
SET_CUR flag. For example the privacy control has SET_CUR flag set in
the defaults in the `uvc_ctrls` variable. Even if the device does not
have it set, it's not cleared by uvc_ctrl_get_flags().

Originally written with assignment in commit 859086ae ("media:
uvcvideo: Apply flags from device to actual properties"). But changed to
|= in commit 0dc68cab ("media: uvcvideo: Prevent setting unavailable
flags"). It would not clear the default flags.

With this patch applied the correct flags are reported to user space.
Tested with:

```
> v4l2-ctl --list-ctrls | grep privacy
privacy 0x009a0910 (bool)   : default=0 value=0 flags=read-only
```

Signed-off-by: default avatarDaniel Schaefer <dhs@frame.work>
Fixes: 0dc68cab ("media: uvcvideo: Prevent setting unavailable flags")
Reviewed-by: default avatarRicardo Ribalda <ribalda@chromium.org>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20240602065053.36850-1-dhs@frame.work


Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
parent c8931ef5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment