public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: mchehab@infradead.org
To: linux-kernel@vger.kernel.org
Cc: linux-dvb-maintainer@linuxtv.org,
	Marcin Rudowski <mar_rud@poczta.onet.pl>,
	Ian Pickworth <ian@pickworth.me.uk>,
	Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: [PATCH 08/21] Cx88 default picture controls values
Date: Fri, 17 Mar 2006 17:54:35 -0300	[thread overview]
Message-ID: <20060317205434.PS87790000008@infradead.org> (raw)
In-Reply-To: <20060317205359.PS65198900000@infradead.org>


From: Marcin Rudowski <mar_rud@poczta.onet.pl>
Date: 1142132627 \-0300

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>
---

 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 073494c..39328bb 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[] = 
 			.minimum       = 0x00,
 			.maximum       = 0xff,
 			.step          = 1,
-			.default_value = 0,
+			.default_value = 0x7f,
 			.type          = V4L2_CTRL_TYPE_INTEGER,
 		},
 		.off                   = 128,
@@ -255,7 +255,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,
@@ -300,7 +300,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,
@@ -909,7 +909,8 @@ static int get_control(struct cx88_core 
 	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);
@@ -946,7 +947,7 @@ static int set_control(struct cx88_core 
 	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);
@@ -987,8 +988,7 @@ static void init_controls(struct cx88_co
 
 	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);
 	}
 }


  parent reply	other threads:[~2006-03-17 20:56 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-17 20:53 [PATCH 00/21] V4L/DVB fixes mchehab
2006-03-17 20:54 ` [PATCH 01/21] Nskips maybe used uninitialized in bttv_risc_overlay mchehab
2006-03-17 20:54 ` [PATCH 03/21] Correct gpio values for Aver 303 Studio in v4l-dvb tree mchehab
2006-03-17 20:54 ` [PATCH 02/21] Fix cx88 error messages on balance change mchehab
2006-03-17 20:54 ` [PATCH 04/21] Fix typo in enum name and use enum in struct dmxdev_filter mchehab
2006-03-17 20:54 ` [PATCH 05/21] Added no_overlay option and quirks to saa7134 mchehab
2006-03-17 23:24   ` Adrian Bunk
2006-03-18  0:04     ` [v4l-dvb-maintainer] " Mauro Carvalho Chehab
2006-03-17 20:54 ` [PATCH 07/21] Cx88-input.c: add IR remote control support to CX88_BOARD_PROLINK_PLAYTVPVR mchehab
2006-03-17 20:54 ` [PATCH 06/21] Cx88-cards.c: fix values of gpio0 for card CX88_BOARD_PROLINK_PLAYTVPVR mchehab
2006-03-17 20:54 ` [PATCH 11/21] Snd_cx88_create: don't dereference NULL core mchehab
2006-03-17 20:54 ` [PATCH 10/21] BUG_ON() Conversion in drivers/video/media mchehab
2006-03-17 20:54 ` [PATCH 09/21] Cleanup mangled whitespace mchehab
2006-03-17 20:54 ` mchehab [this message]
2006-03-17 21:10   ` [PATCH 08/21] Cx88 default picture controls values Lee Revell
2006-03-18  0:25     ` Mauro Carvalho Chehab
2006-03-17 20:54 ` [PATCH 12/21] Kconfig: select VIDEO_CX25840 to build cx25840 a/v decoder module mchehab
2006-03-17 20:54 ` [PATCH 13/21] Whitespace: fix incorrect indentation of curly bracket mchehab
2006-03-17 20:54 ` [PATCH 14/21] Cinergy T2 dmx cleanup on disconnect mchehab
2006-03-17 20:54 ` [PATCH 15/21] Restore tuning capabilities in v4l2 mxb driver mchehab
2006-03-17 20:54 ` [PATCH 17/21] Kconfig: fix ATSC frontend menu item names by manufacturer mchehab
2006-03-17 20:54 ` [PATCH 16/21] Kconfig: swap VIDEO_CX88_ALSA and VIDEO_CX88_DVB mchehab
2006-03-18 19:59   ` Michael Krufky
2006-03-18 20:15   ` [2.6.16 PATCH] " Michael Krufky
2006-03-17 20:54 ` [PATCH 19/21] Cpia2: move Kconfig build logic into cpia2/Kconfig mchehab
2006-03-17 20:54 ` [PATCH 20/21] VIDEO_CPIA2 must depend on USB mchehab
2006-03-17 20:54 ` [PATCH 18/21] Fix a bug when more than MAXBOARDS were plugged on em28xx mchehab
2006-03-17 20:54 ` [PATCH 21/21] Fixed em28xx based system lockup mchehab
2006-03-17 23:07 ` [PATCH 00/21] V4L/DVB fixes Linus Torvalds
2006-03-17 23:13   ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060317205434.PS87790000008@infradead.org \
    --to=mchehab@infradead.org \
    --cc=ian@pickworth.me.uk \
    --cc=linux-dvb-maintainer@linuxtv.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mar_rud@poczta.onet.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox