aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-core
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb-core')
-rw-r--r--drivers/media/dvb-core/dvb_frontend.c226
1 files changed, 116 insertions, 110 deletions
diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index aa4d4d85dc20..609e691eff15 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -66,8 +66,6 @@ MODULE_PARM_DESC(dvb_powerdown_on_sleep, "0: do not power down, 1: turn LNB volt
66module_param(dvb_mfe_wait_time, int, 0644); 66module_param(dvb_mfe_wait_time, int, 0644);
67MODULE_PARM_DESC(dvb_mfe_wait_time, "Wait up to <mfe_wait_time> seconds on open() for multi-frontend to become available (default:5 seconds)"); 67MODULE_PARM_DESC(dvb_mfe_wait_time, "Wait up to <mfe_wait_time> seconds on open() for multi-frontend to become available (default:5 seconds)");
68 68
69#define dprintk if (dvb_frontend_debug) printk
70
71#define FESTATE_IDLE 1 69#define FESTATE_IDLE 1
72#define FESTATE_RETUNE 2 70#define FESTATE_RETUNE 2
73#define FESTATE_TUNING_FAST 4 71#define FESTATE_TUNING_FAST 4
@@ -207,7 +205,7 @@ static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
207 struct dvb_frontend_event *e; 205 struct dvb_frontend_event *e;
208 int wp; 206 int wp;
209 207
210 dprintk ("%s\n", __func__); 208 dev_dbg(fe->dvb->device, "%s:\n", __func__);
211 209
212 if ((status & FE_HAS_LOCK) && has_get_frontend(fe)) 210 if ((status & FE_HAS_LOCK) && has_get_frontend(fe))
213 dtv_get_frontend(fe, &fepriv->parameters_out); 211 dtv_get_frontend(fe, &fepriv->parameters_out);
@@ -237,7 +235,7 @@ static int dvb_frontend_get_event(struct dvb_frontend *fe,
237 struct dvb_frontend_private *fepriv = fe->frontend_priv; 235 struct dvb_frontend_private *fepriv = fe->frontend_priv;
238 struct dvb_fe_events *events = &fepriv->events; 236 struct dvb_fe_events *events = &fepriv->events;
239 237
240 dprintk ("%s\n", __func__); 238 dev_dbg(fe->dvb->device, "%s:\n", __func__);
241 239
242 if (events->overflow) { 240 if (events->overflow) {
243 events->overflow = 0; 241 events->overflow = 0;
@@ -282,10 +280,9 @@ static void dvb_frontend_clear_events(struct dvb_frontend *fe)
282 280
283static void dvb_frontend_init(struct dvb_frontend *fe) 281static void dvb_frontend_init(struct dvb_frontend *fe)
284{ 282{
285 dprintk ("DVB: initialising adapter %i frontend %i (%s)...\n", 283 dev_dbg(fe->dvb->device,
286 fe->dvb->num, 284 "%s: initialising adapter %i frontend %i (%s)...\n",
287 fe->id, 285 __func__, fe->dvb->num, fe->id, fe->ops.info.name);
288 fe->ops.info.name);
289 286
290 if (fe->ops.init) 287 if (fe->ops.init)
291 fe->ops.init(fe); 288 fe->ops.init(fe);
@@ -310,8 +307,9 @@ EXPORT_SYMBOL(dvb_frontend_reinitialise);
310static void dvb_frontend_swzigzag_update_delay(struct dvb_frontend_private *fepriv, int locked) 307static void dvb_frontend_swzigzag_update_delay(struct dvb_frontend_private *fepriv, int locked)
311{ 308{
312 int q2; 309 int q2;
310 struct dvb_frontend *fe = fepriv->dvbdev->priv;
313 311
314 dprintk ("%s\n", __func__); 312 dev_dbg(fe->dvb->device, "%s:\n", __func__);
315 313
316 if (locked) 314 if (locked)
317 (fepriv->quality) = (fepriv->quality * 220 + 36*256) / 256; 315 (fepriv->quality) = (fepriv->quality * 220 + 36*256) / 256;
@@ -403,10 +401,11 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
403 return 1; 401 return 1;
404 } 402 }
405 403
406 dprintk("%s: drift:%i inversion:%i auto_step:%i " 404 dev_dbg(fe->dvb->device, "%s: drift:%i inversion:%i auto_step:%i " \
407 "auto_sub_step:%i started_auto_step:%i\n", 405 "auto_sub_step:%i started_auto_step:%i\n",
408 __func__, fepriv->lnb_drift, fepriv->inversion, 406 __func__, fepriv->lnb_drift, fepriv->inversion,
409 fepriv->auto_step, fepriv->auto_sub_step, fepriv->started_auto_step); 407 fepriv->auto_step, fepriv->auto_sub_step,
408 fepriv->started_auto_step);
410 409
411 /* set the frontend itself */ 410 /* set the frontend itself */
412 c->frequency += fepriv->lnb_drift; 411 c->frequency += fepriv->lnb_drift;
@@ -605,7 +604,7 @@ static int dvb_frontend_thread(void *data)
605 604
606 bool re_tune = false; 605 bool re_tune = false;
607 606
608 dprintk("%s\n", __func__); 607 dev_dbg(fe->dvb->device, "%s:\n", __func__);
609 608
610 fepriv->check_wrapped = 0; 609 fepriv->check_wrapped = 0;
611 fepriv->quality = 0; 610 fepriv->quality = 0;
@@ -651,10 +650,10 @@ restart:
651 algo = fe->ops.get_frontend_algo(fe); 650 algo = fe->ops.get_frontend_algo(fe);
652 switch (algo) { 651 switch (algo) {
653 case DVBFE_ALGO_HW: 652 case DVBFE_ALGO_HW:
654 dprintk("%s: Frontend ALGO = DVBFE_ALGO_HW\n", __func__); 653 dev_dbg(fe->dvb->device, "%s: Frontend ALGO = DVBFE_ALGO_HW\n", __func__);
655 654
656 if (fepriv->state & FESTATE_RETUNE) { 655 if (fepriv->state & FESTATE_RETUNE) {
657 dprintk("%s: Retune requested, FESTATE_RETUNE\n", __func__); 656 dev_dbg(fe->dvb->device, "%s: Retune requested, FESTATE_RETUNE\n", __func__);
658 re_tune = true; 657 re_tune = true;
659 fepriv->state = FESTATE_TUNED; 658 fepriv->state = FESTATE_TUNED;
660 } else { 659 } else {
@@ -665,19 +664,19 @@ restart:
665 fe->ops.tune(fe, re_tune, fepriv->tune_mode_flags, &fepriv->delay, &s); 664 fe->ops.tune(fe, re_tune, fepriv->tune_mode_flags, &fepriv->delay, &s);
666 665
667 if (s != fepriv->status && !(fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT)) { 666 if (s != fepriv->status && !(fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT)) {
668 dprintk("%s: state changed, adding current state\n", __func__); 667 dev_dbg(fe->dvb->device, "%s: state changed, adding current state\n", __func__);
669 dvb_frontend_add_event(fe, s); 668 dvb_frontend_add_event(fe, s);
670 fepriv->status = s; 669 fepriv->status = s;
671 } 670 }
672 break; 671 break;
673 case DVBFE_ALGO_SW: 672 case DVBFE_ALGO_SW:
674 dprintk("%s: Frontend ALGO = DVBFE_ALGO_SW\n", __func__); 673 dev_dbg(fe->dvb->device, "%s: Frontend ALGO = DVBFE_ALGO_SW\n", __func__);
675 dvb_frontend_swzigzag(fe); 674 dvb_frontend_swzigzag(fe);
676 break; 675 break;
677 case DVBFE_ALGO_CUSTOM: 676 case DVBFE_ALGO_CUSTOM:
678 dprintk("%s: Frontend ALGO = DVBFE_ALGO_CUSTOM, state=%d\n", __func__, fepriv->state); 677 dev_dbg(fe->dvb->device, "%s: Frontend ALGO = DVBFE_ALGO_CUSTOM, state=%d\n", __func__, fepriv->state);
679 if (fepriv->state & FESTATE_RETUNE) { 678 if (fepriv->state & FESTATE_RETUNE) {
680 dprintk("%s: Retune requested, FESTAT_RETUNE\n", __func__); 679 dev_dbg(fe->dvb->device, "%s: Retune requested, FESTAT_RETUNE\n", __func__);
681 fepriv->state = FESTATE_TUNED; 680 fepriv->state = FESTATE_TUNED;
682 } 681 }
683 /* Case where we are going to search for a carrier 682 /* Case where we are going to search for a carrier
@@ -713,7 +712,7 @@ restart:
713 } 712 }
714 break; 713 break;
715 default: 714 default:
716 dprintk("%s: UNDEFINED ALGO !\n", __func__); 715 dev_dbg(fe->dvb->device, "%s: UNDEFINED ALGO !\n", __func__);
717 break; 716 break;
718 } 717 }
719 } else { 718 } else {
@@ -750,7 +749,7 @@ static void dvb_frontend_stop(struct dvb_frontend *fe)
750{ 749{
751 struct dvb_frontend_private *fepriv = fe->frontend_priv; 750 struct dvb_frontend_private *fepriv = fe->frontend_priv;
752 751
753 dprintk ("%s\n", __func__); 752 dev_dbg(fe->dvb->device, "%s:\n", __func__);
754 753
755 fepriv->exit = DVB_FE_NORMAL_EXIT; 754 fepriv->exit = DVB_FE_NORMAL_EXIT;
756 mb(); 755 mb();
@@ -765,7 +764,8 @@ static void dvb_frontend_stop(struct dvb_frontend *fe)
765 764
766 /* paranoia check in case a signal arrived */ 765 /* paranoia check in case a signal arrived */
767 if (fepriv->thread) 766 if (fepriv->thread)
768 printk("dvb_frontend_stop: warning: thread %p won't exit\n", 767 dev_warn(fe->dvb->device,
768 "dvb_frontend_stop: warning: thread %p won't exit\n",
769 fepriv->thread); 769 fepriv->thread);
770} 770}
771 771
@@ -818,7 +818,7 @@ static int dvb_frontend_start(struct dvb_frontend *fe)
818 struct dvb_frontend_private *fepriv = fe->frontend_priv; 818 struct dvb_frontend_private *fepriv = fe->frontend_priv;
819 struct task_struct *fe_thread; 819 struct task_struct *fe_thread;
820 820
821 dprintk ("%s\n", __func__); 821 dev_dbg(fe->dvb->device, "%s:\n", __func__);
822 822
823 if (fepriv->thread) { 823 if (fepriv->thread) {
824 if (fepriv->exit == DVB_FE_NO_EXIT) 824 if (fepriv->exit == DVB_FE_NO_EXIT)
@@ -841,7 +841,9 @@ static int dvb_frontend_start(struct dvb_frontend *fe)
841 "kdvb-ad-%i-fe-%i", fe->dvb->num,fe->id); 841 "kdvb-ad-%i-fe-%i", fe->dvb->num,fe->id);
842 if (IS_ERR(fe_thread)) { 842 if (IS_ERR(fe_thread)) {
843 ret = PTR_ERR(fe_thread); 843 ret = PTR_ERR(fe_thread);
844 printk("dvb_frontend_start: failed to start kthread (%d)\n", ret); 844 dev_warn(fe->dvb->device,
845 "dvb_frontend_start: failed to start kthread (%d)\n",
846 ret);
845 up(&fepriv->sem); 847 up(&fepriv->sem);
846 return ret; 848 return ret;
847 } 849 }
@@ -862,8 +864,8 @@ static void dvb_frontend_get_frequency_limits(struct dvb_frontend *fe,
862 *freq_max = min(fe->ops.info.frequency_max, fe->ops.tuner_ops.info.frequency_max); 864 *freq_max = min(fe->ops.info.frequency_max, fe->ops.tuner_ops.info.frequency_max);
863 865
864 if (*freq_min == 0 || *freq_max == 0) 866 if (*freq_min == 0 || *freq_max == 0)
865 printk(KERN_WARNING "DVB: adapter %i frontend %u frequency limits undefined - fix the driver\n", 867 dev_warn(fe->dvb->device, "DVB: adapter %i frontend %u frequency limits undefined - fix the driver\n",
866 fe->dvb->num,fe->id); 868 fe->dvb->num, fe->id);
867} 869}
868 870
869static int dvb_frontend_check_parameters(struct dvb_frontend *fe) 871static int dvb_frontend_check_parameters(struct dvb_frontend *fe)
@@ -876,8 +878,9 @@ static int dvb_frontend_check_parameters(struct dvb_frontend *fe)
876 dvb_frontend_get_frequency_limits(fe, &freq_min, &freq_max); 878 dvb_frontend_get_frequency_limits(fe, &freq_min, &freq_max);
877 if ((freq_min && c->frequency < freq_min) || 879 if ((freq_min && c->frequency < freq_min) ||
878 (freq_max && c->frequency > freq_max)) { 880 (freq_max && c->frequency > freq_max)) {
879 printk(KERN_WARNING "DVB: adapter %i frontend %i frequency %u out of range (%u..%u)\n", 881 dev_warn(fe->dvb->device, "DVB: adapter %i frontend %i frequency %u out of range (%u..%u)\n",
880 fe->dvb->num, fe->id, c->frequency, freq_min, freq_max); 882 fe->dvb->num, fe->id, c->frequency,
883 freq_min, freq_max);
881 return -EINVAL; 884 return -EINVAL;
882 } 885 }
883 886
@@ -892,10 +895,10 @@ static int dvb_frontend_check_parameters(struct dvb_frontend *fe)
892 c->symbol_rate < fe->ops.info.symbol_rate_min) || 895 c->symbol_rate < fe->ops.info.symbol_rate_min) ||
893 (fe->ops.info.symbol_rate_max && 896 (fe->ops.info.symbol_rate_max &&
894 c->symbol_rate > fe->ops.info.symbol_rate_max)) { 897 c->symbol_rate > fe->ops.info.symbol_rate_max)) {
895 printk(KERN_WARNING "DVB: adapter %i frontend %i symbol rate %u out of range (%u..%u)\n", 898 dev_warn(fe->dvb->device, "DVB: adapter %i frontend %i symbol rate %u out of range (%u..%u)\n",
896 fe->dvb->num, fe->id, c->symbol_rate, 899 fe->dvb->num, fe->id, c->symbol_rate,
897 fe->ops.info.symbol_rate_min, 900 fe->ops.info.symbol_rate_min,
898 fe->ops.info.symbol_rate_max); 901 fe->ops.info.symbol_rate_max);
899 return -EINVAL; 902 return -EINVAL;
900 } 903 }
901 default: 904 default:
@@ -917,8 +920,8 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe)
917 920
918 c->state = DTV_CLEAR; 921 c->state = DTV_CLEAR;
919 922
920 dprintk("%s() Clearing cache for delivery system %d\n", __func__, 923 dev_dbg(fe->dvb->device, "%s: Clearing cache for delivery system %d\n",
921 c->delivery_system); 924 __func__, c->delivery_system);
922 925
923 c->transmission_mode = TRANSMISSION_MODE_AUTO; 926 c->transmission_mode = TRANSMISSION_MODE_AUTO;
924 c->bandwidth_hz = 0; /* AUTO */ 927 c->bandwidth_hz = 0; /* AUTO */
@@ -1053,35 +1056,31 @@ static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = {
1053 _DTV_CMD(DTV_ATSCMH_SCCC_CODE_MODE_D, 0, 0), 1056 _DTV_CMD(DTV_ATSCMH_SCCC_CODE_MODE_D, 0, 0),
1054}; 1057};
1055 1058
1056static void dtv_property_dump(struct dtv_property *tvp) 1059static void dtv_property_dump(struct dvb_frontend *fe, struct dtv_property *tvp)
1057{ 1060{
1058 int i; 1061 int i;
1059 1062
1060 if (tvp->cmd <= 0 || tvp->cmd > DTV_MAX_COMMAND) { 1063 if (tvp->cmd <= 0 || tvp->cmd > DTV_MAX_COMMAND) {
1061 printk(KERN_WARNING "%s: tvp.cmd = 0x%08x undefined\n", 1064 dev_warn(fe->dvb->device, "%s: tvp.cmd = 0x%08x undefined\n",
1062 __func__, tvp->cmd); 1065 __func__, tvp->cmd);
1063 return; 1066 return;
1064 } 1067 }
1065 1068
1066 dprintk("%s() tvp.cmd = 0x%08x (%s)\n" 1069 dev_dbg(fe->dvb->device, "%s: tvp.cmd = 0x%08x (%s)\n", __func__,
1067 ,__func__ 1070 tvp->cmd, dtv_cmds[tvp->cmd].name);
1068 ,tvp->cmd
1069 ,dtv_cmds[ tvp->cmd ].name);
1070
1071 if(dtv_cmds[ tvp->cmd ].buffer) {
1072 1071
1073 dprintk("%s() tvp.u.buffer.len = 0x%02x\n" 1072 if (dtv_cmds[tvp->cmd].buffer) {
1074 ,__func__ 1073 dev_dbg(fe->dvb->device, "%s: tvp.u.buffer.len = 0x%02x\n",
1075 ,tvp->u.buffer.len); 1074 __func__, tvp->u.buffer.len);
1076 1075
1077 for(i = 0; i < tvp->u.buffer.len; i++) 1076 for(i = 0; i < tvp->u.buffer.len; i++)
1078 dprintk("%s() tvp.u.buffer.data[0x%02x] = 0x%02x\n" 1077 dev_dbg(fe->dvb->device,
1079 ,__func__ 1078 "%s: tvp.u.buffer.data[0x%02x] = 0x%02x\n",
1080 ,i 1079 __func__, i, tvp->u.buffer.data[i]);
1081 ,tvp->u.buffer.data[i]); 1080 } else {
1082 1081 dev_dbg(fe->dvb->device, "%s: tvp.u.data = 0x%08x\n", __func__,
1083 } else 1082 tvp->u.data);
1084 dprintk("%s() tvp.u.data = 0x%08x\n", __func__, tvp->u.data); 1083 }
1085} 1084}
1086 1085
1087/* Synchronise the legacy tuning parameters into the cache, so that demodulator 1086/* Synchronise the legacy tuning parameters into the cache, so that demodulator
@@ -1097,18 +1096,19 @@ static int dtv_property_cache_sync(struct dvb_frontend *fe,
1097 1096
1098 switch (dvbv3_type(c->delivery_system)) { 1097 switch (dvbv3_type(c->delivery_system)) {
1099 case DVBV3_QPSK: 1098 case DVBV3_QPSK:
1100 dprintk("%s() Preparing QPSK req\n", __func__); 1099 dev_dbg(fe->dvb->device, "%s: Preparing QPSK req\n", __func__);
1101 c->symbol_rate = p->u.qpsk.symbol_rate; 1100 c->symbol_rate = p->u.qpsk.symbol_rate;
1102 c->fec_inner = p->u.qpsk.fec_inner; 1101 c->fec_inner = p->u.qpsk.fec_inner;
1103 break; 1102 break;
1104 case DVBV3_QAM: 1103 case DVBV3_QAM:
1105 dprintk("%s() Preparing QAM req\n", __func__); 1104 dev_dbg(fe->dvb->device, "%s: Preparing QAM req\n", __func__);
1106 c->symbol_rate = p->u.qam.symbol_rate; 1105 c->symbol_rate = p->u.qam.symbol_rate;
1107 c->fec_inner = p->u.qam.fec_inner; 1106 c->fec_inner = p->u.qam.fec_inner;
1108 c->modulation = p->u.qam.modulation; 1107 c->modulation = p->u.qam.modulation;
1109 break; 1108 break;
1110 case DVBV3_OFDM: 1109 case DVBV3_OFDM:
1111 dprintk("%s() Preparing OFDM req\n", __func__); 1110 dev_dbg(fe->dvb->device, "%s: Preparing OFDM req\n", __func__);
1111
1112 switch (p->u.ofdm.bandwidth) { 1112 switch (p->u.ofdm.bandwidth) {
1113 case BANDWIDTH_10_MHZ: 1113 case BANDWIDTH_10_MHZ:
1114 c->bandwidth_hz = 10000000; 1114 c->bandwidth_hz = 10000000;
@@ -1140,7 +1140,7 @@ static int dtv_property_cache_sync(struct dvb_frontend *fe,
1140 c->hierarchy = p->u.ofdm.hierarchy_information; 1140 c->hierarchy = p->u.ofdm.hierarchy_information;
1141 break; 1141 break;
1142 case DVBV3_ATSC: 1142 case DVBV3_ATSC:
1143 dprintk("%s() Preparing ATSC req\n", __func__); 1143 dev_dbg(fe->dvb->device, "%s: Preparing ATSC req\n", __func__);
1144 c->modulation = p->u.vsb.modulation; 1144 c->modulation = p->u.vsb.modulation;
1145 if (c->delivery_system == SYS_ATSCMH) 1145 if (c->delivery_system == SYS_ATSCMH)
1146 break; 1146 break;
@@ -1150,9 +1150,9 @@ static int dtv_property_cache_sync(struct dvb_frontend *fe,
1150 c->delivery_system = SYS_DVBC_ANNEX_B; 1150 c->delivery_system = SYS_DVBC_ANNEX_B;
1151 break; 1151 break;
1152 case DVBV3_UNKNOWN: 1152 case DVBV3_UNKNOWN:
1153 printk(KERN_ERR 1153 dev_err(fe->dvb->device,
1154 "%s: doesn't know how to handle a DVBv3 call to delivery system %i\n", 1154 "%s: doesn't know how to handle a DVBv3 call to delivery system %i\n",
1155 __func__, c->delivery_system); 1155 __func__, c->delivery_system);
1156 return -EINVAL; 1156 return -EINVAL;
1157 } 1157 }
1158 1158
@@ -1172,24 +1172,23 @@ static int dtv_property_legacy_params_sync(struct dvb_frontend *fe,
1172 1172
1173 switch (dvbv3_type(c->delivery_system)) { 1173 switch (dvbv3_type(c->delivery_system)) {
1174 case DVBV3_UNKNOWN: 1174 case DVBV3_UNKNOWN:
1175 printk(KERN_ERR 1175 dev_err(fe->dvb->device,
1176 "%s: doesn't know how to handle a DVBv3 call to delivery system %i\n", 1176 "%s: doesn't know how to handle a DVBv3 call to delivery system %i\n",
1177 __func__, c->delivery_system); 1177 __func__, c->delivery_system);
1178 return -EINVAL; 1178 return -EINVAL;
1179 case DVBV3_QPSK: 1179 case DVBV3_QPSK:
1180 dprintk("%s() Preparing QPSK req\n", __func__); 1180 dev_dbg(fe->dvb->device, "%s: Preparing QPSK req\n", __func__);
1181 p->u.qpsk.symbol_rate = c->symbol_rate; 1181 p->u.qpsk.symbol_rate = c->symbol_rate;
1182 p->u.qpsk.fec_inner = c->fec_inner; 1182 p->u.qpsk.fec_inner = c->fec_inner;
1183 break; 1183 break;
1184 case DVBV3_QAM: 1184 case DVBV3_QAM:
1185 dprintk("%s() Preparing QAM req\n", __func__); 1185 dev_dbg(fe->dvb->device, "%s: Preparing QAM req\n", __func__);
1186 p->u.qam.symbol_rate = c->symbol_rate; 1186 p->u.qam.symbol_rate = c->symbol_rate;
1187 p->u.qam.fec_inner = c->fec_inner; 1187 p->u.qam.fec_inner = c->fec_inner;
1188 p->u.qam.modulation = c->modulation; 1188 p->u.qam.modulation = c->modulation;
1189 break; 1189 break;
1190 case DVBV3_OFDM: 1190 case DVBV3_OFDM:
1191 dprintk("%s() Preparing OFDM req\n", __func__); 1191 dev_dbg(fe->dvb->device, "%s: Preparing OFDM req\n", __func__);
1192
1193 switch (c->bandwidth_hz) { 1192 switch (c->bandwidth_hz) {
1194 case 10000000: 1193 case 10000000:
1195 p->u.ofdm.bandwidth = BANDWIDTH_10_MHZ; 1194 p->u.ofdm.bandwidth = BANDWIDTH_10_MHZ;
@@ -1221,7 +1220,7 @@ static int dtv_property_legacy_params_sync(struct dvb_frontend *fe,
1221 p->u.ofdm.hierarchy_information = c->hierarchy; 1220 p->u.ofdm.hierarchy_information = c->hierarchy;
1222 break; 1221 break;
1223 case DVBV3_ATSC: 1222 case DVBV3_ATSC:
1224 dprintk("%s() Preparing VSB req\n", __func__); 1223 dev_dbg(fe->dvb->device, "%s: Preparing VSB req\n", __func__);
1225 p->u.vsb.modulation = c->modulation; 1224 p->u.vsb.modulation = c->modulation;
1226 break; 1225 break;
1227 } 1226 }
@@ -1452,7 +1451,7 @@ static int dtv_property_process_get(struct dvb_frontend *fe,
1452 return r; 1451 return r;
1453 } 1452 }
1454 1453
1455 dtv_property_dump(tvp); 1454 dtv_property_dump(fe, tvp);
1456 1455
1457 return 0; 1456 return 0;
1458} 1457}
@@ -1497,8 +1496,9 @@ static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system)
1497 * DVBv3 system that matches the delivery system. 1496 * DVBv3 system that matches the delivery system.
1498 */ 1497 */
1499 if (is_dvbv3_delsys(c->delivery_system)) { 1498 if (is_dvbv3_delsys(c->delivery_system)) {
1500 dprintk("%s() Using delivery system to %d\n", 1499 dev_dbg(fe->dvb->device,
1501 __func__, c->delivery_system); 1500 "%s: Using delivery system to %d\n",
1501 __func__, c->delivery_system);
1502 return 0; 1502 return 0;
1503 } 1503 }
1504 type = dvbv3_type(c->delivery_system); 1504 type = dvbv3_type(c->delivery_system);
@@ -1516,8 +1516,8 @@ static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system)
1516 desired_system = SYS_DVBT; 1516 desired_system = SYS_DVBT;
1517 break; 1517 break;
1518 default: 1518 default:
1519 dprintk("%s(): This frontend doesn't support DVBv3 calls\n", 1519 dev_dbg(fe->dvb->device, "%s: This frontend doesn't support DVBv3 calls\n",
1520 __func__); 1520 __func__);
1521 return -EINVAL; 1521 return -EINVAL;
1522 } 1522 }
1523 /* 1523 /*
@@ -1539,8 +1539,8 @@ static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system)
1539 ncaps++; 1539 ncaps++;
1540 } 1540 }
1541 if (delsys == SYS_UNDEFINED) { 1541 if (delsys == SYS_UNDEFINED) {
1542 dprintk("%s() Couldn't find a delivery system that matches %d\n", 1542 dev_dbg(fe->dvb->device, "%s: Couldn't find a delivery system that matches %d\n",
1543 __func__, desired_system); 1543 __func__, desired_system);
1544 } 1544 }
1545 } else { 1545 } else {
1546 /* 1546 /*
@@ -1553,8 +1553,9 @@ static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system)
1553 while (fe->ops.delsys[ncaps] && ncaps < MAX_DELSYS) { 1553 while (fe->ops.delsys[ncaps] && ncaps < MAX_DELSYS) {
1554 if (fe->ops.delsys[ncaps] == desired_system) { 1554 if (fe->ops.delsys[ncaps] == desired_system) {
1555 c->delivery_system = desired_system; 1555 c->delivery_system = desired_system;
1556 dprintk("%s() Changing delivery system to %d\n", 1556 dev_dbg(fe->dvb->device,
1557 __func__, desired_system); 1557 "%s: Changing delivery system to %d\n",
1558 __func__, desired_system);
1558 return 0; 1559 return 0;
1559 } 1560 }
1560 ncaps++; 1561 ncaps++;
@@ -1568,8 +1569,9 @@ static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system)
1568 * DVBv3 delivery systems 1569 * DVBv3 delivery systems
1569 */ 1570 */
1570 if (!is_dvbv3_delsys(desired_system)) { 1571 if (!is_dvbv3_delsys(desired_system)) {
1571 dprintk("%s() can't use a DVBv3 FE_SET_FRONTEND call on this frontend\n", 1572 dev_dbg(fe->dvb->device,
1572 __func__); 1573 "%s: can't use a DVBv3 FE_SET_FRONTEND call on this frontend\n",
1574 __func__);
1573 return -EINVAL; 1575 return -EINVAL;
1574 } 1576 }
1575 1577
@@ -1586,8 +1588,9 @@ static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system)
1586 } 1588 }
1587 /* There's nothing compatible with the desired delivery system */ 1589 /* There's nothing compatible with the desired delivery system */
1588 if (delsys == SYS_UNDEFINED) { 1590 if (delsys == SYS_UNDEFINED) {
1589 dprintk("%s() Incompatible DVBv3 FE_SET_FRONTEND call for this frontend\n", 1591 dev_dbg(fe->dvb->device,
1590 __func__); 1592 "%s: Incompatible DVBv3 FE_SET_FRONTEND call for this frontend\n",
1593 __func__);
1591 return -EINVAL; 1594 return -EINVAL;
1592 } 1595 }
1593 } 1596 }
@@ -1603,8 +1606,9 @@ static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system)
1603 * the auto mode for most things, and will assume that the desired 1606 * the auto mode for most things, and will assume that the desired
1604 * delivery system is the last one at the ops.delsys[] array 1607 * delivery system is the last one at the ops.delsys[] array
1605 */ 1608 */
1606 dprintk("%s() Using delivery system %d emulated as if it were a %d\n", 1609 dev_dbg(fe->dvb->device,
1607 __func__, delsys, desired_system); 1610 "%s: Using delivery system %d emulated as if it were a %d\n",
1611 __func__, delsys, desired_system);
1608 1612
1609 /* 1613 /*
1610 * For now, handles ISDB-T calls. More code may be needed here for the 1614 * For now, handles ISDB-T calls. More code may be needed here for the
@@ -1612,8 +1616,10 @@ static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system)
1612 */ 1616 */
1613 if (type == DVBV3_OFDM) { 1617 if (type == DVBV3_OFDM) {
1614 if (c->delivery_system == SYS_ISDBT) { 1618 if (c->delivery_system == SYS_ISDBT) {
1615 dprintk("%s() Using defaults for SYS_ISDBT\n", 1619 dev_dbg(fe->dvb->device,
1616 __func__); 1620 "%s: Using defaults for SYS_ISDBT\n",
1621 __func__);
1622
1617 if (!c->bandwidth_hz) 1623 if (!c->bandwidth_hz)
1618 c->bandwidth_hz = 6000000; 1624 c->bandwidth_hz = 6000000;
1619 1625
@@ -1631,7 +1637,8 @@ static int set_delivery_system(struct dvb_frontend *fe, u32 desired_system)
1631 } 1637 }
1632 } 1638 }
1633 } 1639 }
1634 dprintk("change delivery system on cache to %d\n", c->delivery_system); 1640 dev_dbg(fe->dvb->device, "%s: change delivery system on cache to %d\n",
1641 __func__, c->delivery_system);
1635 1642
1636 return 0; 1643 return 0;
1637} 1644}
@@ -1664,7 +1671,8 @@ static int dtv_property_process_set(struct dvb_frontend *fe,
1664 * ioctl. 1671 * ioctl.
1665 */ 1672 */
1666 c->state = tvp->cmd; 1673 c->state = tvp->cmd;
1667 dprintk("%s() Finalised property cache\n", __func__); 1674 dev_dbg(fe->dvb->device, "%s: Finalised property cache\n",
1675 __func__);
1668 1676
1669 r = dtv_set_frontend(fe); 1677 r = dtv_set_frontend(fe);
1670 break; 1678 break;
@@ -1810,8 +1818,7 @@ static int dvb_frontend_ioctl(struct file *file,
1810 struct dvb_frontend_private *fepriv = fe->frontend_priv; 1818 struct dvb_frontend_private *fepriv = fe->frontend_priv;
1811 int err = -EOPNOTSUPP; 1819 int err = -EOPNOTSUPP;
1812 1820
1813 dprintk("%s (%d)\n", __func__, _IOC_NR(cmd)); 1821 dev_dbg(fe->dvb->device, "%s: (%d)\n", __func__, _IOC_NR(cmd));
1814
1815 if (fepriv->exit != DVB_FE_NO_EXIT) 1822 if (fepriv->exit != DVB_FE_NO_EXIT)
1816 return -ENODEV; 1823 return -ENODEV;
1817 1824
@@ -1847,13 +1854,13 @@ static int dvb_frontend_ioctl_properties(struct file *file,
1847 struct dtv_property *tvp = NULL; 1854 struct dtv_property *tvp = NULL;
1848 int i; 1855 int i;
1849 1856
1850 dprintk("%s\n", __func__); 1857 dev_dbg(fe->dvb->device, "%s:\n", __func__);
1851 1858
1852 if(cmd == FE_SET_PROPERTY) { 1859 if(cmd == FE_SET_PROPERTY) {
1853 tvps = (struct dtv_properties __user *)parg; 1860 tvps = (struct dtv_properties __user *)parg;
1854 1861
1855 dprintk("%s() properties.num = %d\n", __func__, tvps->num); 1862 dev_dbg(fe->dvb->device, "%s: properties.num = %d\n", __func__, tvps->num);
1856 dprintk("%s() properties.props = %p\n", __func__, tvps->props); 1863 dev_dbg(fe->dvb->device, "%s: properties.props = %p\n", __func__, tvps->props);
1857 1864
1858 /* Put an arbitrary limit on the number of messages that can 1865 /* Put an arbitrary limit on the number of messages that can
1859 * be sent at once */ 1866 * be sent at once */
@@ -1879,14 +1886,14 @@ static int dvb_frontend_ioctl_properties(struct file *file,
1879 } 1886 }
1880 1887
1881 if (c->state == DTV_TUNE) 1888 if (c->state == DTV_TUNE)
1882 dprintk("%s() Property cache is full, tuning\n", __func__); 1889 dev_dbg(fe->dvb->device, "%s: Property cache is full, tuning\n", __func__);
1883 1890
1884 } else 1891 } else
1885 if(cmd == FE_GET_PROPERTY) { 1892 if(cmd == FE_GET_PROPERTY) {
1886 tvps = (struct dtv_properties __user *)parg; 1893 tvps = (struct dtv_properties __user *)parg;
1887 1894
1888 dprintk("%s() properties.num = %d\n", __func__, tvps->num); 1895 dev_dbg(fe->dvb->device, "%s: properties.num = %d\n", __func__, tvps->num);
1889 dprintk("%s() properties.props = %p\n", __func__, tvps->props); 1896 dev_dbg(fe->dvb->device, "%s: properties.props = %p\n", __func__, tvps->props);
1890 1897
1891 /* Put an arbitrary limit on the number of messages that can 1898 /* Put an arbitrary limit on the number of messages that can
1892 * be sent at once */ 1899 * be sent at once */
@@ -2094,13 +2101,13 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
2094 info->type = FE_OFDM; 2101 info->type = FE_OFDM;
2095 break; 2102 break;
2096 default: 2103 default:
2097 printk(KERN_ERR 2104 dev_err(fe->dvb->device,
2098 "%s: doesn't know how to handle a DVBv3 call to delivery system %i\n", 2105 "%s: doesn't know how to handle a DVBv3 call to delivery system %i\n",
2099 __func__, c->delivery_system); 2106 __func__, c->delivery_system);
2100 fe->ops.info.type = FE_OFDM; 2107 fe->ops.info.type = FE_OFDM;
2101 } 2108 }
2102 dprintk("current delivery system on cache: %d, V3 type: %d\n", 2109 dev_dbg(fe->dvb->device, "%s: current delivery system on cache: %d, V3 type: %d\n",
2103 c->delivery_system, fe->ops.info.type); 2110 __func__, c->delivery_system, fe->ops.info.type);
2104 2111
2105 /* Force the CAN_INVERSION_AUTO bit on. If the frontend doesn't 2112 /* Force the CAN_INVERSION_AUTO bit on. If the frontend doesn't
2106 * do it, it is done for it. */ 2113 * do it, it is done for it. */
@@ -2294,7 +2301,7 @@ static unsigned int dvb_frontend_poll(struct file *file, struct poll_table_struc
2294 struct dvb_frontend *fe = dvbdev->priv; 2301 struct dvb_frontend *fe = dvbdev->priv;
2295 struct dvb_frontend_private *fepriv = fe->frontend_priv; 2302 struct dvb_frontend_private *fepriv = fe->frontend_priv;
2296 2303
2297 dprintk ("%s\n", __func__); 2304 dev_dbg_ratelimited(fe->dvb->device, "%s:\n", __func__);
2298 2305
2299 poll_wait (file, &fepriv->events.wait_queue, wait); 2306 poll_wait (file, &fepriv->events.wait_queue, wait);
2300 2307
@@ -2312,7 +2319,7 @@ static int dvb_frontend_open(struct inode *inode, struct file *file)
2312 struct dvb_adapter *adapter = fe->dvb; 2319 struct dvb_adapter *adapter = fe->dvb;
2313 int ret; 2320 int ret;
2314 2321
2315 dprintk ("%s\n", __func__); 2322 dev_dbg(fe->dvb->device, "%s:\n", __func__);
2316 if (fepriv->exit == DVB_FE_DEVICE_REMOVED) 2323 if (fepriv->exit == DVB_FE_DEVICE_REMOVED)
2317 return -ENODEV; 2324 return -ENODEV;
2318 2325
@@ -2407,7 +2414,7 @@ static int dvb_frontend_release(struct inode *inode, struct file *file)
2407 struct dvb_frontend_private *fepriv = fe->frontend_priv; 2414 struct dvb_frontend_private *fepriv = fe->frontend_priv;
2408 int ret; 2415 int ret;
2409 2416
2410 dprintk ("%s\n", __func__); 2417 dev_dbg(fe->dvb->device, "%s:\n", __func__);
2411 2418
2412 if ((file->f_flags & O_ACCMODE) != O_RDONLY) { 2419 if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
2413 fepriv->release_jiffies = jiffies; 2420 fepriv->release_jiffies = jiffies;
@@ -2489,7 +2496,7 @@ int dvb_register_frontend(struct dvb_adapter* dvb,
2489 .kernel_ioctl = dvb_frontend_ioctl 2496 .kernel_ioctl = dvb_frontend_ioctl
2490 }; 2497 };
2491 2498
2492 dprintk ("%s\n", __func__); 2499 dev_dbg(dvb->device, "%s:\n", __func__);
2493 2500
2494 if (mutex_lock_interruptible(&frontend_mutex)) 2501 if (mutex_lock_interruptible(&frontend_mutex))
2495 return -ERESTARTSYS; 2502 return -ERESTARTSYS;
@@ -2508,10 +2515,9 @@ int dvb_register_frontend(struct dvb_adapter* dvb,
2508 fe->dvb = dvb; 2515 fe->dvb = dvb;
2509 fepriv->inversion = INVERSION_OFF; 2516 fepriv->inversion = INVERSION_OFF;
2510 2517
2511 printk ("DVB: registering adapter %i frontend %i (%s)...\n", 2518 dev_info(fe->dvb->device,
2512 fe->dvb->num, 2519 "DVB: registering adapter %i frontend %i (%s)...\n",
2513 fe->id, 2520 fe->dvb->num, fe->id, fe->ops.info.name);
2514 fe->ops.info.name);
2515 2521
2516 dvb_register_device (fe->dvb, &fepriv->dvbdev, &dvbdev_template, 2522 dvb_register_device (fe->dvb, &fepriv->dvbdev, &dvbdev_template,
2517 fe, DVB_DEVICE_FRONTEND); 2523 fe, DVB_DEVICE_FRONTEND);
@@ -2532,7 +2538,7 @@ EXPORT_SYMBOL(dvb_register_frontend);
2532int dvb_unregister_frontend(struct dvb_frontend* fe) 2538int dvb_unregister_frontend(struct dvb_frontend* fe)
2533{ 2539{
2534 struct dvb_frontend_private *fepriv = fe->frontend_priv; 2540 struct dvb_frontend_private *fepriv = fe->frontend_priv;
2535 dprintk ("%s\n", __func__); 2541 dev_dbg(fe->dvb->device, "%s:\n", __func__);
2536 2542
2537 mutex_lock(&frontend_mutex); 2543 mutex_lock(&frontend_mutex);
2538 dvb_frontend_stop (fe); 2544 dvb_frontend_stop (fe);