V4L/DVB (3615): Saa7134: select FW_LOADER
[safe/jmp/linux-2.6] / drivers / media / video / tda7432.c
index c6efc98..78e043a 100644 (file)
@@ -48,9 +48,8 @@
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
 
-#include "bttv.h"
-#include <media/audiochip.h>
 #include <media/v4l2-common.h>
+#include <media/i2c-addr.h>
 
 #ifndef VIDEO_AUDIO_BALANCE
 # define VIDEO_AUDIO_BALANCE 32
@@ -71,7 +70,7 @@ module_param(maxvol, int, S_IRUGO | S_IWUSR);
 
 /* Address to scan (I2C address of this chip) */
 static unsigned short normal_i2c[] = {
-       I2C_TDA7432 >> 1,
+       I2C_ADDR_TDA7432 >> 1,
        I2C_CLIENT_END,
 };
 I2C_CLIENT_INSMOD;
@@ -227,8 +226,8 @@ static struct i2c_client client_template;
 static int tda7432_write(struct i2c_client *client, int subaddr, int val)
 {
        unsigned char buffer[2];
-       v4l_dbg(2,client,"In tda7432_write\n");
-       v4l_dbg(1,client,"Writing %d 0x%x\n", subaddr, val);
+       v4l_dbg(2, debug,client,"In tda7432_write\n");
+       v4l_dbg(1, debug,client,"Writing %d 0x%x\n", subaddr, val);
        buffer[0] = subaddr;
        buffer[1] = val;
        if (2 != i2c_master_send(client,buffer,2)) {
@@ -245,9 +244,9 @@ static int tda7432_set(struct i2c_client *client)
 {
        struct tda7432 *t = i2c_get_clientdata(client);
        unsigned char buf[16];
-       v4l_dbg(2,client,"In tda7432_set\n");
+       v4l_dbg(2, debug,client,"In tda7432_set\n");
 
-       v4l_dbg(1,client,
+       v4l_dbg(1, debug,client,
                "tda7432: 7432_set(0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x)\n",
                t->input,t->volume,t->bass,t->treble,t->lf,t->lr,t->rf,t->rr,t->loud);
        buf[0]  = TDA7432_IN;
@@ -271,7 +270,7 @@ static int tda7432_set(struct i2c_client *client)
 static void do_tda7432_init(struct i2c_client *client)
 {
        struct tda7432 *t = i2c_get_clientdata(client);
-       v4l_dbg(2,client,"In tda7432_init\n");
+       v4l_dbg(2, debug,client,"In tda7432_init\n");
 
        t->input  = TDA7432_STEREO_IN |  /* Main (stereo) input   */
                    TDA7432_BASS_SYM  |  /* Symmetric bass cut    */
@@ -300,10 +299,9 @@ static int tda7432_attach(struct i2c_adapter *adap, int addr, int kind)
        struct tda7432 *t;
        struct i2c_client *client;
 
-       t = kmalloc(sizeof *t,GFP_KERNEL);
+       t = kzalloc(sizeof *t,GFP_KERNEL);
        if (!t)
                return -ENOMEM;
-       memset(t,0,sizeof *t);
 
        client = &t->c;
        memcpy(client,&client_template,sizeof(struct i2c_client));
@@ -340,9 +338,9 @@ static int tda7432_command(struct i2c_client *client,
                           unsigned int cmd, void *arg)
 {
        struct tda7432 *t = i2c_get_clientdata(client);
-       v4l_dbg(2,client,"In tda7432_command\n");
-        if (debug>1)
-                v4l_i2c_print_ioctl(client,cmd);
+       v4l_dbg(2, debug,client,"In tda7432_command\n");
+       if (debug>1)
+               v4l_i2c_print_ioctl(client,cmd);
 
        switch (cmd) {
        /* --- v4l ioctls --- */
@@ -489,7 +487,7 @@ static int tda7432_command(struct i2c_client *client,
 
 static struct i2c_driver driver = {
        .driver = {
-               .name    = "i2c tda7432 driver",
+               .name    = "tda7432",
        },
        .id              = I2C_DRIVERID_TDA7432,
        .attach_adapter  = tda7432_probe,