summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-10-24 00:00:24 -0400
committerMichael Krufky <mkrufky@linuxtv.org>2007-10-24 00:00:24 -0400
commit3c5bcbaf545783293afcf23dce8c88ead829f6c0 (patch)
tree02e17b1b026bc2c2d78bfcae9887e8e11411f383 /linux/drivers/media/dvb/frontends
parent13158eca8802518b8b4426eb20f86aae1b512461 (diff)
downloadmediapointer-dvb-s2-3c5bcbaf545783293afcf23dce8c88ead829f6c0.tar.gz
mediapointer-dvb-s2-3c5bcbaf545783293afcf23dce8c88ead829f6c0.tar.bz2
tda18271: clean up debug macros
From: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> --- linux/drivers/media/dvb/frontends/tda18271.c | 76 ++++++++++++--------------- 1 file changed, 35 insertions(+), 41 deletions(-)
Diffstat (limited to 'linux/drivers/media/dvb/frontends')
-rw-r--r--linux/drivers/media/dvb/frontends/tda18271.c76
1 files changed, 35 insertions, 41 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda18271.c b/linux/drivers/media/dvb/frontends/tda18271.c
index 83e89a54f..8916db29f 100644
--- a/linux/drivers/media/dvb/frontends/tda18271.c
+++ b/linux/drivers/media/dvb/frontends/tda18271.c
@@ -28,13 +28,9 @@ static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
-#define tuner_dbg(fmt, arg...) do {\
- if (debug > 0) \
- printk(KERN_DEBUG fmt, ##arg); } while (0)
-
-#define tuner_extra_dbg(fmt, arg...) do {\
- if (debug > 1) \
- printk(KERN_DEBUG fmt, ##arg); } while (0)
+#define dprintk(level, fmt, arg...) do {\
+ if (debug >= level) \
+ printk(KERN_DEBUG "%s: " fmt, __FUNCTION__, ##arg); } while (0)
#define R_ID 0x00 /* ID byte */
#define R_TM 0x01 /* Thermo byte */
@@ -335,23 +331,23 @@ static void tda18271_dump_regs(struct dvb_frontend *fe)
struct tda18271_priv *priv = fe->tuner_priv;
unsigned char *regs = priv->tda18271_regs;
- tuner_dbg("=== TDA18271 REG DUMP ===\n");
- tuner_dbg("ID_BYTE = 0x%x\n", 0xff & regs[R_ID]);
- tuner_dbg("THERMO_BYTE = 0x%x\n", 0xff & regs[R_TM]);
- tuner_dbg("POWER_LEVEL_BYTE = 0x%x\n", 0xff & regs[R_PL]);
- tuner_dbg("EASY_PROG_BYTE_1 = 0x%x\n", 0xff & regs[R_EP1]);
- tuner_dbg("EASY_PROG_BYTE_2 = 0x%x\n", 0xff & regs[R_EP2]);
- tuner_dbg("EASY_PROG_BYTE_3 = 0x%x\n", 0xff & regs[R_EP3]);
- tuner_dbg("EASY_PROG_BYTE_4 = 0x%x\n", 0xff & regs[R_EP4]);
- tuner_dbg("EASY_PROG_BYTE_5 = 0x%x\n", 0xff & regs[R_EP5]);
- tuner_dbg("CAL_POST_DIV_BYTE = 0x%x\n", 0xff & regs[R_CPD]);
- tuner_dbg("CAL_DIV_BYTE_1 = 0x%x\n", 0xff & regs[R_CD1]);
- tuner_dbg("CAL_DIV_BYTE_2 = 0x%x\n", 0xff & regs[R_CD2]);
- tuner_dbg("CAL_DIV_BYTE_3 = 0x%x\n", 0xff & regs[R_CD3]);
- tuner_dbg("MAIN_POST_DIV_BYTE = 0x%x\n", 0xff & regs[R_MPD]);
- tuner_dbg("MAIN_DIV_BYTE_1 = 0x%x\n", 0xff & regs[R_MD1]);
- tuner_dbg("MAIN_DIV_BYTE_2 = 0x%x\n", 0xff & regs[R_MD2]);
- tuner_dbg("MAIN_DIV_BYTE_3 = 0x%x\n", 0xff & regs[R_MD3]);
+ dprintk(1, "=== TDA18271 REG DUMP ===\n");
+ dprintk(1, "ID_BYTE = 0x%x\n", 0xff & regs[R_ID]);
+ dprintk(1, "THERMO_BYTE = 0x%x\n", 0xff & regs[R_TM]);
+ dprintk(1, "POWER_LEVEL_BYTE = 0x%x\n", 0xff & regs[R_PL]);
+ dprintk(1, "EASY_PROG_BYTE_1 = 0x%x\n", 0xff & regs[R_EP1]);
+ dprintk(1, "EASY_PROG_BYTE_2 = 0x%x\n", 0xff & regs[R_EP2]);
+ dprintk(1, "EASY_PROG_BYTE_3 = 0x%x\n", 0xff & regs[R_EP3]);
+ dprintk(1, "EASY_PROG_BYTE_4 = 0x%x\n", 0xff & regs[R_EP4]);
+ dprintk(1, "EASY_PROG_BYTE_5 = 0x%x\n", 0xff & regs[R_EP5]);
+ dprintk(1, "CAL_POST_DIV_BYTE = 0x%x\n", 0xff & regs[R_CPD]);
+ dprintk(1, "CAL_DIV_BYTE_1 = 0x%x\n", 0xff & regs[R_CD1]);
+ dprintk(1, "CAL_DIV_BYTE_2 = 0x%x\n", 0xff & regs[R_CD2]);
+ dprintk(1, "CAL_DIV_BYTE_3 = 0x%x\n", 0xff & regs[R_CD3]);
+ dprintk(1, "MAIN_POST_DIV_BYTE = 0x%x\n", 0xff & regs[R_MPD]);
+ dprintk(1, "MAIN_DIV_BYTE_1 = 0x%x\n", 0xff & regs[R_MD1]);
+ dprintk(1, "MAIN_DIV_BYTE_2 = 0x%x\n", 0xff & regs[R_MD2]);
+ dprintk(1, "MAIN_DIV_BYTE_3 = 0x%x\n", 0xff & regs[R_MD3]);
}
static void tda18271_read_regs(struct dvb_frontend *fe)
@@ -619,7 +615,7 @@ static int tda18271_tune(struct dvb_frontend *fe,
freq = freq / 1000;
#endif
- tuner_dbg("%s: freq = %d, ifc = %d\n", __FUNCTION__, freq, ifc);
+ dprintk(1, "freq = %d, ifc = %d\n", freq, ifc);
tda18271_init_regs(fe);
/* RF tracking filter calibration */
@@ -631,8 +627,7 @@ static int tda18271_tune(struct dvb_frontend *fe,
break;
i++;
}
- tuner_extra_dbg("bp filter = 0x%x, i = %d\n",
- tda18271_bp_filter[i].val, i);
+ dprintk(2, "bp filter = 0x%x, i = %d\n", tda18271_bp_filter[i].val, i);
regs[R_EP1] &= ~0x07; /* clear bp filter bits */
regs[R_EP1] |= tda18271_bp_filter[i].val;
@@ -671,8 +666,8 @@ static int tda18271_tune(struct dvb_frontend *fe,
break;
i++;
}
- tuner_extra_dbg("cal pll, pd = 0x%x, d = 0x%x, i = %d\n",
- tda18271_cal_pll[i].pd, tda18271_cal_pll[i].d, i);
+ dprintk(2, "cal pll, pd = 0x%x, d = 0x%x, i = %d\n",
+ tda18271_cal_pll[i].pd, tda18271_cal_pll[i].d, i);
regs[R_CPD] = tda18271_cal_pll[i].pd;
@@ -698,8 +693,8 @@ static int tda18271_tune(struct dvb_frontend *fe,
break;
i++;
}
- tuner_extra_dbg("main pll, pd = 0x%x, d = 0x%x, i = %d\n",
- tda18271_main_pll[i].pd, tda18271_main_pll[i].d, i);
+ dprintk(2, "main pll, pd = 0x%x, d = 0x%x, i = %d\n",
+ tda18271_main_pll[i].pd, tda18271_main_pll[i].d, i);
regs[R_MPD] = (0x7f & tda18271_main_pll[i].pd);
@@ -727,7 +722,7 @@ static int tda18271_tune(struct dvb_frontend *fe,
break;
i++;
}
- tuner_extra_dbg("km = 0x%x, i = %d\n", tda18271_km[i].val, i);
+ dprintk(2, "km = 0x%x, i = %d\n", tda18271_km[i].val, i);
regs[R_EB13] &= 0x83;
regs[R_EB13] |= tda18271_km[i].val;
@@ -740,8 +735,7 @@ static int tda18271_tune(struct dvb_frontend *fe,
break;
i++;
}
- tuner_extra_dbg("rf band = 0x%x, i = %d\n",
- tda18271_rf_band[i].val, i);
+ dprintk(2, "rf band = 0x%x, i = %d\n", tda18271_rf_band[i].val, i);
regs[R_EP2] &= ~0xe0; /* clear rf band bits */
regs[R_EP2] |= (tda18271_rf_band[i].val << 5);
@@ -753,8 +747,8 @@ static int tda18271_tune(struct dvb_frontend *fe,
break;
i++;
}
- tuner_extra_dbg("gain taper = 0x%x, i = %d\n",
- tda18271_gain_taper[i].val, i);
+ dprintk(2, "gain taper = 0x%x, i = %d\n",
+ tda18271_gain_taper[i].val, i);
regs[R_EP2] &= ~0x1f; /* clear gain taper bits */
regs[R_EP2] |= tda18271_gain_taper[i].val;
@@ -788,7 +782,7 @@ static int tda18271_tune(struct dvb_frontend *fe,
break;
i++;
}
- tuner_extra_dbg("rf cal = 0x%x, i = %d\n", tda18271_rf_cal[i].val, i);
+ dprintk(2, "rf cal = 0x%x, i = %d\n", tda18271_rf_cal[i].val, i);
/* VHF_Low band only */
if (tda18271_rf_cal[i].rfmax != 0) {
@@ -852,8 +846,8 @@ static int tda18271_tune(struct dvb_frontend *fe,
break;
i++;
}
- tuner_extra_dbg("main pll, pd = 0x%x, d = 0x%x, i = %d\n",
- tda18271_main_pll[i].pd, tda18271_main_pll[i].d, i);
+ dprintk(2, "main pll, pd = 0x%x, d = 0x%x, i = %d\n",
+ tda18271_main_pll[i].pd, tda18271_main_pll[i].d, i);
regs[R_MPD] = (0x7f & tda18271_main_pll[i].pd);
switch (priv->mode) {
@@ -987,7 +981,7 @@ static int tda18271_set_analog_params(struct dvb_frontend *fe,
if (params->mode == V4L2_TUNER_RADIO)
sgIF = 88; /* if frequency is 5.5 MHz */
- tuner_dbg("setting tda18271 to system %s\n", mode);
+ dprintk(1, "setting tda18271 to system %s\n", mode);
return tda18271_tune(fe, sgIF * 62500, params->frequency * 62500,
0, std);
@@ -1033,7 +1027,7 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
{
struct tda18271_priv *priv = NULL;
- tuner_dbg("%s:\n", __FUNCTION__);
+ dprintk(1, "@ 0x%x\n", addr);
priv = kzalloc(sizeof(struct tda18271_priv), GFP_KERNEL);
if (priv == NULL)
return NULL;