]> www.infradead.org Git - users/jedix/linux-maple.git/commit
media: gspca/sn9c20x: Add ability to control built-in webcam LEDs
authorPete Hemery <petehemery@hotmail.com>
Mon, 2 Aug 2021 12:26:20 +0000 (14:26 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 6 Aug 2021 08:48:49 +0000 (10:48 +0200)
commitc38b314c60c821d4fc9fe1d620da3a6fe0217644
tree2151756d1a2ff741dba483f43f4301fae9cd1247
parent67fdf5ed9502c0d877131ad45bdaf8b4027b3c7b
media: gspca/sn9c20x: Add ability to control built-in webcam LEDs

If you image search "microdia sonix webcam", or SN9C120, you can find
 examples of the type of webcam I have. It has 6 built-in LEDs.
It's ancient (2006 maybe?) but in 2020 it was the only USB webcam I had.
It doesn't perform well, especially in low light.

The Windows XP drivers had the ability to toggle the LEDs, as well as
 "Auto" mode which would read and adjust the exposure and turn them
 on when it got "too dark", along with other nice features, like
 smoothing dead pixels, funky filters, effects and face tracking.

Watching Wireshark usbmon with the Windows driver I was able to discover
 which values are required to toggle the LEDs.

Reading ext-ctrls-flash.rst, V4L2_FLASH_LED_MODE_TORCH seems to describe
 mostly what I want it to do.
Ideally the control would be boolean/checkbox, but the existing
 implementation seems to require a menu.

This patch implements the ability to control the LEDs, attempting to
 minimise changes to external files and other webcams.

Review by anyone more familiar with the code base for unintended
 side effects would be welcome and appreciated. First kernel submission.

Signed-off-by: Pete Hemery <petehemery@hotmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/usb/gspca/sn9c20x.c