summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/hdpvr/hdpvr-core.c
diff options
context:
space:
mode:
authorTaylor Ralph <taylor.ralph@gmail.com>2011-10-20 23:33:23 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-02-15 12:47:02 -0200
commitfda27874de91d5a8b9a018b3bc74b14578994908 (patch)
tree4d6ce0ed6293087f4986b01e8380ce2a83a447b8 /drivers/media/video/hdpvr/hdpvr-core.c
parentbab6f610640a92b6b40e6b732f520a6e0c85dbbe (diff)
downloadop-kernel-dev-fda27874de91d5a8b9a018b3bc74b14578994908.zip
op-kernel-dev-fda27874de91d5a8b9a018b3bc74b14578994908.tar.gz
[media] hdpvr: update picture controls to support firmware versions > 0.15
Correctly sets the max/min/default values for the hdpvr picture controls. The reason the current values didn't cause a problem until now is because any firmware <= 0.15 didn't support them. The latest firmware releases properly support picture controls and the values in the patch are derived from the windows driver using SniffUSB2.0. Thanks to Devin Heitmueller for helping me. Signed-off-by: Taylor Ralph <tralph@mythtv.org> Thanks-to: Devin Heitmueller <dheitmueller@kernellabs.com> Acked-by: Jarod Wilson <jarod@redhat.com> Reviewed-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/hdpvr/hdpvr-core.c')
-rw-r--r--drivers/media/video/hdpvr/hdpvr-core.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c
index 441dacf..687282d 100644
--- a/drivers/media/video/hdpvr/hdpvr-core.c
+++ b/drivers/media/video/hdpvr/hdpvr-core.c
@@ -154,10 +154,20 @@ static int device_authorization(struct hdpvr_device *dev)
}
#endif
+ dev->fw_ver = dev->usbc_buf[1];
+
v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n",
- dev->usbc_buf[1], &dev->usbc_buf[2]);
+ dev->fw_ver, &dev->usbc_buf[2]);
+
+ if (dev->fw_ver > 0x15) {
+ dev->options.brightness = 0x80;
+ dev->options.contrast = 0x40;
+ dev->options.hue = 0xf;
+ dev->options.saturation = 0x40;
+ dev->options.sharpness = 0x80;
+ }
- switch (dev->usbc_buf[1]) {
+ switch (dev->fw_ver) {
case HDPVR_FIRMWARE_VERSION:
dev->flags &= ~HDPVR_FLAG_AC3_CAP;
break;
@@ -169,7 +179,7 @@ static int device_authorization(struct hdpvr_device *dev)
default:
v4l2_info(&dev->v4l2_dev, "untested firmware, the driver might"
" not work.\n");
- if (dev->usbc_buf[1] >= HDPVR_FIRMWARE_VERSION_AC3)
+ if (dev->fw_ver >= HDPVR_FIRMWARE_VERSION_AC3)
dev->flags |= HDPVR_FLAG_AC3_CAP;
else
dev->flags &= ~HDPVR_FLAG_AC3_CAP;
@@ -270,6 +280,8 @@ static const struct hdpvr_options hdpvr_default_options = {
.bitrate_mode = HDPVR_CONSTANT,
.gop_mode = HDPVR_SIMPLE_IDR_GOP,
.audio_codec = V4L2_MPEG_AUDIO_ENCODING_AAC,
+ /* original picture controls for firmware version <= 0x15 */
+ /* updated in device_authorization() for newer firmware */
.brightness = 0x86,
.contrast = 0x80,
.hue = 0x80,
OpenPOWER on IntegriCloud