aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/dsbr100.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-13 17:03:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-13 17:03:59 -0400
commitcf2fa66055d718ae13e62451bb546505f63906a2 (patch)
treee206d3f04e74a34e9aa88d21af6c26eea21d4121 /drivers/media/radio/dsbr100.c
parent4501a466f28788485604ee42641d7a5fe7258d16 (diff)
parent57f51dbc45f65f7ee1e8c8f77200bb8000e3e271 (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (313 commits) V4L/DVB (9186): Added support for Prof 7300 DVB-S/S2 cards V4L/DVB (9185): S2API: Ensure we have a reasonable ROLLOFF default V4L/DVB (9184): cx24116: Change the default SNR units back to percentage by default. V4L/DVB (9183): S2API: Return error of the caller provides 0 commands. V4L/DVB (9182): S2API: Added support for DTV_HIERARCHY V4L/DVB (9181): S2API: Add support fot DTV_GUARD_INTERVAL and DTV_TRANSMISSION_MODE V4L/DVB (9180): S2API: Added support for DTV_CODE_RATE_HP/LP V4L/DVB (9179): S2API: frontend.h cleanup V4L/DVB (9178): cx24116: Add module parameter to return SNR as ESNO. V4L/DVB (9177): S2API: Change _8PSK / _16APSK to PSK_8 and APSK_16 V4L/DVB (9176): Add support for DvbWorld USB cards with STV0288 demodulator. V4L/DVB (9175): Remove NULL pointer in stb6000 driver. V4L/DVB (9174): Allow custom inittab for ST STV0288 demodulator. V4L/DVB (9173): S2API: Remove the hardcoded command limit during validation V4L/DVB (9172): S2API: Bugfix related to DVB-S / DVB-S2 tuning for the legacy API. V4L/DVB (9171): S2API: Stop an OOPS if illegal commands are dumped in S2API. V4L/DVB (9170): cx24116: Sanity checking to data input via S2API to the cx24116 demod. V4L/DVB (9169): uvcvideo: Support two new Bison Electronics webcams. V4L/DVB (9168): Add support for MSI TV@nywhere Plus remote V4L/DVB: v4l2-dev: remove duplicated #include ...
Diffstat (limited to 'drivers/media/radio/dsbr100.c')
-rw-r--r--drivers/media/radio/dsbr100.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c
index 70c65a745923..66783fffe4c1 100644
--- a/drivers/media/radio/dsbr100.c
+++ b/drivers/media/radio/dsbr100.c
@@ -274,7 +274,7 @@ static int vidioc_querycap(struct file *file, void *priv,
274static int vidioc_g_tuner(struct file *file, void *priv, 274static int vidioc_g_tuner(struct file *file, void *priv,
275 struct v4l2_tuner *v) 275 struct v4l2_tuner *v)
276{ 276{
277 struct dsbr100_device *radio = video_get_drvdata(video_devdata(file)); 277 struct dsbr100_device *radio = video_drvdata(file);
278 278
279 if (v->index > 0) 279 if (v->index > 0)
280 return -EINVAL; 280 return -EINVAL;
@@ -306,7 +306,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
306static int vidioc_s_frequency(struct file *file, void *priv, 306static int vidioc_s_frequency(struct file *file, void *priv,
307 struct v4l2_frequency *f) 307 struct v4l2_frequency *f)
308{ 308{
309 struct dsbr100_device *radio = video_get_drvdata(video_devdata(file)); 309 struct dsbr100_device *radio = video_drvdata(file);
310 310
311 radio->curfreq = f->frequency; 311 radio->curfreq = f->frequency;
312 if (dsbr100_setfreq(radio, radio->curfreq)==-1) 312 if (dsbr100_setfreq(radio, radio->curfreq)==-1)
@@ -317,7 +317,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
317static int vidioc_g_frequency(struct file *file, void *priv, 317static int vidioc_g_frequency(struct file *file, void *priv,
318 struct v4l2_frequency *f) 318 struct v4l2_frequency *f)
319{ 319{
320 struct dsbr100_device *radio = video_get_drvdata(video_devdata(file)); 320 struct dsbr100_device *radio = video_drvdata(file);
321 321
322 f->type = V4L2_TUNER_RADIO; 322 f->type = V4L2_TUNER_RADIO;
323 f->frequency = radio->curfreq; 323 f->frequency = radio->curfreq;
@@ -342,7 +342,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
342static int vidioc_g_ctrl(struct file *file, void *priv, 342static int vidioc_g_ctrl(struct file *file, void *priv,
343 struct v4l2_control *ctrl) 343 struct v4l2_control *ctrl)
344{ 344{
345 struct dsbr100_device *radio = video_get_drvdata(video_devdata(file)); 345 struct dsbr100_device *radio = video_drvdata(file);
346 346
347 switch (ctrl->id) { 347 switch (ctrl->id) {
348 case V4L2_CID_AUDIO_MUTE: 348 case V4L2_CID_AUDIO_MUTE:
@@ -355,16 +355,20 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
355static int vidioc_s_ctrl(struct file *file, void *priv, 355static int vidioc_s_ctrl(struct file *file, void *priv,
356 struct v4l2_control *ctrl) 356 struct v4l2_control *ctrl)
357{ 357{
358 struct dsbr100_device *radio = video_get_drvdata(video_devdata(file)); 358 struct dsbr100_device *radio = video_drvdata(file);
359 359
360 switch (ctrl->id) { 360 switch (ctrl->id) {
361 case V4L2_CID_AUDIO_MUTE: 361 case V4L2_CID_AUDIO_MUTE:
362 if (ctrl->value) { 362 if (ctrl->value) {
363 if (dsbr100_stop(radio)==-1) 363 if (dsbr100_stop(radio) == -1) {
364 warn("Radio did not respond properly"); 364 warn("Radio did not respond properly");
365 return -EBUSY;
366 }
365 } else { 367 } else {
366 if (dsbr100_start(radio)==-1) 368 if (dsbr100_start(radio) == -1) {
367 warn("Radio did not respond properly"); 369 warn("Radio did not respond properly");
370 return -EBUSY;
371 }
368 } 372 }
369 return 0; 373 return 0;
370 } 374 }
@@ -405,23 +409,26 @@ static int vidioc_s_audio(struct file *file, void *priv,
405 409
406static int usb_dsbr100_open(struct inode *inode, struct file *file) 410static int usb_dsbr100_open(struct inode *inode, struct file *file)
407{ 411{
408 struct dsbr100_device *radio=video_get_drvdata(video_devdata(file)); 412 struct dsbr100_device *radio = video_drvdata(file);
409 413
414 lock_kernel();
410 radio->users = 1; 415 radio->users = 1;
411 radio->muted = 1; 416 radio->muted = 1;
412 417
413 if (dsbr100_start(radio)<0) { 418 if (dsbr100_start(radio)<0) {
414 warn("Radio did not start up properly"); 419 warn("Radio did not start up properly");
415 radio->users = 0; 420 radio->users = 0;
421 unlock_kernel();
416 return -EIO; 422 return -EIO;
417 } 423 }
418 dsbr100_setfreq(radio, radio->curfreq); 424 dsbr100_setfreq(radio, radio->curfreq);
425 unlock_kernel();
419 return 0; 426 return 0;
420} 427}
421 428
422static int usb_dsbr100_close(struct inode *inode, struct file *file) 429static int usb_dsbr100_close(struct inode *inode, struct file *file)
423{ 430{
424 struct dsbr100_device *radio=video_get_drvdata(video_devdata(file)); 431 struct dsbr100_device *radio = video_drvdata(file);
425 432
426 if (!radio) 433 if (!radio)
427 return -ENODEV; 434 return -ENODEV;
@@ -507,7 +514,8 @@ static int usb_dsbr100_probe(struct usb_interface *intf,
507static int __init dsbr100_init(void) 514static int __init dsbr100_init(void)
508{ 515{
509 int retval = usb_register(&usb_dsbr100_driver); 516 int retval = usb_register(&usb_dsbr100_driver);
510 info(DRIVER_VERSION ":" DRIVER_DESC); 517 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
518 DRIVER_DESC "\n");
511 return retval; 519 return retval;
512} 520}
513 521