diff options
author | Marcin Rudowski <mar_rud@poczta.onet.pl> | 2006-03-11 22:03:47 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-21 11:53:15 -0500 |
commit | 9f9c907fdc331fc6062d758f46f65cb0d2dd11be (patch) | |
tree | 4e699fdfeb360a02fa9d1ba880d65b4a47ffe77e /drivers/media | |
parent | a5daecbaebda687d62c2ba1f46adaa96e4394282 (diff) |
V4L/DVB (3449): Cx88 default picture controls values
This patch fixes default values for some picture controls:
- brightness set to 50% by default (now is 0%)
- hue set to 50% by default (now is 0%)
- sets saturation to datasheet value
- volume set to 0dB (now is -32dB)
and some left small fixes:
- twice offset adding
- balance didn't follow datasheet (bits[0:5] = attenuation;
bit[6] = channel to provide attenuation)
Signed-off-by: Marcin Rudowski <mar_rud@poczta.onet.pl>
Signed-off-by: Ian Pickworth <ian@pickworth.me.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 7bbc81fb43b5..b1892dff0fe8 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -227,7 +227,7 @@ static struct cx88_ctrl cx8800_ctls[] = { | |||
227 | .minimum = 0x00, | 227 | .minimum = 0x00, |
228 | .maximum = 0xff, | 228 | .maximum = 0xff, |
229 | .step = 1, | 229 | .step = 1, |
230 | .default_value = 0, | 230 | .default_value = 0x7f, |
231 | .type = V4L2_CTRL_TYPE_INTEGER, | 231 | .type = V4L2_CTRL_TYPE_INTEGER, |
232 | }, | 232 | }, |
233 | .off = 128, | 233 | .off = 128, |
@@ -255,7 +255,7 @@ static struct cx88_ctrl cx8800_ctls[] = { | |||
255 | .minimum = 0, | 255 | .minimum = 0, |
256 | .maximum = 0xff, | 256 | .maximum = 0xff, |
257 | .step = 1, | 257 | .step = 1, |
258 | .default_value = 0, | 258 | .default_value = 0x7f, |
259 | .type = V4L2_CTRL_TYPE_INTEGER, | 259 | .type = V4L2_CTRL_TYPE_INTEGER, |
260 | }, | 260 | }, |
261 | .off = 128, | 261 | .off = 128, |
@@ -300,7 +300,7 @@ static struct cx88_ctrl cx8800_ctls[] = { | |||
300 | .minimum = 0, | 300 | .minimum = 0, |
301 | .maximum = 0x3f, | 301 | .maximum = 0x3f, |
302 | .step = 1, | 302 | .step = 1, |
303 | .default_value = 0x1f, | 303 | .default_value = 0x3f, |
304 | .type = V4L2_CTRL_TYPE_INTEGER, | 304 | .type = V4L2_CTRL_TYPE_INTEGER, |
305 | }, | 305 | }, |
306 | .reg = AUD_VOL_CTL, | 306 | .reg = AUD_VOL_CTL, |
@@ -909,7 +909,8 @@ static int get_control(struct cx88_core *core, struct v4l2_control *ctl) | |||
909 | value = c->sreg ? cx_sread(c->sreg) : cx_read(c->reg); | 909 | value = c->sreg ? cx_sread(c->sreg) : cx_read(c->reg); |
910 | switch (ctl->id) { | 910 | switch (ctl->id) { |
911 | case V4L2_CID_AUDIO_BALANCE: | 911 | case V4L2_CID_AUDIO_BALANCE: |
912 | ctl->value = (value & 0x40) ? (value & 0x3f) : (0x40 - (value & 0x3f)); | 912 | ctl->value = ((value & 0x7f) < 0x40) ? ((value & 0x7f) + 0x40) |
913 | : (0x7f - (value & 0x7f)); | ||
913 | break; | 914 | break; |
914 | case V4L2_CID_AUDIO_VOLUME: | 915 | case V4L2_CID_AUDIO_VOLUME: |
915 | ctl->value = 0x3f - (value & 0x3f); | 916 | ctl->value = 0x3f - (value & 0x3f); |
@@ -946,7 +947,7 @@ static int set_control(struct cx88_core *core, struct v4l2_control *ctl) | |||
946 | mask=c->mask; | 947 | mask=c->mask; |
947 | switch (ctl->id) { | 948 | switch (ctl->id) { |
948 | case V4L2_CID_AUDIO_BALANCE: | 949 | case V4L2_CID_AUDIO_BALANCE: |
949 | value = (ctl->value < 0x40) ? (0x40 - ctl->value) : ctl->value; | 950 | value = (ctl->value < 0x40) ? (0x7f - ctl->value) : (ctl->value - 0x40); |
950 | break; | 951 | break; |
951 | case V4L2_CID_AUDIO_VOLUME: | 952 | case V4L2_CID_AUDIO_VOLUME: |
952 | value = 0x3f - (ctl->value & 0x3f); | 953 | value = 0x3f - (ctl->value & 0x3f); |
@@ -987,8 +988,7 @@ static void init_controls(struct cx88_core *core) | |||
987 | 988 | ||
988 | for (i = 0; i < CX8800_CTLS; i++) { | 989 | for (i = 0; i < CX8800_CTLS; i++) { |
989 | ctrl.id=cx8800_ctls[i].v.id; | 990 | ctrl.id=cx8800_ctls[i].v.id; |
990 | ctrl.value=cx8800_ctls[i].v.default_value | 991 | ctrl.value=cx8800_ctls[i].v.default_value; |
991 | +cx8800_ctls[i].off; | ||
992 | set_control(core, &ctrl); | 992 | set_control(core, &ctrl); |
993 | } | 993 | } |
994 | } | 994 | } |