diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-12 00:03:47 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-12 00:03:47 -0300 |
commit | 3d611f80a1b8888b9001e1738f24194c694a8bf4 (patch) | |
tree | 2ce4b855e3e4f7157cc7933136401c8e94d15875 | |
parent | f994311899a6043042ad5dd10fa71b7a825f89a5 (diff) | |
download | mediapointer-dvb-s2-3d611f80a1b8888b9001e1738f24194c694a8bf4.tar.gz mediapointer-dvb-s2-3d611f80a1b8888b9001e1738f24194c694a8bf4.tar.bz2 |
Cx88 default picture controls values
From: Marcin Rudowski <mar_rud@poczta.onet.pl>
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>
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-video.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c index edd32f7c1..79126bc5c 100644 --- a/linux/drivers/media/video/cx88/cx88-video.c +++ b/linux/drivers/media/video/cx88/cx88-video.c @@ -253,7 +253,7 @@ static struct cx88_ctrl cx8800_ctls[] = { .minimum = 0x00, .maximum = 0xff, .step = 1, - .default_value = 0, + .default_value = 0x7f, .type = V4L2_CTRL_TYPE_INTEGER, }, .off = 128, @@ -281,7 +281,7 @@ static struct cx88_ctrl cx8800_ctls[] = { .minimum = 0, .maximum = 0xff, .step = 1, - .default_value = 0, + .default_value = 0x7f, .type = V4L2_CTRL_TYPE_INTEGER, }, .off = 128, @@ -326,7 +326,7 @@ static struct cx88_ctrl cx8800_ctls[] = { .minimum = 0, .maximum = 0x3f, .step = 1, - .default_value = 0x1f, + .default_value = 0x3f, .type = V4L2_CTRL_TYPE_INTEGER, }, .reg = AUD_VOL_CTL, @@ -1160,7 +1160,8 @@ static int get_control(struct cx88_core *core, struct v4l2_control *ctl) value = c->sreg ? cx_sread(c->sreg) : cx_read(c->reg); switch (ctl->id) { case V4L2_CID_AUDIO_BALANCE: - ctl->value = (value & 0x40) ? (value & 0x3f) : (0x40 - (value & 0x3f)); + ctl->value = ((value & 0x7f) < 0x40) ? ((value & 0x7f) + 0x40) + : (0x7f - (value & 0x7f)); break; case V4L2_CID_AUDIO_VOLUME: ctl->value = 0x3f - (value & 0x3f); @@ -1205,7 +1206,7 @@ static int set_control(struct cx88_core *core, struct v4l2_control *ctl) mask=c->mask; switch (ctl->id) { case V4L2_CID_AUDIO_BALANCE: - value = (ctl->value < 0x40) ? (0x40 - ctl->value) : ctl->value; + value = (ctl->value < 0x40) ? (0x7f - ctl->value) : (ctl->value - 0x40); break; case V4L2_CID_AUDIO_VOLUME: value = 0x3f - (ctl->value & 0x3f); @@ -1246,8 +1247,7 @@ static void init_controls(struct cx88_core *core) for (i = 0; i < CX8800_CTLS; i++) { ctrl.id=cx8800_ctls[i].v.id; - ctrl.value=cx8800_ctls[i].v.default_value - +cx8800_ctls[i].off; + ctrl.value=cx8800_ctls[i].v.default_value; set_control(core, &ctrl); } } |