aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/zc3xx.c
diff options
context:
space:
mode:
authorJean-François Moine <moinejf@free.fr>2010-04-25 14:25:42 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 11:58:16 -0400
commita85675316f24835ce0c3286ee3cb33fa2f24bca7 (patch)
treec8014585650f181d5318a0e723223f5cd7291621 /drivers/media/video/gspca/zc3xx.c
parent07ae4918f75f26f4f4200de186a27178c7e58038 (diff)
V4L/DVB: gspca - zc3xx: Fix the gamma calculation from the contrast
Signed-off-by: Jean-François Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/zc3xx.c')
-rw-r--r--drivers/media/video/gspca/zc3xx.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c
index 1bab5086bada..d02aa5c8472a 100644
--- a/drivers/media/video/gspca/zc3xx.c
+++ b/drivers/media/video/gspca/zc3xx.c
@@ -6014,8 +6014,8 @@ static void setcontrast(struct gspca_dev *gspca_dev)
6014 int g, i, k, adj, gp; 6014 int g, i, k, adj, gp;
6015 u8 gr[16]; 6015 u8 gr[16];
6016 static const u8 delta_tb[16] = /* delta for contrast */ 6016 static const u8 delta_tb[16] = /* delta for contrast */
6017 {0x15, 0x0d, 0x0a, 0x09, 0x08, 0x08, 0x08, 0x08, 6017 {0x2c, 0x1a, 0x12, 0x0c, 0x0a, 0x06, 0x06, 0x06,
6018 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; 6018 0x04, 0x06, 0x04, 0x04, 0x03, 0x03, 0x02, 0x02};
6019 static const u8 gamma_tb[6][16] = { 6019 static const u8 gamma_tb[6][16] = {
6020 {0x00, 0x00, 0x03, 0x0d, 0x1b, 0x2e, 0x45, 0x5f, 6020 {0x00, 0x00, 0x03, 0x0d, 0x1b, 0x2e, 0x45, 0x5f,
6021 0x79, 0x93, 0xab, 0xc1, 0xd4, 0xe5, 0xf3, 0xff}, 6021 0x79, 0x93, 0xab, 0xc1, 0xd4, 0xe5, 0xf3, 0xff},
@@ -6037,11 +6037,11 @@ static void setcontrast(struct gspca_dev *gspca_dev)
6037 adj = 0; 6037 adj = 0;
6038 gp = 0; 6038 gp = 0;
6039 for (i = 0; i < 16; i++) { 6039 for (i = 0; i < 16; i++) {
6040 g = Tgamma[i] - delta_tb[i] * k / 128 - adj / 2; 6040 g = Tgamma[i] - delta_tb[i] * k / 256 - adj / 2;
6041 if (g > 0xff) 6041 if (g > 0xff)
6042 g = 0xff; 6042 g = 0xff;
6043 else if (g <= 0) 6043 else if (g < 0)
6044 g = 1; 6044 g = 0;
6045 reg_w(dev, g, 0x0120 + i); /* gamma */ 6045 reg_w(dev, g, 0x0120 + i); /* gamma */
6046 if (k > 0) 6046 if (k > 0)
6047 adj--; 6047 adj--;