aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2006-08-08 08:10:11 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-09-26 10:53:32 -0400
commit8b9a46647b965f7033c198dd5e73d58b10e22a21 (patch)
tree1f162c9868f0473524a60d65ee8c66b29e2f2588 /drivers/media/dvb/frontends
parent2b100e7d3c448dd369cf36ff38844b2440fab49d (diff)
V4L/DVB (4403): Use dprintk in tda826x.
As opposed to printk() at the moment, which will fill logs uselessly Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r--drivers/media/dvb/frontends/tda826x.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/media/dvb/frontends/tda826x.c b/drivers/media/dvb/frontends/tda826x.c
index f594eab4432e..7c19b88e950f 100644
--- a/drivers/media/dvb/frontends/tda826x.c
+++ b/drivers/media/dvb/frontends/tda826x.c
@@ -26,6 +26,12 @@
26 26
27#include "tda826x.h" 27#include "tda826x.h"
28 28
29static int debug = 0;
30#define dprintk(args...) \
31 do { \
32 if (debug) printk(KERN_DEBUG "tda826x: " args); \
33 } while (0)
34
29struct tda826x_priv { 35struct tda826x_priv {
30 /* i2c details */ 36 /* i2c details */
31 int i2c_address; 37 int i2c_address;
@@ -49,17 +55,18 @@ static int tda826x_sleep(struct dvb_frontend *fe)
49 u8 buf [] = { 0x00, 0x8d }; 55 u8 buf [] = { 0x00, 0x8d };
50 struct i2c_msg msg = { .addr = priv->i2c_address, .flags = 0, .buf = buf, .len = 2 }; 56 struct i2c_msg msg = { .addr = priv->i2c_address, .flags = 0, .buf = buf, .len = 2 };
51 57
58 dprintk("%s:\n", __FUNCTION__);
59
52 if (!priv->has_loopthrough) 60 if (!priv->has_loopthrough)
53 buf[1] = 0xad; 61 buf[1] = 0xad;
54 62
55 if (fe->ops.i2c_gate_ctrl) 63 if (fe->ops.i2c_gate_ctrl)
56 fe->ops.i2c_gate_ctrl(fe, 1); 64 fe->ops.i2c_gate_ctrl(fe, 1);
57 if ((ret = i2c_transfer (priv->i2c, &msg, 1)) != 1) { 65 if ((ret = i2c_transfer (priv->i2c, &msg, 1)) != 1) {
58 printk("%s: i2c error\n", __FUNCTION__); 66 dprintk("%s: i2c error\n", __FUNCTION__);
59 } 67 }
60 if (fe->ops.i2c_gate_ctrl) 68 if (fe->ops.i2c_gate_ctrl)
61 fe->ops.i2c_gate_ctrl(fe, 0); 69 fe->ops.i2c_gate_ctrl(fe, 0);
62 printk("%s:\n", __FUNCTION__);
63 70
64 return (ret == 1) ? 0 : ret; 71 return (ret == 1) ? 0 : ret;
65} 72}
@@ -72,6 +79,8 @@ static int tda826x_set_params(struct dvb_frontend *fe, struct dvb_frontend_param
72 u8 buf [11]; 79 u8 buf [11];
73 struct i2c_msg msg = { .addr = priv->i2c_address, .flags = 0, .buf = buf, .len = 11 }; 80 struct i2c_msg msg = { .addr = priv->i2c_address, .flags = 0, .buf = buf, .len = 11 };
74 81
82 dprintk("%s:\n", __FUNCTION__);
83
75 div = (params->frequency + (1000-1)) / 1000; 84 div = (params->frequency + (1000-1)) / 1000;
76 85
77 buf[0] = 0x00; // subaddress 86 buf[0] = 0x00; // subaddress
@@ -91,13 +100,12 @@ static int tda826x_set_params(struct dvb_frontend *fe, struct dvb_frontend_param
91 if (fe->ops.i2c_gate_ctrl) 100 if (fe->ops.i2c_gate_ctrl)
92 fe->ops.i2c_gate_ctrl(fe, 1); 101 fe->ops.i2c_gate_ctrl(fe, 1);
93 if ((ret = i2c_transfer (priv->i2c, &msg, 1)) != 1) { 102 if ((ret = i2c_transfer (priv->i2c, &msg, 1)) != 1) {
94 printk("%s: i2c error\n", __FUNCTION__); 103 dprintk("%s: i2c error\n", __FUNCTION__);
95 } 104 }
96 if (fe->ops.i2c_gate_ctrl) 105 if (fe->ops.i2c_gate_ctrl)
97 fe->ops.i2c_gate_ctrl(fe, 0); 106 fe->ops.i2c_gate_ctrl(fe, 0);
98 107
99 priv->frequency = div * 1000; 108 priv->frequency = div * 1000;
100 printk("%s:\n", __FUNCTION__);
101 109
102 return (ret == 1) ? 0 : ret; 110 return (ret == 1) ? 0 : ret;
103} 111}
@@ -128,6 +136,8 @@ struct dvb_frontend *tda826x_attach(struct dvb_frontend *fe, int addr, struct i2
128 struct i2c_msg msg [] = { { .addr = addr, .flags = I2C_M_RD, .buf = b1, .len = 2 } }; 136 struct i2c_msg msg [] = { { .addr = addr, .flags = I2C_M_RD, .buf = b1, .len = 2 } };
129 int ret; 137 int ret;
130 138
139 dprintk("%s:\n", __FUNCTION__);
140
131 if (fe->ops.i2c_gate_ctrl) 141 if (fe->ops.i2c_gate_ctrl)
132 fe->ops.i2c_gate_ctrl(fe, 1); 142 fe->ops.i2c_gate_ctrl(fe, 1);
133 ret = i2c_transfer (i2c, msg, 1); 143 ret = i2c_transfer (i2c, msg, 1);
@@ -150,12 +160,14 @@ struct dvb_frontend *tda826x_attach(struct dvb_frontend *fe, int addr, struct i2
150 memcpy(&fe->ops.tuner_ops, &tda826x_tuner_ops, sizeof(struct dvb_tuner_ops)); 160 memcpy(&fe->ops.tuner_ops, &tda826x_tuner_ops, sizeof(struct dvb_tuner_ops));
151 161
152 fe->tuner_priv = priv; 162 fe->tuner_priv = priv;
153 printk("%s:\n", __FUNCTION__);
154 163
155 return fe; 164 return fe;
156} 165}
157EXPORT_SYMBOL(tda826x_attach); 166EXPORT_SYMBOL(tda826x_attach);
158 167
168module_param(debug, int, 0644);
169MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
170
159MODULE_DESCRIPTION("DVB TDA826x driver"); 171MODULE_DESCRIPTION("DVB TDA826x driver");
160MODULE_AUTHOR("Andrew de Quincey"); 172MODULE_AUTHOR("Andrew de Quincey");
161MODULE_LICENSE("GPL"); 173MODULE_LICENSE("GPL");