media: uvcvideo: Refactor power_line_frequency_controls_limited
authorRicardo Ribalda <ribalda@chromium.org>
Thu, 5 Jan 2023 13:52:56 +0000 (14:52 +0100)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sun, 15 Jan 2023 21:45:14 +0000 (23:45 +0200)
commit3aa8628eb78a63d0bf93e159846e9c92bccc8f69
tree4dca4879de808b82c916d660cd2bf1ef8be80063
parent96a160b068e09b4ed5a32e2179e5219fc3545eca
media: uvcvideo: Refactor power_line_frequency_controls_limited

Move the control mapping to uvc_ctrl.c. This way we do not have
references to UVC controls or V4L2 controls in uvc_driver.c.

This also fixes a bug introduced in commit 382075604a68 ("media:
uvcvideo: Limit power line control for Quanta UVC Webcam"). The
offending commit caused the power line control menu entries to have
incorrect indices compared to the V4L2_CID_POWER_LINE_FREQUENCY_*
enumeration. Now that the limited mapping reuses the correct menu_info
array, the indices correctly map to the V4L2 control specification.

Fixes: 382075604a68 ("media: uvcvideo: Limit power line control for Quanta UVC Webcam")
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
drivers/media/usb/uvc/uvc_ctrl.c
drivers/media/usb/uvc/uvc_driver.c
drivers/media/usb/uvc/uvcvideo.h