From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Ricardo Ribalda <ribalda@chromium.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Sergey Senozhatsky <senozhatsky@chromium.org>
Subject: Re: [PATCH v3 2/3] media: uvcvideo: Fix power line control for Lenovo Integrated Camera
Date: Tue, 3 Jan 2023 23:06:06 +0200 [thread overview]
Message-ID: <Y7SYviXPM9bpTgE8@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20221101-easycam-v3-2-2c9881a7a4f7@chromium.org>
Hi Ricardo,
Thank you for the patch.
On Tue, Jan 03, 2023 at 12:01:22PM +0100, Ricardo Ribalda wrote:
> The device does not implement the power line control correctly. It is
> a UVC 1.5 device, but implements the PLC control as a UVC 1.1 device.
>
> Add the corresponding control mapping override.
>
> Bus 003 Device 002: ID 30c9:0093 Lenovo Integrated Camera
> Device Descriptor:
> bLength 18
> bDescriptorType 1
> bcdUSB 2.01
> bDeviceClass 239 Miscellaneous Device
> bDeviceSubClass 2
> bDeviceProtocol 1 Interface Association
> bMaxPacketSize0 64
> idVendor 0x30c9
> idProduct 0x0093
> bcdDevice 0.07
> iManufacturer 3 Lenovo
> iProduct 1 Integrated Camera
> iSerial 2 8SSC21J75356V1SR2830069
> bNumConfigurations 1
>
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
> drivers/media/usb/uvc/uvc_ctrl.c | 24 +++++++++++++-----------
> drivers/media/usb/uvc/uvc_driver.c | 16 ++++++++++++++++
> drivers/media/usb/uvc/uvcvideo.h | 1 +
> 3 files changed, 30 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
> index c95a2229f4fa..d8283d71bc96 100644
> --- a/drivers/media/usb/uvc/uvc_ctrl.c
> +++ b/drivers/media/usb/uvc/uvc_ctrl.c
> @@ -721,18 +721,20 @@ static const struct uvc_control_mapping uvc_ctrl_mappings[] = {
> },
> };
>
> +const struct uvc_control_mapping uvc_ctrl_power_line_mapping_uvc11 = {
> + .id = V4L2_CID_POWER_LINE_FREQUENCY,
> + .entity = UVC_GUID_UVC_PROCESSING,
> + .selector = UVC_PU_POWER_LINE_FREQUENCY_CONTROL,
> + .size = 2,
> + .offset = 0,
> + .v4l2_type = V4L2_CTRL_TYPE_MENU,
> + .data_type = UVC_CTRL_DATA_TYPE_ENUM,
> + .menu_info = power_line_frequency_controls,
> + .menu_count = ARRAY_SIZE(power_line_frequency_controls) - 1,
> +};
> +
> static const struct uvc_control_mapping uvc_ctrl_mappings_uvc11[] = {
> - {
> - .id = V4L2_CID_POWER_LINE_FREQUENCY,
> - .entity = UVC_GUID_UVC_PROCESSING,
> - .selector = UVC_PU_POWER_LINE_FREQUENCY_CONTROL,
> - .size = 2,
> - .offset = 0,
> - .v4l2_type = V4L2_CTRL_TYPE_MENU,
> - .data_type = UVC_CTRL_DATA_TYPE_ENUM,
> - .menu_info = power_line_frequency_controls,
> - .menu_count = ARRAY_SIZE(power_line_frequency_controls) - 1,
> - },
> + uvc_ctrl_power_line_mapping_uvc11,
This conflicts with your v4l2-compliance fixes series that I have
applied to my tree. I have fixed the conflict locally and pushed the
result to
https://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git/log/?h=next/uvc,
could you check that I got it right ?
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> };
>
> static const struct uvc_control_mapping uvc_ctrl_mappings_uvc15[] = {
> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> index f2abd9d0c717..9c09bc988278 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -2370,6 +2370,13 @@ MODULE_PARM_DESC(timeout, "Streaming control requests timeout");
> * Driver initialization and cleanup
> */
>
> +static const struct uvc_device_info uvc_ctrl_power_line_uvc11 = {
> + .mappings = (const struct uvc_control_mapping *[]) {
> + &uvc_ctrl_power_line_mapping_uvc11,
> + NULL, /* Sentinel */
> + },
> +};
> +
> static const struct uvc_menu_info power_line_frequency_controls_limited[] = {
> { 1, "50 Hz" },
> { 2, "60 Hz" },
> @@ -2973,6 +2980,15 @@ static const struct usb_device_id uvc_ids[] = {
> .bInterfaceSubClass = 1,
> .bInterfaceProtocol = 0,
> .driver_info = UVC_INFO_QUIRK(UVC_QUIRK_FORCE_BPP) },
> + /* Lenovo Integrated Camera */
> + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
> + | USB_DEVICE_ID_MATCH_INT_INFO,
> + .idVendor = 0x30c9,
> + .idProduct = 0x0093,
> + .bInterfaceClass = USB_CLASS_VIDEO,
> + .bInterfaceSubClass = 1,
> + .bInterfaceProtocol = UVC_PC_PROTOCOL_15,
> + .driver_info = (kernel_ulong_t)&uvc_ctrl_power_line_uvc11 },
> /* Sonix Technology USB 2.0 Camera */
> { .match_flags = USB_DEVICE_ID_MATCH_DEVICE
> | USB_DEVICE_ID_MATCH_INT_INFO,
> diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
> index df93db259312..bcb0b0c101c8 100644
> --- a/drivers/media/usb/uvc/uvcvideo.h
> +++ b/drivers/media/usb/uvc/uvcvideo.h
> @@ -728,6 +728,7 @@ int uvc_status_start(struct uvc_device *dev, gfp_t flags);
> void uvc_status_stop(struct uvc_device *dev);
>
> /* Controls */
> +extern const struct uvc_control_mapping uvc_ctrl_power_line_mapping_uvc11;
> extern const struct v4l2_subscribed_event_ops uvc_ctrl_sub_ev_ops;
>
> int uvc_query_v4l2_ctrl(struct uvc_video_chain *chain,
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2023-01-03 21:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-03 11:01 [PATCH v3 0/3] media: uvcvideo: Limit Power Line Control Ricardo Ribalda
2023-01-03 11:01 ` [PATCH v3 1/3] media: uvcvideo: Limit power line control for Acer EasyCamera Ricardo Ribalda
2023-01-03 11:01 ` [PATCH v3 2/3] media: uvcvideo: Fix power line control for Lenovo Integrated Camera Ricardo Ribalda
2023-01-03 21:06 ` Laurent Pinchart [this message]
2023-01-03 11:01 ` [PATCH v3 3/3] media: uvcvideo: Refactor power_line_frequency_controls_limited Ricardo Ribalda
2023-01-03 21:07 ` Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y7SYviXPM9bpTgE8@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=ribalda@chromium.org \
--cc=senozhatsky@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox