Commit 6f998742 authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

V4L/DVB (6446): tda18271: clean up debug macros

Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 4524c1ab
...@@ -28,13 +28,9 @@ static int debug; ...@@ -28,13 +28,9 @@ static int debug;
module_param(debug, int, 0644); module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
#define tuner_dbg(fmt, arg...) do {\ #define dprintk(level, fmt, arg...) do {\
if (debug > 0) \ if (debug >= level) \
printk(KERN_DEBUG fmt, ##arg); } while (0) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__, ##arg); } while (0)
#define tuner_extra_dbg(fmt, arg...) do {\
if (debug > 1) \
printk(KERN_DEBUG fmt, ##arg); } while (0)
#define R_ID 0x00 /* ID byte */ #define R_ID 0x00 /* ID byte */
#define R_TM 0x01 /* Thermo byte */ #define R_TM 0x01 /* Thermo byte */
...@@ -335,23 +331,23 @@ static void tda18271_dump_regs(struct dvb_frontend *fe) ...@@ -335,23 +331,23 @@ static void tda18271_dump_regs(struct dvb_frontend *fe)
struct tda18271_priv *priv = fe->tuner_priv; struct tda18271_priv *priv = fe->tuner_priv;
unsigned char *regs = priv->tda18271_regs; unsigned char *regs = priv->tda18271_regs;
tuner_dbg("=== TDA18271 REG DUMP ===\n"); dprintk(1, "=== TDA18271 REG DUMP ===\n");
tuner_dbg("ID_BYTE = 0x%x\n", 0xff & regs[R_ID]); dprintk(1, "ID_BYTE = 0x%x\n", 0xff & regs[R_ID]);
tuner_dbg("THERMO_BYTE = 0x%x\n", 0xff & regs[R_TM]); dprintk(1, "THERMO_BYTE = 0x%x\n", 0xff & regs[R_TM]);
tuner_dbg("POWER_LEVEL_BYTE = 0x%x\n", 0xff & regs[R_PL]); dprintk(1, "POWER_LEVEL_BYTE = 0x%x\n", 0xff & regs[R_PL]);
tuner_dbg("EASY_PROG_BYTE_1 = 0x%x\n", 0xff & regs[R_EP1]); dprintk(1, "EASY_PROG_BYTE_1 = 0x%x\n", 0xff & regs[R_EP1]);
tuner_dbg("EASY_PROG_BYTE_2 = 0x%x\n", 0xff & regs[R_EP2]); dprintk(1, "EASY_PROG_BYTE_2 = 0x%x\n", 0xff & regs[R_EP2]);
tuner_dbg("EASY_PROG_BYTE_3 = 0x%x\n", 0xff & regs[R_EP3]); dprintk(1, "EASY_PROG_BYTE_3 = 0x%x\n", 0xff & regs[R_EP3]);
tuner_dbg("EASY_PROG_BYTE_4 = 0x%x\n", 0xff & regs[R_EP4]); dprintk(1, "EASY_PROG_BYTE_4 = 0x%x\n", 0xff & regs[R_EP4]);
tuner_dbg("EASY_PROG_BYTE_5 = 0x%x\n", 0xff & regs[R_EP5]); dprintk(1, "EASY_PROG_BYTE_5 = 0x%x\n", 0xff & regs[R_EP5]);
tuner_dbg("CAL_POST_DIV_BYTE = 0x%x\n", 0xff & regs[R_CPD]); dprintk(1, "CAL_POST_DIV_BYTE = 0x%x\n", 0xff & regs[R_CPD]);
tuner_dbg("CAL_DIV_BYTE_1 = 0x%x\n", 0xff & regs[R_CD1]); dprintk(1, "CAL_DIV_BYTE_1 = 0x%x\n", 0xff & regs[R_CD1]);
tuner_dbg("CAL_DIV_BYTE_2 = 0x%x\n", 0xff & regs[R_CD2]); dprintk(1, "CAL_DIV_BYTE_2 = 0x%x\n", 0xff & regs[R_CD2]);
tuner_dbg("CAL_DIV_BYTE_3 = 0x%x\n", 0xff & regs[R_CD3]); dprintk(1, "CAL_DIV_BYTE_3 = 0x%x\n", 0xff & regs[R_CD3]);
tuner_dbg("MAIN_POST_DIV_BYTE = 0x%x\n", 0xff & regs[R_MPD]); dprintk(1, "MAIN_POST_DIV_BYTE = 0x%x\n", 0xff & regs[R_MPD]);
tuner_dbg("MAIN_DIV_BYTE_1 = 0x%x\n", 0xff & regs[R_MD1]); dprintk(1, "MAIN_DIV_BYTE_1 = 0x%x\n", 0xff & regs[R_MD1]);
tuner_dbg("MAIN_DIV_BYTE_2 = 0x%x\n", 0xff & regs[R_MD2]); dprintk(1, "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, "MAIN_DIV_BYTE_3 = 0x%x\n", 0xff & regs[R_MD3]);
} }
static void tda18271_read_regs(struct dvb_frontend *fe) static void tda18271_read_regs(struct dvb_frontend *fe)
...@@ -614,7 +610,7 @@ static int tda18271_tune(struct dvb_frontend *fe, ...@@ -614,7 +610,7 @@ static int tda18271_tune(struct dvb_frontend *fe,
int i; int i;
tuner_dbg("%s: freq = %d, ifc = %d\n", __FUNCTION__, freq, ifc); dprintk(1, "freq = %d, ifc = %d\n", freq, ifc);
tda18271_init_regs(fe); tda18271_init_regs(fe);
/* RF tracking filter calibration */ /* RF tracking filter calibration */
...@@ -626,8 +622,7 @@ static int tda18271_tune(struct dvb_frontend *fe, ...@@ -626,8 +622,7 @@ static int tda18271_tune(struct dvb_frontend *fe,
break; break;
i++; i++;
} }
tuner_extra_dbg("bp filter = 0x%x, i = %d\n", dprintk(2, "bp filter = 0x%x, i = %d\n", tda18271_bp_filter[i].val, i);
tda18271_bp_filter[i].val, i);
regs[R_EP1] &= ~0x07; /* clear bp filter bits */ regs[R_EP1] &= ~0x07; /* clear bp filter bits */
regs[R_EP1] |= tda18271_bp_filter[i].val; regs[R_EP1] |= tda18271_bp_filter[i].val;
...@@ -666,7 +661,7 @@ static int tda18271_tune(struct dvb_frontend *fe, ...@@ -666,7 +661,7 @@ static int tda18271_tune(struct dvb_frontend *fe,
break; break;
i++; i++;
} }
tuner_extra_dbg("cal pll, pd = 0x%x, d = 0x%x, i = %d\n", dprintk(2, "cal pll, pd = 0x%x, d = 0x%x, i = %d\n",
tda18271_cal_pll[i].pd, tda18271_cal_pll[i].d, i); tda18271_cal_pll[i].pd, tda18271_cal_pll[i].d, i);
regs[R_CPD] = tda18271_cal_pll[i].pd; regs[R_CPD] = tda18271_cal_pll[i].pd;
...@@ -693,7 +688,7 @@ static int tda18271_tune(struct dvb_frontend *fe, ...@@ -693,7 +688,7 @@ static int tda18271_tune(struct dvb_frontend *fe,
break; break;
i++; i++;
} }
tuner_extra_dbg("main pll, pd = 0x%x, d = 0x%x, i = %d\n", dprintk(2, "main pll, pd = 0x%x, d = 0x%x, i = %d\n",
tda18271_main_pll[i].pd, tda18271_main_pll[i].d, i); tda18271_main_pll[i].pd, tda18271_main_pll[i].d, i);
regs[R_MPD] = (0x7f & tda18271_main_pll[i].pd); regs[R_MPD] = (0x7f & tda18271_main_pll[i].pd);
...@@ -722,7 +717,7 @@ static int tda18271_tune(struct dvb_frontend *fe, ...@@ -722,7 +717,7 @@ static int tda18271_tune(struct dvb_frontend *fe,
break; break;
i++; 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] &= 0x83;
regs[R_EB13] |= tda18271_km[i].val; regs[R_EB13] |= tda18271_km[i].val;
...@@ -735,8 +730,7 @@ static int tda18271_tune(struct dvb_frontend *fe, ...@@ -735,8 +730,7 @@ static int tda18271_tune(struct dvb_frontend *fe,
break; break;
i++; i++;
} }
tuner_extra_dbg("rf band = 0x%x, i = %d\n", dprintk(2, "rf band = 0x%x, i = %d\n", tda18271_rf_band[i].val, i);
tda18271_rf_band[i].val, i);
regs[R_EP2] &= ~0xe0; /* clear rf band bits */ regs[R_EP2] &= ~0xe0; /* clear rf band bits */
regs[R_EP2] |= (tda18271_rf_band[i].val << 5); regs[R_EP2] |= (tda18271_rf_band[i].val << 5);
...@@ -748,7 +742,7 @@ static int tda18271_tune(struct dvb_frontend *fe, ...@@ -748,7 +742,7 @@ static int tda18271_tune(struct dvb_frontend *fe,
break; break;
i++; i++;
} }
tuner_extra_dbg("gain taper = 0x%x, i = %d\n", dprintk(2, "gain taper = 0x%x, i = %d\n",
tda18271_gain_taper[i].val, i); tda18271_gain_taper[i].val, i);
regs[R_EP2] &= ~0x1f; /* clear gain taper bits */ regs[R_EP2] &= ~0x1f; /* clear gain taper bits */
...@@ -783,7 +777,7 @@ static int tda18271_tune(struct dvb_frontend *fe, ...@@ -783,7 +777,7 @@ static int tda18271_tune(struct dvb_frontend *fe,
break; break;
i++; 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 */ /* VHF_Low band only */
if (tda18271_rf_cal[i].rfmax != 0) { if (tda18271_rf_cal[i].rfmax != 0) {
...@@ -847,7 +841,7 @@ static int tda18271_tune(struct dvb_frontend *fe, ...@@ -847,7 +841,7 @@ static int tda18271_tune(struct dvb_frontend *fe,
break; break;
i++; i++;
} }
tuner_extra_dbg("main pll, pd = 0x%x, d = 0x%x, i = %d\n", dprintk(2, "main pll, pd = 0x%x, d = 0x%x, i = %d\n",
tda18271_main_pll[i].pd, tda18271_main_pll[i].d, i); tda18271_main_pll[i].pd, tda18271_main_pll[i].d, i);
regs[R_MPD] = (0x7f & tda18271_main_pll[i].pd); regs[R_MPD] = (0x7f & tda18271_main_pll[i].pd);
...@@ -979,7 +973,7 @@ static int tda18271_set_analog_params(struct dvb_frontend *fe, ...@@ -979,7 +973,7 @@ static int tda18271_set_analog_params(struct dvb_frontend *fe,
if (params->mode == V4L2_TUNER_RADIO) if (params->mode == V4L2_TUNER_RADIO)
sgIF = 88; /* if frequency is 5.5 MHz */ 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, return tda18271_tune(fe, sgIF * 62500, params->frequency * 62500,
0, std); 0, std);
...@@ -1025,7 +1019,7 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr, ...@@ -1025,7 +1019,7 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr,
{ {
struct tda18271_priv *priv = NULL; struct tda18271_priv *priv = NULL;
tuner_dbg("%s:\n", __FUNCTION__); dprintk(1, "@ 0x%x\n", addr);
priv = kzalloc(sizeof(struct tda18271_priv), GFP_KERNEL); priv = kzalloc(sizeof(struct tda18271_priv), GFP_KERNEL);
if (priv == NULL) if (priv == NULL)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment