diff options
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-dvb.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-dvb.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-dvb.c b/drivers/media/video/pvrusb2/pvrusb2-dvb.c index 6504c97e0bbc..6ec4bf81fc7f 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-dvb.c +++ b/drivers/media/video/pvrusb2/pvrusb2-dvb.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/kthread.h> | 21 | #include <linux/kthread.h> |
22 | #include <linux/freezer.h> | 22 | #include <linux/freezer.h> |
23 | #include "dvbdev.h" | 23 | #include "dvbdev.h" |
24 | #include "pvrusb2-debug.h" | ||
24 | #include "pvrusb2-hdw-internal.h" | 25 | #include "pvrusb2-hdw-internal.h" |
25 | #include "pvrusb2-hdw.h" | 26 | #include "pvrusb2-hdw.h" |
26 | #include "pvrusb2-io.h" | 27 | #include "pvrusb2-io.h" |
@@ -35,7 +36,7 @@ static int pvr2_dvb_feed_func(struct pvr2_dvb_adapter *adap) | |||
35 | struct pvr2_buffer *bp; | 36 | struct pvr2_buffer *bp; |
36 | struct pvr2_stream *stream; | 37 | struct pvr2_stream *stream; |
37 | 38 | ||
38 | printk(KERN_DEBUG "dvb thread started\n"); | 39 | pvr2_trace(PVR2_TRACE_DVB_FEED, "dvb feed thread started"); |
39 | set_freezable(); | 40 | set_freezable(); |
40 | 41 | ||
41 | stream = adap->channel.stream->stream; | 42 | stream = adap->channel.stream->stream; |
@@ -82,7 +83,7 @@ static int pvr2_dvb_feed_func(struct pvr2_dvb_adapter *adap) | |||
82 | /* If we get here and ret is < 0, then an error has occurred. | 83 | /* If we get here and ret is < 0, then an error has occurred. |
83 | Probably would be a good idea to communicate that to DVB core... */ | 84 | Probably would be a good idea to communicate that to DVB core... */ |
84 | 85 | ||
85 | printk(KERN_DEBUG "dvb thread stopped\n"); | 86 | pvr2_trace(PVR2_TRACE_DVB_FEED, "dvb feed thread stopped"); |
86 | 87 | ||
87 | return 0; | 88 | return 0; |
88 | } | 89 | } |
@@ -210,7 +211,8 @@ static int pvr2_dvb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) | |||
210 | do { | 211 | do { |
211 | if (onoff) { | 212 | if (onoff) { |
212 | if (!adap->feedcount) { | 213 | if (!adap->feedcount) { |
213 | printk(KERN_DEBUG "start feeding\n"); | 214 | pvr2_trace(PVR2_TRACE_DVB_FEED, |
215 | "start feeding demux"); | ||
214 | ret = pvr2_dvb_stream_start(adap); | 216 | ret = pvr2_dvb_stream_start(adap); |
215 | if (ret < 0) break; | 217 | if (ret < 0) break; |
216 | } | 218 | } |
@@ -218,7 +220,8 @@ static int pvr2_dvb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) | |||
218 | } else if (adap->feedcount > 0) { | 220 | } else if (adap->feedcount > 0) { |
219 | (adap->feedcount)--; | 221 | (adap->feedcount)--; |
220 | if (!adap->feedcount) { | 222 | if (!adap->feedcount) { |
221 | printk(KERN_DEBUG "stop feeding\n"); | 223 | pvr2_trace(PVR2_TRACE_DVB_FEED, |
224 | "stop feeding demux"); | ||
222 | pvr2_dvb_stream_end(adap); | 225 | pvr2_dvb_stream_end(adap); |
223 | } | 226 | } |
224 | } | 227 | } |
@@ -230,15 +233,13 @@ static int pvr2_dvb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) | |||
230 | 233 | ||
231 | static int pvr2_dvb_start_feed(struct dvb_demux_feed *dvbdmxfeed) | 234 | static int pvr2_dvb_start_feed(struct dvb_demux_feed *dvbdmxfeed) |
232 | { | 235 | { |
233 | printk(KERN_DEBUG "start pid: 0x%04x, feedtype: %d\n", | 236 | pvr2_trace(PVR2_TRACE_DVB_FEED, "start pid: 0x%04x", dvbdmxfeed->pid); |
234 | dvbdmxfeed->pid, dvbdmxfeed->type); | ||
235 | return pvr2_dvb_ctrl_feed(dvbdmxfeed, 1); | 237 | return pvr2_dvb_ctrl_feed(dvbdmxfeed, 1); |
236 | } | 238 | } |
237 | 239 | ||
238 | static int pvr2_dvb_stop_feed(struct dvb_demux_feed *dvbdmxfeed) | 240 | static int pvr2_dvb_stop_feed(struct dvb_demux_feed *dvbdmxfeed) |
239 | { | 241 | { |
240 | printk(KERN_DEBUG "stop pid: 0x%04x, feedtype: %d\n", | 242 | pvr2_trace(PVR2_TRACE_DVB_FEED, "stop pid: 0x%04x", dvbdmxfeed->pid); |
241 | dvbdmxfeed->pid, dvbdmxfeed->type); | ||
242 | return pvr2_dvb_ctrl_feed(dvbdmxfeed, 0); | 243 | return pvr2_dvb_ctrl_feed(dvbdmxfeed, 0); |
243 | } | 244 | } |
244 | 245 | ||
@@ -259,7 +260,8 @@ static int pvr2_dvb_adapter_init(struct pvr2_dvb_adapter *adap) | |||
259 | &adap->channel.hdw->usb_dev->dev, | 260 | &adap->channel.hdw->usb_dev->dev, |
260 | adapter_nr); | 261 | adapter_nr); |
261 | if (ret < 0) { | 262 | if (ret < 0) { |
262 | err("dvb_register_adapter failed: error %d", ret); | 263 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, |
264 | "dvb_register_adapter failed: error %d", ret); | ||
263 | goto err; | 265 | goto err; |
264 | } | 266 | } |
265 | adap->dvb_adap.priv = adap; | 267 | adap->dvb_adap.priv = adap; |
@@ -276,7 +278,8 @@ static int pvr2_dvb_adapter_init(struct pvr2_dvb_adapter *adap) | |||
276 | 278 | ||
277 | ret = dvb_dmx_init(&adap->demux); | 279 | ret = dvb_dmx_init(&adap->demux); |
278 | if (ret < 0) { | 280 | if (ret < 0) { |
279 | err("dvb_dmx_init failed: error %d", ret); | 281 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, |
282 | "dvb_dmx_init failed: error %d", ret); | ||
280 | goto err_dmx; | 283 | goto err_dmx; |
281 | } | 284 | } |
282 | 285 | ||
@@ -286,7 +289,8 @@ static int pvr2_dvb_adapter_init(struct pvr2_dvb_adapter *adap) | |||
286 | 289 | ||
287 | ret = dvb_dmxdev_init(&adap->dmxdev, &adap->dvb_adap); | 290 | ret = dvb_dmxdev_init(&adap->dmxdev, &adap->dvb_adap); |
288 | if (ret < 0) { | 291 | if (ret < 0) { |
289 | err("dvb_dmxdev_init failed: error %d", ret); | 292 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, |
293 | "dvb_dmxdev_init failed: error %d", ret); | ||
290 | goto err_dmx_dev; | 294 | goto err_dmx_dev; |
291 | } | 295 | } |
292 | 296 | ||
@@ -304,7 +308,7 @@ err: | |||
304 | 308 | ||
305 | static int pvr2_dvb_adapter_exit(struct pvr2_dvb_adapter *adap) | 309 | static int pvr2_dvb_adapter_exit(struct pvr2_dvb_adapter *adap) |
306 | { | 310 | { |
307 | printk(KERN_DEBUG "unregistering DVB devices\n"); | 311 | pvr2_trace(PVR2_TRACE_INFO, "unregistering DVB devices"); |
308 | dvb_net_release(&adap->dvb_net); | 312 | dvb_net_release(&adap->dvb_net); |
309 | adap->demux.dmx.close(&adap->demux.dmx); | 313 | adap->demux.dmx.close(&adap->demux.dmx); |
310 | dvb_dmxdev_release(&adap->dmxdev); | 314 | dvb_dmxdev_release(&adap->dmxdev); |
@@ -320,7 +324,7 @@ static int pvr2_dvb_frontend_init(struct pvr2_dvb_adapter *adap) | |||
320 | int ret = 0; | 324 | int ret = 0; |
321 | 325 | ||
322 | if (dvb_props == NULL) { | 326 | if (dvb_props == NULL) { |
323 | err("fe_props not defined!"); | 327 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, "fe_props not defined!"); |
324 | return -EINVAL; | 328 | return -EINVAL; |
325 | } | 329 | } |
326 | 330 | ||
@@ -328,13 +332,15 @@ static int pvr2_dvb_frontend_init(struct pvr2_dvb_adapter *adap) | |||
328 | &adap->channel, | 332 | &adap->channel, |
329 | (1 << PVR2_CVAL_INPUT_DTV)); | 333 | (1 << PVR2_CVAL_INPUT_DTV)); |
330 | if (ret) { | 334 | if (ret) { |
331 | err("failed to grab control of dtv input (code=%d)", | 335 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, |
336 | "failed to grab control of dtv input (code=%d)", | ||
332 | ret); | 337 | ret); |
333 | return ret; | 338 | return ret; |
334 | } | 339 | } |
335 | 340 | ||
336 | if (dvb_props->frontend_attach == NULL) { | 341 | if (dvb_props->frontend_attach == NULL) { |
337 | err("frontend_attach not defined!"); | 342 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, |
343 | "frontend_attach not defined!"); | ||
338 | ret = -EINVAL; | 344 | ret = -EINVAL; |
339 | goto done; | 345 | goto done; |
340 | } | 346 | } |
@@ -342,7 +348,8 @@ static int pvr2_dvb_frontend_init(struct pvr2_dvb_adapter *adap) | |||
342 | if ((dvb_props->frontend_attach(adap) == 0) && (adap->fe)) { | 348 | if ((dvb_props->frontend_attach(adap) == 0) && (adap->fe)) { |
343 | 349 | ||
344 | if (dvb_register_frontend(&adap->dvb_adap, adap->fe)) { | 350 | if (dvb_register_frontend(&adap->dvb_adap, adap->fe)) { |
345 | err("frontend registration failed!"); | 351 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, |
352 | "frontend registration failed!"); | ||
346 | dvb_frontend_detach(adap->fe); | 353 | dvb_frontend_detach(adap->fe); |
347 | adap->fe = NULL; | 354 | adap->fe = NULL; |
348 | ret = -ENODEV; | 355 | ret = -ENODEV; |
@@ -359,7 +366,8 @@ static int pvr2_dvb_frontend_init(struct pvr2_dvb_adapter *adap) | |||
359 | adap->fe->ops.ts_bus_ctrl = pvr2_dvb_bus_ctrl; | 366 | adap->fe->ops.ts_bus_ctrl = pvr2_dvb_bus_ctrl; |
360 | 367 | ||
361 | } else { | 368 | } else { |
362 | err("no frontend was attached!"); | 369 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, |
370 | "no frontend was attached!"); | ||
363 | ret = -ENODEV; | 371 | ret = -ENODEV; |
364 | return ret; | 372 | return ret; |
365 | } | 373 | } |