V4L/DVB (8828): gspca: Set the clock at the end of initialization in sonixj.
[safe/jmp/linux-2.6] / drivers / media / video / bt856.c
index da3be00..98ee2d8 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * bt856 - BT856A Digital Video Encoder (Rockwell Part)
  *
  * Copyright (C) 1999 Mike Bernson <mike@mlb.org>
 #include <linux/major.h>
 #include <linux/slab.h>
 #include <linux/mm.h>
-#include <linux/pci.h>
 #include <linux/signal.h>
+#include <linux/types.h>
+#include <linux/i2c.h>
+#include <linux/video_encoder.h>
 #include <asm/io.h>
 #include <asm/pgtable.h>
 #include <asm/page.h>
-#include <linux/sched.h>
-#include <linux/types.h>
+#include <asm/uaccess.h>
 
 #include <linux/videodev.h>
-#include <asm/uaccess.h>
 
 MODULE_DESCRIPTION("Brooktree-856A video encoder driver");
 MODULE_AUTHOR("Mike Bernson & Dave Perks");
 MODULE_LICENSE("GPL");
 
-#include <linux/i2c.h>
 
 #define I2C_NAME(s) (s)->name
 
-#include <linux/video_encoder.h>
 
-static int debug = 0;
+static int debug;
 module_param(debug, int, 0);
 MODULE_PARM_DESC(debug, "Debug level (0-1)");
 
@@ -70,17 +68,14 @@ MODULE_PARM_DESC(debug, "Debug level (0-1)");
 
 /* ----------------------------------------------------------------------- */
 
-#define REG_OFFSET  0xCE
+#define REG_OFFSET     0xDA
+#define BT856_NR_REG   6
 
 struct bt856 {
-       unsigned char reg[32];
+       unsigned char reg[BT856_NR_REG];
 
        int norm;
        int enable;
-       int bright;
-       int contrast;
-       int hue;
-       int sat;
 };
 
 #define   I2C_BT856        0x88
@@ -119,8 +114,8 @@ bt856_dump (struct i2c_client *client)
        struct bt856 *encoder = i2c_get_clientdata(client);
 
        printk(KERN_INFO "%s: register dump:", I2C_NAME(client));
-       for (i = 0xd6; i <= 0xde; i += 2)
-               printk(" %02x", encoder->reg[i - REG_OFFSET]);
+       for (i = 0; i < BT856_NR_REG; i += 2)
+               printk(" %02x", encoder->reg[i]);
        printk("\n");
 }
 
@@ -288,7 +283,7 @@ bt856_command (struct i2c_client *client,
 static unsigned short normal_i2c[] = { I2C_BT856 >> 1, I2C_CLIENT_END };
 
 static unsigned short ignore = I2C_CLIENT_END;
-                                                                                
+
 static struct i2c_client_address_data addr_data = {
        .normal_i2c             = normal_i2c,
        .probe                  = &ignore,
@@ -316,7 +311,7 @@ bt856_detect_client (struct i2c_adapter *adapter,
                return 0;
 
        client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
-       if (client == 0)
+       if (!client)
                return -ENOMEM;
        client->addr = address;
        client->adapter = adapter;