aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-31 21:47:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-31 21:47:44 -0400
commit8762541f067d371320731510669e27f5cc40af38 (patch)
treefa2890094858614a947ba70612854acde9888940 /sound
parent6dbb35b0a74b44b2a48a5373d48074c5aa69fdf5 (diff)
parentadfe1560de1c696324554fba70c92f2d7c947ff7 (diff)
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull second set of media updates from Mauro Carvalho Chehab: - radio API: add support to work with radio frequency bands - new AM/FM radio drivers: radio-shark, radio-shark2 - new Remote Controller USB driver: iguanair - conversion of several drivers to the v4l2 core control framework - new board additions at existing drivers - the remaining (and vast majority of the patches) are due to drivers/DocBook fixes/cleanups. * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (154 commits) [media] radio-tea5777: use library for 64bits div [media] tlg2300: Declare MODULE_FIRMWARE usage [media] lgs8gxx: Declare MODULE_FIRMWARE usage [media] xc5000: Add MODULE_FIRMWARE statements [media] s2255drv: Add MODULE_FIRMWARE statement [media] dib8000: move dereference after check for NULL [media] Documentation: Update cardlists [media] bttv: add support for Aposonic W-DVR [media] cx25821: Remove bad strcpy to read-only char* [media] pms.c: remove duplicated include [media] smiapp-core.c: remove duplicated include [media] via-camera: pass correct format settings to sensor [media] rtl2832.c: minor cleanup [media] Add support for the IguanaWorks USB IR Transceiver [media] Minor cleanups for MCE USB [media] drivers/media/dvb/siano/smscoreapi.c: use list_for_each_entry [media] Use a named union in struct v4l2_ioctl_info [media] mceusb: Add Twisted Melon USB IDs [media] staging/media/solo6x10: use module_pci_driver macro [media] staging/media/dt3155v4l: use module_pci_driver macro ... Conflicts: Documentation/feature-removal-schedule.txt
Diffstat (limited to 'sound')
-rw-r--r--sound/i2c/other/tea575x-tuner.c41
1 files changed, 25 insertions, 16 deletions
diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c
index b29b88f93c9e..d14edb7d6484 100644
--- a/sound/i2c/other/tea575x-tuner.c
+++ b/sound/i2c/other/tea575x-tuner.c
@@ -71,6 +71,9 @@ static void snd_tea575x_write(struct snd_tea575x *tea, unsigned int val)
71 u16 l; 71 u16 l;
72 u8 data; 72 u8 data;
73 73
74 if (tea->ops->write_val)
75 return tea->ops->write_val(tea, val);
76
74 tea->ops->set_direction(tea, 1); 77 tea->ops->set_direction(tea, 1);
75 udelay(16); 78 udelay(16);
76 79
@@ -94,6 +97,9 @@ static u32 snd_tea575x_read(struct snd_tea575x *tea)
94 u16 l, rdata; 97 u16 l, rdata;
95 u32 data = 0; 98 u32 data = 0;
96 99
100 if (tea->ops->read_val)
101 return tea->ops->read_val(tea);
102
97 tea->ops->set_direction(tea, 0); 103 tea->ops->set_direction(tea, 0);
98 tea->ops->set_pins(tea, 0); 104 tea->ops->set_pins(tea, 0);
99 udelay(16); 105 udelay(16);
@@ -379,7 +385,6 @@ int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner)
379 strlcpy(tea->vd.name, tea->v4l2_dev->name, sizeof(tea->vd.name)); 385 strlcpy(tea->vd.name, tea->v4l2_dev->name, sizeof(tea->vd.name));
380 tea->vd.lock = &tea->mutex; 386 tea->vd.lock = &tea->mutex;
381 tea->vd.v4l2_dev = tea->v4l2_dev; 387 tea->vd.v4l2_dev = tea->v4l2_dev;
382 tea->vd.ctrl_handler = &tea->ctrl_handler;
383 tea->fops = tea575x_fops; 388 tea->fops = tea575x_fops;
384 tea->fops.owner = owner; 389 tea->fops.owner = owner;
385 tea->vd.fops = &tea->fops; 390 tea->vd.fops = &tea->fops;
@@ -388,29 +393,33 @@ int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner)
388 if (tea->cannot_read_data) 393 if (tea->cannot_read_data)
389 v4l2_disable_ioctl(&tea->vd, VIDIOC_S_HW_FREQ_SEEK); 394 v4l2_disable_ioctl(&tea->vd, VIDIOC_S_HW_FREQ_SEEK);
390 395
391 v4l2_ctrl_handler_init(&tea->ctrl_handler, 1); 396 if (!tea->cannot_mute) {
392 v4l2_ctrl_new_std(&tea->ctrl_handler, &tea575x_ctrl_ops, V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1); 397 tea->vd.ctrl_handler = &tea->ctrl_handler;
393 retval = tea->ctrl_handler.error; 398 v4l2_ctrl_handler_init(&tea->ctrl_handler, 1);
394 if (retval) { 399 v4l2_ctrl_new_std(&tea->ctrl_handler, &tea575x_ctrl_ops,
395 v4l2_err(tea->v4l2_dev, "can't initialize controls\n"); 400 V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1);
396 v4l2_ctrl_handler_free(&tea->ctrl_handler); 401 retval = tea->ctrl_handler.error;
397 return retval;
398 }
399
400 if (tea->ext_init) {
401 retval = tea->ext_init(tea);
402 if (retval) { 402 if (retval) {
403 v4l2_err(tea->v4l2_dev, "can't initialize controls\n");
403 v4l2_ctrl_handler_free(&tea->ctrl_handler); 404 v4l2_ctrl_handler_free(&tea->ctrl_handler);
404 return retval; 405 return retval;
405 } 406 }
406 }
407 407
408 v4l2_ctrl_handler_setup(&tea->ctrl_handler); 408 if (tea->ext_init) {
409 retval = tea->ext_init(tea);
410 if (retval) {
411 v4l2_ctrl_handler_free(&tea->ctrl_handler);
412 return retval;
413 }
414 }
415
416 v4l2_ctrl_handler_setup(&tea->ctrl_handler);
417 }
409 418
410 retval = video_register_device(&tea->vd, VFL_TYPE_RADIO, tea->radio_nr); 419 retval = video_register_device(&tea->vd, VFL_TYPE_RADIO, tea->radio_nr);
411 if (retval) { 420 if (retval) {
412 v4l2_err(tea->v4l2_dev, "can't register video device!\n"); 421 v4l2_err(tea->v4l2_dev, "can't register video device!\n");
413 v4l2_ctrl_handler_free(&tea->ctrl_handler); 422 v4l2_ctrl_handler_free(tea->vd.ctrl_handler);
414 return retval; 423 return retval;
415 } 424 }
416 425
@@ -420,7 +429,7 @@ int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner)
420void snd_tea575x_exit(struct snd_tea575x *tea) 429void snd_tea575x_exit(struct snd_tea575x *tea)
421{ 430{
422 video_unregister_device(&tea->vd); 431 video_unregister_device(&tea->vd);
423 v4l2_ctrl_handler_free(&tea->ctrl_handler); 432 v4l2_ctrl_handler_free(tea->vd.ctrl_handler);
424} 433}
425 434
426static int __init alsa_tea575x_module_init(void) 435static int __init alsa_tea575x_module_init(void)