diff options
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-alsa.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-alsa.c | 65 |
1 files changed, 36 insertions, 29 deletions
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c index 64e2c108df34..aca84d2f9825 100644 --- a/drivers/media/video/saa7134/saa7134-alsa.c +++ b/drivers/media/video/saa7134/saa7134-alsa.c | |||
@@ -71,7 +71,7 @@ MODULE_PARM_DESC(enable, "Enable (or not) the SAA7134 capture interface(s)."); | |||
71 | */ | 71 | */ |
72 | 72 | ||
73 | typedef struct snd_card_saa7134 { | 73 | typedef struct snd_card_saa7134 { |
74 | snd_card_t *card; | 74 | struct snd_card *card; |
75 | spinlock_t mixer_lock; | 75 | spinlock_t mixer_lock; |
76 | int mixer_volume[MIXER_ADDR_LAST+1][2]; | 76 | int mixer_volume[MIXER_ADDR_LAST+1][2]; |
77 | int capture_source[MIXER_ADDR_LAST+1][2]; | 77 | int capture_source[MIXER_ADDR_LAST+1][2]; |
@@ -95,10 +95,10 @@ typedef struct snd_card_saa7134_pcm { | |||
95 | 95 | ||
96 | spinlock_t lock; | 96 | spinlock_t lock; |
97 | 97 | ||
98 | snd_pcm_substream_t *substream; | 98 | struct snd_pcm_substream *substream; |
99 | } snd_card_saa7134_pcm_t; | 99 | } snd_card_saa7134_pcm_t; |
100 | 100 | ||
101 | static snd_card_t *snd_saa7134_cards[SNDRV_CARDS]; | 101 | static struct snd_card *snd_saa7134_cards[SNDRV_CARDS]; |
102 | 102 | ||
103 | 103 | ||
104 | /* | 104 | /* |
@@ -251,10 +251,10 @@ out: | |||
251 | * | 251 | * |
252 | */ | 252 | */ |
253 | 253 | ||
254 | static int snd_card_saa7134_capture_trigger(snd_pcm_substream_t * substream, | 254 | static int snd_card_saa7134_capture_trigger(struct snd_pcm_substream * substream, |
255 | int cmd) | 255 | int cmd) |
256 | { | 256 | { |
257 | snd_pcm_runtime_t *runtime = substream->runtime; | 257 | struct snd_pcm_runtime *runtime = substream->runtime; |
258 | snd_card_saa7134_pcm_t *pcm = runtime->private_data; | 258 | snd_card_saa7134_pcm_t *pcm = runtime->private_data; |
259 | struct saa7134_dev *dev=pcm->dev; | 259 | struct saa7134_dev *dev=pcm->dev; |
260 | int err = 0; | 260 | int err = 0; |
@@ -332,9 +332,9 @@ static int dsp_buffer_free(struct saa7134_dev *dev) | |||
332 | * | 332 | * |
333 | */ | 333 | */ |
334 | 334 | ||
335 | static int snd_card_saa7134_capture_prepare(snd_pcm_substream_t * substream) | 335 | static int snd_card_saa7134_capture_prepare(struct snd_pcm_substream * substream) |
336 | { | 336 | { |
337 | snd_pcm_runtime_t *runtime = substream->runtime; | 337 | struct snd_pcm_runtime *runtime = substream->runtime; |
338 | int bswap, sign; | 338 | int bswap, sign; |
339 | u32 fmt, control; | 339 | u32 fmt, control; |
340 | snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); | 340 | snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); |
@@ -421,9 +421,10 @@ static int snd_card_saa7134_capture_prepare(snd_pcm_substream_t * substream) | |||
421 | * | 421 | * |
422 | */ | 422 | */ |
423 | 423 | ||
424 | static snd_pcm_uframes_t snd_card_saa7134_capture_pointer(snd_pcm_substream_t * substream) | 424 | static snd_pcm_uframes_t |
425 | snd_card_saa7134_capture_pointer(struct snd_pcm_substream * substream) | ||
425 | { | 426 | { |
426 | snd_pcm_runtime_t *runtime = substream->runtime; | 427 | struct snd_pcm_runtime *runtime = substream->runtime; |
427 | snd_card_saa7134_pcm_t *pcm = runtime->private_data; | 428 | snd_card_saa7134_pcm_t *pcm = runtime->private_data; |
428 | struct saa7134_dev *dev=pcm->dev; | 429 | struct saa7134_dev *dev=pcm->dev; |
429 | 430 | ||
@@ -441,7 +442,7 @@ static snd_pcm_uframes_t snd_card_saa7134_capture_pointer(snd_pcm_substream_t * | |||
441 | * ALSA hardware capabilities definition | 442 | * ALSA hardware capabilities definition |
442 | */ | 443 | */ |
443 | 444 | ||
444 | static snd_pcm_hardware_t snd_card_saa7134_capture = | 445 | static struct snd_pcm_hardware snd_card_saa7134_capture = |
445 | { | 446 | { |
446 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | | 447 | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | |
447 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | 448 | SNDRV_PCM_INFO_BLOCK_TRANSFER | |
@@ -464,7 +465,7 @@ static snd_pcm_hardware_t snd_card_saa7134_capture = | |||
464 | .periods_max = 1024, | 465 | .periods_max = 1024, |
465 | }; | 466 | }; |
466 | 467 | ||
467 | static void snd_card_saa7134_runtime_free(snd_pcm_runtime_t *runtime) | 468 | static void snd_card_saa7134_runtime_free(struct snd_pcm_runtime *runtime) |
468 | { | 469 | { |
469 | snd_card_saa7134_pcm_t *pcm = runtime->private_data; | 470 | snd_card_saa7134_pcm_t *pcm = runtime->private_data; |
470 | 471 | ||
@@ -481,8 +482,8 @@ static void snd_card_saa7134_runtime_free(snd_pcm_runtime_t *runtime) | |||
481 | * | 482 | * |
482 | */ | 483 | */ |
483 | 484 | ||
484 | static int snd_card_saa7134_hw_params(snd_pcm_substream_t * substream, | 485 | static int snd_card_saa7134_hw_params(struct snd_pcm_substream * substream, |
485 | snd_pcm_hw_params_t * hw_params) | 486 | struct snd_pcm_hw_params * hw_params) |
486 | { | 487 | { |
487 | snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); | 488 | snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); |
488 | struct saa7134_dev *dev; | 489 | struct saa7134_dev *dev; |
@@ -561,7 +562,7 @@ static int snd_card_saa7134_hw_params(snd_pcm_substream_t * substream, | |||
561 | * | 562 | * |
562 | */ | 563 | */ |
563 | 564 | ||
564 | static int snd_card_saa7134_hw_free(snd_pcm_substream_t * substream) | 565 | static int snd_card_saa7134_hw_free(struct snd_pcm_substream * substream) |
565 | { | 566 | { |
566 | snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); | 567 | snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); |
567 | struct saa7134_dev *dev; | 568 | struct saa7134_dev *dev; |
@@ -587,7 +588,7 @@ static int snd_card_saa7134_hw_free(snd_pcm_substream_t * substream) | |||
587 | * | 588 | * |
588 | */ | 589 | */ |
589 | 590 | ||
590 | static int snd_card_saa7134_capture_close(snd_pcm_substream_t * substream) | 591 | static int snd_card_saa7134_capture_close(struct snd_pcm_substream * substream) |
591 | { | 592 | { |
592 | return 0; | 593 | return 0; |
593 | } | 594 | } |
@@ -602,9 +603,9 @@ static int snd_card_saa7134_capture_close(snd_pcm_substream_t * substream) | |||
602 | * | 603 | * |
603 | */ | 604 | */ |
604 | 605 | ||
605 | static int snd_card_saa7134_capture_open(snd_pcm_substream_t * substream) | 606 | static int snd_card_saa7134_capture_open(struct snd_pcm_substream * substream) |
606 | { | 607 | { |
607 | snd_pcm_runtime_t *runtime = substream->runtime; | 608 | struct snd_pcm_runtime *runtime = substream->runtime; |
608 | snd_card_saa7134_pcm_t *pcm; | 609 | snd_card_saa7134_pcm_t *pcm; |
609 | snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); | 610 | snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); |
610 | struct saa7134_dev *dev = saa7134->dev; | 611 | struct saa7134_dev *dev = saa7134->dev; |
@@ -640,7 +641,7 @@ static int snd_card_saa7134_capture_open(snd_pcm_substream_t * substream) | |||
640 | * ALSA capture callbacks definition | 641 | * ALSA capture callbacks definition |
641 | */ | 642 | */ |
642 | 643 | ||
643 | static snd_pcm_ops_t snd_card_saa7134_capture_ops = { | 644 | static struct snd_pcm_ops snd_card_saa7134_capture_ops = { |
644 | .open = snd_card_saa7134_capture_open, | 645 | .open = snd_card_saa7134_capture_open, |
645 | .close = snd_card_saa7134_capture_close, | 646 | .close = snd_card_saa7134_capture_close, |
646 | .ioctl = snd_pcm_lib_ioctl, | 647 | .ioctl = snd_pcm_lib_ioctl, |
@@ -661,7 +662,7 @@ static snd_pcm_ops_t snd_card_saa7134_capture_ops = { | |||
661 | 662 | ||
662 | static int snd_card_saa7134_pcm(snd_card_saa7134_t *saa7134, int device) | 663 | static int snd_card_saa7134_pcm(snd_card_saa7134_t *saa7134, int device) |
663 | { | 664 | { |
664 | snd_pcm_t *pcm; | 665 | struct snd_pcm *pcm; |
665 | int err; | 666 | int err; |
666 | 667 | ||
667 | if ((err = snd_pcm_new(saa7134->card, "SAA7134 PCM", device, 0, 1, &pcm)) < 0) | 668 | if ((err = snd_pcm_new(saa7134->card, "SAA7134 PCM", device, 0, 1, &pcm)) < 0) |
@@ -679,7 +680,8 @@ static int snd_card_saa7134_pcm(snd_card_saa7134_t *saa7134, int device) | |||
679 | .get = snd_saa7134_volume_get, .put = snd_saa7134_volume_put, \ | 680 | .get = snd_saa7134_volume_get, .put = snd_saa7134_volume_put, \ |
680 | .private_value = addr } | 681 | .private_value = addr } |
681 | 682 | ||
682 | static int snd_saa7134_volume_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo) | 683 | static int snd_saa7134_volume_info(struct snd_kcontrol * kcontrol, |
684 | struct snd_ctl_elem_info * uinfo) | ||
683 | { | 685 | { |
684 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 686 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
685 | uinfo->count = 2; | 687 | uinfo->count = 2; |
@@ -688,7 +690,8 @@ static int snd_saa7134_volume_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_ | |||
688 | return 0; | 690 | return 0; |
689 | } | 691 | } |
690 | 692 | ||
691 | static int snd_saa7134_volume_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 693 | static int snd_saa7134_volume_get(struct snd_kcontrol * kcontrol, |
694 | struct snd_ctl_elem_value * ucontrol) | ||
692 | { | 695 | { |
693 | snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol); | 696 | snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol); |
694 | int addr = kcontrol->private_value; | 697 | int addr = kcontrol->private_value; |
@@ -698,7 +701,8 @@ static int snd_saa7134_volume_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ | |||
698 | return 0; | 701 | return 0; |
699 | } | 702 | } |
700 | 703 | ||
701 | static int snd_saa7134_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 704 | static int snd_saa7134_volume_put(struct snd_kcontrol * kcontrol, |
705 | struct snd_ctl_elem_value * ucontrol) | ||
702 | { | 706 | { |
703 | snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol); | 707 | snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol); |
704 | int change, addr = kcontrol->private_value; | 708 | int change, addr = kcontrol->private_value; |
@@ -729,7 +733,8 @@ static int snd_saa7134_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ | |||
729 | .get = snd_saa7134_capsrc_get, .put = snd_saa7134_capsrc_put, \ | 733 | .get = snd_saa7134_capsrc_get, .put = snd_saa7134_capsrc_put, \ |
730 | .private_value = addr } | 734 | .private_value = addr } |
731 | 735 | ||
732 | static int snd_saa7134_capsrc_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo) | 736 | static int snd_saa7134_capsrc_info(struct snd_kcontrol * kcontrol, |
737 | struct snd_ctl_elem_info * uinfo) | ||
733 | { | 738 | { |
734 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 739 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
735 | uinfo->count = 2; | 740 | uinfo->count = 2; |
@@ -738,7 +743,8 @@ static int snd_saa7134_capsrc_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_ | |||
738 | return 0; | 743 | return 0; |
739 | } | 744 | } |
740 | 745 | ||
741 | static int snd_saa7134_capsrc_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 746 | static int snd_saa7134_capsrc_get(struct snd_kcontrol * kcontrol, |
747 | struct snd_ctl_elem_value * ucontrol) | ||
742 | { | 748 | { |
743 | snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol); | 749 | snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol); |
744 | int addr = kcontrol->private_value; | 750 | int addr = kcontrol->private_value; |
@@ -751,7 +757,8 @@ static int snd_saa7134_capsrc_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ | |||
751 | return 0; | 757 | return 0; |
752 | } | 758 | } |
753 | 759 | ||
754 | static int snd_saa7134_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) | 760 | static int snd_saa7134_capsrc_put(struct snd_kcontrol * kcontrol, |
761 | struct snd_ctl_elem_value * ucontrol) | ||
755 | { | 762 | { |
756 | snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol); | 763 | snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol); |
757 | int change, addr = kcontrol->private_value; | 764 | int change, addr = kcontrol->private_value; |
@@ -828,7 +835,7 @@ static int snd_saa7134_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_ | |||
828 | return change; | 835 | return change; |
829 | } | 836 | } |
830 | 837 | ||
831 | static snd_kcontrol_new_t snd_saa7134_controls[] = { | 838 | static struct snd_kcontrol_new snd_saa7134_controls[] = { |
832 | SAA713x_VOLUME("Video Volume", 0, MIXER_ADDR_TVTUNER), | 839 | SAA713x_VOLUME("Video Volume", 0, MIXER_ADDR_TVTUNER), |
833 | SAA713x_CAPSRC("Video Capture Switch", 0, MIXER_ADDR_TVTUNER), | 840 | SAA713x_CAPSRC("Video Capture Switch", 0, MIXER_ADDR_TVTUNER), |
834 | SAA713x_VOLUME("Line Volume", 1, MIXER_ADDR_LINE1), | 841 | SAA713x_VOLUME("Line Volume", 1, MIXER_ADDR_LINE1), |
@@ -847,7 +854,7 @@ SAA713x_CAPSRC("Line Capture Switch", 2, MIXER_ADDR_LINE2), | |||
847 | 854 | ||
848 | static int snd_card_saa7134_new_mixer(snd_card_saa7134_t * chip) | 855 | static int snd_card_saa7134_new_mixer(snd_card_saa7134_t * chip) |
849 | { | 856 | { |
850 | snd_card_t *card = chip->card; | 857 | struct snd_card *card = chip->card; |
851 | unsigned int idx; | 858 | unsigned int idx; |
852 | int err; | 859 | int err; |
853 | 860 | ||
@@ -861,7 +868,7 @@ static int snd_card_saa7134_new_mixer(snd_card_saa7134_t * chip) | |||
861 | return 0; | 868 | return 0; |
862 | } | 869 | } |
863 | 870 | ||
864 | static void snd_saa7134_free(snd_card_t * card) | 871 | static void snd_saa7134_free(struct snd_card * card) |
865 | { | 872 | { |
866 | snd_card_saa7134_t *chip = card->private_data; | 873 | snd_card_saa7134_t *chip = card->private_data; |
867 | 874 | ||
@@ -888,7 +895,7 @@ static void snd_saa7134_free(snd_card_t * card) | |||
888 | static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum) | 895 | static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum) |
889 | { | 896 | { |
890 | 897 | ||
891 | snd_card_t *card; | 898 | struct snd_card *card; |
892 | snd_card_saa7134_t *chip; | 899 | snd_card_saa7134_t *chip; |
893 | int err; | 900 | int err; |
894 | 901 | ||