diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-10-04 13:17:02 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 07:37:13 -0400 |
commit | 803f9ccf50178af6cde7aec86db2d78db3d069e7 (patch) | |
tree | 1ed7e298aba2026d89466a63239d1dc4a94e571e /drivers/media/video/gspca | |
parent | eeb00c604ad203a51a0b92e124bcc4f98ba7e2c0 (diff) |
V4L/DVB (9097): gspca: Adjust control values and restore compilation of sonixj.
- no compilation since last changeset
- brightness is a signed value
- better values of the color matrix
[mchehab@redhat.com: fix a merge conflict]
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca')
-rw-r--r-- | drivers/media/video/gspca/Makefile | 2 | ||||
-rw-r--r-- | drivers/media/video/gspca/sonixj.c | 27 |
2 files changed, 14 insertions, 15 deletions
diff --git a/drivers/media/video/gspca/Makefile b/drivers/media/video/gspca/Makefile index b510b06fd873..b87322f4a487 100644 --- a/drivers/media/video/gspca/Makefile +++ b/drivers/media/video/gspca/Makefile | |||
@@ -6,7 +6,7 @@ obj-$(CONFIG_USB_GSPCA_OV519) += gspca_ov519.o | |||
6 | obj-$(CONFIG_USB_GSPCA_PAC207) += gspca_pac207.o | 6 | obj-$(CONFIG_USB_GSPCA_PAC207) += gspca_pac207.o |
7 | obj-$(CONFIG_USB_GSPCA_PAC7311) += gspca_pac7311.o | 7 | obj-$(CONFIG_USB_GSPCA_PAC7311) += gspca_pac7311.o |
8 | obj-$(CONFIG_USB_GSPCA_SONIXB) += gspca_sonixb.o | 8 | obj-$(CONFIG_USB_GSPCA_SONIXB) += gspca_sonixb.o |
9 | obj-$(CONFIG_USB_GSPCA_SONXIJ) += gspca_sonixj.o | 9 | obj-$(CONFIG_USB_GSPCA_SONIXJ) += gspca_sonixj.o |
10 | obj-$(CONFIG_USB_GSPCA_SPCA500) += gspca_spca500.o | 10 | obj-$(CONFIG_USB_GSPCA_SPCA500) += gspca_spca500.o |
11 | obj-$(CONFIG_USB_GSPCA_SPCA501) += gspca_spca501.o | 11 | obj-$(CONFIG_USB_GSPCA_SPCA501) += gspca_spca501.o |
12 | obj-$(CONFIG_USB_GSPCA_SPCA505) += gspca_spca505.o | 12 | obj-$(CONFIG_USB_GSPCA_SPCA505) += gspca_spca505.o |
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index 03fe77d38cc1..93b17340b7b1 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c | |||
@@ -267,10 +267,12 @@ static const __u8 gamma_def[] = { | |||
267 | 0xa6, 0xb2, 0xbf, 0xca, 0xd5, 0xe0, 0xeb, 0xf5, 0xff | 267 | 0xa6, 0xb2, 0xbf, 0xca, 0xd5, 0xe0, 0xeb, 0xf5, 0xff |
268 | }; | 268 | }; |
269 | 269 | ||
270 | /* color matrix and offsets */ | ||
270 | static const __u8 reg84[] = { | 271 | static const __u8 reg84[] = { |
271 | 0x14, 0x00, 0x27, 0x00, 0x07, 0x00, 0xe5, 0x0f, | 272 | 0x14, 0x00, 0x27, 0x00, 0x07, 0x00, /* YR YG YB gains */ |
272 | 0xe4, 0x0f, 0x38, 0x00, 0x3e, 0x00, 0xc3, 0x0f, | 273 | 0xe8, 0x0f, 0xda, 0x0f, 0x40, 0x00, /* UR UG UB */ |
273 | 0xf7, 0x0f, 0x00, 0x00, 0x00 | 274 | 0x3e, 0x00, 0xcd, 0x0f, 0xf7, 0x0f, /* VR VG VB */ |
275 | 0x00, 0x00, 0x00 /* YUV offsets */ | ||
274 | }; | 276 | }; |
275 | static const __u8 hv7131r_sensor_init[][8] = { | 277 | static const __u8 hv7131r_sensor_init[][8] = { |
276 | {0xC1, 0x11, 0x01, 0x08, 0x01, 0x00, 0x00, 0x10}, | 278 | {0xC1, 0x11, 0x01, 0x08, 0x01, 0x00, 0x00, 0x10}, |
@@ -1102,20 +1104,17 @@ static unsigned int setexposure(struct gspca_dev *gspca_dev, | |||
1102 | static void setbrightcont(struct gspca_dev *gspca_dev) | 1104 | static void setbrightcont(struct gspca_dev *gspca_dev) |
1103 | { | 1105 | { |
1104 | struct sd *sd = (struct sd *) gspca_dev; | 1106 | struct sd *sd = (struct sd *) gspca_dev; |
1105 | unsigned val; | 1107 | int val; |
1106 | __u8 reg84_full[0x15]; | 1108 | __u8 reg84_full[0x15]; |
1107 | 1109 | ||
1108 | memset(reg84_full, 0, sizeof reg84_full); | 1110 | memcpy(reg84_full, reg84, sizeof reg84_full); |
1109 | val = sd->contrast * 0x20 / CONTRAST_MAX + 0x10; /* 10..30 */ | 1111 | val = sd->contrast * 0x30 / CONTRAST_MAX + 0x10; /* 10..40 */ |
1110 | reg84_full[2] = val; | 1112 | reg84_full[0] = (val + 1) / 2; /* red */ |
1111 | reg84_full[0] = (val + 1) / 2; | 1113 | reg84_full[2] = val; /* green */ |
1112 | reg84_full[4] = (val + 1) / 5; | 1114 | reg84_full[4] = (val + 1) / 5; /* blue */ |
1113 | if (val > BRIGHTNESS_DEF) | 1115 | val = (sd->brightness - BRIGHTNESS_DEF) * 0x10 |
1114 | val = (sd->brightness - BRIGHTNESS_DEF) * 0x20 | ||
1115 | / BRIGHTNESS_MAX; | 1116 | / BRIGHTNESS_MAX; |
1116 | else | 1117 | reg84_full[0x12] = val & 0x1f; /* 5:0 signed value */ |
1117 | val = 0; | ||
1118 | reg84_full[0x12] = val; /* 00..1f */ | ||
1119 | reg_w(gspca_dev, 0x84, reg84_full, sizeof reg84_full); | 1118 | reg_w(gspca_dev, 0x84, reg84_full, sizeof reg84_full); |
1120 | } | 1119 | } |
1121 | 1120 | ||