From: "ccc194101@163.com" <ccc194101@163.com>
To: "Mauro Carvalho Chehab" <mchehab+huawei@kernel.org>
Cc: laurent.pinchart <laurent.pinchart@ideasonboard.com>,
mchehab <mchehab@kernel.org>,
linux-media <linux-media@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
stable <stable@vger.kernel.org>
Subject: Re: Re: [PATCH] media: uvcvideo:Create input device for all uvc devices with status endpoints.
Date: Tue, 5 Nov 2024 09:35:53 +0800 [thread overview]
Message-ID: <202411050934200431623@163.com> (raw)
In-Reply-To: 20241104110553.6687a58e@foz.lan
hi Mauro:
> It sounds to me that this is an application bug, not a Kernel one.
> What applications have such bug?
??? This is a testing application produced by a third-party company, and the modification is mainly aimed at improving compatibility.
??? And retaining nodes has no harm and is more suitable for application scenarios.
--------------
ccc194101@163.com
>Em Mon,? 4 Nov 2024 10:39:47 +0800
>chenchangcheng <ccc194101@163.com> escreveu:
>
>> Some applications need to check if there is an input device on the camera
>> before proceeding to the next step. When there is no input device,
>> the application will report an error.
>
>Nack.
>
>It is not mandatory for V4L2 devices to create input devices.
>
>It sounds to me that this is an application bug, not a Kernel one.
>What applications have such bug?
>
>> Create input device for all uvc devices with status endpoints.
>> and only when bTriggerSupport and bTriggerUsage are one are
>> allowed to report camera button.
>
>Please fix the application instead.
>
>>
>> Fixes: 3bc22dc66a4f ("media: uvcvideo: Only create input devs if hw supports it")
>
>Regards,
>Mauro
>
>> Signed-off-by: chenchangcheng <ccc194101@163.com>
>> ---
>>? drivers/media/usb/uvc/uvc_status.c | 13 ++++++-------
>>? 1 file changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/media/usb/uvc/uvc_status.c b/drivers/media/usb/uvc/uvc_status.c
>> index a78a88c710e2..177640c6a813 100644
>> --- a/drivers/media/usb/uvc/uvc_status.c
>> +++ b/drivers/media/usb/uvc/uvc_status.c
>> @@ -44,9 +44,6 @@ static int uvc_input_init(struct uvc_device *dev)
>>? struct input_dev *input;
>>? int ret;
>>?
>> - if (!uvc_input_has_button(dev))
>> - return 0;
>> -
>
>
>>? input = input_allocate_device();
>>? if (input == NULL)
>>? return -ENOMEM;
>> @@ -110,10 +107,12 @@ static void uvc_event_streaming(struct uvc_device *dev,
>>? if (len <= offsetof(struct uvc_status, streaming))
>>? return;
>>?
>> - uvc_dbg(dev, STATUS, "Button (intf %u) %s len %d\n",
>> - status->bOriginator,
>> - status->streaming.button ? "pressed" : "released", len);
>> - uvc_input_report_key(dev, KEY_CAMERA, status->streaming.button);
>> + if (uvc_input_has_button(dev)) {
>> + uvc_dbg(dev, STATUS, "Button (intf %u) %s len %d\n",
>> + status->bOriginator,
>> + status->streaming.button ? "pressed" : "released", len);
>> + uvc_input_report_key(dev, KEY_CAMERA, status->streaming.button);
>> + }
>>? } else {
>>? uvc_dbg(dev, STATUS, "Stream %u error event %02x len %d\n",
>>? status->bOriginator, status->bEvent, len);
>
>
>
>Thanks,
>Mauro
next prev parent reply other threads:[~2024-11-05 1:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 2:39 [PATCH] media: uvcvideo:Create input device for all uvc devices with status endpoints chenchangcheng
2024-11-04 8:43 ` kernel test robot
2024-11-04 10:05 ` Mauro Carvalho Chehab
2024-11-05 1:35 ` ccc194101 [this message]
2024-11-04 10:05 ` kernel test robot
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=202411050934200431623@163.com \
--to=ccc194101@163.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab+huawei@kernel.org \
--cc=mchehab@kernel.org \
--cc=stable@vger.kernel.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