]> git.baikalelectronics.ru Git - kernel.git/commit
media: usbtv: fix brightness and contrast controls
authorAdam Sampson <ats@offog.org>
Tue, 24 Oct 2017 20:14:46 +0000 (16:14 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 31 Oct 2017 11:26:10 +0000 (07:26 -0400)
commit0eb00e51e6f1891dad13197fa356af9c21bdf5b0
tree039b786fd94ca7874a9f7c50f25aa832f15c0e21
parent27fd2ad9d623f1b6ff7cc702e84188d21f2e60f7
media: usbtv: fix brightness and contrast controls

Because the brightness and contrast controls share a register,
usbtv_s_ctrl needs to read the existing values for both controls before
inserting the new value. However, the code accidentally wrote to the
registers (from an uninitialised stack array), rather than reading them.

The user-visible effect of this was that adjusting the brightness would
also set the contrast to a random value, and vice versa -- so it wasn't
possible to correctly adjust the brightness of usbtv's video output.

Tested with an "EasyDAY" UTV007 device.

Fixes: 7ff7805ce700 ("usbtv: add video controls")
Signed-off-by: Adam Sampson <ats@offog.org>
Reviewed-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/usb/usbtv/usbtv-video.c