aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorReinhard Nissl <rnissl@gmx.de>2008-07-09 14:33:38 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 14:53:24 -0500
commitc615a27a533b6f6de6143d4d58cfa0abfdb6970d (patch)
treefcdeb675a50fa62ff36b66dbabeada0a64972eac /drivers/media/dvb
parentaa912921d888c72470d32616dc9d65cdbe477906 (diff)
V4L/DVB (9467): Fix runtime verbosity
Signed-off-by: Reinhard Nissl <rnissl@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/frontends/stb0899_drv.c132
-rw-r--r--drivers/media/dvb/frontends/stb0899_priv.h12
2 files changed, 72 insertions, 72 deletions
diff --git a/drivers/media/dvb/frontends/stb0899_drv.c b/drivers/media/dvb/frontends/stb0899_drv.c
index bdbb60c9e4ed..cf787f5fc00c 100644
--- a/drivers/media/dvb/frontends/stb0899_drv.c
+++ b/drivers/media/dvb/frontends/stb0899_drv.c
@@ -31,7 +31,7 @@
31#include "stb0899_priv.h" 31#include "stb0899_priv.h"
32#include "stb0899_reg.h" 32#include "stb0899_reg.h"
33 33
34static unsigned int verbose = 1; 34static unsigned int verbose = 0;//1;
35module_param(verbose, int, 0644); 35module_param(verbose, int, 0644);
36 36
37/* C/N in dB/10, NIRM/NIRL */ 37/* C/N in dB/10, NIRM/NIRL */
@@ -241,14 +241,14 @@ int _stb0899_read_reg(struct stb0899_state *state, unsigned int reg)
241 ret = i2c_transfer(state->i2c, msg, 2); 241 ret = i2c_transfer(state->i2c, msg, 2);
242 if (ret != 2) { 242 if (ret != 2) {
243 if (ret != -ERESTARTSYS) 243 if (ret != -ERESTARTSYS)
244 dprintk(verbose, FE_ERROR, 1, 244 dprintk(state->verbose, FE_ERROR, 1,
245 "Read error, Reg=[0x%02x], Status=%d", 245 "Read error, Reg=[0x%02x], Status=%d",
246 reg, ret); 246 reg, ret);
247 247
248 return ret < 0 ? ret : -EREMOTEIO; 248 return ret < 0 ? ret : -EREMOTEIO;
249 } 249 }
250 if (unlikely(verbose >= FE_DEBUGREG)) 250 if (unlikely(*state->verbose >= FE_DEBUGREG))
251 dprintk(verbose, FE_ERROR, 1, "Reg=[0x%02x], data=%02x", 251 dprintk(state->verbose, FE_ERROR, 1, "Reg=[0x%02x], data=%02x",
252 reg, buf); 252 reg, buf);
253 253
254 return (unsigned int)buf; 254 return (unsigned int)buf;
@@ -361,7 +361,7 @@ u32 _stb0899_read_s2reg(struct stb0899_state *state,
361 } 361 }
362 362
363 data = MAKEWORD32(buf[3], buf[2], buf[1], buf[0]); 363 data = MAKEWORD32(buf[3], buf[2], buf[1], buf[0]);
364 if (unlikely(state->verbose >= FE_DEBUGREG)) 364 if (unlikely(*state->verbose >= FE_DEBUGREG))
365 printk(KERN_DEBUG "%s Device=[0x%04x], Base address=[0x%08x], Offset=[0x%04x], Data=[0x%08x]\n", 365 printk(KERN_DEBUG "%s Device=[0x%04x], Base address=[0x%08x], Offset=[0x%04x], Data=[0x%08x]\n",
366 __func__, stb0899_i2cdev, stb0899_base_addr, stb0899_reg_offset, data); 366 __func__, stb0899_i2cdev, stb0899_base_addr, stb0899_reg_offset, data);
367 367
@@ -418,7 +418,7 @@ int stb0899_write_s2reg(struct stb0899_state *state,
418 buf_1[4] = GETBYTE(stb0899_data, BYTE2); 418 buf_1[4] = GETBYTE(stb0899_data, BYTE2);
419 buf_1[5] = GETBYTE(stb0899_data, BYTE3); 419 buf_1[5] = GETBYTE(stb0899_data, BYTE3);
420 420
421 if (unlikely(state->verbose >= FE_DEBUGREG)) 421 if (unlikely(*state->verbose >= FE_DEBUGREG))
422 printk(KERN_DEBUG "%s Device=[0x%04x], Base Address=[0x%08x], Offset=[0x%04x], Data=[0x%08x]\n", 422 printk(KERN_DEBUG "%s Device=[0x%04x], Base Address=[0x%08x], Offset=[0x%04x], Data=[0x%08x]\n",
423 __func__, stb0899_i2cdev, stb0899_base_addr, stb0899_reg_offset, stb0899_data); 423 __func__, stb0899_i2cdev, stb0899_base_addr, stb0899_reg_offset, stb0899_data);
424 424
@@ -480,7 +480,7 @@ int stb0899_read_regs(struct stb0899_state *state, unsigned int reg, u8 *buf, u3
480 (((reg & 0xff00) == 0xf200) || ((reg & 0xff00) == 0xf600))) 480 (((reg & 0xff00) == 0xf200) || ((reg & 0xff00) == 0xf600)))
481 _stb0899_read_reg(state, (reg | 0x00ff)); 481 _stb0899_read_reg(state, (reg | 0x00ff));
482 482
483 if (unlikely(state->verbose >= FE_DEBUGREG)) { 483 if (unlikely(*state->verbose >= FE_DEBUGREG)) {
484 int i; 484 int i;
485 485
486 printk(KERN_DEBUG "%s [0x%04x]:", __func__, reg); 486 printk(KERN_DEBUG "%s [0x%04x]:", __func__, reg);
@@ -510,7 +510,7 @@ int stb0899_write_regs(struct stb0899_state *state, unsigned int reg, u8 *data,
510 buf[1] = reg & 0xff; 510 buf[1] = reg & 0xff;
511 memcpy(&buf[2], data, count); 511 memcpy(&buf[2], data, count);
512 512
513 if (unlikely(state->verbose >= FE_DEBUGREG)) { 513 if (unlikely(*state->verbose >= FE_DEBUGREG)) {
514 int i; 514 int i;
515 515
516 printk(KERN_DEBUG "%s [0x%04x]:", __func__, reg); 516 printk(KERN_DEBUG "%s [0x%04x]:", __func__, reg);
@@ -530,7 +530,7 @@ int stb0899_write_regs(struct stb0899_state *state, unsigned int reg, u8 *data,
530 530
531 if (ret != 1) { 531 if (ret != 1) {
532 if (ret != -ERESTARTSYS) 532 if (ret != -ERESTARTSYS)
533 dprintk(verbose, FE_ERROR, 1, "Reg=[0x%04x], Data=[0x%02x ...], Count=%u, Status=%d", 533 dprintk(state->verbose, FE_ERROR, 1, "Reg=[0x%04x], Data=[0x%02x ...], Count=%u, Status=%d",
534 reg, data[0], count, ret); 534 reg, data[0], count, ret);
535 return ret < 0 ? ret : -EREMOTEIO; 535 return ret < 0 ? ret : -EREMOTEIO;
536 } 536 }
@@ -554,7 +554,7 @@ static u32 stb0899_get_mclk(struct stb0899_state *state)
554 554
555 div = stb0899_read_reg(state, STB0899_NCOARSE); 555 div = stb0899_read_reg(state, STB0899_NCOARSE);
556 mclk = (div + 1) * state->config->xtal_freq / 6; 556 mclk = (div + 1) * state->config->xtal_freq / 6;
557 dprintk(verbose, FE_DEBUG, 1, "div=%d, mclk=%d", div, mclk); 557 dprintk(state->verbose, FE_DEBUG, 1, "div=%d, mclk=%d", div, mclk);
558 558
559 return mclk; 559 return mclk;
560} 560}
@@ -570,14 +570,14 @@ static void stb0899_set_mclk(struct stb0899_state *state, u32 Mclk)
570 struct stb0899_internal *internal = &state->internal; 570 struct stb0899_internal *internal = &state->internal;
571 u8 mdiv = 0; 571 u8 mdiv = 0;
572 572
573 dprintk(verbose, FE_DEBUG, 1, "state->config=%p", state->config); 573 dprintk(state->verbose, FE_DEBUG, 1, "state->config=%p", state->config);
574 mdiv = ((6 * Mclk) / state->config->xtal_freq) - 1; 574 mdiv = ((6 * Mclk) / state->config->xtal_freq) - 1;
575 dprintk(verbose, FE_DEBUG, 1, "mdiv=%d", mdiv); 575 dprintk(state->verbose, FE_DEBUG, 1, "mdiv=%d", mdiv);
576 576
577 stb0899_write_reg(state, STB0899_NCOARSE, mdiv); 577 stb0899_write_reg(state, STB0899_NCOARSE, mdiv);
578 internal->master_clk = stb0899_get_mclk(state); 578 internal->master_clk = stb0899_get_mclk(state);
579 579
580 dprintk(verbose, FE_DEBUG, 1, "MasterCLOCK=%d", internal->master_clk); 580 dprintk(state->verbose, FE_DEBUG, 1, "MasterCLOCK=%d", internal->master_clk);
581} 581}
582 582
583static int stb0899_postproc(struct stb0899_state *state, u8 ctl, int enable) 583static int stb0899_postproc(struct stb0899_state *state, u8 ctl, int enable)
@@ -606,7 +606,7 @@ static void stb0899_release(struct dvb_frontend *fe)
606{ 606{
607 struct stb0899_state *state = fe->demodulator_priv; 607 struct stb0899_state *state = fe->demodulator_priv;
608 608
609 dprintk(verbose, FE_DEBUG, 1, "Release Frontend"); 609 dprintk(state->verbose, FE_DEBUG, 1, "Release Frontend");
610 /* post process event */ 610 /* post process event */
611 stb0899_postproc(state, STB0899_POSTPROC_GPIO_POWER, 0); 611 stb0899_postproc(state, STB0899_POSTPROC_GPIO_POWER, 0);
612 kfree(state); 612 kfree(state);
@@ -683,7 +683,7 @@ static int stb0899_wait_diseqc_fifo_empty(struct stb0899_state *state, int timeo
683 if (!STB0899_GETFIELD(FIFOFULL, reg)) 683 if (!STB0899_GETFIELD(FIFOFULL, reg))
684 break; 684 break;
685 if ((jiffies - start) > timeout) { 685 if ((jiffies - start) > timeout) {
686 dprintk(verbose, FE_ERROR, 1, "timed out !!"); 686 dprintk(state->verbose, FE_ERROR, 1, "timed out !!");
687 return -ETIMEDOUT; 687 return -ETIMEDOUT;
688 } 688 }
689 } 689 }
@@ -725,7 +725,7 @@ static int stb0899_wait_diseqc_rxidle(struct stb0899_state *state, int timeout)
725 while (!STB0899_GETFIELD(RXEND, reg)) { 725 while (!STB0899_GETFIELD(RXEND, reg)) {
726 reg = stb0899_read_reg(state, STB0899_DISRX_ST0); 726 reg = stb0899_read_reg(state, STB0899_DISRX_ST0);
727 if (jiffies - start > timeout) { 727 if (jiffies - start > timeout) {
728 dprintk(verbose, FE_ERROR, 1, "timed out!!"); 728 dprintk(state->verbose, FE_ERROR, 1, "timed out!!");
729 return -ETIMEDOUT; 729 return -ETIMEDOUT;
730 } 730 }
731 msleep(10); 731 msleep(10);
@@ -774,7 +774,7 @@ static int stb0899_wait_diseqc_txidle(struct stb0899_state *state, int timeout)
774 while (!STB0899_GETFIELD(TXIDLE, reg)) { 774 while (!STB0899_GETFIELD(TXIDLE, reg)) {
775 reg = stb0899_read_reg(state, STB0899_DISSTATUS); 775 reg = stb0899_read_reg(state, STB0899_DISSTATUS);
776 if (jiffies - start > timeout) { 776 if (jiffies - start > timeout) {
777 dprintk(verbose, FE_ERROR, 1, "timed out!!"); 777 dprintk(state->verbose, FE_ERROR, 1, "timed out!!");
778 return -ETIMEDOUT; 778 return -ETIMEDOUT;
779 } 779 }
780 msleep(10); 780 msleep(10);
@@ -862,7 +862,7 @@ static int stb0899_sleep(struct dvb_frontend *fe)
862 struct stb0899_state *state = fe->demodulator_priv; 862 struct stb0899_state *state = fe->demodulator_priv;
863 u8 reg; 863 u8 reg;
864 864
865 dprintk(verbose, FE_DEBUG, 1, "Going to Sleep .. (Really tired .. :-))"); 865 dprintk(state->verbose, FE_DEBUG, 1, "Going to Sleep .. (Really tired .. :-))");
866 /* post process event */ 866 /* post process event */
867 stb0899_postproc(state, STB0899_POSTPROC_GPIO_POWER, 0); 867 stb0899_postproc(state, STB0899_POSTPROC_GPIO_POWER, 0);
868 868
@@ -894,15 +894,15 @@ static int stb0899_init(struct dvb_frontend *fe)
894 struct stb0899_state *state = fe->demodulator_priv; 894 struct stb0899_state *state = fe->demodulator_priv;
895 struct stb0899_config *config = state->config; 895 struct stb0899_config *config = state->config;
896 896
897 dprintk(verbose, FE_DEBUG, 1, "Initializing STB0899 ... "); 897 dprintk(state->verbose, FE_DEBUG, 1, "Initializing STB0899 ... ");
898// mutex_init(&state->search_lock); 898// mutex_init(&state->search_lock);
899 899
900 /* init device */ 900 /* init device */
901 dprintk(verbose, FE_DEBUG, 1, "init device"); 901 dprintk(state->verbose, FE_DEBUG, 1, "init device");
902 for (i = 0; config->init_dev[i].address != 0xffff; i++) 902 for (i = 0; config->init_dev[i].address != 0xffff; i++)
903 stb0899_write_reg(state, config->init_dev[i].address, config->init_dev[i].data); 903 stb0899_write_reg(state, config->init_dev[i].address, config->init_dev[i].data);
904 904
905 dprintk(verbose, FE_DEBUG, 1, "init S2 demod"); 905 dprintk(state->verbose, FE_DEBUG, 1, "init S2 demod");
906 /* init S2 demod */ 906 /* init S2 demod */
907 for (i = 0; config->init_s2_demod[i].offset != 0xffff; i++) 907 for (i = 0; config->init_s2_demod[i].offset != 0xffff; i++)
908 stb0899_write_s2reg(state, STB0899_S2DEMOD, 908 stb0899_write_s2reg(state, STB0899_S2DEMOD,
@@ -910,12 +910,12 @@ static int stb0899_init(struct dvb_frontend *fe)
910 config->init_s2_demod[i].offset, 910 config->init_s2_demod[i].offset,
911 config->init_s2_demod[i].data); 911 config->init_s2_demod[i].data);
912 912
913 dprintk(verbose, FE_DEBUG, 1, "init S1 demod"); 913 dprintk(state->verbose, FE_DEBUG, 1, "init S1 demod");
914 /* init S1 demod */ 914 /* init S1 demod */
915 for (i = 0; config->init_s1_demod[i].address != 0xffff; i++) 915 for (i = 0; config->init_s1_demod[i].address != 0xffff; i++)
916 stb0899_write_reg(state, config->init_s1_demod[i].address, config->init_s1_demod[i].data); 916 stb0899_write_reg(state, config->init_s1_demod[i].address, config->init_s1_demod[i].data);
917 917
918 dprintk(verbose, FE_DEBUG, 1, "init S2 FEC"); 918 dprintk(state->verbose, FE_DEBUG, 1, "init S2 FEC");
919 /* init S2 fec */ 919 /* init S2 fec */
920 for (i = 0; config->init_s2_fec[i].offset != 0xffff; i++) 920 for (i = 0; config->init_s2_fec[i].offset != 0xffff; i++)
921 stb0899_write_s2reg(state, STB0899_S2FEC, 921 stb0899_write_s2reg(state, STB0899_S2FEC,
@@ -923,7 +923,7 @@ static int stb0899_init(struct dvb_frontend *fe)
923 config->init_s2_fec[i].offset, 923 config->init_s2_fec[i].offset,
924 config->init_s2_fec[i].data); 924 config->init_s2_fec[i].data);
925 925
926 dprintk(verbose, FE_DEBUG, 1, "init TST"); 926 dprintk(state->verbose, FE_DEBUG, 1, "init TST");
927 /* init test */ 927 /* init test */
928 for (i = 0; config->init_tst[i].address != 0xffff; i++) 928 for (i = 0; config->init_tst[i].address != 0xffff; i++)
929 stb0899_write_reg(state, config->init_tst[i].address, config->init_tst[i].data); 929 stb0899_write_reg(state, config->init_tst[i].address, config->init_tst[i].data);
@@ -979,7 +979,7 @@ static int stb0899_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
979 979
980 *strength = stb0899_table_lookup(stb0899_dvbsrf_tab, ARRAY_SIZE(stb0899_dvbsrf_tab) - 1, val); 980 *strength = stb0899_table_lookup(stb0899_dvbsrf_tab, ARRAY_SIZE(stb0899_dvbsrf_tab) - 1, val);
981 *strength += 750; 981 *strength += 750;
982 dprintk(verbose, FE_DEBUG, 1, "AGCIQVALUE = 0x%02x, C = %d * 0.1 dBm", 982 dprintk(state->verbose, FE_DEBUG, 1, "AGCIQVALUE = 0x%02x, C = %d * 0.1 dBm",
983 val & 0xff, *strength); 983 val & 0xff, *strength);
984 } 984 }
985 } 985 }
@@ -991,12 +991,12 @@ static int stb0899_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
991 991
992 *strength = stb0899_table_lookup(stb0899_dvbs2rf_tab, ARRAY_SIZE(stb0899_dvbs2rf_tab) - 1, val); 992 *strength = stb0899_table_lookup(stb0899_dvbs2rf_tab, ARRAY_SIZE(stb0899_dvbs2rf_tab) - 1, val);
993 *strength += 750; 993 *strength += 750;
994 dprintk(verbose, FE_DEBUG, 1, "IF_AGC_GAIN = 0x%04x, C = %d * 0.1 dBm", 994 dprintk(state->verbose, FE_DEBUG, 1, "IF_AGC_GAIN = 0x%04x, C = %d * 0.1 dBm",
995 val & 0x3fff, *strength); 995 val & 0x3fff, *strength);
996 } 996 }
997 break; 997 break;
998 default: 998 default:
999 dprintk(verbose, FE_DEBUG, 1, "Unsupported delivery system"); 999 dprintk(state->verbose, FE_DEBUG, 1, "Unsupported delivery system");
1000 return -EINVAL; 1000 return -EINVAL;
1001 } 1001 }
1002 1002
@@ -1023,7 +1023,7 @@ static int stb0899_read_snr(struct dvb_frontend *fe, u16 *snr)
1023 val = MAKEWORD16(buf[0], buf[1]); 1023 val = MAKEWORD16(buf[0], buf[1]);
1024 1024
1025 *snr = stb0899_table_lookup(stb0899_cn_tab, ARRAY_SIZE(stb0899_cn_tab) - 1, val); 1025 *snr = stb0899_table_lookup(stb0899_cn_tab, ARRAY_SIZE(stb0899_cn_tab) - 1, val);
1026 dprintk(verbose, FE_DEBUG, 1, "NIR = 0x%02x%02x = %u, C/N = %d * 0.1 dBm\n", 1026 dprintk(state->verbose, FE_DEBUG, 1, "NIR = 0x%02x%02x = %u, C/N = %d * 0.1 dBm\n",
1027 buf[0], buf[1], val, *snr); 1027 buf[0], buf[1], val, *snr);
1028 } 1028 }
1029 } 1029 }
@@ -1047,12 +1047,12 @@ static int stb0899_read_snr(struct dvb_frontend *fe, u16 *snr)
1047 val = (quantn - estn) / 10; 1047 val = (quantn - estn) / 10;
1048 } 1048 }
1049 *snr = val; 1049 *snr = val;
1050 dprintk(verbose, FE_DEBUG, 1, "Es/N0 quant = %d (%d) estimate = %u (%d), C/N = %d * 0.1 dBm", 1050 dprintk(state->verbose, FE_DEBUG, 1, "Es/N0 quant = %d (%d) estimate = %u (%d), C/N = %d * 0.1 dBm",
1051 quant, quantn, est, estn, val); 1051 quant, quantn, est, estn, val);
1052 } 1052 }
1053 break; 1053 break;
1054 default: 1054 default:
1055 dprintk(verbose, FE_DEBUG, 1, "Unsupported delivery system"); 1055 dprintk(state->verbose, FE_DEBUG, 1, "Unsupported delivery system");
1056 return -EINVAL; 1056 return -EINVAL;
1057 } 1057 }
1058 1058
@@ -1118,7 +1118,7 @@ static int stb0899_read_status(struct dvb_frontend *fe, enum fe_status *status)
1118 } 1118 }
1119 break; 1119 break;
1120 default: 1120 default:
1121 dprintk(verbose, FE_DEBUG, 1, "Unsupported delivery system"); 1121 dprintk(state->verbose, FE_DEBUG, 1, "Unsupported delivery system");
1122 return -EINVAL; 1122 return -EINVAL;
1123 } 1123 }
1124 return 0; 1124 return 0;
@@ -1177,7 +1177,7 @@ static int stb0899_read_ber(struct dvb_frontend *fe, u32 *ber)
1177 } 1177 }
1178 break; 1178 break;
1179 default: 1179 default:
1180 dprintk(verbose, FE_DEBUG, 1, "Unsupported delivery system"); 1180 dprintk(state->verbose, FE_DEBUG, 1, "Unsupported delivery system");
1181 return -EINVAL; 1181 return -EINVAL;
1182 } 1182 }
1183 1183
@@ -1369,26 +1369,26 @@ static int stb0899_get_info(struct dvb_frontend *fe, struct dvbfe_info *fe_info)
1369{ 1369{
1370 struct stb0899_state *state = fe->demodulator_priv; 1370 struct stb0899_state *state = fe->demodulator_priv;
1371 1371
1372 dprintk(verbose, FE_DEBUG, 1, "Get Info"); 1372 dprintk(state->verbose, FE_DEBUG, 1, "Get Info");
1373 1373
1374 switch (state->delsys) { 1374 switch (state->delsys) {
1375 case DVBFE_DELSYS_DVBS: 1375 case DVBFE_DELSYS_DVBS:
1376 dprintk(verbose, FE_ERROR, 1, "Querying DVB-S info"); 1376 dprintk(state->verbose, FE_ERROR, 1, "Querying DVB-S info");
1377 memcpy(fe_info, &dvbs_info, sizeof (struct dvbfe_info)); 1377 memcpy(fe_info, &dvbs_info, sizeof (struct dvbfe_info));
1378 break; 1378 break;
1379 case DVBFE_DELSYS_DSS: 1379 case DVBFE_DELSYS_DSS:
1380 dprintk(verbose, FE_ERROR, 1, "Querying DSS info"); 1380 dprintk(state->verbose, FE_ERROR, 1, "Querying DSS info");
1381 memcpy(fe_info, &dss_info, sizeof (struct dvbfe_info)); 1381 memcpy(fe_info, &dss_info, sizeof (struct dvbfe_info));
1382 break; 1382 break;
1383 case DVBFE_DELSYS_DVBS2: 1383 case DVBFE_DELSYS_DVBS2:
1384 dprintk(verbose, FE_ERROR, 1, "Querying DVB-S2 info"); 1384 dprintk(state->verbose, FE_ERROR, 1, "Querying DVB-S2 info");
1385 memcpy(fe_info, &dvbs2_info, sizeof (struct dvbfe_info)); 1385 memcpy(fe_info, &dvbs2_info, sizeof (struct dvbfe_info));
1386 break; 1386 break;
1387 default: 1387 default:
1388 dprintk(verbose, FE_ERROR, 1, "Unsupported delivery system"); 1388 dprintk(state->verbose, FE_ERROR, 1, "Unsupported delivery system");
1389 return -EINVAL; 1389 return -EINVAL;
1390 } 1390 }
1391 dprintk(verbose, FE_DEBUG, 1, "delivery system=%d", state->delsys); 1391 dprintk(state->verbose, FE_DEBUG, 1, "delivery system=%d", state->delsys);
1392 1392
1393 return 0; 1393 return 0;
1394} 1394}
@@ -1410,7 +1410,7 @@ static void stb0899_set_delivery(struct stb0899_state *state)
1410 1410
1411 switch (state->delsys) { 1411 switch (state->delsys) {
1412 case DVBFE_DELSYS_DVBS: 1412 case DVBFE_DELSYS_DVBS:
1413 dprintk(verbose, FE_DEBUG, 1, "Delivery System -- DVB-S"); 1413 dprintk(state->verbose, FE_DEBUG, 1, "Delivery System -- DVB-S");
1414 /* FECM/Viterbi ON */ 1414 /* FECM/Viterbi ON */
1415 reg = stb0899_read_reg(state, STB0899_FECM); 1415 reg = stb0899_read_reg(state, STB0899_FECM);
1416 STB0899_SETFIELD_VAL(FECM_RSVD0, reg, 0); 1416 STB0899_SETFIELD_VAL(FECM_RSVD0, reg, 0);
@@ -1493,7 +1493,7 @@ static void stb0899_set_delivery(struct stb0899_state *state)
1493 STB0899_SETFIELD_VAL(STOP_CKS2DMD108, stop_clk[1], 1); 1493 STB0899_SETFIELD_VAL(STOP_CKS2DMD108, stop_clk[1], 1);
1494 break; 1494 break;
1495 default: 1495 default:
1496 dprintk(verbose, FE_ERROR, 1, "Unsupported delivery system"); 1496 dprintk(state->verbose, FE_ERROR, 1, "Unsupported delivery system");
1497 break; 1497 break;
1498 } 1498 }
1499 STB0899_SETFIELD_VAL(STOP_CKADCI108, stop_clk[0], 0); 1499 STB0899_SETFIELD_VAL(STOP_CKADCI108, stop_clk[0], 0);
@@ -1537,28 +1537,28 @@ static enum dvbfe_search stb0899_search(struct dvb_frontend *fe, struct dvbfe_pa
1537 i_params->freq = params->frequency; 1537 i_params->freq = params->frequency;
1538 switch (state->delsys) { 1538 switch (state->delsys) {
1539 case DVBFE_DELSYS_DVBS: 1539 case DVBFE_DELSYS_DVBS:
1540 dprintk(verbose, FE_ERROR, 1, "set DVB-S params"); 1540 dprintk(state->verbose, FE_ERROR, 1, "set DVB-S params");
1541 i_params->srate = params->delsys.dvbs.symbol_rate; 1541 i_params->srate = params->delsys.dvbs.symbol_rate;
1542 break; 1542 break;
1543 case DVBFE_DELSYS_DSS: 1543 case DVBFE_DELSYS_DSS:
1544 dprintk(verbose, FE_ERROR, 1, "set DSS params"); 1544 dprintk(state->verbose, FE_ERROR, 1, "set DSS params");
1545 i_params->srate = params->delsys.dss.symbol_rate; 1545 i_params->srate = params->delsys.dss.symbol_rate;
1546 break; 1546 break;
1547 case DVBFE_DELSYS_DVBS2: 1547 case DVBFE_DELSYS_DVBS2:
1548 dprintk(verbose, FE_ERROR, 1, "set DVB-S2 params"); 1548 dprintk(state->verbose, FE_ERROR, 1, "set DVB-S2 params");
1549 i_params->srate = params->delsys.dvbs2.symbol_rate; 1549 i_params->srate = params->delsys.dvbs2.symbol_rate;
1550 break; 1550 break;
1551 default: 1551 default:
1552 dprintk(verbose, FE_ERROR, 1, "Unsupported delivery system"); 1552 dprintk(state->verbose, FE_ERROR, 1, "Unsupported delivery system");
1553 return -EINVAL; 1553 return -EINVAL;
1554 } 1554 }
1555 dprintk(verbose, FE_DEBUG, 1, "delivery system=%d", state->delsys); 1555 dprintk(state->verbose, FE_DEBUG, 1, "delivery system=%d", state->delsys);
1556 1556
1557 SearchRange = 10000000; 1557 SearchRange = 10000000;
1558 dprintk(verbose, FE_DEBUG, 1, "Frequency=%d, Srate=%d", i_params->freq, i_params->srate); 1558 dprintk(state->verbose, FE_DEBUG, 1, "Frequency=%d, Srate=%d", i_params->freq, i_params->srate);
1559 /* checking Search Range is meaningless for a fixed 3 Mhz */ 1559 /* checking Search Range is meaningless for a fixed 3 Mhz */
1560 if (INRANGE(i_params->srate, 1000000, 45000000)) { 1560 if (INRANGE(i_params->srate, 1000000, 45000000)) {
1561 dprintk(verbose, FE_DEBUG, 1, "Parameters IN RANGE"); 1561 dprintk(state->verbose, FE_DEBUG, 1, "Parameters IN RANGE");
1562 stb0899_set_delivery(state); 1562 stb0899_set_delivery(state);
1563 1563
1564 if (state->config->tuner_set_rfsiggain) { 1564 if (state->config->tuner_set_rfsiggain) {
@@ -1579,7 +1579,7 @@ static enum dvbfe_search stb0899_search(struct dvb_frontend *fe, struct dvbfe_pa
1579 switch (state->delsys) { 1579 switch (state->delsys) {
1580 case DVBFE_DELSYS_DVBS: 1580 case DVBFE_DELSYS_DVBS:
1581 case DVBFE_DELSYS_DSS: 1581 case DVBFE_DELSYS_DSS:
1582 dprintk(verbose, FE_DEBUG, 1, "DVB-S delivery system"); 1582 dprintk(state->verbose, FE_DEBUG, 1, "DVB-S delivery system");
1583 internal->freq = i_params->freq; 1583 internal->freq = i_params->freq;
1584 internal->srate = i_params->srate; 1584 internal->srate = i_params->srate;
1585 /* 1585 /*
@@ -1607,17 +1607,17 @@ static enum dvbfe_search stb0899_search(struct dvb_frontend *fe, struct dvbfe_pa
1607 stb0899_write_reg(state, STB0899_AGCRFCFG, 0x11); 1607 stb0899_write_reg(state, STB0899_AGCRFCFG, 0x11);
1608 1608
1609 /* Run the search algorithm */ 1609 /* Run the search algorithm */
1610 dprintk(verbose, FE_DEBUG, 1, "running DVB-S search algo .."); 1610 dprintk(state->verbose, FE_DEBUG, 1, "running DVB-S search algo ..");
1611 if (stb0899_dvbs_algo(state) == RANGEOK) { 1611 if (stb0899_dvbs_algo(state) == RANGEOK) {
1612 internal->lock = 1; 1612 internal->lock = 1;
1613 dprintk(verbose, FE_DEBUG, 1, 1613 dprintk(state->verbose, FE_DEBUG, 1,
1614 "-------------------------------------> DVB-S LOCK !"); 1614 "-------------------------------------> DVB-S LOCK !");
1615 1615
1616// stb0899_write_reg(state, STB0899_ERRCTRL1, 0x3d); /* Viterbi Errors */ 1616// stb0899_write_reg(state, STB0899_ERRCTRL1, 0x3d); /* Viterbi Errors */
1617// internal->v_status = stb0899_read_reg(state, STB0899_VSTATUS); 1617// internal->v_status = stb0899_read_reg(state, STB0899_VSTATUS);
1618// internal->err_ctrl = stb0899_read_reg(state, STB0899_ERRCTRL1); 1618// internal->err_ctrl = stb0899_read_reg(state, STB0899_ERRCTRL1);
1619// dprintk(verbose, FE_DEBUG, 1, "VSTATUS=0x%02x", internal->v_status); 1619// dprintk(state->verbose, FE_DEBUG, 1, "VSTATUS=0x%02x", internal->v_status);
1620// dprintk(verbose, FE_DEBUG, 1, "ERR_CTRL=0x%02x", internal->err_ctrl); 1620// dprintk(state->verbose, FE_DEBUG, 1, "ERR_CTRL=0x%02x", internal->err_ctrl);
1621 1621
1622 return DVBFE_ALGO_SEARCH_SUCCESS; 1622 return DVBFE_ALGO_SEARCH_SUCCESS;
1623 } else { 1623 } else {
@@ -1651,10 +1651,10 @@ static enum dvbfe_search stb0899_search(struct dvb_frontend *fe, struct dvbfe_pa
1651 stb0899_set_iterations(state); 1651 stb0899_set_iterations(state);
1652 1652
1653 /* Run the search algorithm */ 1653 /* Run the search algorithm */
1654 dprintk(verbose, FE_DEBUG, 1, "running DVB-S2 search algo .."); 1654 dprintk(state->verbose, FE_DEBUG, 1, "running DVB-S2 search algo ..");
1655 if (stb0899_dvbs2_algo(state) == DVBS2_FEC_LOCK) { 1655 if (stb0899_dvbs2_algo(state) == DVBS2_FEC_LOCK) {
1656 internal->lock = 1; 1656 internal->lock = 1;
1657 dprintk(verbose, FE_DEBUG, 1, 1657 dprintk(state->verbose, FE_DEBUG, 1,
1658 "-------------------------------------> DVB-S2 LOCK !"); 1658 "-------------------------------------> DVB-S2 LOCK !");
1659 1659
1660// stb0899_write_reg(state, STB0899_ERRCTRL1, 0xb6); /* Packet Errors */ 1660// stb0899_write_reg(state, STB0899_ERRCTRL1, 0xb6); /* Packet Errors */
@@ -1669,7 +1669,7 @@ static enum dvbfe_search stb0899_search(struct dvb_frontend *fe, struct dvbfe_pa
1669 } 1669 }
1670 break; 1670 break;
1671 default: 1671 default:
1672 dprintk(verbose, FE_ERROR, 1, "Unsupported delivery system"); 1672 dprintk(state->verbose, FE_ERROR, 1, "Unsupported delivery system");
1673 return DVBFE_ALGO_SEARCH_INVALID; 1673 return DVBFE_ALGO_SEARCH_INVALID;
1674 } 1674 }
1675 } 1675 }
@@ -1682,12 +1682,12 @@ static enum stb0899_status stb0899_track_carrier(struct stb0899_state *state)
1682 u8 reg; 1682 u8 reg;
1683 1683
1684 reg = stb0899_read_reg(state, STB0899_DSTATUS); 1684 reg = stb0899_read_reg(state, STB0899_DSTATUS);
1685 dprintk(verbose, FE_DEBUG, 1, "--------------------> STB0899_DSTATUS=[0x%02x]", reg); 1685 dprintk(state->verbose, FE_DEBUG, 1, "--------------------> STB0899_DSTATUS=[0x%02x]", reg);
1686 if (STB0899_GETFIELD(CARRIER_FOUND, reg)) { 1686 if (STB0899_GETFIELD(CARRIER_FOUND, reg)) {
1687 dprintk(verbose, FE_DEBUG, 1, "-------------> CARRIEROK !"); 1687 dprintk(state->verbose, FE_DEBUG, 1, "-------------> CARRIEROK !");
1688 return CARRIEROK; 1688 return CARRIEROK;
1689 } else { 1689 } else {
1690 dprintk(verbose, FE_DEBUG, 1, "-------------> NOCARRIER !"); 1690 dprintk(state->verbose, FE_DEBUG, 1, "-------------> NOCARRIER !");
1691 return NOCARRIER; 1691 return NOCARRIER;
1692 } 1692 }
1693 1693
@@ -1699,12 +1699,12 @@ static enum stb0899_status stb0899_get_ifagc(struct stb0899_state *state)
1699 u8 reg; 1699 u8 reg;
1700 1700
1701 reg = STB0899_READ_S2REG(STB0899_S2DEMOD, DMD_STATUS); 1701 reg = STB0899_READ_S2REG(STB0899_S2DEMOD, DMD_STATUS);
1702 dprintk(verbose, FE_DEBUG, 1, "DMD_STATUS=[0x%02x]", reg); 1702 dprintk(state->verbose, FE_DEBUG, 1, "DMD_STATUS=[0x%02x]", reg);
1703 if (STB0899_GETFIELD(IF_AGC_LOCK, reg)) { 1703 if (STB0899_GETFIELD(IF_AGC_LOCK, reg)) {
1704 dprintk(verbose, FE_DEBUG, 1, "------------->IF AGC LOCKED !"); 1704 dprintk(state->verbose, FE_DEBUG, 1, "------------->IF AGC LOCKED !");
1705 return AGC1OK; 1705 return AGC1OK;
1706 } else { 1706 } else {
1707 dprintk(verbose, FE_DEBUG, 1, "------------->IF AGC LOCK LOST !"); 1707 dprintk(state->verbose, FE_DEBUG, 1, "------------->IF AGC LOCK LOST !");
1708 return NOAGC1; 1708 return NOAGC1;
1709 } 1709 }
1710 1710
@@ -1904,21 +1904,21 @@ static int stb0899_get_params(struct dvb_frontend *fe, struct dvbfe_params *para
1904 params->delivery = state->delsys; 1904 params->delivery = state->delsys;
1905 switch (state->delsys) { 1905 switch (state->delsys) {
1906 case DVBFE_DELSYS_DVBS: 1906 case DVBFE_DELSYS_DVBS:
1907 dprintk(verbose, FE_DEBUG, 1, "Get DVB-S params"); 1907 dprintk(state->verbose, FE_DEBUG, 1, "Get DVB-S params");
1908 params->delsys.dvbs.symbol_rate = internal->srate; 1908 params->delsys.dvbs.symbol_rate = internal->srate;
1909 params->delsys.dvbs.modulation = DVBFE_MOD_QPSK; 1909 params->delsys.dvbs.modulation = DVBFE_MOD_QPSK;
1910 break; 1910 break;
1911 case DVBFE_DELSYS_DSS: 1911 case DVBFE_DELSYS_DSS:
1912 dprintk(verbose, FE_DEBUG, 1, "Get DSS params"); 1912 dprintk(state->verbose, FE_DEBUG, 1, "Get DSS params");
1913 params->delsys.dss.symbol_rate = internal->srate; 1913 params->delsys.dss.symbol_rate = internal->srate;
1914 params->delsys.dss.modulation = DVBFE_MOD_QPSK; 1914 params->delsys.dss.modulation = DVBFE_MOD_QPSK;
1915 break; 1915 break;
1916 case DVBFE_DELSYS_DVBS2: 1916 case DVBFE_DELSYS_DVBS2:
1917 dprintk(verbose, FE_DEBUG, 1, "Get DVB-S2 params"); 1917 dprintk(state->verbose, FE_DEBUG, 1, "Get DVB-S2 params");
1918 params->delsys.dvbs2.symbol_rate = internal->srate; 1918 params->delsys.dvbs2.symbol_rate = internal->srate;
1919 break; 1919 break;
1920 default: 1920 default:
1921 dprintk(verbose, FE_ERROR, 1, "Unsupported delivery system"); 1921 dprintk(state->verbose, FE_ERROR, 1, "Unsupported delivery system");
1922 return -EINVAL; 1922 return -EINVAL;
1923 } 1923 }
1924 1924
@@ -1983,7 +1983,7 @@ struct dvb_frontend *stb0899_attach(struct stb0899_config *config, struct i2c_ad
1983 goto error; 1983 goto error;
1984 1984
1985 inversion = config->inversion; 1985 inversion = config->inversion;
1986 state->verbose = verbose; 1986 state->verbose = &verbose;
1987 state->config = config; 1987 state->config = config;
1988 state->i2c = i2c; 1988 state->i2c = i2c;
1989 state->frontend.ops = stb0899_ops; 1989 state->frontend.ops = stb0899_ops;
diff --git a/drivers/media/dvb/frontends/stb0899_priv.h b/drivers/media/dvb/frontends/stb0899_priv.h
index 755269979d1e..2e845c930063 100644
--- a/drivers/media/dvb/frontends/stb0899_priv.h
+++ b/drivers/media/dvb/frontends/stb0899_priv.h
@@ -33,16 +33,16 @@
33 33
34#define dprintk(x, y, z, format, arg...) do { \ 34#define dprintk(x, y, z, format, arg...) do { \
35 if (z) { \ 35 if (z) { \
36 if ((x > FE_ERROR) && (x > y)) \ 36 if ((*x > FE_ERROR) && (*x > y)) \
37 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \ 37 printk(KERN_ERR "%s: " format "\n", __func__ , ##arg); \
38 else if ((x > FE_NOTICE) && (x > y)) \ 38 else if ((*x > FE_NOTICE) && (*x > y)) \
39 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \ 39 printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg); \
40 else if ((x > FE_INFO) && (x > y)) \ 40 else if ((*x > FE_INFO) && (*x > y)) \
41 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \ 41 printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \
42 else if ((x > FE_DEBUG) && (x > y)) \ 42 else if ((*x > FE_DEBUG) && (*x > y)) \
43 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \ 43 printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg); \
44 } else { \ 44 } else { \
45 if (x > y) \ 45 if (*x > y) \
46 printk(format, ##arg); \ 46 printk(format, ##arg); \
47 } \ 47 } \
48} while(0) 48} while(0)
@@ -215,7 +215,7 @@ struct stb0899_state {
215 struct stb0899_config *config; 215 struct stb0899_config *config;
216 struct dvb_frontend frontend; 216 struct dvb_frontend frontend;
217 217
218 u32 verbose; /* Cached module verbosity level */ 218 u32 *verbose; /* Cached module verbosity level */
219 219
220 struct stb0899_internal internal; /* Device internal parameters */ 220 struct stb0899_internal internal; /* Device internal parameters */
221 221