diff options
author | Mauro Carvalho Chehab <devnull@localhost> | 2006-01-08 12:05:34 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <devnull@localhost> | 2006-01-08 12:05:34 +0000 |
commit | 73c5fb6887d21bdbe4c5aec07f132e0010a554da (patch) | |
tree | 29aed676055bf337c38c7be489cb544df9fe9c1e /linux/drivers/media/video/tda7432.c | |
parent | 1dcaf3c6fe06fdbc838908e5b109d9c9aa510835 (diff) | |
download | mediapointer-dvb-s2-73c5fb6887d21bdbe4c5aec07f132e0010a554da.tar.gz mediapointer-dvb-s2-73c5fb6887d21bdbe4c5aec07f132e0010a554da.tar.bz2 |
i2c fixes and cleanups
- Miscelaneous i2c cleanups and fixes to work with kernel >2.6.15
- linux/sound/pci/bt87x.c updated to kernel version.
kernel-sync
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux/drivers/media/video/tda7432.c')
-rw-r--r-- | linux/drivers/media/video/tda7432.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/linux/drivers/media/video/tda7432.c b/linux/drivers/media/video/tda7432.c index 7b68530b1..7e050b5b5 100644 --- a/linux/drivers/media/video/tda7432.c +++ b/linux/drivers/media/video/tda7432.c @@ -96,9 +96,6 @@ struct tda7432 { static struct i2c_driver driver; static struct i2c_client client_template; -#define dprintk if (debug) printk -#define d2printk if (debug > 1) printk - /* The TDA7432 is made by STS-Thompson * http://www.st.com * http://us.st.com/stonline/books/pdf/docs/4056.pdf @@ -235,12 +232,12 @@ static struct i2c_client client_template; static int tda7432_write(struct i2c_client *client, int subaddr, int val) { unsigned char buffer[2]; - d2printk("tda7432: In tda7432_write\n"); - dprintk("tda7432: Writing %d 0x%x\n", subaddr, val); + v4l_dbg(2,client,"In tda7432_write\n"); + v4l_dbg(1,client,"Writing %d 0x%x\n", subaddr, val); buffer[0] = subaddr; buffer[1] = val; if (2 != i2c_master_send(client,buffer,2)) { - printk(KERN_WARNING "tda7432: I/O error, trying (write %d 0x%x)\n", + v4l_err(client,"I/O error, trying (write %d 0x%x)\n", subaddr, val); return -1; } @@ -252,12 +249,12 @@ static int tda7432_write(struct i2c_client *client, int subaddr, int val) static int tda7432_read(struct i2c_client *client) { unsigned char buffer; - d2printk("tda7432: In tda7432_read\n"); + v4l_dbg(2,client,"In tda7432_read\n"); if (1 != i2c_master_recv(client,&buffer,1)) { - printk(KERN_WARNING "tda7432: I/O error, trying (read)\n"); + v4l_err(client,"I/O error, trying (read)\n"); return -1; } - dprintk("tda7432: Read 0x%02x\n", buffer); + v4l_dbg(1,client,"Read 0x%02x\n", buffer); return buffer; } #endif @@ -266,9 +263,9 @@ static int tda7432_set(struct i2c_client *client) { struct tda7432 *t = i2c_get_clientdata(client); unsigned char buf[16]; - d2printk("tda7432: In tda7432_set\n"); + v4l_dbg(2,client,"In tda7432_set\n"); - dprintk(KERN_INFO + v4l_dbg(1,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; @@ -282,7 +279,7 @@ static int tda7432_set(struct i2c_client *client) buf[8] = t->rr; buf[9] = t->loud; if (10 != i2c_master_send(client,buf,10)) { - printk(KERN_WARNING "tda7432: I/O error, trying tda7432_set\n"); + v4l_err(client,"I/O error, trying tda7432_set\n"); return -1; } @@ -292,7 +289,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); - d2printk("tda7432: In tda7432_init\n"); + v4l_dbg(2,client,"In tda7432_init\n"); t->input = TDA7432_STEREO_IN | /* Main (stereo) input */ TDA7432_BASS_SYM | /* Symmetric bass cut */ @@ -325,7 +322,6 @@ static int tda7432_attach(struct i2c_adapter *adap, int addr, { struct tda7432 *t; struct i2c_client *client; - d2printk("tda7432: In tda7432_attach\n"); t = kmalloc(sizeof *t,GFP_KERNEL); if (!t) @@ -342,9 +338,9 @@ static int tda7432_attach(struct i2c_adapter *adap, int addr, #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) MOD_INC_USE_COUNT; #endif - printk(KERN_INFO "tda7432: init\n"); - i2c_attach_client(client); + + v4l_info(client, "chip found @ 0x%x (%s)\n", address << 1, adapter->name); return 0; } |