summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <devnull@localhost>2006-01-07 21:30:41 +0000
committerMauro Carvalho Chehab <devnull@localhost>2006-01-07 21:30:41 +0000
commit5cac981da5fdce6e96e8664cc06adbabc38cad03 (patch)
tree174741c897a9cdcb1b3aa4b68b8755a2727302ef /linux/drivers/media
parent891b1a330d34434953b744f5b470acf01cbcd1df (diff)
downloadmediapointer-dvb-s2-5cac981da5fdce6e96e8664cc06adbabc38cad03.tar.gz
mediapointer-dvb-s2-5cac981da5fdce6e96e8664cc06adbabc38cad03.tar.bz2
printk cleanups
- some fixes from the previous patches - printk replaced by v4l_ print macros on saa6752 and bt832 Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/bt832.c72
-rw-r--r--linux/drivers/media/video/ir-kbd-i2c.c4
-rw-r--r--linux/drivers/media/video/msp3400-driver.c2
-rw-r--r--linux/drivers/media/video/saa7134/saa6752hs.c6
-rw-r--r--linux/drivers/media/video/tvaudio.c1
5 files changed, 46 insertions, 39 deletions
diff --git a/linux/drivers/media/video/bt832.c b/linux/drivers/media/video/bt832.c
index eec3cbfae..83d67b2c1 100644
--- a/linux/drivers/media/video/bt832.c
+++ b/linux/drivers/media/video/bt832.c
@@ -30,13 +30,11 @@
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/slab.h>
+#include <media/audiochip.h>
+#include <media/v4l2-common.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-#include "audiochip.h"
-#include "id.h"
#include "i2c-compat.h"
-#else
-#include <media/audiochip.h>
#endif
#include "bttv.h"
#include "bt832.h"
@@ -48,9 +46,14 @@ static unsigned short normal_i2c[] = { I2C_BT832_ALT1>>1, I2C_BT832_ALT2>>1,
I2C_CLIENT_END };
I2C_CLIENT_INSMOD;
-/* ---------------------------------------------------------------------- */
+int debug = 0; /* debug output */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+module_param(debug, int, 0644);
+#else
+MODULE_PARM(debug, "i");
+#endif
-#define dprintk if (debug) printk
+/* ---------------------------------------------------------------------- */
static int bt832_detach(struct i2c_client *client);
@@ -67,23 +70,26 @@ int bt832_hexdump(struct i2c_client *i2c_client_s, unsigned char *buf)
int i,rc;
buf[0]=0x80; // start at register 0 with auto-increment
if (1 != (rc = i2c_master_send(i2c_client_s,buf,1)))
- printk("bt832: i2c i/o error: rc == %d (should be 1)\n",rc);
+ v4l_err(i2c_client_s,"i2c i/o error: rc == %d (should be 1)\n",rc);
for(i=0;i<65;i++)
buf[i]=0;
if (65 != (rc=i2c_master_recv(i2c_client_s,buf,65)))
- printk("bt832: i2c i/o error: rc == %d (should be 65)\n",rc);
+ v4l_err(i2c_client_s,"i2c i/o error: rc == %d (should be 65)\n",rc);
// Note: On READ the first byte is the current index
// (e.g. 0x80, what we just wrote)
- if(1) {
+ if(debug>1) {
int i;
- printk("BT832 hexdump:\n");
+ v4l_dbg(2,i2c_client_s,"hexdump:");
for(i=1;i<65;i++) {
if(i!=1) {
- if(((i-1)%8)==0) printk(" ");
- if(((i-1)%16)==0) printk("\n");
+ if(((i-1)%8)==0) printk(" ");
+ if(((i-1)%16)==0) {
+ printk("\n");
+ v4l_dbg(2,i2c_client_s,"hexdump:");
+ }
}
printk(" %02x",buf[i]);
}
@@ -102,68 +108,68 @@ int bt832_init(struct i2c_client *i2c_client_s)
bt832_hexdump(i2c_client_s,buf);
if(buf[0x40] != 0x31) {
- printk("bt832: this i2c chip is no bt832 (id=%02x). Detaching.\n",buf[0x40]);
+ v4l_err(i2c_client_s,"This i2c chip is no bt832 (id=%02x). Detaching.\n",buf[0x40]);
kfree(buf);
return 0;
}
- printk("Write 0 tp VPSTATUS\n");
+ v4l_err(i2c_client_s,"Write 0 tp VPSTATUS\n");
buf[0]=BT832_VP_STATUS; // Reg.52
buf[1]= 0x00;
if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
- printk("bt832: i2c i/o error VPS: rc == %d (should be 2)\n",rc);
+ v4l_err(i2c_client_s,"i2c i/o error VPS: rc == %d (should be 2)\n",rc);
bt832_hexdump(i2c_client_s,buf);
// Leave low power mode:
- printk("Bt832: leave low power mode.\n");
+ v4l_err(i2c_client_s,"leave low power mode.\n");
buf[0]=BT832_CAM_SETUP0; //0x39 57
buf[1]=0x08;
if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
- printk("bt832: i2c i/o error LLPM: rc == %d (should be 2)\n",rc);
+ v4l_err(i2c_client_s,"i2c i/o error LLPM: rc == %d (should be 2)\n",rc);
bt832_hexdump(i2c_client_s,buf);
- printk("Write 0 tp VPSTATUS\n");
+ v4l_info(i2c_client_s,"Write 0 tp VPSTATUS\n");
buf[0]=BT832_VP_STATUS; // Reg.52
buf[1]= 0x00;
if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
- printk("bt832: i2c i/o error VPS: rc == %d (should be 2)\n",rc);
+ v4l_err(i2c_client_s,"i2c i/o error VPS: rc == %d (should be 2)\n",rc);
bt832_hexdump(i2c_client_s,buf);
// Enable Output
- printk("Enable Output\n");
+ v4l_info(i2c_client_s,"Enable Output\n");
buf[0]=BT832_VP_CONTROL1; // Reg.40
buf[1]= 0x27 & (~0x01); // Default | !skip
if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
- printk("bt832: i2c i/o error EO: rc == %d (should be 2)\n",rc);
+ v4l_err(i2c_client_s,"i2c i/o error EO: rc == %d (should be 2)\n",rc);
bt832_hexdump(i2c_client_s,buf);
#if 0
// Full 30/25 Frame rate
- printk("Full 30/25 Frame rate\n");
+ v4l_err(i2c_client_s,"Full 30/25 Frame rate\n");
buf[0]=BT832_VP_CONTROL0; // Reg.39
buf[1]= 0x00;
if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
- printk("bt832: i2c i/o error FFR: rc == %d (should be 2)\n",rc);
+ v4l_err(i2c_client_s,"i2c i/o error FFR: rc == %d (should be 2)\n",rc);
bt832_hexdump(i2c_client_s,buf);
#endif
#if 1
// for testing (even works when no camera attached)
- printk("bt832: *** Generate NTSC M Bars *****\n");
+ v4l_info(i2c_client_s,"*** Generate NTSC M Bars *****\n");
buf[0]=BT832_VP_TESTCONTROL0; // Reg. 42
buf[1]=3; // Generate NTSC System M bars, Generate Frame timing internally
if (2 != (rc = i2c_master_send(i2c_client_s,buf,2)))
- printk("bt832: i2c i/o error MBAR: rc == %d (should be 2)\n",rc);
+ v4l_info(i2c_client_s,"i2c i/o error MBAR: rc == %d (should be 2)\n",rc);
#endif
- printk("Bt832: Camera Present: %s\n",
+ v4l_info(i2c_client_s,"Camera Present: %s\n",
(buf[1+BT832_CAM_STATUS] & BT832_56_CAMERA_PRESENT) ? "yes":"no");
bt832_hexdump(i2c_client_s,buf);
@@ -182,13 +188,9 @@ static int bt832_attach(struct i2c_adapter *adap, int addr,
{
struct bt832 *t;
- printk("bt832_attach\n");
-
client_template.adapter = adap;
client_template.addr = addr;
- printk("bt832: chip found @ 0x%x\n", addr<<1);
-
if (NULL == (t = kmalloc(sizeof(*t), GFP_KERNEL)))
return -ENOMEM;
memset(t,0,sizeof(*t));
@@ -196,6 +198,9 @@ static int bt832_attach(struct i2c_adapter *adap, int addr,
i2c_set_clientdata(&t->client, t);
i2c_attach_client(&t->client);
+ v4l_info(t->client,"chip found @ 0x%x\n", addr<<1);
+
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
MOD_INC_USE_COUNT;
#endif
@@ -223,7 +228,7 @@ static int bt832_detach(struct i2c_client *client)
{
struct bt832 *t = i2c_get_clientdata(client);
- printk("bt832: detach.\n");
+ v4l_info(t->client,"dettach\n");
i2c_detach_client(client);
kfree(t);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
@@ -237,7 +242,8 @@ bt832_command(struct i2c_client *client, unsigned int cmd, void *arg)
{
struct bt832 *t = i2c_get_clientdata(client);
- printk("bt832: command %x\n",cmd);
+ if (debug>1)
+ v4l_client_print_ioctl(t->client,cmd);
switch (cmd) {
case BT832_HEXDUMP: {
@@ -248,7 +254,7 @@ bt832_command(struct i2c_client *client, unsigned int cmd, void *arg)
}
break;
case BT832_REATTACH:
- printk("bt832: re-attach\n");
+ v4l_info(t->client,"re-attach\n");
i2c_del_driver(&driver);
i2c_add_driver(&driver);
break;
diff --git a/linux/drivers/media/video/ir-kbd-i2c.c b/linux/drivers/media/video/ir-kbd-i2c.c
index 86965c710..bad66ef5f 100644
--- a/linux/drivers/media/video/ir-kbd-i2c.c
+++ b/linux/drivers/media/video/ir-kbd-i2c.c
@@ -1,5 +1,5 @@
/*
- * $Id: ir-kbd-i2c.c,v 1.31 2006/01/07 20:43:23 mchehab Exp $
+ * $Id: ir-kbd-i2c.c,v 1.32 2006/01/07 21:30:41 mchehab Exp $
*
* keyboard input driver for i2c IR remote controls
*
@@ -281,7 +281,7 @@ static int ir_probe(struct i2c_adapter *adap);
static struct i2c_driver driver = {
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0))&&(LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15))
- .owner = THIS_MODULE;
+ .owner = THIS_MODULE,
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
.name = "ir-kbd-i2c",
diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c
index ddd515b30..bb470fc83 100644
--- a/linux/drivers/media/video/msp3400-driver.c
+++ b/linux/drivers/media/video/msp3400-driver.c
@@ -1230,7 +1230,7 @@ static struct i2c_driver i2c_driver = {
.command = msp_command,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
.driver = {
-#if LINUX_VERSION_CODE . KERNEL_VERSION(2,6,15)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
.name = "msp3400",
#endif
.suspend = msp_suspend,
diff --git a/linux/drivers/media/video/saa7134/saa6752hs.c b/linux/drivers/media/video/saa7134/saa6752hs.c
index 69e8c209c..dc49dbf68 100644
--- a/linux/drivers/media/video/saa7134/saa6752hs.c
+++ b/linux/drivers/media/video/saa7134/saa6752hs.c
@@ -10,7 +10,8 @@
#include <linux/i2c.h>
#include <linux/types.h>
#include "compat.h"
-#include <linux/videodev.h>
+#include <linux/videodev2.h>
+#include <media/v4l2-common.h>
#include <linux/init.h>
#include <linux/crc32.h>
@@ -524,7 +525,6 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, unsigned short f
{
struct saa6752hs_state *h;
- printk("saa6752hs: chip found @ 0x%x\n", addr<<1);
if (NULL == (h = kmalloc(sizeof(*h), GFP_KERNEL)))
return -ENOMEM;
@@ -540,6 +540,8 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr, unsigned short f
i2c_set_clientdata(&h->client, h);
i2c_attach_client(&h->client);
+ v4l_info(&h->client,"saa6752hs: chip found @ 0x%x\n", addr<<1);
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
MOD_INC_USE_COUNT;
#endif
diff --git a/linux/drivers/media/video/tvaudio.c b/linux/drivers/media/video/tvaudio.c
index 2f7131d81..5de17e25f 100644
--- a/linux/drivers/media/video/tvaudio.c
+++ b/linux/drivers/media/video/tvaudio.c
@@ -1789,7 +1789,6 @@ static struct i2c_driver driver = {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))&&(LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15))
.owner = THIS_MODULE,
#endif
- static struct i2c_driver driver = {
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
.name = "tvaudio",
.flags = I2C_DF_NOTIFY,