aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2012-07-19 12:10:12 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-09-27 13:30:31 -0400
commit75aeafc9d0e21222b876990946ef534b384462f1 (patch)
treed89b8509af58b0d1400e26a26c0cabeea032382e /drivers/media/dvb-frontends
parentee47e2f9f568a1fbe7261e1bbe2b81211015dc6a (diff)
[media] cxd2820r: switch to Kernel dev_* logging
Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb-frontends')
-rw-r--r--drivers/media/dvb-frontends/cxd2820r_c.c26
-rw-r--r--drivers/media/dvb-frontends/cxd2820r_core.c84
-rw-r--r--drivers/media/dvb-frontends/cxd2820r_priv.h13
-rw-r--r--drivers/media/dvb-frontends/cxd2820r_t.c28
-rw-r--r--drivers/media/dvb-frontends/cxd2820r_t2.c26
5 files changed, 101 insertions, 76 deletions
diff --git a/drivers/media/dvb-frontends/cxd2820r_c.c b/drivers/media/dvb-frontends/cxd2820r_c.c
index ed3b0ba624de..d2a0c285840d 100644
--- a/drivers/media/dvb-frontends/cxd2820r_c.c
+++ b/drivers/media/dvb-frontends/cxd2820r_c.c
@@ -47,7 +47,8 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe)
47 { 0x10070, priv->cfg.ts_mode, 0xff }, 47 { 0x10070, priv->cfg.ts_mode, 0xff },
48 }; 48 };
49 49
50 dbg("%s: RF=%d SR=%d", __func__, c->frequency, c->symbol_rate); 50 dev_dbg(&priv->i2c->dev, "%s: frequency=%d symbol_rate=%d\n", __func__,
51 c->frequency, c->symbol_rate);
51 52
52 /* update GPIOs */ 53 /* update GPIOs */
53 ret = cxd2820r_gpio(fe); 54 ret = cxd2820r_gpio(fe);
@@ -78,7 +79,7 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe)
78 } else 79 } else
79 if_freq = 0; 80 if_freq = 0;
80 81
81 dbg("%s: if_freq=%d", __func__, if_freq); 82 dev_dbg(&priv->i2c->dev, "%s: if_freq=%d\n", __func__, if_freq);
82 83
83 num = if_freq / 1000; /* Hz => kHz */ 84 num = if_freq / 1000; /* Hz => kHz */
84 num *= 0x4000; 85 num *= 0x4000;
@@ -100,7 +101,7 @@ int cxd2820r_set_frontend_c(struct dvb_frontend *fe)
100 101
101 return ret; 102 return ret;
102error: 103error:
103 dbg("%s: failed:%d", __func__, ret); 104 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
104 return ret; 105 return ret;
105} 106}
106 107
@@ -150,7 +151,7 @@ int cxd2820r_get_frontend_c(struct dvb_frontend *fe)
150 151
151 return ret; 152 return ret;
152error: 153error:
153 dbg("%s: failed:%d", __func__, ret); 154 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
154 return ret; 155 return ret;
155} 156}
156 157
@@ -184,7 +185,7 @@ int cxd2820r_read_ber_c(struct dvb_frontend *fe, u32 *ber)
184 185
185 return ret; 186 return ret;
186error: 187error:
187 dbg("%s: failed:%d", __func__, ret); 188 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
188 return ret; 189 return ret;
189} 190}
190 191
@@ -214,7 +215,7 @@ int cxd2820r_read_signal_strength_c(struct dvb_frontend *fe,
214 215
215 return ret; 216 return ret;
216error: 217error:
217 dbg("%s: failed:%d", __func__, ret); 218 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
218 return ret; 219 return ret;
219} 220}
220 221
@@ -251,7 +252,7 @@ int cxd2820r_read_snr_c(struct dvb_frontend *fe, u16 *snr)
251 252
252 return ret; 253 return ret;
253error: 254error:
254 dbg("%s: failed:%d", __func__, ret); 255 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
255 return ret; 256 return ret;
256} 257}
257 258
@@ -283,11 +284,12 @@ int cxd2820r_read_status_c(struct dvb_frontend *fe, fe_status_t *status)
283 } 284 }
284 } 285 }
285 286
286 dbg("%s: lock=%02x %02x", __func__, buf[0], buf[1]); 287 dev_dbg(&priv->i2c->dev, "%s: lock=%02x %02x\n", __func__, buf[0],
288 buf[1]);
287 289
288 return ret; 290 return ret;
289error: 291error:
290 dbg("%s: failed:%d", __func__, ret); 292 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
291 return ret; 293 return ret;
292} 294}
293 295
@@ -302,7 +304,7 @@ int cxd2820r_init_c(struct dvb_frontend *fe)
302 304
303 return ret; 305 return ret;
304error: 306error:
305 dbg("%s: failed:%d", __func__, ret); 307 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
306 return ret; 308 return ret;
307} 309}
308 310
@@ -318,7 +320,7 @@ int cxd2820r_sleep_c(struct dvb_frontend *fe)
318 { 0x00080, 0x00, 0xff }, 320 { 0x00080, 0x00, 0xff },
319 }; 321 };
320 322
321 dbg("%s", __func__); 323 dev_dbg(&priv->i2c->dev, "%s\n", __func__);
322 324
323 priv->delivery_system = SYS_UNDEFINED; 325 priv->delivery_system = SYS_UNDEFINED;
324 326
@@ -331,7 +333,7 @@ int cxd2820r_sleep_c(struct dvb_frontend *fe)
331 333
332 return ret; 334 return ret;
333error: 335error:
334 dbg("%s: failed:%d", __func__, ret); 336 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
335 return ret; 337 return ret;
336} 338}
337 339
diff --git a/drivers/media/dvb-frontends/cxd2820r_core.c b/drivers/media/dvb-frontends/cxd2820r_core.c
index 3bba37d74f57..a3656ba67d77 100644
--- a/drivers/media/dvb-frontends/cxd2820r_core.c
+++ b/drivers/media/dvb-frontends/cxd2820r_core.c
@@ -21,10 +21,6 @@
21 21
22#include "cxd2820r_priv.h" 22#include "cxd2820r_priv.h"
23 23
24int cxd2820r_debug;
25module_param_named(debug, cxd2820r_debug, int, 0644);
26MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");
27
28/* write multiple registers */ 24/* write multiple registers */
29static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg, 25static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg,
30 u8 *val, int len) 26 u8 *val, int len)
@@ -47,7 +43,8 @@ static int cxd2820r_wr_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg,
47 if (ret == 1) { 43 if (ret == 1) {
48 ret = 0; 44 ret = 0;
49 } else { 45 } else {
50 warn("i2c wr failed ret:%d reg:%02x len:%d", ret, reg, len); 46 dev_warn(&priv->i2c->dev, "%s: i2c wr failed=%d reg=%02x " \
47 "len=%d\n", KBUILD_MODNAME, ret, reg, len);
51 ret = -EREMOTEIO; 48 ret = -EREMOTEIO;
52 } 49 }
53 return ret; 50 return ret;
@@ -78,7 +75,8 @@ static int cxd2820r_rd_regs_i2c(struct cxd2820r_priv *priv, u8 i2c, u8 reg,
78 memcpy(val, buf, len); 75 memcpy(val, buf, len);
79 ret = 0; 76 ret = 0;
80 } else { 77 } else {
81 warn("i2c rd failed ret:%d reg:%02x len:%d", ret, reg, len); 78 dev_warn(&priv->i2c->dev, "%s: i2c rd failed=%d reg=%02x " \
79 "len=%d\n", KBUILD_MODNAME, ret, reg, len);
82 ret = -EREMOTEIO; 80 ret = -EREMOTEIO;
83 } 81 }
84 82
@@ -175,7 +173,9 @@ int cxd2820r_gpio(struct dvb_frontend *fe)
175 struct cxd2820r_priv *priv = fe->demodulator_priv; 173 struct cxd2820r_priv *priv = fe->demodulator_priv;
176 int ret, i; 174 int ret, i;
177 u8 *gpio, tmp0, tmp1; 175 u8 *gpio, tmp0, tmp1;
178 dbg("%s: delsys=%d", __func__, fe->dtv_property_cache.delivery_system); 176
177 dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__,
178 fe->dtv_property_cache.delivery_system);
179 179
180 switch (fe->dtv_property_cache.delivery_system) { 180 switch (fe->dtv_property_cache.delivery_system) {
181 case SYS_DVBT: 181 case SYS_DVBT:
@@ -217,10 +217,12 @@ int cxd2820r_gpio(struct dvb_frontend *fe)
217 else 217 else
218 tmp1 |= (0 << (0 + i)); 218 tmp1 |= (0 << (0 + i));
219 219
220 dbg("%s: GPIO i=%d %02x %02x", __func__, i, tmp0, tmp1); 220 dev_dbg(&priv->i2c->dev, "%s: gpio i=%d %02x %02x\n", __func__,
221 i, tmp0, tmp1);
221 } 222 }
222 223
223 dbg("%s: wr gpio=%02x %02x", __func__, tmp0, tmp1); 224 dev_dbg(&priv->i2c->dev, "%s: wr gpio=%02x %02x\n", __func__, tmp0,
225 tmp1);
224 226
225 /* write bits [7:2] */ 227 /* write bits [7:2] */
226 ret = cxd2820r_wr_reg_mask(priv, 0x00089, tmp0, 0xfc); 228 ret = cxd2820r_wr_reg_mask(priv, 0x00089, tmp0, 0xfc);
@@ -236,7 +238,7 @@ int cxd2820r_gpio(struct dvb_frontend *fe)
236 238
237 return ret; 239 return ret;
238error: 240error:
239 dbg("%s: failed:%d", __func__, ret); 241 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
240 return ret; 242 return ret;
241} 243}
242 244
@@ -248,10 +250,13 @@ u32 cxd2820r_div_u64_round_closest(u64 dividend, u32 divisor)
248 250
249static int cxd2820r_set_frontend(struct dvb_frontend *fe) 251static int cxd2820r_set_frontend(struct dvb_frontend *fe)
250{ 252{
253 struct cxd2820r_priv *priv = fe->demodulator_priv;
251 struct dtv_frontend_properties *c = &fe->dtv_property_cache; 254 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
252 int ret; 255 int ret;
253 256
254 dbg("%s: delsys=%d", __func__, fe->dtv_property_cache.delivery_system); 257 dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__,
258 fe->dtv_property_cache.delivery_system);
259
255 switch (c->delivery_system) { 260 switch (c->delivery_system) {
256 case SYS_DVBT: 261 case SYS_DVBT:
257 ret = cxd2820r_init_t(fe); 262 ret = cxd2820r_init_t(fe);
@@ -278,7 +283,8 @@ static int cxd2820r_set_frontend(struct dvb_frontend *fe)
278 goto err; 283 goto err;
279 break; 284 break;
280 default: 285 default:
281 dbg("%s: error state=%d", __func__, fe->dtv_property_cache.delivery_system); 286 dev_dbg(&priv->i2c->dev, "%s: error state=%d\n", __func__,
287 fe->dtv_property_cache.delivery_system);
282 ret = -EINVAL; 288 ret = -EINVAL;
283 break; 289 break;
284 } 290 }
@@ -287,9 +293,12 @@ err:
287} 293}
288static int cxd2820r_read_status(struct dvb_frontend *fe, fe_status_t *status) 294static int cxd2820r_read_status(struct dvb_frontend *fe, fe_status_t *status)
289{ 295{
296 struct cxd2820r_priv *priv = fe->demodulator_priv;
290 int ret; 297 int ret;
291 298
292 dbg("%s: delsys=%d", __func__, fe->dtv_property_cache.delivery_system); 299 dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__,
300 fe->dtv_property_cache.delivery_system);
301
293 switch (fe->dtv_property_cache.delivery_system) { 302 switch (fe->dtv_property_cache.delivery_system) {
294 case SYS_DVBT: 303 case SYS_DVBT:
295 ret = cxd2820r_read_status_t(fe, status); 304 ret = cxd2820r_read_status_t(fe, status);
@@ -312,7 +321,8 @@ static int cxd2820r_get_frontend(struct dvb_frontend *fe)
312 struct cxd2820r_priv *priv = fe->demodulator_priv; 321 struct cxd2820r_priv *priv = fe->demodulator_priv;
313 int ret; 322 int ret;
314 323
315 dbg("%s: delsys=%d", __func__, fe->dtv_property_cache.delivery_system); 324 dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__,
325 fe->dtv_property_cache.delivery_system);
316 326
317 if (priv->delivery_system == SYS_UNDEFINED) 327 if (priv->delivery_system == SYS_UNDEFINED)
318 return 0; 328 return 0;
@@ -336,9 +346,12 @@ static int cxd2820r_get_frontend(struct dvb_frontend *fe)
336 346
337static int cxd2820r_read_ber(struct dvb_frontend *fe, u32 *ber) 347static int cxd2820r_read_ber(struct dvb_frontend *fe, u32 *ber)
338{ 348{
349 struct cxd2820r_priv *priv = fe->demodulator_priv;
339 int ret; 350 int ret;
340 351
341 dbg("%s: delsys=%d", __func__, fe->dtv_property_cache.delivery_system); 352 dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__,
353 fe->dtv_property_cache.delivery_system);
354
342 switch (fe->dtv_property_cache.delivery_system) { 355 switch (fe->dtv_property_cache.delivery_system) {
343 case SYS_DVBT: 356 case SYS_DVBT:
344 ret = cxd2820r_read_ber_t(fe, ber); 357 ret = cxd2820r_read_ber_t(fe, ber);
@@ -358,9 +371,12 @@ static int cxd2820r_read_ber(struct dvb_frontend *fe, u32 *ber)
358 371
359static int cxd2820r_read_signal_strength(struct dvb_frontend *fe, u16 *strength) 372static int cxd2820r_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
360{ 373{
374 struct cxd2820r_priv *priv = fe->demodulator_priv;
361 int ret; 375 int ret;
362 376
363 dbg("%s: delsys=%d", __func__, fe->dtv_property_cache.delivery_system); 377 dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__,
378 fe->dtv_property_cache.delivery_system);
379
364 switch (fe->dtv_property_cache.delivery_system) { 380 switch (fe->dtv_property_cache.delivery_system) {
365 case SYS_DVBT: 381 case SYS_DVBT:
366 ret = cxd2820r_read_signal_strength_t(fe, strength); 382 ret = cxd2820r_read_signal_strength_t(fe, strength);
@@ -380,9 +396,12 @@ static int cxd2820r_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
380 396
381static int cxd2820r_read_snr(struct dvb_frontend *fe, u16 *snr) 397static int cxd2820r_read_snr(struct dvb_frontend *fe, u16 *snr)
382{ 398{
399 struct cxd2820r_priv *priv = fe->demodulator_priv;
383 int ret; 400 int ret;
384 401
385 dbg("%s: delsys=%d", __func__, fe->dtv_property_cache.delivery_system); 402 dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__,
403 fe->dtv_property_cache.delivery_system);
404
386 switch (fe->dtv_property_cache.delivery_system) { 405 switch (fe->dtv_property_cache.delivery_system) {
387 case SYS_DVBT: 406 case SYS_DVBT:
388 ret = cxd2820r_read_snr_t(fe, snr); 407 ret = cxd2820r_read_snr_t(fe, snr);
@@ -402,9 +421,12 @@ static int cxd2820r_read_snr(struct dvb_frontend *fe, u16 *snr)
402 421
403static int cxd2820r_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) 422static int cxd2820r_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
404{ 423{
424 struct cxd2820r_priv *priv = fe->demodulator_priv;
405 int ret; 425 int ret;
406 426
407 dbg("%s: delsys=%d", __func__, fe->dtv_property_cache.delivery_system); 427 dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__,
428 fe->dtv_property_cache.delivery_system);
429
408 switch (fe->dtv_property_cache.delivery_system) { 430 switch (fe->dtv_property_cache.delivery_system) {
409 case SYS_DVBT: 431 case SYS_DVBT:
410 ret = cxd2820r_read_ucblocks_t(fe, ucblocks); 432 ret = cxd2820r_read_ucblocks_t(fe, ucblocks);
@@ -429,9 +451,12 @@ static int cxd2820r_init(struct dvb_frontend *fe)
429 451
430static int cxd2820r_sleep(struct dvb_frontend *fe) 452static int cxd2820r_sleep(struct dvb_frontend *fe)
431{ 453{
454 struct cxd2820r_priv *priv = fe->demodulator_priv;
432 int ret; 455 int ret;
433 456
434 dbg("%s: delsys=%d", __func__, fe->dtv_property_cache.delivery_system); 457 dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__,
458 fe->dtv_property_cache.delivery_system);
459
435 switch (fe->dtv_property_cache.delivery_system) { 460 switch (fe->dtv_property_cache.delivery_system) {
436 case SYS_DVBT: 461 case SYS_DVBT:
437 ret = cxd2820r_sleep_t(fe); 462 ret = cxd2820r_sleep_t(fe);
@@ -452,9 +477,12 @@ static int cxd2820r_sleep(struct dvb_frontend *fe)
452static int cxd2820r_get_tune_settings(struct dvb_frontend *fe, 477static int cxd2820r_get_tune_settings(struct dvb_frontend *fe,
453 struct dvb_frontend_tune_settings *s) 478 struct dvb_frontend_tune_settings *s)
454{ 479{
480 struct cxd2820r_priv *priv = fe->demodulator_priv;
455 int ret; 481 int ret;
456 482
457 dbg("%s: delsys=%d", __func__, fe->dtv_property_cache.delivery_system); 483 dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__,
484 fe->dtv_property_cache.delivery_system);
485
458 switch (fe->dtv_property_cache.delivery_system) { 486 switch (fe->dtv_property_cache.delivery_system) {
459 case SYS_DVBT: 487 case SYS_DVBT:
460 ret = cxd2820r_get_tune_settings_t(fe, s); 488 ret = cxd2820r_get_tune_settings_t(fe, s);
@@ -478,7 +506,9 @@ static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe)
478 struct dtv_frontend_properties *c = &fe->dtv_property_cache; 506 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
479 int ret, i; 507 int ret, i;
480 fe_status_t status = 0; 508 fe_status_t status = 0;
481 dbg("%s: delsys=%d", __func__, fe->dtv_property_cache.delivery_system); 509
510 dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__,
511 fe->dtv_property_cache.delivery_system);
482 512
483 /* switch between DVB-T and DVB-T2 when tune fails */ 513 /* switch between DVB-T and DVB-T2 when tune fails */
484 if (priv->last_tune_failed) { 514 if (priv->last_tune_failed) {
@@ -520,7 +550,7 @@ static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe)
520 550
521 /* wait frontend lock */ 551 /* wait frontend lock */
522 for (; i > 0; i--) { 552 for (; i > 0; i--) {
523 dbg("%s: LOOP=%d", __func__, i); 553 dev_dbg(&priv->i2c->dev, "%s: loop=%d\n", __func__, i);
524 msleep(50); 554 msleep(50);
525 ret = cxd2820r_read_status(fe, &status); 555 ret = cxd2820r_read_status(fe, &status);
526 if (ret) 556 if (ret)
@@ -540,7 +570,7 @@ static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe)
540 } 570 }
541 571
542error: 572error:
543 dbg("%s: failed:%d", __func__, ret); 573 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
544 return DVBFE_ALGO_SEARCH_ERROR; 574 return DVBFE_ALGO_SEARCH_ERROR;
545} 575}
546 576
@@ -552,7 +582,8 @@ static int cxd2820r_get_frontend_algo(struct dvb_frontend *fe)
552static void cxd2820r_release(struct dvb_frontend *fe) 582static void cxd2820r_release(struct dvb_frontend *fe)
553{ 583{
554 struct cxd2820r_priv *priv = fe->demodulator_priv; 584 struct cxd2820r_priv *priv = fe->demodulator_priv;
555 dbg("%s", __func__); 585
586 dev_dbg(&priv->i2c->dev, "%s\n", __func__);
556 587
557 kfree(priv); 588 kfree(priv);
558 return; 589 return;
@@ -561,7 +592,8 @@ static void cxd2820r_release(struct dvb_frontend *fe)
561static int cxd2820r_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) 592static int cxd2820r_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
562{ 593{
563 struct cxd2820r_priv *priv = fe->demodulator_priv; 594 struct cxd2820r_priv *priv = fe->demodulator_priv;
564 dbg("%s: %d", __func__, enable); 595
596 dev_dbg(&priv->i2c->dev, "%s: %d\n", __func__, enable);
565 597
566 /* Bit 0 of reg 0xdb in bank 0x00 controls I2C repeater */ 598 /* Bit 0 of reg 0xdb in bank 0x00 controls I2C repeater */
567 return cxd2820r_wr_reg_mask(priv, 0xdb, enable ? 1 : 0, 0x1); 599 return cxd2820r_wr_reg_mask(priv, 0xdb, enable ? 1 : 0, 0x1);
@@ -628,7 +660,7 @@ struct dvb_frontend *cxd2820r_attach(const struct cxd2820r_config *cfg,
628 660
629 priv->bank[0] = priv->bank[1] = 0xff; 661 priv->bank[0] = priv->bank[1] = 0xff;
630 ret = cxd2820r_rd_reg(priv, 0x000fd, &tmp); 662 ret = cxd2820r_rd_reg(priv, 0x000fd, &tmp);
631 dbg("%s: chip id=%02x", __func__, tmp); 663 dev_dbg(&priv->i2c->dev, "%s: chip id=%02x\n", __func__, tmp);
632 if (ret || tmp != 0xe1) 664 if (ret || tmp != 0xe1)
633 goto error; 665 goto error;
634 666
diff --git a/drivers/media/dvb-frontends/cxd2820r_priv.h b/drivers/media/dvb-frontends/cxd2820r_priv.h
index 9a9822cad9cd..9396492119ca 100644
--- a/drivers/media/dvb-frontends/cxd2820r_priv.h
+++ b/drivers/media/dvb-frontends/cxd2820r_priv.h
@@ -27,19 +27,6 @@
27#include "dvb_math.h" 27#include "dvb_math.h"
28#include "cxd2820r.h" 28#include "cxd2820r.h"
29 29
30#define LOG_PREFIX "cxd2820r"
31
32#undef dbg
33#define dbg(f, arg...) \
34 if (cxd2820r_debug) \
35 printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg)
36#undef err
37#define err(f, arg...) printk(KERN_ERR LOG_PREFIX": " f "\n" , ## arg)
38#undef info
39#define info(f, arg...) printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg)
40#undef warn
41#define warn(f, arg...) printk(KERN_WARNING LOG_PREFIX": " f "\n" , ## arg)
42
43struct reg_val_mask { 30struct reg_val_mask {
44 u32 reg; 31 u32 reg;
45 u8 val; 32 u8 val;
diff --git a/drivers/media/dvb-frontends/cxd2820r_t.c b/drivers/media/dvb-frontends/cxd2820r_t.c
index e5dd22bc16be..af5890e4f837 100644
--- a/drivers/media/dvb-frontends/cxd2820r_t.c
+++ b/drivers/media/dvb-frontends/cxd2820r_t.c
@@ -54,7 +54,8 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe)
54 { 0x00427, 0x41, 0xff }, 54 { 0x00427, 0x41, 0xff },
55 }; 55 };
56 56
57 dbg("%s: RF=%d BW=%d", __func__, c->frequency, c->bandwidth_hz); 57 dev_dbg(&priv->i2c->dev, "%s: frequency=%d bandwidth_hz=%d\n", __func__,
58 c->frequency, c->bandwidth_hz);
58 59
59 switch (c->bandwidth_hz) { 60 switch (c->bandwidth_hz) {
60 case 6000000: 61 case 6000000:
@@ -102,7 +103,7 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe)
102 } else 103 } else
103 if_freq = 0; 104 if_freq = 0;
104 105
105 dbg("%s: if_freq=%d", __func__, if_freq); 106 dev_dbg(&priv->i2c->dev, "%s: if_freq=%d\n", __func__, if_freq);
106 107
107 num = if_freq / 1000; /* Hz => kHz */ 108 num = if_freq / 1000; /* Hz => kHz */
108 num *= 0x1000000; 109 num *= 0x1000000;
@@ -137,7 +138,7 @@ int cxd2820r_set_frontend_t(struct dvb_frontend *fe)
137 138
138 return ret; 139 return ret;
139error: 140error:
140 dbg("%s: failed:%d", __func__, ret); 141 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
141 return ret; 142 return ret;
142} 143}
143 144
@@ -254,7 +255,7 @@ int cxd2820r_get_frontend_t(struct dvb_frontend *fe)
254 255
255 return ret; 256 return ret;
256error: 257error:
257 dbg("%s: failed:%d", __func__, ret); 258 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
258 return ret; 259 return ret;
259} 260}
260 261
@@ -288,7 +289,7 @@ int cxd2820r_read_ber_t(struct dvb_frontend *fe, u32 *ber)
288 289
289 return ret; 290 return ret;
290error: 291error:
291 dbg("%s: failed:%d", __func__, ret); 292 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
292 return ret; 293 return ret;
293} 294}
294 295
@@ -312,7 +313,7 @@ int cxd2820r_read_signal_strength_t(struct dvb_frontend *fe,
312 313
313 return ret; 314 return ret;
314error: 315error:
315 dbg("%s: failed:%d", __func__, ret); 316 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
316 return ret; 317 return ret;
317} 318}
318 319
@@ -336,11 +337,12 @@ int cxd2820r_read_snr_t(struct dvb_frontend *fe, u16 *snr)
336 else 337 else
337 *snr = 0; 338 *snr = 0;
338 339
339 dbg("%s: dBx10=%d val=%04x", __func__, *snr, tmp); 340 dev_dbg(&priv->i2c->dev, "%s: dBx10=%d val=%04x\n", __func__, *snr,
341 tmp);
340 342
341 return ret; 343 return ret;
342error: 344error:
343 dbg("%s: failed:%d", __func__, ret); 345 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
344 return ret; 346 return ret;
345} 347}
346 348
@@ -389,11 +391,11 @@ int cxd2820r_read_status_t(struct dvb_frontend *fe, fe_status_t *status)
389 } 391 }
390 } 392 }
391 393
392 dbg("%s: lock=%*ph", __func__, 4, buf); 394 dev_dbg(&priv->i2c->dev, "%s: lock=%*ph\n", __func__, 4, buf);
393 395
394 return ret; 396 return ret;
395error: 397error:
396 dbg("%s: failed:%d", __func__, ret); 398 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
397 return ret; 399 return ret;
398} 400}
399 401
@@ -408,7 +410,7 @@ int cxd2820r_init_t(struct dvb_frontend *fe)
408 410
409 return ret; 411 return ret;
410error: 412error:
411 dbg("%s: failed:%d", __func__, ret); 413 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
412 return ret; 414 return ret;
413} 415}
414 416
@@ -424,7 +426,7 @@ int cxd2820r_sleep_t(struct dvb_frontend *fe)
424 { 0x00080, 0x00, 0xff }, 426 { 0x00080, 0x00, 0xff },
425 }; 427 };
426 428
427 dbg("%s", __func__); 429 dev_dbg(&priv->i2c->dev, "%s\n", __func__);
428 430
429 priv->delivery_system = SYS_UNDEFINED; 431 priv->delivery_system = SYS_UNDEFINED;
430 432
@@ -437,7 +439,7 @@ int cxd2820r_sleep_t(struct dvb_frontend *fe)
437 439
438 return ret; 440 return ret;
439error: 441error:
440 dbg("%s: failed:%d", __func__, ret); 442 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
441 return ret; 443 return ret;
442} 444}
443 445
diff --git a/drivers/media/dvb-frontends/cxd2820r_t2.c b/drivers/media/dvb-frontends/cxd2820r_t2.c
index 3a5759e0d235..653c56eb065b 100644
--- a/drivers/media/dvb-frontends/cxd2820r_t2.c
+++ b/drivers/media/dvb-frontends/cxd2820r_t2.c
@@ -68,7 +68,8 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe)
68 { 0x027ef, 0x10, 0x18 }, 68 { 0x027ef, 0x10, 0x18 },
69 }; 69 };
70 70
71 dbg("%s: RF=%d BW=%d", __func__, c->frequency, c->bandwidth_hz); 71 dev_dbg(&priv->i2c->dev, "%s: frequency=%d bandwidth_hz=%d\n", __func__,
72 c->frequency, c->bandwidth_hz);
72 73
73 switch (c->bandwidth_hz) { 74 switch (c->bandwidth_hz) {
74 case 5000000: 75 case 5000000:
@@ -119,7 +120,7 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe)
119 } else 120 } else
120 if_freq = 0; 121 if_freq = 0;
121 122
122 dbg("%s: if_freq=%d", __func__, if_freq); 123 dev_dbg(&priv->i2c->dev, "%s: if_freq=%d\n", __func__, if_freq);
123 124
124 num = if_freq / 1000; /* Hz => kHz */ 125 num = if_freq / 1000; /* Hz => kHz */
125 num *= 0x1000000; 126 num *= 0x1000000;
@@ -150,7 +151,7 @@ int cxd2820r_set_frontend_t2(struct dvb_frontend *fe)
150 151
151 return ret; 152 return ret;
152error: 153error:
153 dbg("%s: failed:%d", __func__, ret); 154 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
154 return ret; 155 return ret;
155 156
156} 157}
@@ -266,7 +267,7 @@ int cxd2820r_get_frontend_t2(struct dvb_frontend *fe)
266 267
267 return ret; 268 return ret;
268error: 269error:
269 dbg("%s: failed:%d", __func__, ret); 270 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
270 return ret; 271 return ret;
271} 272}
272 273
@@ -291,11 +292,11 @@ int cxd2820r_read_status_t2(struct dvb_frontend *fe, fe_status_t *status)
291 } 292 }
292 } 293 }
293 294
294 dbg("%s: lock=%02x", __func__, buf[0]); 295 dev_dbg(&priv->i2c->dev, "%s: lock=%02x\n", __func__, buf[0]);
295 296
296 return ret; 297 return ret;
297error: 298error:
298 dbg("%s: failed:%d", __func__, ret); 299 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
299 return ret; 300 return ret;
300} 301}
301 302
@@ -322,7 +323,7 @@ int cxd2820r_read_ber_t2(struct dvb_frontend *fe, u32 *ber)
322 323
323 return ret; 324 return ret;
324error: 325error:
325 dbg("%s: failed:%d", __func__, ret); 326 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
326 return ret; 327 return ret;
327} 328}
328 329
@@ -346,7 +347,7 @@ int cxd2820r_read_signal_strength_t2(struct dvb_frontend *fe,
346 347
347 return ret; 348 return ret;
348error: 349error:
349 dbg("%s: failed:%d", __func__, ret); 350 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
350 return ret; 351 return ret;
351} 352}
352 353
@@ -370,11 +371,12 @@ int cxd2820r_read_snr_t2(struct dvb_frontend *fe, u16 *snr)
370 else 371 else
371 *snr = 0; 372 *snr = 0;
372 373
373 dbg("%s: dBx10=%d val=%04x", __func__, *snr, tmp); 374 dev_dbg(&priv->i2c->dev, "%s: dBx10=%d val=%04x\n", __func__, *snr,
375 tmp);
374 376
375 return ret; 377 return ret;
376error: 378error:
377 dbg("%s: failed:%d", __func__, ret); 379 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
378 return ret; 380 return ret;
379} 381}
380 382
@@ -398,7 +400,7 @@ int cxd2820r_sleep_t2(struct dvb_frontend *fe)
398 { 0x00080, 0x00, 0xff }, 400 { 0x00080, 0x00, 0xff },
399 }; 401 };
400 402
401 dbg("%s", __func__); 403 dev_dbg(&priv->i2c->dev, "%s\n", __func__);
402 404
403 for (i = 0; i < ARRAY_SIZE(tab); i++) { 405 for (i = 0; i < ARRAY_SIZE(tab); i++) {
404 ret = cxd2820r_wr_reg_mask(priv, tab[i].reg, tab[i].val, 406 ret = cxd2820r_wr_reg_mask(priv, tab[i].reg, tab[i].val,
@@ -411,7 +413,7 @@ int cxd2820r_sleep_t2(struct dvb_frontend *fe)
411 413
412 return ret; 414 return ret;
413error: 415error:
414 dbg("%s: failed:%d", __func__, ret); 416 dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
415 return ret; 417 return ret;
416} 418}
417 419