aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-alsa.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-01-13 12:48:06 -0500
committerJaroslav Kysela <perex@suse.cz>2006-03-22 04:23:39 -0500
commitf7cbb7fcd3bae5264a079e06411b35366da9bd4d (patch)
treecc6c46c6e68f2c13da665ad30c9e1dd370dcb7cf /drivers/media/video/saa7134/saa7134-alsa.c
parent97c67b65cbdfd19887450ae1b80ddbb54de9559d (diff)
[ALSA] Fix snd_xxx_t typedefs
Modules: PXA Mainstone driver,CX88 driver,SAA7134 driver Replace snd_xxx_t typedefs with explicit structs. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-alsa.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-alsa.c65
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 7df5e0826e12..e02e6ee31b78 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
73typedef struct snd_card_saa7134 { 73typedef 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
101static snd_card_t *snd_saa7134_cards[SNDRV_CARDS]; 101static 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
254static int snd_card_saa7134_capture_trigger(snd_pcm_substream_t * substream, 254static 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;
@@ -333,9 +333,9 @@ static int dsp_buffer_free(struct saa7134_dev *dev)
333 * 333 *
334 */ 334 */
335 335
336static int snd_card_saa7134_capture_prepare(snd_pcm_substream_t * substream) 336static int snd_card_saa7134_capture_prepare(struct snd_pcm_substream * substream)
337{ 337{
338 snd_pcm_runtime_t *runtime = substream->runtime; 338 struct snd_pcm_runtime *runtime = substream->runtime;
339 int bswap, sign; 339 int bswap, sign;
340 u32 fmt, control; 340 u32 fmt, control;
341 snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); 341 snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream);
@@ -422,9 +422,10 @@ static int snd_card_saa7134_capture_prepare(snd_pcm_substream_t * substream)
422 * 422 *
423 */ 423 */
424 424
425static snd_pcm_uframes_t snd_card_saa7134_capture_pointer(snd_pcm_substream_t * substream) 425static snd_pcm_uframes_t
426snd_card_saa7134_capture_pointer(struct snd_pcm_substream * substream)
426{ 427{
427 snd_pcm_runtime_t *runtime = substream->runtime; 428 struct snd_pcm_runtime *runtime = substream->runtime;
428 snd_card_saa7134_pcm_t *pcm = runtime->private_data; 429 snd_card_saa7134_pcm_t *pcm = runtime->private_data;
429 struct saa7134_dev *dev=pcm->dev; 430 struct saa7134_dev *dev=pcm->dev;
430 431
@@ -442,7 +443,7 @@ static snd_pcm_uframes_t snd_card_saa7134_capture_pointer(snd_pcm_substream_t *
442 * ALSA hardware capabilities definition 443 * ALSA hardware capabilities definition
443 */ 444 */
444 445
445static snd_pcm_hardware_t snd_card_saa7134_capture = 446static struct snd_pcm_hardware snd_card_saa7134_capture =
446{ 447{
447 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 448 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
448 SNDRV_PCM_INFO_BLOCK_TRANSFER | 449 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -465,7 +466,7 @@ static snd_pcm_hardware_t snd_card_saa7134_capture =
465 .periods_max = 1024, 466 .periods_max = 1024,
466}; 467};
467 468
468static void snd_card_saa7134_runtime_free(snd_pcm_runtime_t *runtime) 469static void snd_card_saa7134_runtime_free(struct snd_pcm_runtime *runtime)
469{ 470{
470 snd_card_saa7134_pcm_t *pcm = runtime->private_data; 471 snd_card_saa7134_pcm_t *pcm = runtime->private_data;
471 472
@@ -482,8 +483,8 @@ static void snd_card_saa7134_runtime_free(snd_pcm_runtime_t *runtime)
482 * 483 *
483 */ 484 */
484 485
485static int snd_card_saa7134_hw_params(snd_pcm_substream_t * substream, 486static int snd_card_saa7134_hw_params(struct snd_pcm_substream * substream,
486 snd_pcm_hw_params_t * hw_params) 487 struct snd_pcm_hw_params * hw_params)
487{ 488{
488 snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); 489 snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream);
489 struct saa7134_dev *dev; 490 struct saa7134_dev *dev;
@@ -562,7 +563,7 @@ static int snd_card_saa7134_hw_params(snd_pcm_substream_t * substream,
562 * 563 *
563 */ 564 */
564 565
565static int snd_card_saa7134_hw_free(snd_pcm_substream_t * substream) 566static int snd_card_saa7134_hw_free(struct snd_pcm_substream * substream)
566{ 567{
567 snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); 568 snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream);
568 struct saa7134_dev *dev; 569 struct saa7134_dev *dev;
@@ -588,7 +589,7 @@ static int snd_card_saa7134_hw_free(snd_pcm_substream_t * substream)
588 * 589 *
589 */ 590 */
590 591
591static int snd_card_saa7134_capture_close(snd_pcm_substream_t * substream) 592static int snd_card_saa7134_capture_close(struct snd_pcm_substream * substream)
592{ 593{
593 return 0; 594 return 0;
594} 595}
@@ -603,9 +604,9 @@ static int snd_card_saa7134_capture_close(snd_pcm_substream_t * substream)
603 * 604 *
604 */ 605 */
605 606
606static int snd_card_saa7134_capture_open(snd_pcm_substream_t * substream) 607static int snd_card_saa7134_capture_open(struct snd_pcm_substream * substream)
607{ 608{
608 snd_pcm_runtime_t *runtime = substream->runtime; 609 struct snd_pcm_runtime *runtime = substream->runtime;
609 snd_card_saa7134_pcm_t *pcm; 610 snd_card_saa7134_pcm_t *pcm;
610 snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream); 611 snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream);
611 struct saa7134_dev *dev = saa7134->dev; 612 struct saa7134_dev *dev = saa7134->dev;
@@ -641,7 +642,7 @@ static int snd_card_saa7134_capture_open(snd_pcm_substream_t * substream)
641 * ALSA capture callbacks definition 642 * ALSA capture callbacks definition
642 */ 643 */
643 644
644static snd_pcm_ops_t snd_card_saa7134_capture_ops = { 645static struct snd_pcm_ops snd_card_saa7134_capture_ops = {
645 .open = snd_card_saa7134_capture_open, 646 .open = snd_card_saa7134_capture_open,
646 .close = snd_card_saa7134_capture_close, 647 .close = snd_card_saa7134_capture_close,
647 .ioctl = snd_pcm_lib_ioctl, 648 .ioctl = snd_pcm_lib_ioctl,
@@ -662,7 +663,7 @@ static snd_pcm_ops_t snd_card_saa7134_capture_ops = {
662 663
663static int snd_card_saa7134_pcm(snd_card_saa7134_t *saa7134, int device) 664static int snd_card_saa7134_pcm(snd_card_saa7134_t *saa7134, int device)
664{ 665{
665 snd_pcm_t *pcm; 666 struct snd_pcm *pcm;
666 int err; 667 int err;
667 668
668 if ((err = snd_pcm_new(saa7134->card, "SAA7134 PCM", device, 0, 1, &pcm)) < 0) 669 if ((err = snd_pcm_new(saa7134->card, "SAA7134 PCM", device, 0, 1, &pcm)) < 0)
@@ -680,7 +681,8 @@ static int snd_card_saa7134_pcm(snd_card_saa7134_t *saa7134, int device)
680 .get = snd_saa7134_volume_get, .put = snd_saa7134_volume_put, \ 681 .get = snd_saa7134_volume_get, .put = snd_saa7134_volume_put, \
681 .private_value = addr } 682 .private_value = addr }
682 683
683static int snd_saa7134_volume_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo) 684static int snd_saa7134_volume_info(struct snd_kcontrol * kcontrol,
685 struct snd_ctl_elem_info * uinfo)
684{ 686{
685 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 687 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
686 uinfo->count = 2; 688 uinfo->count = 2;
@@ -689,7 +691,8 @@ static int snd_saa7134_volume_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_
689 return 0; 691 return 0;
690} 692}
691 693
692static int snd_saa7134_volume_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 694static int snd_saa7134_volume_get(struct snd_kcontrol * kcontrol,
695 struct snd_ctl_elem_value * ucontrol)
693{ 696{
694 snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol); 697 snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol);
695 int addr = kcontrol->private_value; 698 int addr = kcontrol->private_value;
@@ -699,7 +702,8 @@ static int snd_saa7134_volume_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
699 return 0; 702 return 0;
700} 703}
701 704
702static int snd_saa7134_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 705static int snd_saa7134_volume_put(struct snd_kcontrol * kcontrol,
706 struct snd_ctl_elem_value * ucontrol)
703{ 707{
704 snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol); 708 snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol);
705 int change, addr = kcontrol->private_value; 709 int change, addr = kcontrol->private_value;
@@ -730,7 +734,8 @@ static int snd_saa7134_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
730 .get = snd_saa7134_capsrc_get, .put = snd_saa7134_capsrc_put, \ 734 .get = snd_saa7134_capsrc_get, .put = snd_saa7134_capsrc_put, \
731 .private_value = addr } 735 .private_value = addr }
732 736
733static int snd_saa7134_capsrc_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo) 737static int snd_saa7134_capsrc_info(struct snd_kcontrol * kcontrol,
738 struct snd_ctl_elem_info * uinfo)
734{ 739{
735 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 740 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
736 uinfo->count = 2; 741 uinfo->count = 2;
@@ -739,7 +744,8 @@ static int snd_saa7134_capsrc_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_
739 return 0; 744 return 0;
740} 745}
741 746
742static int snd_saa7134_capsrc_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 747static int snd_saa7134_capsrc_get(struct snd_kcontrol * kcontrol,
748 struct snd_ctl_elem_value * ucontrol)
743{ 749{
744 snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol); 750 snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol);
745 int addr = kcontrol->private_value; 751 int addr = kcontrol->private_value;
@@ -752,7 +758,8 @@ static int snd_saa7134_capsrc_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
752 return 0; 758 return 0;
753} 759}
754 760
755static int snd_saa7134_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 761static int snd_saa7134_capsrc_put(struct snd_kcontrol * kcontrol,
762 struct snd_ctl_elem_value * ucontrol)
756{ 763{
757 snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol); 764 snd_card_saa7134_t *chip = snd_kcontrol_chip(kcontrol);
758 int change, addr = kcontrol->private_value; 765 int change, addr = kcontrol->private_value;
@@ -829,7 +836,7 @@ static int snd_saa7134_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_
829 return change; 836 return change;
830} 837}
831 838
832static snd_kcontrol_new_t snd_saa7134_controls[] = { 839static struct snd_kcontrol_new snd_saa7134_controls[] = {
833SAA713x_VOLUME("Video Volume", 0, MIXER_ADDR_TVTUNER), 840SAA713x_VOLUME("Video Volume", 0, MIXER_ADDR_TVTUNER),
834SAA713x_CAPSRC("Video Capture Switch", 0, MIXER_ADDR_TVTUNER), 841SAA713x_CAPSRC("Video Capture Switch", 0, MIXER_ADDR_TVTUNER),
835SAA713x_VOLUME("Line Volume", 1, MIXER_ADDR_LINE1), 842SAA713x_VOLUME("Line Volume", 1, MIXER_ADDR_LINE1),
@@ -848,7 +855,7 @@ SAA713x_CAPSRC("Line Capture Switch", 2, MIXER_ADDR_LINE2),
848 855
849static int snd_card_saa7134_new_mixer(snd_card_saa7134_t * chip) 856static int snd_card_saa7134_new_mixer(snd_card_saa7134_t * chip)
850{ 857{
851 snd_card_t *card = chip->card; 858 struct snd_card *card = chip->card;
852 unsigned int idx; 859 unsigned int idx;
853 int err; 860 int err;
854 861
@@ -862,7 +869,7 @@ static int snd_card_saa7134_new_mixer(snd_card_saa7134_t * chip)
862 return 0; 869 return 0;
863} 870}
864 871
865static void snd_saa7134_free(snd_card_t * card) 872static void snd_saa7134_free(struct snd_card * card)
866{ 873{
867 snd_card_saa7134_t *chip = card->private_data; 874 snd_card_saa7134_t *chip = card->private_data;
868 875
@@ -889,7 +896,7 @@ static void snd_saa7134_free(snd_card_t * card)
889static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum) 896static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum)
890{ 897{
891 898
892 snd_card_t *card; 899 struct snd_card *card;
893 snd_card_saa7134_t *chip; 900 snd_card_saa7134_t *chip;
894 int err; 901 int err;
895 902