aboutsummaryrefslogtreecommitdiffstats
path: root/sound/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'sound/drivers')
-rw-r--r--sound/drivers/vx/vx_core.c58
-rw-r--r--sound/drivers/vx/vx_hwdep.c24
-rw-r--r--sound/drivers/vx/vx_mixer.c162
-rw-r--r--sound/drivers/vx/vx_pcm.c200
-rw-r--r--sound/drivers/vx/vx_uer.c22
5 files changed, 244 insertions, 222 deletions
diff --git a/sound/drivers/vx/vx_core.c b/sound/drivers/vx/vx_core.c
index e6e4cf997419..5abf42351772 100644
--- a/sound/drivers/vx/vx_core.c
+++ b/sound/drivers/vx/vx_core.c
@@ -49,7 +49,7 @@ MODULE_LICENSE("GPL");
49 * 49 *
50 * returns zero if a bit matches, or a negative error code. 50 * returns zero if a bit matches, or a negative error code.
51 */ 51 */
52int snd_vx_check_reg_bit(vx_core_t *chip, int reg, int mask, int bit, int time) 52int snd_vx_check_reg_bit(struct vx_core *chip, int reg, int mask, int bit, int time)
53{ 53{
54 unsigned long end_time = jiffies + (time * HZ + 999) / 1000; 54 unsigned long end_time = jiffies + (time * HZ + 999) / 1000;
55#ifdef CONFIG_SND_DEBUG 55#ifdef CONFIG_SND_DEBUG
@@ -78,7 +78,7 @@ int snd_vx_check_reg_bit(vx_core_t *chip, int reg, int mask, int bit, int time)
78 * returns 0 if successful, or a negative error code. 78 * returns 0 if successful, or a negative error code.
79 * 79 *
80 */ 80 */
81static int vx_send_irq_dsp(vx_core_t *chip, int num) 81static int vx_send_irq_dsp(struct vx_core *chip, int num)
82{ 82{
83 int nirq; 83 int nirq;
84 84
@@ -99,7 +99,7 @@ static int vx_send_irq_dsp(vx_core_t *chip, int num)
99 * 99 *
100 * returns 0 if successful, or a negative error code. 100 * returns 0 if successful, or a negative error code.
101 */ 101 */
102static int vx_reset_chk(vx_core_t *chip) 102static int vx_reset_chk(struct vx_core *chip)
103{ 103{
104 /* Reset irq CHK */ 104 /* Reset irq CHK */
105 if (vx_send_irq_dsp(chip, IRQ_RESET_CHK) < 0) 105 if (vx_send_irq_dsp(chip, IRQ_RESET_CHK) < 0)
@@ -118,7 +118,7 @@ static int vx_reset_chk(vx_core_t *chip)
118 * the error code can be VX-specific, retrieved via vx_get_error(). 118 * the error code can be VX-specific, retrieved via vx_get_error().
119 * NB: call with spinlock held! 119 * NB: call with spinlock held!
120 */ 120 */
121static int vx_transfer_end(vx_core_t *chip, int cmd) 121static int vx_transfer_end(struct vx_core *chip, int cmd)
122{ 122{
123 int err; 123 int err;
124 124
@@ -156,7 +156,7 @@ static int vx_transfer_end(vx_core_t *chip, int cmd)
156 * the error code can be VX-specific, retrieved via vx_get_error(). 156 * the error code can be VX-specific, retrieved via vx_get_error().
157 * NB: call with spinlock held! 157 * NB: call with spinlock held!
158 */ 158 */
159static int vx_read_status(vx_core_t *chip, struct vx_rmh *rmh) 159static int vx_read_status(struct vx_core *chip, struct vx_rmh *rmh)
160{ 160{
161 int i, err, val, size; 161 int i, err, val, size;
162 162
@@ -236,7 +236,7 @@ static int vx_read_status(vx_core_t *chip, struct vx_rmh *rmh)
236 * 236 *
237 * this function doesn't call spinlock at all. 237 * this function doesn't call spinlock at all.
238 */ 238 */
239int vx_send_msg_nolock(vx_core_t *chip, struct vx_rmh *rmh) 239int vx_send_msg_nolock(struct vx_core *chip, struct vx_rmh *rmh)
240{ 240{
241 int i, err; 241 int i, err;
242 242
@@ -341,7 +341,7 @@ int vx_send_msg_nolock(vx_core_t *chip, struct vx_rmh *rmh)
341 * returns 0 if successful, or a negative error code. 341 * returns 0 if successful, or a negative error code.
342 * see vx_send_msg_nolock(). 342 * see vx_send_msg_nolock().
343 */ 343 */
344int vx_send_msg(vx_core_t *chip, struct vx_rmh *rmh) 344int vx_send_msg(struct vx_core *chip, struct vx_rmh *rmh)
345{ 345{
346 unsigned long flags; 346 unsigned long flags;
347 int err; 347 int err;
@@ -364,7 +364,7 @@ int vx_send_msg(vx_core_t *chip, struct vx_rmh *rmh)
364 * 364 *
365 * unlike RMH, no command is sent to DSP. 365 * unlike RMH, no command is sent to DSP.
366 */ 366 */
367int vx_send_rih_nolock(vx_core_t *chip, int cmd) 367int vx_send_rih_nolock(struct vx_core *chip, int cmd)
368{ 368{
369 int err; 369 int err;
370 370
@@ -401,7 +401,7 @@ int vx_send_rih_nolock(vx_core_t *chip, int cmd)
401 * 401 *
402 * see vx_send_rih_nolock(). 402 * see vx_send_rih_nolock().
403 */ 403 */
404int vx_send_rih(vx_core_t *chip, int cmd) 404int vx_send_rih(struct vx_core *chip, int cmd)
405{ 405{
406 unsigned long flags; 406 unsigned long flags;
407 int err; 407 int err;
@@ -418,7 +418,7 @@ int vx_send_rih(vx_core_t *chip, int cmd)
418 * snd_vx_boot_xilinx - boot up the xilinx interface 418 * snd_vx_boot_xilinx - boot up the xilinx interface
419 * @boot: the boot record to load 419 * @boot: the boot record to load
420 */ 420 */
421int snd_vx_load_boot_image(vx_core_t *chip, const struct firmware *boot) 421int snd_vx_load_boot_image(struct vx_core *chip, const struct firmware *boot)
422{ 422{
423 unsigned int i; 423 unsigned int i;
424 int no_fillup = vx_has_new_dsp(chip); 424 int no_fillup = vx_has_new_dsp(chip);
@@ -470,7 +470,7 @@ int snd_vx_load_boot_image(vx_core_t *chip, const struct firmware *boot)
470 * 470 *
471 * called from irq handler only 471 * called from irq handler only
472 */ 472 */
473static int vx_test_irq_src(vx_core_t *chip, unsigned int *ret) 473static int vx_test_irq_src(struct vx_core *chip, unsigned int *ret)
474{ 474{
475 int err; 475 int err;
476 476
@@ -491,7 +491,7 @@ static int vx_test_irq_src(vx_core_t *chip, unsigned int *ret)
491 */ 491 */
492static void vx_interrupt(unsigned long private_data) 492static void vx_interrupt(unsigned long private_data)
493{ 493{
494 vx_core_t *chip = (vx_core_t *) private_data; 494 struct vx_core *chip = (struct vx_core *) private_data;
495 unsigned int events; 495 unsigned int events;
496 496
497 if (chip->chip_status & VX_STAT_IS_STALE) 497 if (chip->chip_status & VX_STAT_IS_STALE)
@@ -535,7 +535,7 @@ static void vx_interrupt(unsigned long private_data)
535 */ 535 */
536irqreturn_t snd_vx_irq_handler(int irq, void *dev, struct pt_regs *regs) 536irqreturn_t snd_vx_irq_handler(int irq, void *dev, struct pt_regs *regs)
537{ 537{
538 vx_core_t *chip = dev; 538 struct vx_core *chip = dev;
539 539
540 if (! (chip->chip_status & VX_STAT_CHIP_INIT) || 540 if (! (chip->chip_status & VX_STAT_CHIP_INIT) ||
541 (chip->chip_status & VX_STAT_IS_STALE)) 541 (chip->chip_status & VX_STAT_IS_STALE))
@@ -548,7 +548,7 @@ irqreturn_t snd_vx_irq_handler(int irq, void *dev, struct pt_regs *regs)
548 548
549/* 549/*
550 */ 550 */
551static void vx_reset_board(vx_core_t *chip, int cold_reset) 551static void vx_reset_board(struct vx_core *chip, int cold_reset)
552{ 552{
553 snd_assert(chip->ops->reset_board, return); 553 snd_assert(chip->ops->reset_board, return);
554 554
@@ -587,9 +587,9 @@ static void vx_reset_board(vx_core_t *chip, int cold_reset)
587 * proc interface 587 * proc interface
588 */ 588 */
589 589
590static void vx_proc_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) 590static void vx_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
591{ 591{
592 vx_core_t *chip = entry->private_data; 592 struct vx_core *chip = entry->private_data;
593 static char *audio_src_vxp[] = { "Line", "Mic", "Digital" }; 593 static char *audio_src_vxp[] = { "Line", "Mic", "Digital" };
594 static char *audio_src_vx2[] = { "Analog", "Analog", "Digital" }; 594 static char *audio_src_vx2[] = { "Analog", "Analog", "Digital" };
595 static char *clock_mode[] = { "Auto", "Internal", "External" }; 595 static char *clock_mode[] = { "Auto", "Internal", "External" };
@@ -630,9 +630,9 @@ static void vx_proc_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
630 chip->ibl.granularity); 630 chip->ibl.granularity);
631} 631}
632 632
633static void vx_proc_init(vx_core_t *chip) 633static void vx_proc_init(struct vx_core *chip)
634{ 634{
635 snd_info_entry_t *entry; 635 struct snd_info_entry *entry;
636 636
637 if (! snd_card_proc_new(chip->card, "vx-status", &entry)) 637 if (! snd_card_proc_new(chip->card, "vx-status", &entry))
638 snd_info_set_text_ops(entry, chip, 1024, vx_proc_read); 638 snd_info_set_text_ops(entry, chip, 1024, vx_proc_read);
@@ -642,7 +642,7 @@ static void vx_proc_init(vx_core_t *chip)
642/** 642/**
643 * snd_vx_dsp_boot - load the DSP boot 643 * snd_vx_dsp_boot - load the DSP boot
644 */ 644 */
645int snd_vx_dsp_boot(vx_core_t *chip, const struct firmware *boot) 645int snd_vx_dsp_boot(struct vx_core *chip, const struct firmware *boot)
646{ 646{
647 int err; 647 int err;
648 int cold_reset = !(chip->chip_status & VX_STAT_DEVICE_INIT); 648 int cold_reset = !(chip->chip_status & VX_STAT_DEVICE_INIT);
@@ -660,7 +660,7 @@ int snd_vx_dsp_boot(vx_core_t *chip, const struct firmware *boot)
660/** 660/**
661 * snd_vx_dsp_load - load the DSP image 661 * snd_vx_dsp_load - load the DSP image
662 */ 662 */
663int snd_vx_dsp_load(vx_core_t *chip, const struct firmware *dsp) 663int snd_vx_dsp_load(struct vx_core *chip, const struct firmware *dsp)
664{ 664{
665 unsigned int i; 665 unsigned int i;
666 int err; 666 int err;
@@ -709,9 +709,9 @@ int snd_vx_dsp_load(vx_core_t *chip, const struct firmware *dsp)
709/* 709/*
710 * suspend 710 * suspend
711 */ 711 */
712static int snd_vx_suspend(snd_card_t *card, pm_message_t state) 712static int snd_vx_suspend(struct snd_card *card, pm_message_t state)
713{ 713{
714 vx_core_t *chip = card->pm_private_data; 714 struct vx_core *chip = card->pm_private_data;
715 unsigned int i; 715 unsigned int i;
716 716
717 snd_assert(chip, return -EINVAL); 717 snd_assert(chip, return -EINVAL);
@@ -726,9 +726,9 @@ static int snd_vx_suspend(snd_card_t *card, pm_message_t state)
726/* 726/*
727 * resume 727 * resume
728 */ 728 */
729static int snd_vx_resume(snd_card_t *card) 729static int snd_vx_resume(struct snd_card *card)
730{ 730{
731 vx_core_t *chip = card->pm_private_data; 731 struct vx_core *chip = card->pm_private_data;
732 int i, err; 732 int i, err;
733 733
734 snd_assert(chip, return -EINVAL); 734 snd_assert(chip, return -EINVAL);
@@ -754,7 +754,7 @@ static int snd_vx_resume(snd_card_t *card)
754#endif 754#endif
755 755
756/** 756/**
757 * snd_vx_create - constructor for vx_core_t 757 * snd_vx_create - constructor for struct vx_core
758 * @hw: hardware specific record 758 * @hw: hardware specific record
759 * 759 *
760 * this function allocates the instance and prepare for the hardware 760 * this function allocates the instance and prepare for the hardware
@@ -762,11 +762,11 @@ static int snd_vx_resume(snd_card_t *card)
762 * 762 *
763 * return the instance pointer if successful, NULL in error. 763 * return the instance pointer if successful, NULL in error.
764 */ 764 */
765vx_core_t *snd_vx_create(snd_card_t *card, struct snd_vx_hardware *hw, 765struct vx_core *snd_vx_create(struct snd_card *card, struct snd_vx_hardware *hw,
766 struct snd_vx_ops *ops, 766 struct snd_vx_ops *ops,
767 int extra_size) 767 int extra_size)
768{ 768{
769 vx_core_t *chip; 769 struct vx_core *chip;
770 770
771 snd_assert(card && hw && ops, return NULL); 771 snd_assert(card && hw && ops, return NULL);
772 772
diff --git a/sound/drivers/vx/vx_hwdep.c b/sound/drivers/vx/vx_hwdep.c
index c4993b004c42..d837783fb538 100644
--- a/sound/drivers/vx/vx_hwdep.c
+++ b/sound/drivers/vx/vx_hwdep.c
@@ -30,7 +30,7 @@
30 30
31#ifdef SND_VX_FW_LOADER 31#ifdef SND_VX_FW_LOADER
32 32
33int snd_vx_setup_firmware(vx_core_t *chip) 33int snd_vx_setup_firmware(struct vx_core *chip)
34{ 34{
35 static char *fw_files[VX_TYPE_NUMS][4] = { 35 static char *fw_files[VX_TYPE_NUMS][4] = {
36 [VX_TYPE_BOARD] = { 36 [VX_TYPE_BOARD] = {
@@ -95,7 +95,7 @@ int snd_vx_setup_firmware(vx_core_t *chip)
95} 95}
96 96
97/* exported */ 97/* exported */
98void snd_vx_free_firmware(vx_core_t *chip) 98void snd_vx_free_firmware(struct vx_core *chip)
99{ 99{
100#ifdef CONFIG_PM 100#ifdef CONFIG_PM
101 int i; 101 int i;
@@ -106,17 +106,18 @@ void snd_vx_free_firmware(vx_core_t *chip)
106 106
107#else /* old style firmware loading */ 107#else /* old style firmware loading */
108 108
109static int vx_hwdep_open(snd_hwdep_t *hw, struct file *file) 109static int vx_hwdep_open(struct snd_hwdep *hw, struct file *file)
110{ 110{
111 return 0; 111 return 0;
112} 112}
113 113
114static int vx_hwdep_release(snd_hwdep_t *hw, struct file *file) 114static int vx_hwdep_release(struct snd_hwdep *hw, struct file *file)
115{ 115{
116 return 0; 116 return 0;
117} 117}
118 118
119static int vx_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *info) 119static int vx_hwdep_dsp_status(struct snd_hwdep *hw,
120 struct snd_hwdep_dsp_status *info)
120{ 121{
121 static char *type_ids[VX_TYPE_NUMS] = { 122 static char *type_ids[VX_TYPE_NUMS] = {
122 [VX_TYPE_BOARD] = "vxboard", 123 [VX_TYPE_BOARD] = "vxboard",
@@ -125,7 +126,7 @@ static int vx_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *info)
125 [VX_TYPE_VXPOCKET] = "vxpocket", 126 [VX_TYPE_VXPOCKET] = "vxpocket",
126 [VX_TYPE_VXP440] = "vxp440", 127 [VX_TYPE_VXP440] = "vxp440",
127 }; 128 };
128 vx_core_t *vx = hw->private_data; 129 struct vx_core *vx = hw->private_data;
129 130
130 snd_assert(type_ids[vx->type], return -EINVAL); 131 snd_assert(type_ids[vx->type], return -EINVAL);
131 strcpy(info->id, type_ids[vx->type]); 132 strcpy(info->id, type_ids[vx->type]);
@@ -147,9 +148,10 @@ static void free_fw(const struct firmware *fw)
147 } 148 }
148} 149}
149 150
150static int vx_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp) 151static int vx_hwdep_dsp_load(struct snd_hwdep *hw,
152 struct snd_hwdep_dsp_image *dsp)
151{ 153{
152 vx_core_t *vx = hw->private_data; 154 struct vx_core *vx = hw->private_data;
153 int index, err; 155 int index, err;
154 struct firmware *fw; 156 struct firmware *fw;
155 157
@@ -216,10 +218,10 @@ static int vx_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp)
216 218
217 219
218/* exported */ 220/* exported */
219int snd_vx_setup_firmware(vx_core_t *chip) 221int snd_vx_setup_firmware(struct vx_core *chip)
220{ 222{
221 int err; 223 int err;
222 snd_hwdep_t *hw; 224 struct snd_hwdep *hw;
223 225
224 if ((err = snd_hwdep_new(chip->card, SND_VX_HWDEP_ID, 0, &hw)) < 0) 226 if ((err = snd_hwdep_new(chip->card, SND_VX_HWDEP_ID, 0, &hw)) < 0)
225 return err; 227 return err;
@@ -238,7 +240,7 @@ int snd_vx_setup_firmware(vx_core_t *chip)
238} 240}
239 241
240/* exported */ 242/* exported */
241void snd_vx_free_firmware(vx_core_t *chip) 243void snd_vx_free_firmware(struct vx_core *chip)
242{ 244{
243#ifdef CONFIG_PM 245#ifdef CONFIG_PM
244 int i; 246 int i;
diff --git a/sound/drivers/vx/vx_mixer.c b/sound/drivers/vx/vx_mixer.c
index 19fc68c23378..8ec2c605d2f0 100644
--- a/sound/drivers/vx/vx_mixer.c
+++ b/sound/drivers/vx/vx_mixer.c
@@ -30,7 +30,7 @@
30/* 30/*
31 * write a codec data (24bit) 31 * write a codec data (24bit)
32 */ 32 */
33static void vx_write_codec_reg(vx_core_t *chip, int codec, unsigned int data) 33static void vx_write_codec_reg(struct vx_core *chip, int codec, unsigned int data)
34{ 34{
35 unsigned long flags; 35 unsigned long flags;
36 36
@@ -47,7 +47,7 @@ static void vx_write_codec_reg(vx_core_t *chip, int codec, unsigned int data)
47/* 47/*
48 * Data type used to access the Codec 48 * Data type used to access the Codec
49 */ 49 */
50typedef union { 50union vx_codec_data {
51 u32 l; 51 u32 l;
52#ifdef SNDRV_BIG_ENDIAN 52#ifdef SNDRV_BIG_ENDIAN
53 struct w { 53 struct w {
@@ -72,7 +72,7 @@ typedef union {
72 u8 hh; 72 u8 hh;
73 } b; 73 } b;
74#endif 74#endif
75} vx_codec_data_t; 75};
76 76
77#define SET_CDC_DATA_SEL(di,s) ((di).b.mh = (u8) (s)) 77#define SET_CDC_DATA_SEL(di,s) ((di).b.mh = (u8) (s))
78#define SET_CDC_DATA_REG(di,r) ((di).b.ml = (u8) (r)) 78#define SET_CDC_DATA_REG(di,r) ((di).b.ml = (u8) (r))
@@ -85,9 +85,9 @@ typedef union {
85 * @reg: register index 85 * @reg: register index
86 * @val: data value 86 * @val: data value
87 */ 87 */
88static void vx_set_codec_reg(vx_core_t *chip, int codec, int reg, int val) 88static void vx_set_codec_reg(struct vx_core *chip, int codec, int reg, int val)
89{ 89{
90 vx_codec_data_t data; 90 union vx_codec_data data;
91 /* DAC control register */ 91 /* DAC control register */
92 SET_CDC_DATA_INIT(data); 92 SET_CDC_DATA_INIT(data);
93 SET_CDC_DATA_REG(data, reg); 93 SET_CDC_DATA_REG(data, reg);
@@ -102,7 +102,7 @@ static void vx_set_codec_reg(vx_core_t *chip, int codec, int reg, int val)
102 * @left: left output level, 0 = mute 102 * @left: left output level, 0 = mute
103 * @right: right output level 103 * @right: right output level
104 */ 104 */
105static void vx_set_analog_output_level(vx_core_t *chip, int codec, int left, int right) 105static void vx_set_analog_output_level(struct vx_core *chip, int codec, int left, int right)
106{ 106{
107 left = chip->hw->output_level_max - left; 107 left = chip->hw->output_level_max - left;
108 right = chip->hw->output_level_max - right; 108 right = chip->hw->output_level_max - right;
@@ -126,7 +126,7 @@ static void vx_set_analog_output_level(vx_core_t *chip, int codec, int left, int
126#define DAC_ATTEN_MIN 0x08 126#define DAC_ATTEN_MIN 0x08
127#define DAC_ATTEN_MAX 0x38 127#define DAC_ATTEN_MAX 0x38
128 128
129void vx_toggle_dac_mute(vx_core_t *chip, int mute) 129void vx_toggle_dac_mute(struct vx_core *chip, int mute)
130{ 130{
131 unsigned int i; 131 unsigned int i;
132 for (i = 0; i < chip->hw->num_codecs; i++) { 132 for (i = 0; i < chip->hw->num_codecs; i++) {
@@ -141,7 +141,7 @@ void vx_toggle_dac_mute(vx_core_t *chip, int mute)
141/* 141/*
142 * vx_reset_codec - reset and initialize the codecs 142 * vx_reset_codec - reset and initialize the codecs
143 */ 143 */
144void vx_reset_codec(vx_core_t *chip, int cold_reset) 144void vx_reset_codec(struct vx_core *chip, int cold_reset)
145{ 145{
146 unsigned int i; 146 unsigned int i;
147 int port = chip->type >= VX_TYPE_VXPOCKET ? 0x75 : 0x65; 147 int port = chip->type >= VX_TYPE_VXPOCKET ? 0x75 : 0x65;
@@ -175,7 +175,7 @@ void vx_reset_codec(vx_core_t *chip, int cold_reset)
175 * change the audio input source 175 * change the audio input source
176 * @src: the target source (VX_AUDIO_SRC_XXX) 176 * @src: the target source (VX_AUDIO_SRC_XXX)
177 */ 177 */
178static void vx_change_audio_source(vx_core_t *chip, int src) 178static void vx_change_audio_source(struct vx_core *chip, int src)
179{ 179{
180 unsigned long flags; 180 unsigned long flags;
181 181
@@ -192,7 +192,7 @@ static void vx_change_audio_source(vx_core_t *chip, int src)
192 * change the audio source if necessary and possible 192 * change the audio source if necessary and possible
193 * returns 1 if the source is actually changed. 193 * returns 1 if the source is actually changed.
194 */ 194 */
195int vx_sync_audio_source(vx_core_t *chip) 195int vx_sync_audio_source(struct vx_core *chip)
196{ 196{
197 if (chip->audio_source_target == chip->audio_source || 197 if (chip->audio_source_target == chip->audio_source ||
198 chip->pcm_running) 198 chip->pcm_running)
@@ -217,7 +217,7 @@ struct vx_audio_level {
217 short monitor_level; 217 short monitor_level;
218}; 218};
219 219
220static int vx_adjust_audio_level(vx_core_t *chip, int audio, int capture, 220static int vx_adjust_audio_level(struct vx_core *chip, int audio, int capture,
221 struct vx_audio_level *info) 221 struct vx_audio_level *info)
222{ 222{
223 struct vx_rmh rmh; 223 struct vx_rmh rmh;
@@ -256,7 +256,7 @@ static int vx_adjust_audio_level(vx_core_t *chip, int audio, int capture,
256 256
257 257
258#if 0 // not used 258#if 0 // not used
259static int vx_read_audio_level(vx_core_t *chip, int audio, int capture, 259static int vx_read_audio_level(struct vx_core *chip, int audio, int capture,
260 struct vx_audio_level *info) 260 struct vx_audio_level *info)
261{ 261{
262 int err; 262 int err;
@@ -283,7 +283,7 @@ static int vx_read_audio_level(vx_core_t *chip, int audio, int capture,
283 * set the monitoring level and mute state of the given audio 283 * set the monitoring level and mute state of the given audio
284 * no more static, because must be called from vx_pcm to demute monitoring 284 * no more static, because must be called from vx_pcm to demute monitoring
285 */ 285 */
286int vx_set_monitor_level(vx_core_t *chip, int audio, int level, int active) 286int vx_set_monitor_level(struct vx_core *chip, int audio, int level, int active)
287{ 287{
288 struct vx_audio_level info; 288 struct vx_audio_level info;
289 289
@@ -301,7 +301,7 @@ int vx_set_monitor_level(vx_core_t *chip, int audio, int level, int active)
301/* 301/*
302 * set the mute status of the given audio 302 * set the mute status of the given audio
303 */ 303 */
304static int vx_set_audio_switch(vx_core_t *chip, int audio, int active) 304static int vx_set_audio_switch(struct vx_core *chip, int audio, int active)
305{ 305{
306 struct vx_audio_level info; 306 struct vx_audio_level info;
307 307
@@ -315,7 +315,7 @@ static int vx_set_audio_switch(vx_core_t *chip, int audio, int active)
315/* 315/*
316 * set the mute status of the given audio 316 * set the mute status of the given audio
317 */ 317 */
318static int vx_set_audio_gain(vx_core_t *chip, int audio, int capture, int level) 318static int vx_set_audio_gain(struct vx_core *chip, int audio, int capture, int level)
319{ 319{
320 struct vx_audio_level info; 320 struct vx_audio_level info;
321 321
@@ -329,7 +329,7 @@ static int vx_set_audio_gain(vx_core_t *chip, int audio, int capture, int level)
329/* 329/*
330 * reset all audio levels 330 * reset all audio levels
331 */ 331 */
332static void vx_reset_audio_levels(vx_core_t *chip) 332static void vx_reset_audio_levels(struct vx_core *chip)
333{ 333{
334 unsigned int i, c; 334 unsigned int i, c;
335 struct vx_audio_level info; 335 struct vx_audio_level info;
@@ -375,7 +375,7 @@ struct vx_vu_meter {
375 * @capture: 0 = playback, 1 = capture operation 375 * @capture: 0 = playback, 1 = capture operation
376 * @info: the array of vx_vu_meter records (size = 2). 376 * @info: the array of vx_vu_meter records (size = 2).
377 */ 377 */
378static int vx_get_audio_vu_meter(vx_core_t *chip, int audio, int capture, struct vx_vu_meter *info) 378static int vx_get_audio_vu_meter(struct vx_core *chip, int audio, int capture, struct vx_vu_meter *info)
379{ 379{
380 struct vx_rmh rmh; 380 struct vx_rmh rmh;
381 int i, err; 381 int i, err;
@@ -413,9 +413,9 @@ static int vx_get_audio_vu_meter(vx_core_t *chip, int audio, int capture, struct
413/* 413/*
414 * output level control 414 * output level control
415 */ 415 */
416static int vx_output_level_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 416static int vx_output_level_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
417{ 417{
418 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 418 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
419 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 419 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
420 uinfo->count = 2; 420 uinfo->count = 2;
421 uinfo->value.integer.min = 0; 421 uinfo->value.integer.min = 0;
@@ -423,9 +423,9 @@ static int vx_output_level_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *u
423 return 0; 423 return 0;
424} 424}
425 425
426static int vx_output_level_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 426static int vx_output_level_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
427{ 427{
428 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 428 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
429 int codec = kcontrol->id.index; 429 int codec = kcontrol->id.index;
430 down(&chip->mixer_mutex); 430 down(&chip->mixer_mutex);
431 ucontrol->value.integer.value[0] = chip->output_level[codec][0]; 431 ucontrol->value.integer.value[0] = chip->output_level[codec][0];
@@ -434,9 +434,9 @@ static int vx_output_level_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u
434 return 0; 434 return 0;
435} 435}
436 436
437static int vx_output_level_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 437static int vx_output_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
438{ 438{
439 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 439 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
440 int codec = kcontrol->id.index; 440 int codec = kcontrol->id.index;
441 down(&chip->mixer_mutex); 441 down(&chip->mixer_mutex);
442 if (ucontrol->value.integer.value[0] != chip->output_level[codec][0] || 442 if (ucontrol->value.integer.value[0] != chip->output_level[codec][0] ||
@@ -453,7 +453,7 @@ static int vx_output_level_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u
453 return 0; 453 return 0;
454} 454}
455 455
456static snd_kcontrol_new_t vx_control_output_level = { 456static struct snd_kcontrol_new vx_control_output_level = {
457 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 457 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
458 .name = "Master Playback Volume", 458 .name = "Master Playback Volume",
459 .info = vx_output_level_info, 459 .info = vx_output_level_info,
@@ -464,7 +464,7 @@ static snd_kcontrol_new_t vx_control_output_level = {
464/* 464/*
465 * audio source select 465 * audio source select
466 */ 466 */
467static int vx_audio_src_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 467static int vx_audio_src_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
468{ 468{
469 static char *texts_mic[3] = { 469 static char *texts_mic[3] = {
470 "Digital", "Line", "Mic" 470 "Digital", "Line", "Mic"
@@ -472,7 +472,7 @@ static int vx_audio_src_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinf
472 static char *texts_vx2[2] = { 472 static char *texts_vx2[2] = {
473 "Digital", "Analog" 473 "Digital", "Analog"
474 }; 474 };
475 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 475 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
476 476
477 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 477 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
478 uinfo->count = 1; 478 uinfo->count = 1;
@@ -492,16 +492,16 @@ static int vx_audio_src_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinf
492 return 0; 492 return 0;
493} 493}
494 494
495static int vx_audio_src_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 495static int vx_audio_src_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
496{ 496{
497 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 497 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
498 ucontrol->value.enumerated.item[0] = chip->audio_source_target; 498 ucontrol->value.enumerated.item[0] = chip->audio_source_target;
499 return 0; 499 return 0;
500} 500}
501 501
502static int vx_audio_src_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 502static int vx_audio_src_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
503{ 503{
504 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 504 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
505 down(&chip->mixer_mutex); 505 down(&chip->mixer_mutex);
506 if (chip->audio_source_target != ucontrol->value.enumerated.item[0]) { 506 if (chip->audio_source_target != ucontrol->value.enumerated.item[0]) {
507 chip->audio_source_target = ucontrol->value.enumerated.item[0]; 507 chip->audio_source_target = ucontrol->value.enumerated.item[0];
@@ -513,7 +513,7 @@ static int vx_audio_src_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucon
513 return 0; 513 return 0;
514} 514}
515 515
516static snd_kcontrol_new_t vx_control_audio_src = { 516static struct snd_kcontrol_new vx_control_audio_src = {
517 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 517 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
518 .name = "Capture Source", 518 .name = "Capture Source",
519 .info = vx_audio_src_info, 519 .info = vx_audio_src_info,
@@ -524,7 +524,7 @@ static snd_kcontrol_new_t vx_control_audio_src = {
524/* 524/*
525 * clock mode selection 525 * clock mode selection
526 */ 526 */
527static int vx_clock_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 527static int vx_clock_mode_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
528{ 528{
529 static char *texts[3] = { 529 static char *texts[3] = {
530 "Auto", "Internal", "External" 530 "Auto", "Internal", "External"
@@ -540,16 +540,16 @@ static int vx_clock_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uin
540 return 0; 540 return 0;
541} 541}
542 542
543static int vx_clock_mode_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 543static int vx_clock_mode_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
544{ 544{
545 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 545 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
546 ucontrol->value.enumerated.item[0] = chip->clock_mode; 546 ucontrol->value.enumerated.item[0] = chip->clock_mode;
547 return 0; 547 return 0;
548} 548}
549 549
550static int vx_clock_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 550static int vx_clock_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
551{ 551{
552 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 552 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
553 down(&chip->mixer_mutex); 553 down(&chip->mixer_mutex);
554 if (chip->clock_mode != ucontrol->value.enumerated.item[0]) { 554 if (chip->clock_mode != ucontrol->value.enumerated.item[0]) {
555 chip->clock_mode = ucontrol->value.enumerated.item[0]; 555 chip->clock_mode = ucontrol->value.enumerated.item[0];
@@ -561,7 +561,7 @@ static int vx_clock_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
561 return 0; 561 return 0;
562} 562}
563 563
564static snd_kcontrol_new_t vx_control_clock_mode = { 564static struct snd_kcontrol_new vx_control_clock_mode = {
565 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 565 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
566 .name = "Clock Mode", 566 .name = "Clock Mode",
567 .info = vx_clock_mode_info, 567 .info = vx_clock_mode_info,
@@ -572,7 +572,7 @@ static snd_kcontrol_new_t vx_control_clock_mode = {
572/* 572/*
573 * Audio Gain 573 * Audio Gain
574 */ 574 */
575static int vx_audio_gain_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 575static int vx_audio_gain_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
576{ 576{
577 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 577 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
578 uinfo->count = 2; 578 uinfo->count = 2;
@@ -581,9 +581,9 @@ static int vx_audio_gain_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uin
581 return 0; 581 return 0;
582} 582}
583 583
584static int vx_audio_gain_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 584static int vx_audio_gain_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
585{ 585{
586 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 586 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
587 int audio = kcontrol->private_value & 0xff; 587 int audio = kcontrol->private_value & 0xff;
588 int capture = (kcontrol->private_value >> 8) & 1; 588 int capture = (kcontrol->private_value >> 8) & 1;
589 589
@@ -594,9 +594,9 @@ static int vx_audio_gain_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
594 return 0; 594 return 0;
595} 595}
596 596
597static int vx_audio_gain_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 597static int vx_audio_gain_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
598{ 598{
599 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 599 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
600 int audio = kcontrol->private_value & 0xff; 600 int audio = kcontrol->private_value & 0xff;
601 int capture = (kcontrol->private_value >> 8) & 1; 601 int capture = (kcontrol->private_value >> 8) & 1;
602 602
@@ -612,9 +612,9 @@ static int vx_audio_gain_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
612 return 0; 612 return 0;
613} 613}
614 614
615static int vx_audio_monitor_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 615static int vx_audio_monitor_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
616{ 616{
617 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 617 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
618 int audio = kcontrol->private_value & 0xff; 618 int audio = kcontrol->private_value & 0xff;
619 619
620 down(&chip->mixer_mutex); 620 down(&chip->mixer_mutex);
@@ -624,9 +624,9 @@ static int vx_audio_monitor_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *
624 return 0; 624 return 0;
625} 625}
626 626
627static int vx_audio_monitor_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 627static int vx_audio_monitor_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
628{ 628{
629 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 629 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
630 int audio = kcontrol->private_value & 0xff; 630 int audio = kcontrol->private_value & 0xff;
631 631
632 down(&chip->mixer_mutex); 632 down(&chip->mixer_mutex);
@@ -643,7 +643,7 @@ static int vx_audio_monitor_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *
643 return 0; 643 return 0;
644} 644}
645 645
646static int vx_audio_sw_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 646static int vx_audio_sw_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
647{ 647{
648 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 648 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
649 uinfo->count = 2; 649 uinfo->count = 2;
@@ -652,9 +652,9 @@ static int vx_audio_sw_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo
652 return 0; 652 return 0;
653} 653}
654 654
655static int vx_audio_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 655static int vx_audio_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
656{ 656{
657 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 657 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
658 int audio = kcontrol->private_value & 0xff; 658 int audio = kcontrol->private_value & 0xff;
659 659
660 down(&chip->mixer_mutex); 660 down(&chip->mixer_mutex);
@@ -664,9 +664,9 @@ static int vx_audio_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont
664 return 0; 664 return 0;
665} 665}
666 666
667static int vx_audio_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 667static int vx_audio_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
668{ 668{
669 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 669 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
670 int audio = kcontrol->private_value & 0xff; 670 int audio = kcontrol->private_value & 0xff;
671 671
672 down(&chip->mixer_mutex); 672 down(&chip->mixer_mutex);
@@ -681,9 +681,9 @@ static int vx_audio_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont
681 return 0; 681 return 0;
682} 682}
683 683
684static int vx_monitor_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 684static int vx_monitor_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
685{ 685{
686 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 686 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
687 int audio = kcontrol->private_value & 0xff; 687 int audio = kcontrol->private_value & 0xff;
688 688
689 down(&chip->mixer_mutex); 689 down(&chip->mixer_mutex);
@@ -693,9 +693,9 @@ static int vx_monitor_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
693 return 0; 693 return 0;
694} 694}
695 695
696static int vx_monitor_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 696static int vx_monitor_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
697{ 697{
698 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 698 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
699 int audio = kcontrol->private_value & 0xff; 699 int audio = kcontrol->private_value & 0xff;
700 700
701 down(&chip->mixer_mutex); 701 down(&chip->mixer_mutex);
@@ -712,28 +712,28 @@ static int vx_monitor_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
712 return 0; 712 return 0;
713} 713}
714 714
715static snd_kcontrol_new_t vx_control_audio_gain = { 715static struct snd_kcontrol_new vx_control_audio_gain = {
716 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 716 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
717 /* name will be filled later */ 717 /* name will be filled later */
718 .info = vx_audio_gain_info, 718 .info = vx_audio_gain_info,
719 .get = vx_audio_gain_get, 719 .get = vx_audio_gain_get,
720 .put = vx_audio_gain_put 720 .put = vx_audio_gain_put
721}; 721};
722static snd_kcontrol_new_t vx_control_output_switch = { 722static struct snd_kcontrol_new vx_control_output_switch = {
723 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 723 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
724 .name = "PCM Playback Switch", 724 .name = "PCM Playback Switch",
725 .info = vx_audio_sw_info, 725 .info = vx_audio_sw_info,
726 .get = vx_audio_sw_get, 726 .get = vx_audio_sw_get,
727 .put = vx_audio_sw_put 727 .put = vx_audio_sw_put
728}; 728};
729static snd_kcontrol_new_t vx_control_monitor_gain = { 729static struct snd_kcontrol_new vx_control_monitor_gain = {
730 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 730 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
731 .name = "Monitoring Volume", 731 .name = "Monitoring Volume",
732 .info = vx_audio_gain_info, /* shared */ 732 .info = vx_audio_gain_info, /* shared */
733 .get = vx_audio_monitor_get, 733 .get = vx_audio_monitor_get,
734 .put = vx_audio_monitor_put 734 .put = vx_audio_monitor_put
735}; 735};
736static snd_kcontrol_new_t vx_control_monitor_switch = { 736static struct snd_kcontrol_new vx_control_monitor_switch = {
737 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 737 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
738 .name = "Monitoring Switch", 738 .name = "Monitoring Switch",
739 .info = vx_audio_sw_info, /* shared */ 739 .info = vx_audio_sw_info, /* shared */
@@ -745,16 +745,16 @@ static snd_kcontrol_new_t vx_control_monitor_switch = {
745/* 745/*
746 * IEC958 status bits 746 * IEC958 status bits
747 */ 747 */
748static int vx_iec958_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 748static int vx_iec958_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
749{ 749{
750 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; 750 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
751 uinfo->count = 1; 751 uinfo->count = 1;
752 return 0; 752 return 0;
753} 753}
754 754
755static int vx_iec958_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 755static int vx_iec958_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
756{ 756{
757 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 757 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
758 758
759 down(&chip->mixer_mutex); 759 down(&chip->mixer_mutex);
760 ucontrol->value.iec958.status[0] = (chip->uer_bits >> 0) & 0xff; 760 ucontrol->value.iec958.status[0] = (chip->uer_bits >> 0) & 0xff;
@@ -765,7 +765,7 @@ static int vx_iec958_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontro
765 return 0; 765 return 0;
766} 766}
767 767
768static int vx_iec958_mask_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol) 768static int vx_iec958_mask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
769{ 769{
770 ucontrol->value.iec958.status[0] = 0xff; 770 ucontrol->value.iec958.status[0] = 0xff;
771 ucontrol->value.iec958.status[1] = 0xff; 771 ucontrol->value.iec958.status[1] = 0xff;
@@ -774,9 +774,9 @@ static int vx_iec958_mask_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *u
774 return 0; 774 return 0;
775} 775}
776 776
777static int vx_iec958_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 777static int vx_iec958_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
778{ 778{
779 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 779 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
780 unsigned int val; 780 unsigned int val;
781 781
782 val = (ucontrol->value.iec958.status[0] << 0) | 782 val = (ucontrol->value.iec958.status[0] << 0) |
@@ -794,7 +794,7 @@ static int vx_iec958_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontro
794 return 0; 794 return 0;
795} 795}
796 796
797static snd_kcontrol_new_t vx_control_iec958_mask = { 797static struct snd_kcontrol_new vx_control_iec958_mask = {
798 .access = SNDRV_CTL_ELEM_ACCESS_READ, 798 .access = SNDRV_CTL_ELEM_ACCESS_READ,
799 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 799 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
800 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,MASK), 800 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,MASK),
@@ -802,7 +802,7 @@ static snd_kcontrol_new_t vx_control_iec958_mask = {
802 .get = vx_iec958_mask_get, 802 .get = vx_iec958_mask_get,
803}; 803};
804 804
805static snd_kcontrol_new_t vx_control_iec958 = { 805static struct snd_kcontrol_new vx_control_iec958 = {
806 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 806 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
807 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 807 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
808 .info = vx_iec958_info, 808 .info = vx_iec958_info,
@@ -818,7 +818,7 @@ static snd_kcontrol_new_t vx_control_iec958 = {
818#define METER_MAX 0xff 818#define METER_MAX 0xff
819#define METER_SHIFT 16 819#define METER_SHIFT 16
820 820
821static int vx_vu_meter_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 821static int vx_vu_meter_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
822{ 822{
823 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 823 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
824 uinfo->count = 2; 824 uinfo->count = 2;
@@ -827,9 +827,9 @@ static int vx_vu_meter_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo
827 return 0; 827 return 0;
828} 828}
829 829
830static int vx_vu_meter_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 830static int vx_vu_meter_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
831{ 831{
832 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 832 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
833 struct vx_vu_meter meter[2]; 833 struct vx_vu_meter meter[2];
834 int audio = kcontrol->private_value & 0xff; 834 int audio = kcontrol->private_value & 0xff;
835 int capture = (kcontrol->private_value >> 8) & 1; 835 int capture = (kcontrol->private_value >> 8) & 1;
@@ -840,9 +840,9 @@ static int vx_vu_meter_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont
840 return 0; 840 return 0;
841} 841}
842 842
843static int vx_peak_meter_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 843static int vx_peak_meter_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
844{ 844{
845 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 845 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
846 struct vx_vu_meter meter[2]; 846 struct vx_vu_meter meter[2];
847 int audio = kcontrol->private_value & 0xff; 847 int audio = kcontrol->private_value & 0xff;
848 int capture = (kcontrol->private_value >> 8) & 1; 848 int capture = (kcontrol->private_value >> 8) & 1;
@@ -853,7 +853,7 @@ static int vx_peak_meter_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
853 return 0; 853 return 0;
854} 854}
855 855
856static int vx_saturation_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 856static int vx_saturation_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
857{ 857{
858 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 858 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
859 uinfo->count = 2; 859 uinfo->count = 2;
@@ -862,9 +862,9 @@ static int vx_saturation_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uin
862 return 0; 862 return 0;
863} 863}
864 864
865static int vx_saturation_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 865static int vx_saturation_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
866{ 866{
867 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 867 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
868 struct vx_vu_meter meter[2]; 868 struct vx_vu_meter meter[2];
869 int audio = kcontrol->private_value & 0xff; 869 int audio = kcontrol->private_value & 0xff;
870 870
@@ -874,7 +874,7 @@ static int vx_saturation_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
874 return 0; 874 return 0;
875} 875}
876 876
877static snd_kcontrol_new_t vx_control_vu_meter = { 877static struct snd_kcontrol_new vx_control_vu_meter = {
878 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 878 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
879 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 879 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
880 /* name will be filled later */ 880 /* name will be filled later */
@@ -882,7 +882,7 @@ static snd_kcontrol_new_t vx_control_vu_meter = {
882 .get = vx_vu_meter_get, 882 .get = vx_vu_meter_get,
883}; 883};
884 884
885static snd_kcontrol_new_t vx_control_peak_meter = { 885static struct snd_kcontrol_new vx_control_peak_meter = {
886 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 886 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
887 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 887 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
888 /* name will be filled later */ 888 /* name will be filled later */
@@ -890,7 +890,7 @@ static snd_kcontrol_new_t vx_control_peak_meter = {
890 .get = vx_peak_meter_get, 890 .get = vx_peak_meter_get,
891}; 891};
892 892
893static snd_kcontrol_new_t vx_control_saturation = { 893static struct snd_kcontrol_new vx_control_saturation = {
894 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 894 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
895 .name = "Input Saturation", 895 .name = "Input Saturation",
896 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 896 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
@@ -904,12 +904,12 @@ static snd_kcontrol_new_t vx_control_saturation = {
904 * 904 *
905 */ 905 */
906 906
907int snd_vx_mixer_new(vx_core_t *chip) 907int snd_vx_mixer_new(struct vx_core *chip)
908{ 908{
909 unsigned int i, c; 909 unsigned int i, c;
910 int err; 910 int err;
911 snd_kcontrol_new_t temp; 911 struct snd_kcontrol_new temp;
912 snd_card_t *card = chip->card; 912 struct snd_card *card = chip->card;
913 char name[32]; 913 char name[32];
914 914
915 strcpy(card->mixername, card->driver); 915 strcpy(card->mixername, card->driver);
diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c
index 2b46758fe86f..464109e421d4 100644
--- a/sound/drivers/vx/vx_pcm.c
+++ b/sound/drivers/vx/vx_pcm.c
@@ -61,7 +61,8 @@
61 */ 61 */
62 62
63/* get the physical page pointer on the given offset */ 63/* get the physical page pointer on the given offset */
64static struct page *snd_pcm_get_vmalloc_page(snd_pcm_substream_t *subs, unsigned long offset) 64static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs,
65 unsigned long offset)
65{ 66{
66 void *pageptr = subs->runtime->dma_area + offset; 67 void *pageptr = subs->runtime->dma_area + offset;
67 return vmalloc_to_page(pageptr); 68 return vmalloc_to_page(pageptr);
@@ -72,9 +73,9 @@ static struct page *snd_pcm_get_vmalloc_page(snd_pcm_substream_t *subs, unsigned
72 * called from hw_params 73 * called from hw_params
73 * NOTE: this may be called not only once per pcm open! 74 * NOTE: this may be called not only once per pcm open!
74 */ 75 */
75static int snd_pcm_alloc_vmalloc_buffer(snd_pcm_substream_t *subs, size_t size) 76static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t size)
76{ 77{
77 snd_pcm_runtime_t *runtime = subs->runtime; 78 struct snd_pcm_runtime *runtime = subs->runtime;
78 if (runtime->dma_area) { 79 if (runtime->dma_area) {
79 /* already allocated */ 80 /* already allocated */
80 if (runtime->dma_bytes >= size) 81 if (runtime->dma_bytes >= size)
@@ -94,9 +95,9 @@ static int snd_pcm_alloc_vmalloc_buffer(snd_pcm_substream_t *subs, size_t size)
94 * called from hw_free callback 95 * called from hw_free callback
95 * NOTE: this may be called not only once per pcm open! 96 * NOTE: this may be called not only once per pcm open!
96 */ 97 */
97static int snd_pcm_free_vmalloc_buffer(snd_pcm_substream_t *subs) 98static int snd_pcm_free_vmalloc_buffer(struct snd_pcm_substream *subs)
98{ 99{
99 snd_pcm_runtime_t *runtime = subs->runtime; 100 struct snd_pcm_runtime *runtime = subs->runtime;
100 if (runtime->dma_area) { 101 if (runtime->dma_area) {
101 vfree(runtime->dma_area); 102 vfree(runtime->dma_area);
102 runtime->dma_area = NULL; 103 runtime->dma_area = NULL;
@@ -108,7 +109,8 @@ static int snd_pcm_free_vmalloc_buffer(snd_pcm_substream_t *subs)
108/* 109/*
109 * read three pending pcm bytes via inb() 110 * read three pending pcm bytes via inb()
110 */ 111 */
111static void vx_pcm_read_per_bytes(vx_core_t *chip, snd_pcm_runtime_t *runtime, vx_pipe_t *pipe) 112static void vx_pcm_read_per_bytes(struct vx_core *chip, struct snd_pcm_runtime *runtime,
113 struct vx_pipe *pipe)
112{ 114{
113 int offset = pipe->hw_ptr; 115 int offset = pipe->hw_ptr;
114 unsigned char *buf = (unsigned char *)(runtime->dma_area + offset); 116 unsigned char *buf = (unsigned char *)(runtime->dma_area + offset);
@@ -135,7 +137,8 @@ static void vx_pcm_read_per_bytes(vx_core_t *chip, snd_pcm_runtime_t *runtime, v
135 * @pc_time: the pointer for the PC-time to set 137 * @pc_time: the pointer for the PC-time to set
136 * @dsp_time: the pointer for RMH status time array 138 * @dsp_time: the pointer for RMH status time array
137 */ 139 */
138static void vx_set_pcx_time(vx_core_t *chip, pcx_time_t *pc_time, unsigned int *dsp_time) 140static void vx_set_pcx_time(struct vx_core *chip, pcx_time_t *pc_time,
141 unsigned int *dsp_time)
139{ 142{
140 dsp_time[0] = (unsigned int)((*pc_time) >> 24) & PCX_TIME_HI_MASK; 143 dsp_time[0] = (unsigned int)((*pc_time) >> 24) & PCX_TIME_HI_MASK;
141 dsp_time[1] = (unsigned int)(*pc_time) & MASK_DSP_WORD; 144 dsp_time[1] = (unsigned int)(*pc_time) & MASK_DSP_WORD;
@@ -151,7 +154,8 @@ static void vx_set_pcx_time(vx_core_t *chip, pcx_time_t *pc_time, unsigned int *
151 * 154 *
152 * returns the increase of the command length. 155 * returns the increase of the command length.
153 */ 156 */
154static int vx_set_differed_time(vx_core_t *chip, struct vx_rmh *rmh, vx_pipe_t *pipe) 157static int vx_set_differed_time(struct vx_core *chip, struct vx_rmh *rmh,
158 struct vx_pipe *pipe)
155{ 159{
156 /* Update The length added to the RMH command by the timestamp */ 160 /* Update The length added to the RMH command by the timestamp */
157 if (! (pipe->differed_type & DC_DIFFERED_DELAY)) 161 if (! (pipe->differed_type & DC_DIFFERED_DELAY))
@@ -184,7 +188,8 @@ static int vx_set_differed_time(vx_core_t *chip, struct vx_rmh *rmh, vx_pipe_t *
184 * @pipe: the affected pipe 188 * @pipe: the affected pipe
185 * @data: format bitmask 189 * @data: format bitmask
186 */ 190 */
187static int vx_set_stream_format(vx_core_t *chip, vx_pipe_t *pipe, unsigned int data) 191static int vx_set_stream_format(struct vx_core *chip, struct vx_pipe *pipe,
192 unsigned int data)
188{ 193{
189 struct vx_rmh rmh; 194 struct vx_rmh rmh;
190 195
@@ -210,8 +215,8 @@ static int vx_set_stream_format(vx_core_t *chip, vx_pipe_t *pipe, unsigned int d
210 * 215 *
211 * returns 0 if successful, or a negative error code. 216 * returns 0 if successful, or a negative error code.
212 */ 217 */
213static int vx_set_format(vx_core_t *chip, vx_pipe_t *pipe, 218static int vx_set_format(struct vx_core *chip, struct vx_pipe *pipe,
214 snd_pcm_runtime_t *runtime) 219 struct snd_pcm_runtime *runtime)
215{ 220{
216 unsigned int header = HEADER_FMT_BASE; 221 unsigned int header = HEADER_FMT_BASE;
217 222
@@ -239,7 +244,7 @@ static int vx_set_format(vx_core_t *chip, vx_pipe_t *pipe,
239/* 244/*
240 * set / query the IBL size 245 * set / query the IBL size
241 */ 246 */
242static int vx_set_ibl(vx_core_t *chip, struct vx_ibl_info *info) 247static int vx_set_ibl(struct vx_core *chip, struct vx_ibl_info *info)
243{ 248{
244 int err; 249 int err;
245 struct vx_rmh rmh; 250 struct vx_rmh rmh;
@@ -269,7 +274,7 @@ static int vx_set_ibl(vx_core_t *chip, struct vx_ibl_info *info)
269 * 274 *
270 * called from trigger callback only 275 * called from trigger callback only
271 */ 276 */
272static int vx_get_pipe_state(vx_core_t *chip, vx_pipe_t *pipe, int *state) 277static int vx_get_pipe_state(struct vx_core *chip, struct vx_pipe *pipe, int *state)
273{ 278{
274 int err; 279 int err;
275 struct vx_rmh rmh; 280 struct vx_rmh rmh;
@@ -294,7 +299,7 @@ static int vx_get_pipe_state(vx_core_t *chip, vx_pipe_t *pipe, int *state)
294 * you'll need to disconnect the host to get back to the 299 * you'll need to disconnect the host to get back to the
295 * normal mode. 300 * normal mode.
296 */ 301 */
297static int vx_query_hbuffer_size(vx_core_t *chip, vx_pipe_t *pipe) 302static int vx_query_hbuffer_size(struct vx_core *chip, struct vx_pipe *pipe)
298{ 303{
299 int result; 304 int result;
300 struct vx_rmh rmh; 305 struct vx_rmh rmh;
@@ -318,7 +323,7 @@ static int vx_query_hbuffer_size(vx_core_t *chip, vx_pipe_t *pipe)
318 * 323 *
319 * called from trigger callback only 324 * called from trigger callback only
320 */ 325 */
321static int vx_pipe_can_start(vx_core_t *chip, vx_pipe_t *pipe) 326static int vx_pipe_can_start(struct vx_core *chip, struct vx_pipe *pipe)
322{ 327{
323 int err; 328 int err;
324 struct vx_rmh rmh; 329 struct vx_rmh rmh;
@@ -339,7 +344,7 @@ static int vx_pipe_can_start(vx_core_t *chip, vx_pipe_t *pipe)
339 * vx_conf_pipe - tell the pipe to stand by and wait for IRQA. 344 * vx_conf_pipe - tell the pipe to stand by and wait for IRQA.
340 * @pipe: the pipe to be configured 345 * @pipe: the pipe to be configured
341 */ 346 */
342static int vx_conf_pipe(vx_core_t *chip, vx_pipe_t *pipe) 347static int vx_conf_pipe(struct vx_core *chip, struct vx_pipe *pipe)
343{ 348{
344 struct vx_rmh rmh; 349 struct vx_rmh rmh;
345 350
@@ -353,7 +358,7 @@ static int vx_conf_pipe(vx_core_t *chip, vx_pipe_t *pipe)
353/* 358/*
354 * vx_send_irqa - trigger IRQA 359 * vx_send_irqa - trigger IRQA
355 */ 360 */
356static int vx_send_irqa(vx_core_t *chip) 361static int vx_send_irqa(struct vx_core *chip)
357{ 362{
358 struct vx_rmh rmh; 363 struct vx_rmh rmh;
359 364
@@ -378,7 +383,7 @@ static int vx_send_irqa(vx_core_t *chip)
378 * called from trigger callback only 383 * called from trigger callback only
379 * 384 *
380 */ 385 */
381static int vx_toggle_pipe(vx_core_t *chip, vx_pipe_t *pipe, int state) 386static int vx_toggle_pipe(struct vx_core *chip, struct vx_pipe *pipe, int state)
382{ 387{
383 int err, i, cur_state; 388 int err, i, cur_state;
384 389
@@ -431,7 +436,7 @@ static int vx_toggle_pipe(vx_core_t *chip, vx_pipe_t *pipe, int state)
431 * 436 *
432 * called from trigger callback only 437 * called from trigger callback only
433 */ 438 */
434static int vx_stop_pipe(vx_core_t *chip, vx_pipe_t *pipe) 439static int vx_stop_pipe(struct vx_core *chip, struct vx_pipe *pipe)
435{ 440{
436 struct vx_rmh rmh; 441 struct vx_rmh rmh;
437 vx_init_rmh(&rmh, CMD_STOP_PIPE); 442 vx_init_rmh(&rmh, CMD_STOP_PIPE);
@@ -449,12 +454,12 @@ static int vx_stop_pipe(vx_core_t *chip, vx_pipe_t *pipe)
449 * 454 *
450 * return 0 on success, or a negative error code. 455 * return 0 on success, or a negative error code.
451 */ 456 */
452static int vx_alloc_pipe(vx_core_t *chip, int capture, 457static int vx_alloc_pipe(struct vx_core *chip, int capture,
453 int audioid, int num_audio, 458 int audioid, int num_audio,
454 vx_pipe_t **pipep) 459 struct vx_pipe **pipep)
455{ 460{
456 int err; 461 int err;
457 vx_pipe_t *pipe; 462 struct vx_pipe *pipe;
458 struct vx_rmh rmh; 463 struct vx_rmh rmh;
459 int data_mode; 464 int data_mode;
460 465
@@ -499,7 +504,7 @@ static int vx_alloc_pipe(vx_core_t *chip, int capture,
499 * vx_free_pipe - release a pipe 504 * vx_free_pipe - release a pipe
500 * @pipe: pipe to be released 505 * @pipe: pipe to be released
501 */ 506 */
502static int vx_free_pipe(vx_core_t *chip, vx_pipe_t *pipe) 507static int vx_free_pipe(struct vx_core *chip, struct vx_pipe *pipe)
503{ 508{
504 struct vx_rmh rmh; 509 struct vx_rmh rmh;
505 510
@@ -517,7 +522,7 @@ static int vx_free_pipe(vx_core_t *chip, vx_pipe_t *pipe)
517 * 522 *
518 * called from trigger callback only 523 * called from trigger callback only
519 */ 524 */
520static int vx_start_stream(vx_core_t *chip, vx_pipe_t *pipe) 525static int vx_start_stream(struct vx_core *chip, struct vx_pipe *pipe)
521{ 526{
522 struct vx_rmh rmh; 527 struct vx_rmh rmh;
523 528
@@ -533,7 +538,7 @@ static int vx_start_stream(vx_core_t *chip, vx_pipe_t *pipe)
533 * 538 *
534 * called from trigger callback only 539 * called from trigger callback only
535 */ 540 */
536static int vx_stop_stream(vx_core_t *chip, vx_pipe_t *pipe) 541static int vx_stop_stream(struct vx_core *chip, struct vx_pipe *pipe)
537{ 542{
538 struct vx_rmh rmh; 543 struct vx_rmh rmh;
539 544
@@ -547,11 +552,12 @@ static int vx_stop_stream(vx_core_t *chip, vx_pipe_t *pipe)
547 * playback hw information 552 * playback hw information
548 */ 553 */
549 554
550static snd_pcm_hardware_t vx_pcm_playback_hw = { 555static struct snd_pcm_hardware vx_pcm_playback_hw = {
551 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 556 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
552 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_MMAP_VALID /*|*/ 557 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_MMAP_VALID /*|*/
553 /*SNDRV_PCM_INFO_RESUME*/), 558 /*SNDRV_PCM_INFO_RESUME*/),
554 .formats = /*SNDRV_PCM_FMTBIT_U8 |*/ SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_3LE, 559 .formats = (/*SNDRV_PCM_FMTBIT_U8 |*/
560 SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_3LE),
555 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 561 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
556 .rate_min = 5000, 562 .rate_min = 5000,
557 .rate_max = 48000, 563 .rate_max = 48000,
@@ -571,11 +577,11 @@ static void vx_pcm_delayed_start(unsigned long arg);
571/* 577/*
572 * vx_pcm_playback_open - open callback for playback 578 * vx_pcm_playback_open - open callback for playback
573 */ 579 */
574static int vx_pcm_playback_open(snd_pcm_substream_t *subs) 580static int vx_pcm_playback_open(struct snd_pcm_substream *subs)
575{ 581{
576 snd_pcm_runtime_t *runtime = subs->runtime; 582 struct snd_pcm_runtime *runtime = subs->runtime;
577 vx_core_t *chip = snd_pcm_substream_chip(subs); 583 struct vx_core *chip = snd_pcm_substream_chip(subs);
578 vx_pipe_t *pipe = NULL; 584 struct vx_pipe *pipe = NULL;
579 unsigned int audio; 585 unsigned int audio;
580 int err; 586 int err;
581 587
@@ -615,10 +621,10 @@ static int vx_pcm_playback_open(snd_pcm_substream_t *subs)
615/* 621/*
616 * vx_pcm_playback_close - close callback for playback 622 * vx_pcm_playback_close - close callback for playback
617 */ 623 */
618static int vx_pcm_playback_close(snd_pcm_substream_t *subs) 624static int vx_pcm_playback_close(struct snd_pcm_substream *subs)
619{ 625{
620 vx_core_t *chip = snd_pcm_substream_chip(subs); 626 struct vx_core *chip = snd_pcm_substream_chip(subs);
621 vx_pipe_t *pipe; 627 struct vx_pipe *pipe;
622 628
623 if (! subs->runtime->private_data) 629 if (! subs->runtime->private_data)
624 return -EINVAL; 630 return -EINVAL;
@@ -641,7 +647,7 @@ static int vx_pcm_playback_close(snd_pcm_substream_t *subs)
641 * 647 *
642 * NB: call with a certain lock. 648 * NB: call with a certain lock.
643 */ 649 */
644static int vx_notify_end_of_buffer(vx_core_t *chip, vx_pipe_t *pipe) 650static int vx_notify_end_of_buffer(struct vx_core *chip, struct vx_pipe *pipe)
645{ 651{
646 int err; 652 int err;
647 struct vx_rmh rmh; /* use a temporary rmh here */ 653 struct vx_rmh rmh; /* use a temporary rmh here */
@@ -669,7 +675,9 @@ static int vx_notify_end_of_buffer(vx_core_t *chip, vx_pipe_t *pipe)
669 * 675 *
670 * return 0 if ok. 676 * return 0 if ok.
671 */ 677 */
672static int vx_pcm_playback_transfer_chunk(vx_core_t *chip, snd_pcm_runtime_t *runtime, vx_pipe_t *pipe, int size) 678static int vx_pcm_playback_transfer_chunk(struct vx_core *chip,
679 struct snd_pcm_runtime *runtime,
680 struct vx_pipe *pipe, int size)
673{ 681{
674 int space, err = 0; 682 int space, err = 0;
675 683
@@ -705,7 +713,9 @@ static int vx_pcm_playback_transfer_chunk(vx_core_t *chip, snd_pcm_runtime_t *ru
705 * so that the caller can check the total transferred size later 713 * so that the caller can check the total transferred size later
706 * (to call snd_pcm_period_elapsed). 714 * (to call snd_pcm_period_elapsed).
707 */ 715 */
708static int vx_update_pipe_position(vx_core_t *chip, snd_pcm_runtime_t *runtime, vx_pipe_t *pipe) 716static int vx_update_pipe_position(struct vx_core *chip,
717 struct snd_pcm_runtime *runtime,
718 struct vx_pipe *pipe)
709{ 719{
710 struct vx_rmh rmh; 720 struct vx_rmh rmh;
711 int err, update; 721 int err, update;
@@ -731,10 +741,12 @@ static int vx_update_pipe_position(vx_core_t *chip, snd_pcm_runtime_t *runtime,
731 * transfer the pending playback buffer data to DSP 741 * transfer the pending playback buffer data to DSP
732 * called from interrupt handler 742 * called from interrupt handler
733 */ 743 */
734static void vx_pcm_playback_transfer(vx_core_t *chip, snd_pcm_substream_t *subs, vx_pipe_t *pipe, int nchunks) 744static void vx_pcm_playback_transfer(struct vx_core *chip,
745 struct snd_pcm_substream *subs,
746 struct vx_pipe *pipe, int nchunks)
735{ 747{
736 int i, err; 748 int i, err;
737 snd_pcm_runtime_t *runtime = subs->runtime; 749 struct snd_pcm_runtime *runtime = subs->runtime;
738 750
739 if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE)) 751 if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE))
740 return; 752 return;
@@ -749,10 +761,12 @@ static void vx_pcm_playback_transfer(vx_core_t *chip, snd_pcm_substream_t *subs,
749 * update the playback position and call snd_pcm_period_elapsed() if necessary 761 * update the playback position and call snd_pcm_period_elapsed() if necessary
750 * called from interrupt handler 762 * called from interrupt handler
751 */ 763 */
752static void vx_pcm_playback_update(vx_core_t *chip, snd_pcm_substream_t *subs, vx_pipe_t *pipe) 764static void vx_pcm_playback_update(struct vx_core *chip,
765 struct snd_pcm_substream *subs,
766 struct vx_pipe *pipe)
753{ 767{
754 int err; 768 int err;
755 snd_pcm_runtime_t *runtime = subs->runtime; 769 struct snd_pcm_runtime *runtime = subs->runtime;
756 770
757 if (pipe->running && ! (chip->chip_status & VX_STAT_IS_STALE)) { 771 if (pipe->running && ! (chip->chip_status & VX_STAT_IS_STALE)) {
758 if ((err = vx_update_pipe_position(chip, runtime, pipe)) < 0) 772 if ((err = vx_update_pipe_position(chip, runtime, pipe)) < 0)
@@ -771,9 +785,9 @@ static void vx_pcm_playback_update(vx_core_t *chip, snd_pcm_substream_t *subs, v
771 */ 785 */
772static void vx_pcm_delayed_start(unsigned long arg) 786static void vx_pcm_delayed_start(unsigned long arg)
773{ 787{
774 snd_pcm_substream_t *subs = (snd_pcm_substream_t *)arg; 788 struct snd_pcm_substream *subs = (struct snd_pcm_substream *)arg;
775 vx_core_t *chip = subs->pcm->private_data; 789 struct vx_core *chip = subs->pcm->private_data;
776 vx_pipe_t *pipe = subs->runtime->private_data; 790 struct vx_pipe *pipe = subs->runtime->private_data;
777 int err; 791 int err;
778 792
779 /* printk( KERN_DEBUG "DDDD tasklet delayed start jiffies = %ld\n", jiffies);*/ 793 /* printk( KERN_DEBUG "DDDD tasklet delayed start jiffies = %ld\n", jiffies);*/
@@ -792,10 +806,10 @@ static void vx_pcm_delayed_start(unsigned long arg)
792/* 806/*
793 * vx_pcm_playback_trigger - trigger callback for playback 807 * vx_pcm_playback_trigger - trigger callback for playback
794 */ 808 */
795static int vx_pcm_trigger(snd_pcm_substream_t *subs, int cmd) 809static int vx_pcm_trigger(struct snd_pcm_substream *subs, int cmd)
796{ 810{
797 vx_core_t *chip = snd_pcm_substream_chip(subs); 811 struct vx_core *chip = snd_pcm_substream_chip(subs);
798 vx_pipe_t *pipe = subs->runtime->private_data; 812 struct vx_pipe *pipe = subs->runtime->private_data;
799 int err; 813 int err;
800 814
801 if (chip->chip_status & VX_STAT_IS_STALE) 815 if (chip->chip_status & VX_STAT_IS_STALE)
@@ -839,18 +853,18 @@ static int vx_pcm_trigger(snd_pcm_substream_t *subs, int cmd)
839/* 853/*
840 * vx_pcm_playback_pointer - pointer callback for playback 854 * vx_pcm_playback_pointer - pointer callback for playback
841 */ 855 */
842static snd_pcm_uframes_t vx_pcm_playback_pointer(snd_pcm_substream_t *subs) 856static snd_pcm_uframes_t vx_pcm_playback_pointer(struct snd_pcm_substream *subs)
843{ 857{
844 snd_pcm_runtime_t *runtime = subs->runtime; 858 struct snd_pcm_runtime *runtime = subs->runtime;
845 vx_pipe_t *pipe = runtime->private_data; 859 struct vx_pipe *pipe = runtime->private_data;
846 return pipe->position; 860 return pipe->position;
847} 861}
848 862
849/* 863/*
850 * vx_pcm_hw_params - hw_params callback for playback and capture 864 * vx_pcm_hw_params - hw_params callback for playback and capture
851 */ 865 */
852static int vx_pcm_hw_params(snd_pcm_substream_t *subs, 866static int vx_pcm_hw_params(struct snd_pcm_substream *subs,
853 snd_pcm_hw_params_t *hw_params) 867 struct snd_pcm_hw_params *hw_params)
854{ 868{
855 return snd_pcm_alloc_vmalloc_buffer(subs, params_buffer_bytes(hw_params)); 869 return snd_pcm_alloc_vmalloc_buffer(subs, params_buffer_bytes(hw_params));
856} 870}
@@ -858,7 +872,7 @@ static int vx_pcm_hw_params(snd_pcm_substream_t *subs,
858/* 872/*
859 * vx_pcm_hw_free - hw_free callback for playback and capture 873 * vx_pcm_hw_free - hw_free callback for playback and capture
860 */ 874 */
861static int vx_pcm_hw_free(snd_pcm_substream_t *subs) 875static int vx_pcm_hw_free(struct snd_pcm_substream *subs)
862{ 876{
863 return snd_pcm_free_vmalloc_buffer(subs); 877 return snd_pcm_free_vmalloc_buffer(subs);
864} 878}
@@ -866,11 +880,11 @@ static int vx_pcm_hw_free(snd_pcm_substream_t *subs)
866/* 880/*
867 * vx_pcm_prepare - prepare callback for playback and capture 881 * vx_pcm_prepare - prepare callback for playback and capture
868 */ 882 */
869static int vx_pcm_prepare(snd_pcm_substream_t *subs) 883static int vx_pcm_prepare(struct snd_pcm_substream *subs)
870{ 884{
871 vx_core_t *chip = snd_pcm_substream_chip(subs); 885 struct vx_core *chip = snd_pcm_substream_chip(subs);
872 snd_pcm_runtime_t *runtime = subs->runtime; 886 struct snd_pcm_runtime *runtime = subs->runtime;
873 vx_pipe_t *pipe = runtime->private_data; 887 struct vx_pipe *pipe = runtime->private_data;
874 int err, data_mode; 888 int err, data_mode;
875 // int max_size, nchunks; 889 // int max_size, nchunks;
876 890
@@ -897,7 +911,8 @@ static int vx_pcm_prepare(snd_pcm_substream_t *subs)
897 } 911 }
898 912
899 if (chip->pcm_running && chip->freq != runtime->rate) { 913 if (chip->pcm_running && chip->freq != runtime->rate) {
900 snd_printk(KERN_ERR "vx: cannot set different clock %d from the current %d\n", runtime->rate, chip->freq); 914 snd_printk(KERN_ERR "vx: cannot set different clock %d "
915 "from the current %d\n", runtime->rate, chip->freq);
901 return -EINVAL; 916 return -EINVAL;
902 } 917 }
903 vx_set_clock(chip, runtime->rate); 918 vx_set_clock(chip, runtime->rate);
@@ -930,7 +945,7 @@ static int vx_pcm_prepare(snd_pcm_substream_t *subs)
930/* 945/*
931 * operators for PCM playback 946 * operators for PCM playback
932 */ 947 */
933static snd_pcm_ops_t vx_pcm_playback_ops = { 948static struct snd_pcm_ops vx_pcm_playback_ops = {
934 .open = vx_pcm_playback_open, 949 .open = vx_pcm_playback_open,
935 .close = vx_pcm_playback_close, 950 .close = vx_pcm_playback_close,
936 .ioctl = snd_pcm_lib_ioctl, 951 .ioctl = snd_pcm_lib_ioctl,
@@ -947,11 +962,12 @@ static snd_pcm_ops_t vx_pcm_playback_ops = {
947 * playback hw information 962 * playback hw information
948 */ 963 */
949 964
950static snd_pcm_hardware_t vx_pcm_capture_hw = { 965static struct snd_pcm_hardware vx_pcm_capture_hw = {
951 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 966 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
952 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_MMAP_VALID /*|*/ 967 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_MMAP_VALID /*|*/
953 /*SNDRV_PCM_INFO_RESUME*/), 968 /*SNDRV_PCM_INFO_RESUME*/),
954 .formats = /*SNDRV_PCM_FMTBIT_U8 |*/ SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_3LE, 969 .formats = (/*SNDRV_PCM_FMTBIT_U8 |*/
970 SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_3LE),
955 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 971 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
956 .rate_min = 5000, 972 .rate_min = 5000,
957 .rate_max = 48000, 973 .rate_max = 48000,
@@ -969,12 +985,12 @@ static snd_pcm_hardware_t vx_pcm_capture_hw = {
969/* 985/*
970 * vx_pcm_capture_open - open callback for capture 986 * vx_pcm_capture_open - open callback for capture
971 */ 987 */
972static int vx_pcm_capture_open(snd_pcm_substream_t *subs) 988static int vx_pcm_capture_open(struct snd_pcm_substream *subs)
973{ 989{
974 snd_pcm_runtime_t *runtime = subs->runtime; 990 struct snd_pcm_runtime *runtime = subs->runtime;
975 vx_core_t *chip = snd_pcm_substream_chip(subs); 991 struct vx_core *chip = snd_pcm_substream_chip(subs);
976 vx_pipe_t *pipe; 992 struct vx_pipe *pipe;
977 vx_pipe_t *pipe_out_monitoring = NULL; 993 struct vx_pipe *pipe_out_monitoring = NULL;
978 unsigned int audio; 994 unsigned int audio;
979 int err; 995 int err;
980 996
@@ -1005,9 +1021,11 @@ static int vx_pcm_capture_open(snd_pcm_substream_t *subs)
1005 if an output pipe is available, it's audios still may need to be 1021 if an output pipe is available, it's audios still may need to be
1006 unmuted. hence we'll have to call a mixer entry point. 1022 unmuted. hence we'll have to call a mixer entry point.
1007 */ 1023 */
1008 vx_set_monitor_level(chip, audio, chip->audio_monitor[audio], chip->audio_monitor_active[audio]); 1024 vx_set_monitor_level(chip, audio, chip->audio_monitor[audio],
1025 chip->audio_monitor_active[audio]);
1009 /* assuming stereo */ 1026 /* assuming stereo */
1010 vx_set_monitor_level(chip, audio+1, chip->audio_monitor[audio+1], chip->audio_monitor_active[audio+1]); 1027 vx_set_monitor_level(chip, audio+1, chip->audio_monitor[audio+1],
1028 chip->audio_monitor_active[audio+1]);
1011 } 1029 }
1012 1030
1013 pipe->monitoring_pipe = pipe_out_monitoring; /* default value NULL */ 1031 pipe->monitoring_pipe = pipe_out_monitoring; /* default value NULL */
@@ -1026,11 +1044,11 @@ static int vx_pcm_capture_open(snd_pcm_substream_t *subs)
1026/* 1044/*
1027 * vx_pcm_capture_close - close callback for capture 1045 * vx_pcm_capture_close - close callback for capture
1028 */ 1046 */
1029static int vx_pcm_capture_close(snd_pcm_substream_t *subs) 1047static int vx_pcm_capture_close(struct snd_pcm_substream *subs)
1030{ 1048{
1031 vx_core_t *chip = snd_pcm_substream_chip(subs); 1049 struct vx_core *chip = snd_pcm_substream_chip(subs);
1032 vx_pipe_t *pipe; 1050 struct vx_pipe *pipe;
1033 vx_pipe_t *pipe_out_monitoring; 1051 struct vx_pipe *pipe_out_monitoring;
1034 1052
1035 if (! subs->runtime->private_data) 1053 if (! subs->runtime->private_data)
1036 return -EINVAL; 1054 return -EINVAL;
@@ -1062,10 +1080,11 @@ static int vx_pcm_capture_close(snd_pcm_substream_t *subs)
1062/* 1080/*
1063 * vx_pcm_capture_update - update the capture buffer 1081 * vx_pcm_capture_update - update the capture buffer
1064 */ 1082 */
1065static void vx_pcm_capture_update(vx_core_t *chip, snd_pcm_substream_t *subs, vx_pipe_t *pipe) 1083static void vx_pcm_capture_update(struct vx_core *chip, struct snd_pcm_substream *subs,
1084 struct vx_pipe *pipe)
1066{ 1085{
1067 int size, space, count; 1086 int size, space, count;
1068 snd_pcm_runtime_t *runtime = subs->runtime; 1087 struct snd_pcm_runtime *runtime = subs->runtime;
1069 1088
1070 if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE)) 1089 if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE))
1071 return; 1090 return;
@@ -1135,17 +1154,17 @@ static void vx_pcm_capture_update(vx_core_t *chip, snd_pcm_substream_t *subs, vx
1135/* 1154/*
1136 * vx_pcm_capture_pointer - pointer callback for capture 1155 * vx_pcm_capture_pointer - pointer callback for capture
1137 */ 1156 */
1138static snd_pcm_uframes_t vx_pcm_capture_pointer(snd_pcm_substream_t *subs) 1157static snd_pcm_uframes_t vx_pcm_capture_pointer(struct snd_pcm_substream *subs)
1139{ 1158{
1140 snd_pcm_runtime_t *runtime = subs->runtime; 1159 struct snd_pcm_runtime *runtime = subs->runtime;
1141 vx_pipe_t *pipe = runtime->private_data; 1160 struct vx_pipe *pipe = runtime->private_data;
1142 return bytes_to_frames(runtime, pipe->hw_ptr); 1161 return bytes_to_frames(runtime, pipe->hw_ptr);
1143} 1162}
1144 1163
1145/* 1164/*
1146 * operators for PCM capture 1165 * operators for PCM capture
1147 */ 1166 */
1148static snd_pcm_ops_t vx_pcm_capture_ops = { 1167static struct snd_pcm_ops vx_pcm_capture_ops = {
1149 .open = vx_pcm_capture_open, 1168 .open = vx_pcm_capture_open,
1150 .close = vx_pcm_capture_close, 1169 .close = vx_pcm_capture_close,
1151 .ioctl = snd_pcm_lib_ioctl, 1170 .ioctl = snd_pcm_lib_ioctl,
@@ -1161,10 +1180,10 @@ static snd_pcm_ops_t vx_pcm_capture_ops = {
1161/* 1180/*
1162 * interrupt handler for pcm streams 1181 * interrupt handler for pcm streams
1163 */ 1182 */
1164void vx_pcm_update_intr(vx_core_t *chip, unsigned int events) 1183void vx_pcm_update_intr(struct vx_core *chip, unsigned int events)
1165{ 1184{
1166 unsigned int i; 1185 unsigned int i;
1167 vx_pipe_t *pipe; 1186 struct vx_pipe *pipe;
1168 1187
1169#define EVENT_MASK (END_OF_BUFFER_EVENTS_PENDING|ASYNC_EVENTS_PENDING) 1188#define EVENT_MASK (END_OF_BUFFER_EVENTS_PENDING|ASYNC_EVENTS_PENDING)
1170 1189
@@ -1218,7 +1237,7 @@ void vx_pcm_update_intr(vx_core_t *chip, unsigned int events)
1218/* 1237/*
1219 * vx_init_audio_io - check the availabe audio i/o and allocate pipe arrays 1238 * vx_init_audio_io - check the availabe audio i/o and allocate pipe arrays
1220 */ 1239 */
1221static int vx_init_audio_io(vx_core_t *chip) 1240static int vx_init_audio_io(struct vx_core *chip)
1222{ 1241{
1223 struct vx_rmh rmh; 1242 struct vx_rmh rmh;
1224 int preferred; 1243 int preferred;
@@ -1234,19 +1253,20 @@ static int vx_init_audio_io(vx_core_t *chip)
1234 chip->audio_info = rmh.Stat[1]; 1253 chip->audio_info = rmh.Stat[1];
1235 1254
1236 /* allocate pipes */ 1255 /* allocate pipes */
1237 chip->playback_pipes = kmalloc(sizeof(vx_pipe_t *) * chip->audio_outs, GFP_KERNEL); 1256 chip->playback_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_outs, GFP_KERNEL);
1238 chip->capture_pipes = kmalloc(sizeof(vx_pipe_t *) * chip->audio_ins, GFP_KERNEL); 1257 chip->capture_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_ins, GFP_KERNEL);
1239 if (! chip->playback_pipes || ! chip->capture_pipes) 1258 if (! chip->playback_pipes || ! chip->capture_pipes)
1240 return -ENOMEM; 1259 return -ENOMEM;
1241 1260
1242 memset(chip->playback_pipes, 0, sizeof(vx_pipe_t *) * chip->audio_outs); 1261 memset(chip->playback_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_outs);
1243 memset(chip->capture_pipes, 0, sizeof(vx_pipe_t *) * chip->audio_ins); 1262 memset(chip->capture_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_ins);
1244 1263
1245 preferred = chip->ibl.size; 1264 preferred = chip->ibl.size;
1246 chip->ibl.size = 0; 1265 chip->ibl.size = 0;
1247 vx_set_ibl(chip, &chip->ibl); /* query the info */ 1266 vx_set_ibl(chip, &chip->ibl); /* query the info */
1248 if (preferred > 0) { 1267 if (preferred > 0) {
1249 chip->ibl.size = ((preferred + chip->ibl.granularity - 1) / chip->ibl.granularity) * chip->ibl.granularity; 1268 chip->ibl.size = ((preferred + chip->ibl.granularity - 1) /
1269 chip->ibl.granularity) * chip->ibl.granularity;
1250 if (chip->ibl.size > chip->ibl.max_size) 1270 if (chip->ibl.size > chip->ibl.max_size)
1251 chip->ibl.size = chip->ibl.max_size; 1271 chip->ibl.size = chip->ibl.max_size;
1252 } else 1272 } else
@@ -1260,9 +1280,9 @@ static int vx_init_audio_io(vx_core_t *chip)
1260/* 1280/*
1261 * free callback for pcm 1281 * free callback for pcm
1262 */ 1282 */
1263static void snd_vx_pcm_free(snd_pcm_t *pcm) 1283static void snd_vx_pcm_free(struct snd_pcm *pcm)
1264{ 1284{
1265 vx_core_t *chip = pcm->private_data; 1285 struct vx_core *chip = pcm->private_data;
1266 chip->pcm[pcm->device] = NULL; 1286 chip->pcm[pcm->device] = NULL;
1267 kfree(chip->playback_pipes); 1287 kfree(chip->playback_pipes);
1268 chip->playback_pipes = NULL; 1288 chip->playback_pipes = NULL;
@@ -1273,9 +1293,9 @@ static void snd_vx_pcm_free(snd_pcm_t *pcm)
1273/* 1293/*
1274 * snd_vx_pcm_new - create and initialize a pcm 1294 * snd_vx_pcm_new - create and initialize a pcm
1275 */ 1295 */
1276int snd_vx_pcm_new(vx_core_t *chip) 1296int snd_vx_pcm_new(struct vx_core *chip)
1277{ 1297{
1278 snd_pcm_t *pcm; 1298 struct snd_pcm *pcm;
1279 unsigned int i; 1299 unsigned int i;
1280 int err; 1300 int err;
1281 1301
diff --git a/sound/drivers/vx/vx_uer.c b/sound/drivers/vx/vx_uer.c
index 4fc38bde34f4..7400306b7f28 100644
--- a/sound/drivers/vx/vx_uer.c
+++ b/sound/drivers/vx/vx_uer.c
@@ -31,7 +31,7 @@
31 * vx_modify_board_clock - tell the board that its clock has been modified 31 * vx_modify_board_clock - tell the board that its clock has been modified
32 * @sync: DSP needs to resynchronize its FIFO 32 * @sync: DSP needs to resynchronize its FIFO
33 */ 33 */
34static int vx_modify_board_clock(vx_core_t *chip, int sync) 34static int vx_modify_board_clock(struct vx_core *chip, int sync)
35{ 35{
36 struct vx_rmh rmh; 36 struct vx_rmh rmh;
37 37
@@ -45,7 +45,7 @@ static int vx_modify_board_clock(vx_core_t *chip, int sync)
45/* 45/*
46 * vx_modify_board_inputs - resync audio inputs 46 * vx_modify_board_inputs - resync audio inputs
47 */ 47 */
48static int vx_modify_board_inputs(vx_core_t *chip) 48static int vx_modify_board_inputs(struct vx_core *chip)
49{ 49{
50 struct vx_rmh rmh; 50 struct vx_rmh rmh;
51 51
@@ -59,7 +59,7 @@ static int vx_modify_board_inputs(vx_core_t *chip)
59 * @index: the bit index 59 * @index: the bit index
60 * returns 0 or 1. 60 * returns 0 or 1.
61 */ 61 */
62static int vx_read_one_cbit(vx_core_t *chip, int index) 62static int vx_read_one_cbit(struct vx_core *chip, int index)
63{ 63{
64 unsigned long flags; 64 unsigned long flags;
65 int val; 65 int val;
@@ -82,7 +82,7 @@ static int vx_read_one_cbit(vx_core_t *chip, int index)
82 * @index: the bit index 82 * @index: the bit index
83 * @val: bit value, 0 or 1 83 * @val: bit value, 0 or 1
84 */ 84 */
85static void vx_write_one_cbit(vx_core_t *chip, int index, int val) 85static void vx_write_one_cbit(struct vx_core *chip, int index, int val)
86{ 86{
87 unsigned long flags; 87 unsigned long flags;
88 val = !!val; /* 0 or 1 */ 88 val = !!val; /* 0 or 1 */
@@ -104,7 +104,7 @@ static void vx_write_one_cbit(vx_core_t *chip, int index, int val)
104 * returns the frequency of UER, or 0 if not sync, 104 * returns the frequency of UER, or 0 if not sync,
105 * or a negative error code. 105 * or a negative error code.
106 */ 106 */
107static int vx_read_uer_status(vx_core_t *chip, int *mode) 107static int vx_read_uer_status(struct vx_core *chip, int *mode)
108{ 108{
109 int val, freq; 109 int val, freq;
110 110
@@ -160,7 +160,7 @@ static int vx_read_uer_status(vx_core_t *chip, int *mode)
160 * default : HexFreq = (dword) ((double) 28224000 / (double) (Frequency*4)) - 0x000001FF 160 * default : HexFreq = (dword) ((double) 28224000 / (double) (Frequency*4)) - 0x000001FF
161 */ 161 */
162 162
163static int vx_calc_clock_from_freq(vx_core_t *chip, int freq) 163static int vx_calc_clock_from_freq(struct vx_core *chip, int freq)
164{ 164{
165 int hexfreq; 165 int hexfreq;
166 166
@@ -187,7 +187,7 @@ static int vx_calc_clock_from_freq(vx_core_t *chip, int freq)
187 * vx_change_clock_source - change the clock source 187 * vx_change_clock_source - change the clock source
188 * @source: the new source 188 * @source: the new source
189 */ 189 */
190static void vx_change_clock_source(vx_core_t *chip, int source) 190static void vx_change_clock_source(struct vx_core *chip, int source)
191{ 191{
192 unsigned long flags; 192 unsigned long flags;
193 193
@@ -205,7 +205,7 @@ static void vx_change_clock_source(vx_core_t *chip, int source)
205/* 205/*
206 * set the internal clock 206 * set the internal clock
207 */ 207 */
208void vx_set_internal_clock(vx_core_t *chip, unsigned int freq) 208void vx_set_internal_clock(struct vx_core *chip, unsigned int freq)
209{ 209{
210 int clock; 210 int clock;
211 unsigned long flags; 211 unsigned long flags;
@@ -228,7 +228,7 @@ void vx_set_internal_clock(vx_core_t *chip, unsigned int freq)
228 * set the iec958 status bits 228 * set the iec958 status bits
229 * @bits: 32-bit status bits 229 * @bits: 32-bit status bits
230 */ 230 */
231void vx_set_iec958_status(vx_core_t *chip, unsigned int bits) 231void vx_set_iec958_status(struct vx_core *chip, unsigned int bits)
232{ 232{
233 int i; 233 int i;
234 234
@@ -243,7 +243,7 @@ void vx_set_iec958_status(vx_core_t *chip, unsigned int bits)
243/* 243/*
244 * vx_set_clock - change the clock and audio source if necessary 244 * vx_set_clock - change the clock and audio source if necessary
245 */ 245 */
246int vx_set_clock(vx_core_t *chip, unsigned int freq) 246int vx_set_clock(struct vx_core *chip, unsigned int freq)
247{ 247{
248 int src_changed = 0; 248 int src_changed = 0;
249 249
@@ -285,7 +285,7 @@ int vx_set_clock(vx_core_t *chip, unsigned int freq)
285/* 285/*
286 * vx_change_frequency - called from interrupt handler 286 * vx_change_frequency - called from interrupt handler
287 */ 287 */
288int vx_change_frequency(vx_core_t *chip) 288int vx_change_frequency(struct vx_core *chip)
289{ 289{
290 int freq; 290 int freq;
291 291