From c3e6f7d8763fa0400d28c57633eb323515ba05fc Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 16 Nov 2005 18:43:35 +0100 Subject: [ALSA] Remove superfluous pcm_free callbacks Remove superflous pcm_free callbacks. Signed-off-by: Takashi Iwai --- sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'sound/pcmcia') diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c b/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c index 20b86d8df7a3..d54033ebd5e9 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c @@ -324,15 +324,6 @@ static snd_pcm_ops_t pdacf_pcm_capture_ops = { }; -/* - * free callback for pcm - */ -static void snd_pdacf_pcm_free(snd_pcm_t *pcm) -{ - pdacf_t *chip = pcm->private_data; - chip->pcm = NULL; -} - /* * snd_pdacf_pcm_new - create and initialize a pcm */ @@ -348,7 +339,6 @@ int snd_pdacf_pcm_new(pdacf_t *chip) snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pdacf_pcm_capture_ops); pcm->private_data = chip; - pcm->private_free = snd_pdacf_pcm_free; pcm->info_flags = 0; strcpy(pcm->name, chip->card->shortname); chip->pcm = pcm; -- cgit v1.2.3 From bdbae7e62837c22c5399df0789a24e9d8a1d675f Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 10:21:19 +0100 Subject: [ALSA] Remove snd_vx_delay() function Replace snd_vx_delay() with appropriate delay/sleep functions. Signed-off-by: Takashi Iwai --- include/sound/vx_core.h | 2 -- sound/drivers/vx/vx_core.c | 19 +++---------------- sound/pci/vx222/vx222_ops.c | 14 +++++++------- sound/pcmcia/vx/vxp_ops.c | 10 +++++----- 4 files changed, 15 insertions(+), 30 deletions(-) (limited to 'sound/pcmcia') diff --git a/include/sound/vx_core.h b/include/sound/vx_core.h index 7a60a3888667..43c901bf7c1f 100644 --- a/include/sound/vx_core.h +++ b/include/sound/vx_core.h @@ -274,8 +274,6 @@ static inline void snd_vx_outl(vx_core_t *chip, int reg, unsigned int val) #define vx_inl(chip,reg) snd_vx_inl(chip, VX_##reg) #define vx_outl(chip,reg,val) snd_vx_outl(chip, VX_##reg,val) -void snd_vx_delay(vx_core_t *chip, int msec); - static inline void vx_reset_dsp(vx_core_t *chip) { snd_assert(chip->ops->reset_dsp, return); diff --git a/sound/drivers/vx/vx_core.c b/sound/drivers/vx/vx_core.c index 4697b1d75cbb..e6e4cf997419 100644 --- a/sound/drivers/vx/vx_core.c +++ b/sound/drivers/vx/vx_core.c @@ -40,18 +40,6 @@ MODULE_DESCRIPTION("Common routines for Digigram VX drivers"); MODULE_LICENSE("GPL"); -/* - * snd_vx_delay - delay for the specified time - * @xmsec: the time to delay in msec - */ -void snd_vx_delay(vx_core_t *chip, int xmsec) -{ - if (! in_interrupt() && xmsec >= 1000 / HZ) - msleep(xmsec); - else - mdelay(xmsec); -} - /* * vx_check_reg_bit - wait for the specified bit is set/reset on a register * @reg: register to check @@ -76,7 +64,7 @@ int snd_vx_check_reg_bit(vx_core_t *chip, int reg, int mask, int bit, int time) do { if ((snd_vx_inb(chip, reg) & mask) == bit) return 0; - //snd_vx_delay(chip, 10); + //msleep(10); } while (time_after_eq(end_time, jiffies)); snd_printd(KERN_DEBUG "vx_check_reg_bit: timeout, reg=%s, mask=0x%x, val=0x%x\n", reg_names[reg], mask, snd_vx_inb(chip, reg)); return -EIO; @@ -664,7 +652,7 @@ int snd_vx_dsp_boot(vx_core_t *chip, const struct firmware *boot) if ((err = snd_vx_load_boot_image(chip, boot)) < 0) return err; - snd_vx_delay(chip, 10); + msleep(10); return 0; } @@ -704,7 +692,7 @@ int snd_vx_dsp_load(vx_core_t *chip, const struct firmware *dsp) } snd_printdd(KERN_DEBUG "checksum = 0x%08x\n", csum); - snd_vx_delay(chip, 200); + msleep(200); if ((err = vx_wait_isr_bit(chip, ISR_CHK)) < 0) return err; @@ -831,7 +819,6 @@ EXPORT_SYMBOL(snd_vx_create); EXPORT_SYMBOL(snd_vx_setup_firmware); EXPORT_SYMBOL(snd_vx_free_firmware); EXPORT_SYMBOL(snd_vx_irq_handler); -EXPORT_SYMBOL(snd_vx_delay); EXPORT_SYMBOL(snd_vx_dsp_boot); EXPORT_SYMBOL(snd_vx_dsp_load); EXPORT_SYMBOL(snd_vx_load_boot_image); diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c index 967bd5e6b23c..2d4d0c29b4c4 100644 --- a/sound/pci/vx222/vx222_ops.c +++ b/sound/pci/vx222/vx222_ops.c @@ -154,7 +154,7 @@ static void vx2_reset_dsp(vx_core_t *_chip) /* set the reset dsp bit to 0 */ vx_outl(chip, CDSP, chip->regCDSP & ~VX_CDSP_DSP_RESET_MASK); - snd_vx_delay(_chip, XX_DSP_RESET_WAIT_TIME); + mdelay(XX_DSP_RESET_WAIT_TIME); chip->regCDSP |= VX_CDSP_DSP_RESET_MASK; /* set the reset dsp bit to 1 */ @@ -362,10 +362,10 @@ static int vx2_load_xilinx_binary(vx_core_t *chip, const struct firmware *xilinx /* XILINX reset (wait at least 1 milisecond between reset on and off). */ vx_outl(chip, CNTRL, VX_CNTRL_REGISTER_VALUE | VX_XILINX_RESET_MASK); vx_inl(chip, CNTRL); - snd_vx_delay(chip, 10); + msleep(10); vx_outl(chip, CNTRL, VX_CNTRL_REGISTER_VALUE); vx_inl(chip, CNTRL); - snd_vx_delay(chip, 10); + msleep(10); if (chip->type == VX_TYPE_BOARD) port = VX_CNTRL; @@ -381,7 +381,7 @@ static int vx2_load_xilinx_binary(vx_core_t *chip, const struct firmware *xilinx } put_xilinx_data(chip, port, 4, 0xff); /* end signature */ - snd_vx_delay(chip, 200); + msleep(200); /* test after loading (is buggy with VX222) */ if (chip->type != VX_TYPE_BOARD) { @@ -720,17 +720,17 @@ static void vx2_reset_codec(vx_core_t *_chip) /* Set the reset CODEC bit to 0. */ vx_outl(chip, CDSP, chip->regCDSP &~ VX_CDSP_CODEC_RESET_MASK); vx_inl(chip, CDSP); - snd_vx_delay(_chip, 10); + msleep(10); /* Set the reset CODEC bit to 1. */ chip->regCDSP |= VX_CDSP_CODEC_RESET_MASK; vx_outl(chip, CDSP, chip->regCDSP); vx_inl(chip, CDSP); if (_chip->type == VX_TYPE_BOARD) { - snd_vx_delay(_chip, 1); + msleep(1); return; } - snd_vx_delay(_chip, 5); /* additionnel wait time for AKM's */ + msleep(5); /* additionnel wait time for AKM's */ vx2_write_codec_reg(_chip, AKM_CODEC_POWER_CONTROL_CMD); /* DAC power up, ADC power up, Vref power down */ diff --git a/sound/pcmcia/vx/vxp_ops.c b/sound/pcmcia/vx/vxp_ops.c index 6f15c3d03ab5..2754d657a4d6 100644 --- a/sound/pcmcia/vx/vxp_ops.c +++ b/sound/pcmcia/vx/vxp_ops.c @@ -96,7 +96,7 @@ static int vx_check_magic(vx_core_t *chip) c = vx_inb(chip, CDSP); if (c == CDSP_MAGIC) return 0; - snd_vx_delay(chip, 10); + msleep(10); } while (time_after_eq(end_time, jiffies)); snd_printk(KERN_ERR "cannot find xilinx magic word (%x)\n", c); return -EIO; @@ -134,12 +134,12 @@ static void vxp_reset_codec(vx_core_t *_chip) /* Set the reset CODEC bit to 1. */ vx_outb(chip, CDSP, chip->regCDSP | VXP_CDSP_CODEC_RESET_MASK); vx_inb(chip, CDSP); - snd_vx_delay(_chip, 10); + msleep(10); /* Set the reset CODEC bit to 0. */ chip->regCDSP &= ~VXP_CDSP_CODEC_RESET_MASK; vx_outb(chip, CDSP, chip->regCDSP); vx_inb(chip, CDSP); - snd_vx_delay(_chip, 1); + msleep(1); } /* @@ -207,7 +207,7 @@ static int vxp_load_xilinx_binary(vx_core_t *_chip, const struct firmware *fw) vx_outb(chip, ICR, ICR_HF0); /* TEMPO 250ms : wait until Xilinx is downloaded */ - snd_vx_delay(_chip, 300); + msleep(300); /* test magical word */ if (vx_check_magic(_chip) < 0) @@ -221,7 +221,7 @@ static int vxp_load_xilinx_binary(vx_core_t *_chip, const struct firmware *fw) chip->regDIALOG |= VXP_DLG_XILINX_REPROG_MASK; vx_outb(chip, DIALOG, chip->regDIALOG); vx_inb(chip, DIALOG); - snd_vx_delay(_chip, 10); + msleep(10); chip->regDIALOG &= ~VXP_DLG_XILINX_REPROG_MASK; vx_outb(chip, DIALOG, chip->regDIALOG); vx_inb(chip, DIALOG); -- cgit v1.2.3 From af26367f69a474ed809e4a59abb5855b47daaff4 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 14:46:59 +0100 Subject: [ALSA] Remove xxx_t typedefs: VXdriver Remove xxx_t typedefs from the VXdriver codes (vx_core support, vx222 and vxpocket). Signed-off-by: Takashi Iwai --- include/sound/vx_core.h | 123 ++++++++++++++------------- sound/drivers/vx/vx_core.c | 58 ++++++------- sound/drivers/vx/vx_hwdep.c | 24 +++--- sound/drivers/vx/vx_mixer.c | 162 +++++++++++++++++------------------ sound/drivers/vx/vx_pcm.c | 200 ++++++++++++++++++++++++-------------------- sound/drivers/vx/vx_uer.c | 22 ++--- sound/pci/vx222/vx222.c | 16 ++-- sound/pci/vx222/vx222.h | 2 +- sound/pci/vx222/vx222_ops.c | 84 +++++++++---------- sound/pcmcia/vx/vxp_mixer.c | 26 +++--- sound/pcmcia/vx/vxp_ops.c | 48 +++++------ sound/pcmcia/vx/vxpocket.c | 26 +++--- sound/pcmcia/vx/vxpocket.h | 8 +- 13 files changed, 410 insertions(+), 389 deletions(-) (limited to 'sound/pcmcia') diff --git a/include/sound/vx_core.h b/include/sound/vx_core.h index 43c901bf7c1f..0a85c37d1bc7 100644 --- a/include/sound/vx_core.h +++ b/include/sound/vx_core.h @@ -36,9 +36,6 @@ struct firmware; struct device; -typedef struct snd_vx_core vx_core_t; -typedef struct vx_pipe vx_pipe_t; - #define VX_DRIVER_VERSION 0x010000 /* 1.0.0 */ /* @@ -76,7 +73,7 @@ struct vx_pipe { int channels; unsigned int differed_type; pcx_time_t pcx_time; - snd_pcm_substream_t *substream; + struct snd_pcm_substream *substream; int hbuf_size; /* H-buffer size in bytes */ int buffer_bytes; /* the ALSA pcm buffer size in bytes */ @@ -88,36 +85,38 @@ struct vx_pipe { u64 cur_count; /* current sample position (for playback) */ unsigned int references; /* an output pipe may be used for monitoring and/or playback */ - vx_pipe_t *monitoring_pipe; /* pointer to the monitoring pipe (capture pipe only)*/ + struct vx_pipe *monitoring_pipe; /* pointer to the monitoring pipe (capture pipe only)*/ struct tasklet_struct start_tq; }; +struct vx_core; + struct snd_vx_ops { /* low-level i/o */ - unsigned char (*in8)(vx_core_t *chip, int reg); - unsigned int (*in32)(vx_core_t *chip, int reg); - void (*out8)(vx_core_t *chip, int reg, unsigned char val); - void (*out32)(vx_core_t *chip, int reg, unsigned int val); + unsigned char (*in8)(struct vx_core *chip, int reg); + unsigned int (*in32)(struct vx_core *chip, int reg); + void (*out8)(struct vx_core *chip, int reg, unsigned char val); + void (*out32)(struct vx_core *chip, int reg, unsigned int val); /* irq */ - int (*test_and_ack)(vx_core_t *chip); - void (*validate_irq)(vx_core_t *chip, int enable); + int (*test_and_ack)(struct vx_core *chip); + void (*validate_irq)(struct vx_core *chip, int enable); /* codec */ - void (*write_codec)(vx_core_t *chip, int codec, unsigned int data); - void (*akm_write)(vx_core_t *chip, int reg, unsigned int data); - void (*reset_codec)(vx_core_t *chip); - void (*change_audio_source)(vx_core_t *chip, int src); - void (*set_clock_source)(vx_core_t *chp, int src); + void (*write_codec)(struct vx_core *chip, int codec, unsigned int data); + void (*akm_write)(struct vx_core *chip, int reg, unsigned int data); + void (*reset_codec)(struct vx_core *chip); + void (*change_audio_source)(struct vx_core *chip, int src); + void (*set_clock_source)(struct vx_core *chp, int src); /* chip init */ - int (*load_dsp)(vx_core_t *chip, int idx, const struct firmware *fw); - void (*reset_dsp)(vx_core_t *chip); - void (*reset_board)(vx_core_t *chip, int cold_reset); - int (*add_controls)(vx_core_t *chip); + int (*load_dsp)(struct vx_core *chip, int idx, const struct firmware *fw); + void (*reset_dsp)(struct vx_core *chip); + void (*reset_board)(struct vx_core *chip, int cold_reset); + int (*add_controls)(struct vx_core *chip); /* pcm */ - void (*dma_write)(vx_core_t *chip, snd_pcm_runtime_t *runtime, - vx_pipe_t *pipe, int count); - void (*dma_read)(vx_core_t *chip, snd_pcm_runtime_t *runtime, - vx_pipe_t *pipe, int count); + void (*dma_write)(struct vx_core *chip, struct snd_pcm_runtime *runtime, + struct vx_pipe *pipe, int count); + void (*dma_read)(struct vx_core *chip, struct snd_pcm_runtime *runtime, + struct vx_pipe *pipe, int count); }; struct snd_vx_hardware { @@ -158,10 +157,10 @@ enum { /* min/max values for analog output for old codecs */ #define VX_ANALOG_OUT_LEVEL_MAX 0xe3 -struct snd_vx_core { +struct vx_core { /* ALSA stuff */ - snd_card_t *card; - snd_pcm_t *pcm[VX_MAX_CODECS]; + struct snd_card *card; + struct snd_pcm *pcm[VX_MAX_CODECS]; int type; /* VX_TYPE_XXX */ int irq; @@ -179,7 +178,7 @@ struct snd_vx_core { unsigned int pcm_running; struct device *dev; - snd_hwdep_t *hwdep; + struct snd_hwdep *hwdep; struct vx_rmh irq_rmh; /* RMH used in interrupts */ @@ -216,14 +215,14 @@ struct snd_vx_core { /* * constructor */ -vx_core_t *snd_vx_create(snd_card_t *card, struct snd_vx_hardware *hw, - struct snd_vx_ops *ops, int extra_size); -int snd_vx_setup_firmware(vx_core_t *chip); -int snd_vx_load_boot_image(vx_core_t *chip, const struct firmware *dsp); -int snd_vx_dsp_boot(vx_core_t *chip, const struct firmware *dsp); -int snd_vx_dsp_load(vx_core_t *chip, const struct firmware *dsp); +struct vx_core *snd_vx_create(struct snd_card *card, struct snd_vx_hardware *hw, + struct snd_vx_ops *ops, int extra_size); +int snd_vx_setup_firmware(struct vx_core *chip); +int snd_vx_load_boot_image(struct vx_core *chip, const struct firmware *dsp); +int snd_vx_dsp_boot(struct vx_core *chip, const struct firmware *dsp); +int snd_vx_dsp_load(struct vx_core *chip, const struct firmware *dsp); -void snd_vx_free_firmware(vx_core_t *chip); +void snd_vx_free_firmware(struct vx_core *chip); /* * interrupt handler; exported for pcmcia @@ -233,37 +232,37 @@ irqreturn_t snd_vx_irq_handler(int irq, void *dev, struct pt_regs *regs); /* * lowlevel functions */ -static inline int vx_test_and_ack(vx_core_t *chip) +static inline int vx_test_and_ack(struct vx_core *chip) { snd_assert(chip->ops->test_and_ack, return -ENXIO); return chip->ops->test_and_ack(chip); } -static inline void vx_validate_irq(vx_core_t *chip, int enable) +static inline void vx_validate_irq(struct vx_core *chip, int enable) { snd_assert(chip->ops->validate_irq, return); chip->ops->validate_irq(chip, enable); } -static inline unsigned char snd_vx_inb(vx_core_t *chip, int reg) +static inline unsigned char snd_vx_inb(struct vx_core *chip, int reg) { snd_assert(chip->ops->in8, return 0); return chip->ops->in8(chip, reg); } -static inline unsigned int snd_vx_inl(vx_core_t *chip, int reg) +static inline unsigned int snd_vx_inl(struct vx_core *chip, int reg) { snd_assert(chip->ops->in32, return 0); return chip->ops->in32(chip, reg); } -static inline void snd_vx_outb(vx_core_t *chip, int reg, unsigned char val) +static inline void snd_vx_outb(struct vx_core *chip, int reg, unsigned char val) { snd_assert(chip->ops->out8, return); chip->ops->out8(chip, reg, val); } -static inline void snd_vx_outl(vx_core_t *chip, int reg, unsigned int val) +static inline void snd_vx_outl(struct vx_core *chip, int reg, unsigned int val) { snd_assert(chip->ops->out32, return); chip->ops->out32(chip, reg, val); @@ -274,25 +273,25 @@ static inline void snd_vx_outl(vx_core_t *chip, int reg, unsigned int val) #define vx_inl(chip,reg) snd_vx_inl(chip, VX_##reg) #define vx_outl(chip,reg,val) snd_vx_outl(chip, VX_##reg,val) -static inline void vx_reset_dsp(vx_core_t *chip) +static inline void vx_reset_dsp(struct vx_core *chip) { snd_assert(chip->ops->reset_dsp, return); chip->ops->reset_dsp(chip); } -int vx_send_msg(vx_core_t *chip, struct vx_rmh *rmh); -int vx_send_msg_nolock(vx_core_t *chip, struct vx_rmh *rmh); -int vx_send_rih(vx_core_t *chip, int cmd); -int vx_send_rih_nolock(vx_core_t *chip, int cmd); +int vx_send_msg(struct vx_core *chip, struct vx_rmh *rmh); +int vx_send_msg_nolock(struct vx_core *chip, struct vx_rmh *rmh); +int vx_send_rih(struct vx_core *chip, int cmd); +int vx_send_rih_nolock(struct vx_core *chip, int cmd); -void vx_reset_codec(vx_core_t *chip, int cold_reset); +void vx_reset_codec(struct vx_core *chip, int cold_reset); /* * check the bit on the specified register * returns zero if a bit matches, or a negative error code. * exported for vxpocket driver */ -int snd_vx_check_reg_bit(vx_core_t *chip, int reg, int mask, int bit, int time); +int snd_vx_check_reg_bit(struct vx_core *chip, int reg, int mask, int bit, int time); #define vx_check_isr(chip,mask,bit,time) snd_vx_check_reg_bit(chip, VX_ISR, mask, bit, time) #define vx_wait_isr_bit(chip,bit) vx_check_isr(chip, bit, bit, 200) #define vx_wait_for_rx_full(chip) vx_wait_isr_bit(chip, ISR_RX_FULL) @@ -301,15 +300,15 @@ int snd_vx_check_reg_bit(vx_core_t *chip, int reg, int mask, int bit, int time); /* * pseudo-DMA transfer */ -static inline void vx_pseudo_dma_write(vx_core_t *chip, snd_pcm_runtime_t *runtime, - vx_pipe_t *pipe, int count) +static inline void vx_pseudo_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, + struct vx_pipe *pipe, int count) { snd_assert(chip->ops->dma_write, return); chip->ops->dma_write(chip, runtime, pipe, count); } -static inline void vx_pseudo_dma_read(vx_core_t *chip, snd_pcm_runtime_t *runtime, - vx_pipe_t *pipe, int count) +static inline void vx_pseudo_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, + struct vx_pipe *pipe, int count) { snd_assert(chip->ops->dma_read, return); chip->ops->dma_read(chip, runtime, pipe, count); @@ -327,24 +326,24 @@ static inline void vx_pseudo_dma_read(vx_core_t *chip, snd_pcm_runtime_t *runtim /* * pcm stuff */ -int snd_vx_pcm_new(vx_core_t *chip); -void vx_pcm_update_intr(vx_core_t *chip, unsigned int events); +int snd_vx_pcm_new(struct vx_core *chip); +void vx_pcm_update_intr(struct vx_core *chip, unsigned int events); /* * mixer stuff */ -int snd_vx_mixer_new(vx_core_t *chip); -void vx_toggle_dac_mute(vx_core_t *chip, int mute); -int vx_sync_audio_source(vx_core_t *chip); -int vx_set_monitor_level(vx_core_t *chip, int audio, int level, int active); +int snd_vx_mixer_new(struct vx_core *chip); +void vx_toggle_dac_mute(struct vx_core *chip, int mute); +int vx_sync_audio_source(struct vx_core *chip); +int vx_set_monitor_level(struct vx_core *chip, int audio, int level, int active); /* * IEC958 & clock stuff */ -void vx_set_iec958_status(vx_core_t *chip, unsigned int bits); -int vx_set_clock(vx_core_t *chip, unsigned int freq); -void vx_set_internal_clock(vx_core_t *chip, unsigned int freq); -int vx_change_frequency(vx_core_t *chip); +void vx_set_iec958_status(struct vx_core *chip, unsigned int bits); +int vx_set_clock(struct vx_core *chip, unsigned int freq); +void vx_set_internal_clock(struct vx_core *chip, unsigned int freq); +int vx_change_frequency(struct vx_core *chip); /* 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"); * * returns zero if a bit matches, or a negative error code. */ -int snd_vx_check_reg_bit(vx_core_t *chip, int reg, int mask, int bit, int time) +int snd_vx_check_reg_bit(struct vx_core *chip, int reg, int mask, int bit, int time) { unsigned long end_time = jiffies + (time * HZ + 999) / 1000; #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) * returns 0 if successful, or a negative error code. * */ -static int vx_send_irq_dsp(vx_core_t *chip, int num) +static int vx_send_irq_dsp(struct vx_core *chip, int num) { int nirq; @@ -99,7 +99,7 @@ static int vx_send_irq_dsp(vx_core_t *chip, int num) * * returns 0 if successful, or a negative error code. */ -static int vx_reset_chk(vx_core_t *chip) +static int vx_reset_chk(struct vx_core *chip) { /* Reset irq CHK */ if (vx_send_irq_dsp(chip, IRQ_RESET_CHK) < 0) @@ -118,7 +118,7 @@ static int vx_reset_chk(vx_core_t *chip) * the error code can be VX-specific, retrieved via vx_get_error(). * NB: call with spinlock held! */ -static int vx_transfer_end(vx_core_t *chip, int cmd) +static int vx_transfer_end(struct vx_core *chip, int cmd) { int err; @@ -156,7 +156,7 @@ static int vx_transfer_end(vx_core_t *chip, int cmd) * the error code can be VX-specific, retrieved via vx_get_error(). * NB: call with spinlock held! */ -static int vx_read_status(vx_core_t *chip, struct vx_rmh *rmh) +static int vx_read_status(struct vx_core *chip, struct vx_rmh *rmh) { int i, err, val, size; @@ -236,7 +236,7 @@ static int vx_read_status(vx_core_t *chip, struct vx_rmh *rmh) * * this function doesn't call spinlock at all. */ -int vx_send_msg_nolock(vx_core_t *chip, struct vx_rmh *rmh) +int vx_send_msg_nolock(struct vx_core *chip, struct vx_rmh *rmh) { int i, err; @@ -341,7 +341,7 @@ int vx_send_msg_nolock(vx_core_t *chip, struct vx_rmh *rmh) * returns 0 if successful, or a negative error code. * see vx_send_msg_nolock(). */ -int vx_send_msg(vx_core_t *chip, struct vx_rmh *rmh) +int vx_send_msg(struct vx_core *chip, struct vx_rmh *rmh) { unsigned long flags; int err; @@ -364,7 +364,7 @@ int vx_send_msg(vx_core_t *chip, struct vx_rmh *rmh) * * unlike RMH, no command is sent to DSP. */ -int vx_send_rih_nolock(vx_core_t *chip, int cmd) +int vx_send_rih_nolock(struct vx_core *chip, int cmd) { int err; @@ -401,7 +401,7 @@ int vx_send_rih_nolock(vx_core_t *chip, int cmd) * * see vx_send_rih_nolock(). */ -int vx_send_rih(vx_core_t *chip, int cmd) +int vx_send_rih(struct vx_core *chip, int cmd) { unsigned long flags; int err; @@ -418,7 +418,7 @@ int vx_send_rih(vx_core_t *chip, int cmd) * snd_vx_boot_xilinx - boot up the xilinx interface * @boot: the boot record to load */ -int snd_vx_load_boot_image(vx_core_t *chip, const struct firmware *boot) +int snd_vx_load_boot_image(struct vx_core *chip, const struct firmware *boot) { unsigned int i; 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) * * called from irq handler only */ -static int vx_test_irq_src(vx_core_t *chip, unsigned int *ret) +static int vx_test_irq_src(struct vx_core *chip, unsigned int *ret) { int err; @@ -491,7 +491,7 @@ static int vx_test_irq_src(vx_core_t *chip, unsigned int *ret) */ static void vx_interrupt(unsigned long private_data) { - vx_core_t *chip = (vx_core_t *) private_data; + struct vx_core *chip = (struct vx_core *) private_data; unsigned int events; if (chip->chip_status & VX_STAT_IS_STALE) @@ -535,7 +535,7 @@ static void vx_interrupt(unsigned long private_data) */ irqreturn_t snd_vx_irq_handler(int irq, void *dev, struct pt_regs *regs) { - vx_core_t *chip = dev; + struct vx_core *chip = dev; if (! (chip->chip_status & VX_STAT_CHIP_INIT) || (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) /* */ -static void vx_reset_board(vx_core_t *chip, int cold_reset) +static void vx_reset_board(struct vx_core *chip, int cold_reset) { snd_assert(chip->ops->reset_board, return); @@ -587,9 +587,9 @@ static void vx_reset_board(vx_core_t *chip, int cold_reset) * proc interface */ -static void vx_proc_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) +static void vx_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) { - vx_core_t *chip = entry->private_data; + struct vx_core *chip = entry->private_data; static char *audio_src_vxp[] = { "Line", "Mic", "Digital" }; static char *audio_src_vx2[] = { "Analog", "Analog", "Digital" }; 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) chip->ibl.granularity); } -static void vx_proc_init(vx_core_t *chip) +static void vx_proc_init(struct vx_core *chip) { - snd_info_entry_t *entry; + struct snd_info_entry *entry; if (! snd_card_proc_new(chip->card, "vx-status", &entry)) snd_info_set_text_ops(entry, chip, 1024, vx_proc_read); @@ -642,7 +642,7 @@ static void vx_proc_init(vx_core_t *chip) /** * snd_vx_dsp_boot - load the DSP boot */ -int snd_vx_dsp_boot(vx_core_t *chip, const struct firmware *boot) +int snd_vx_dsp_boot(struct vx_core *chip, const struct firmware *boot) { int err; 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) /** * snd_vx_dsp_load - load the DSP image */ -int snd_vx_dsp_load(vx_core_t *chip, const struct firmware *dsp) +int snd_vx_dsp_load(struct vx_core *chip, const struct firmware *dsp) { unsigned int i; int err; @@ -709,9 +709,9 @@ int snd_vx_dsp_load(vx_core_t *chip, const struct firmware *dsp) /* * suspend */ -static int snd_vx_suspend(snd_card_t *card, pm_message_t state) +static int snd_vx_suspend(struct snd_card *card, pm_message_t state) { - vx_core_t *chip = card->pm_private_data; + struct vx_core *chip = card->pm_private_data; unsigned int i; snd_assert(chip, return -EINVAL); @@ -726,9 +726,9 @@ static int snd_vx_suspend(snd_card_t *card, pm_message_t state) /* * resume */ -static int snd_vx_resume(snd_card_t *card) +static int snd_vx_resume(struct snd_card *card) { - vx_core_t *chip = card->pm_private_data; + struct vx_core *chip = card->pm_private_data; int i, err; snd_assert(chip, return -EINVAL); @@ -754,7 +754,7 @@ static int snd_vx_resume(snd_card_t *card) #endif /** - * snd_vx_create - constructor for vx_core_t + * snd_vx_create - constructor for struct vx_core * @hw: hardware specific record * * this function allocates the instance and prepare for the hardware @@ -762,11 +762,11 @@ static int snd_vx_resume(snd_card_t *card) * * return the instance pointer if successful, NULL in error. */ -vx_core_t *snd_vx_create(snd_card_t *card, struct snd_vx_hardware *hw, - struct snd_vx_ops *ops, - int extra_size) +struct vx_core *snd_vx_create(struct snd_card *card, struct snd_vx_hardware *hw, + struct snd_vx_ops *ops, + int extra_size) { - vx_core_t *chip; + struct vx_core *chip; snd_assert(card && hw && ops, return NULL); 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 @@ #ifdef SND_VX_FW_LOADER -int snd_vx_setup_firmware(vx_core_t *chip) +int snd_vx_setup_firmware(struct vx_core *chip) { static char *fw_files[VX_TYPE_NUMS][4] = { [VX_TYPE_BOARD] = { @@ -95,7 +95,7 @@ int snd_vx_setup_firmware(vx_core_t *chip) } /* exported */ -void snd_vx_free_firmware(vx_core_t *chip) +void snd_vx_free_firmware(struct vx_core *chip) { #ifdef CONFIG_PM int i; @@ -106,17 +106,18 @@ void snd_vx_free_firmware(vx_core_t *chip) #else /* old style firmware loading */ -static int vx_hwdep_open(snd_hwdep_t *hw, struct file *file) +static int vx_hwdep_open(struct snd_hwdep *hw, struct file *file) { return 0; } -static int vx_hwdep_release(snd_hwdep_t *hw, struct file *file) +static int vx_hwdep_release(struct snd_hwdep *hw, struct file *file) { return 0; } -static int vx_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *info) +static int vx_hwdep_dsp_status(struct snd_hwdep *hw, + struct snd_hwdep_dsp_status *info) { static char *type_ids[VX_TYPE_NUMS] = { [VX_TYPE_BOARD] = "vxboard", @@ -125,7 +126,7 @@ static int vx_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *info) [VX_TYPE_VXPOCKET] = "vxpocket", [VX_TYPE_VXP440] = "vxp440", }; - vx_core_t *vx = hw->private_data; + struct vx_core *vx = hw->private_data; snd_assert(type_ids[vx->type], return -EINVAL); strcpy(info->id, type_ids[vx->type]); @@ -147,9 +148,10 @@ static void free_fw(const struct firmware *fw) } } -static int vx_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp) +static int vx_hwdep_dsp_load(struct snd_hwdep *hw, + struct snd_hwdep_dsp_image *dsp) { - vx_core_t *vx = hw->private_data; + struct vx_core *vx = hw->private_data; int index, err; struct firmware *fw; @@ -216,10 +218,10 @@ static int vx_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp) /* exported */ -int snd_vx_setup_firmware(vx_core_t *chip) +int snd_vx_setup_firmware(struct vx_core *chip) { int err; - snd_hwdep_t *hw; + struct snd_hwdep *hw; if ((err = snd_hwdep_new(chip->card, SND_VX_HWDEP_ID, 0, &hw)) < 0) return err; @@ -238,7 +240,7 @@ int snd_vx_setup_firmware(vx_core_t *chip) } /* exported */ -void snd_vx_free_firmware(vx_core_t *chip) +void snd_vx_free_firmware(struct vx_core *chip) { #ifdef CONFIG_PM 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 @@ /* * write a codec data (24bit) */ -static void vx_write_codec_reg(vx_core_t *chip, int codec, unsigned int data) +static void vx_write_codec_reg(struct vx_core *chip, int codec, unsigned int data) { unsigned long flags; @@ -47,7 +47,7 @@ static void vx_write_codec_reg(vx_core_t *chip, int codec, unsigned int data) /* * Data type used to access the Codec */ -typedef union { +union vx_codec_data { u32 l; #ifdef SNDRV_BIG_ENDIAN struct w { @@ -72,7 +72,7 @@ typedef union { u8 hh; } b; #endif -} vx_codec_data_t; +}; #define SET_CDC_DATA_SEL(di,s) ((di).b.mh = (u8) (s)) #define SET_CDC_DATA_REG(di,r) ((di).b.ml = (u8) (r)) @@ -85,9 +85,9 @@ typedef union { * @reg: register index * @val: data value */ -static void vx_set_codec_reg(vx_core_t *chip, int codec, int reg, int val) +static void vx_set_codec_reg(struct vx_core *chip, int codec, int reg, int val) { - vx_codec_data_t data; + union vx_codec_data data; /* DAC control register */ SET_CDC_DATA_INIT(data); 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) * @left: left output level, 0 = mute * @right: right output level */ -static void vx_set_analog_output_level(vx_core_t *chip, int codec, int left, int right) +static void vx_set_analog_output_level(struct vx_core *chip, int codec, int left, int right) { left = chip->hw->output_level_max - left; 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 #define DAC_ATTEN_MIN 0x08 #define DAC_ATTEN_MAX 0x38 -void vx_toggle_dac_mute(vx_core_t *chip, int mute) +void vx_toggle_dac_mute(struct vx_core *chip, int mute) { unsigned int i; for (i = 0; i < chip->hw->num_codecs; i++) { @@ -141,7 +141,7 @@ void vx_toggle_dac_mute(vx_core_t *chip, int mute) /* * vx_reset_codec - reset and initialize the codecs */ -void vx_reset_codec(vx_core_t *chip, int cold_reset) +void vx_reset_codec(struct vx_core *chip, int cold_reset) { unsigned int i; int port = chip->type >= VX_TYPE_VXPOCKET ? 0x75 : 0x65; @@ -175,7 +175,7 @@ void vx_reset_codec(vx_core_t *chip, int cold_reset) * change the audio input source * @src: the target source (VX_AUDIO_SRC_XXX) */ -static void vx_change_audio_source(vx_core_t *chip, int src) +static void vx_change_audio_source(struct vx_core *chip, int src) { unsigned long flags; @@ -192,7 +192,7 @@ static void vx_change_audio_source(vx_core_t *chip, int src) * change the audio source if necessary and possible * returns 1 if the source is actually changed. */ -int vx_sync_audio_source(vx_core_t *chip) +int vx_sync_audio_source(struct vx_core *chip) { if (chip->audio_source_target == chip->audio_source || chip->pcm_running) @@ -217,7 +217,7 @@ struct vx_audio_level { short monitor_level; }; -static int vx_adjust_audio_level(vx_core_t *chip, int audio, int capture, +static int vx_adjust_audio_level(struct vx_core *chip, int audio, int capture, struct vx_audio_level *info) { struct vx_rmh rmh; @@ -256,7 +256,7 @@ static int vx_adjust_audio_level(vx_core_t *chip, int audio, int capture, #if 0 // not used -static int vx_read_audio_level(vx_core_t *chip, int audio, int capture, +static int vx_read_audio_level(struct vx_core *chip, int audio, int capture, struct vx_audio_level *info) { int err; @@ -283,7 +283,7 @@ static int vx_read_audio_level(vx_core_t *chip, int audio, int capture, * set the monitoring level and mute state of the given audio * no more static, because must be called from vx_pcm to demute monitoring */ -int vx_set_monitor_level(vx_core_t *chip, int audio, int level, int active) +int vx_set_monitor_level(struct vx_core *chip, int audio, int level, int active) { struct vx_audio_level info; @@ -301,7 +301,7 @@ int vx_set_monitor_level(vx_core_t *chip, int audio, int level, int active) /* * set the mute status of the given audio */ -static int vx_set_audio_switch(vx_core_t *chip, int audio, int active) +static int vx_set_audio_switch(struct vx_core *chip, int audio, int active) { struct vx_audio_level info; @@ -315,7 +315,7 @@ static int vx_set_audio_switch(vx_core_t *chip, int audio, int active) /* * set the mute status of the given audio */ -static int vx_set_audio_gain(vx_core_t *chip, int audio, int capture, int level) +static int vx_set_audio_gain(struct vx_core *chip, int audio, int capture, int level) { struct vx_audio_level info; @@ -329,7 +329,7 @@ static int vx_set_audio_gain(vx_core_t *chip, int audio, int capture, int level) /* * reset all audio levels */ -static void vx_reset_audio_levels(vx_core_t *chip) +static void vx_reset_audio_levels(struct vx_core *chip) { unsigned int i, c; struct vx_audio_level info; @@ -375,7 +375,7 @@ struct vx_vu_meter { * @capture: 0 = playback, 1 = capture operation * @info: the array of vx_vu_meter records (size = 2). */ -static int vx_get_audio_vu_meter(vx_core_t *chip, int audio, int capture, struct vx_vu_meter *info) +static int vx_get_audio_vu_meter(struct vx_core *chip, int audio, int capture, struct vx_vu_meter *info) { struct vx_rmh rmh; int i, err; @@ -413,9 +413,9 @@ static int vx_get_audio_vu_meter(vx_core_t *chip, int audio, int capture, struct /* * output level control */ -static int vx_output_level_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int vx_output_level_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->count = 2; 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 return 0; } -static int vx_output_level_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_output_level_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); int codec = kcontrol->id.index; down(&chip->mixer_mutex); 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 return 0; } -static int vx_output_level_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_output_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); int codec = kcontrol->id.index; down(&chip->mixer_mutex); 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 return 0; } -static snd_kcontrol_new_t vx_control_output_level = { +static struct snd_kcontrol_new vx_control_output_level = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Master Playback Volume", .info = vx_output_level_info, @@ -464,7 +464,7 @@ static snd_kcontrol_new_t vx_control_output_level = { /* * audio source select */ -static int vx_audio_src_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int vx_audio_src_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { static char *texts_mic[3] = { "Digital", "Line", "Mic" @@ -472,7 +472,7 @@ static int vx_audio_src_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinf static char *texts_vx2[2] = { "Digital", "Analog" }; - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; uinfo->count = 1; @@ -492,16 +492,16 @@ static int vx_audio_src_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinf return 0; } -static int vx_audio_src_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_audio_src_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); ucontrol->value.enumerated.item[0] = chip->audio_source_target; return 0; } -static int vx_audio_src_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_audio_src_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); down(&chip->mixer_mutex); if (chip->audio_source_target != ucontrol->value.enumerated.item[0]) { 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 return 0; } -static snd_kcontrol_new_t vx_control_audio_src = { +static struct snd_kcontrol_new vx_control_audio_src = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Capture Source", .info = vx_audio_src_info, @@ -524,7 +524,7 @@ static snd_kcontrol_new_t vx_control_audio_src = { /* * clock mode selection */ -static int vx_clock_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int vx_clock_mode_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { static char *texts[3] = { "Auto", "Internal", "External" @@ -540,16 +540,16 @@ static int vx_clock_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uin return 0; } -static int vx_clock_mode_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_clock_mode_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); ucontrol->value.enumerated.item[0] = chip->clock_mode; return 0; } -static int vx_clock_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_clock_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); down(&chip->mixer_mutex); if (chip->clock_mode != ucontrol->value.enumerated.item[0]) { 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 return 0; } -static snd_kcontrol_new_t vx_control_clock_mode = { +static struct snd_kcontrol_new vx_control_clock_mode = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Clock Mode", .info = vx_clock_mode_info, @@ -572,7 +572,7 @@ static snd_kcontrol_new_t vx_control_clock_mode = { /* * Audio Gain */ -static int vx_audio_gain_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int vx_audio_gain_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->count = 2; @@ -581,9 +581,9 @@ static int vx_audio_gain_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uin return 0; } -static int vx_audio_gain_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_audio_gain_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); int audio = kcontrol->private_value & 0xff; int capture = (kcontrol->private_value >> 8) & 1; @@ -594,9 +594,9 @@ static int vx_audio_gain_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco return 0; } -static int vx_audio_gain_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_audio_gain_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); int audio = kcontrol->private_value & 0xff; int capture = (kcontrol->private_value >> 8) & 1; @@ -612,9 +612,9 @@ static int vx_audio_gain_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco return 0; } -static int vx_audio_monitor_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_audio_monitor_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); int audio = kcontrol->private_value & 0xff; down(&chip->mixer_mutex); @@ -624,9 +624,9 @@ static int vx_audio_monitor_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * return 0; } -static int vx_audio_monitor_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_audio_monitor_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); int audio = kcontrol->private_value & 0xff; down(&chip->mixer_mutex); @@ -643,7 +643,7 @@ static int vx_audio_monitor_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t * return 0; } -static int vx_audio_sw_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int vx_audio_sw_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->count = 2; @@ -652,9 +652,9 @@ static int vx_audio_sw_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo return 0; } -static int vx_audio_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_audio_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); int audio = kcontrol->private_value & 0xff; down(&chip->mixer_mutex); @@ -664,9 +664,9 @@ static int vx_audio_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont return 0; } -static int vx_audio_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_audio_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); int audio = kcontrol->private_value & 0xff; down(&chip->mixer_mutex); @@ -681,9 +681,9 @@ static int vx_audio_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont return 0; } -static int vx_monitor_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_monitor_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); int audio = kcontrol->private_value & 0xff; down(&chip->mixer_mutex); @@ -693,9 +693,9 @@ static int vx_monitor_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco return 0; } -static int vx_monitor_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_monitor_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); int audio = kcontrol->private_value & 0xff; down(&chip->mixer_mutex); @@ -712,28 +712,28 @@ static int vx_monitor_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco return 0; } -static snd_kcontrol_new_t vx_control_audio_gain = { +static struct snd_kcontrol_new vx_control_audio_gain = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, /* name will be filled later */ .info = vx_audio_gain_info, .get = vx_audio_gain_get, .put = vx_audio_gain_put }; -static snd_kcontrol_new_t vx_control_output_switch = { +static struct snd_kcontrol_new vx_control_output_switch = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "PCM Playback Switch", .info = vx_audio_sw_info, .get = vx_audio_sw_get, .put = vx_audio_sw_put }; -static snd_kcontrol_new_t vx_control_monitor_gain = { +static struct snd_kcontrol_new vx_control_monitor_gain = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Monitoring Volume", .info = vx_audio_gain_info, /* shared */ .get = vx_audio_monitor_get, .put = vx_audio_monitor_put }; -static snd_kcontrol_new_t vx_control_monitor_switch = { +static struct snd_kcontrol_new vx_control_monitor_switch = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Monitoring Switch", .info = vx_audio_sw_info, /* shared */ @@ -745,16 +745,16 @@ static snd_kcontrol_new_t vx_control_monitor_switch = { /* * IEC958 status bits */ -static int vx_iec958_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int vx_iec958_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; uinfo->count = 1; return 0; } -static int vx_iec958_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_iec958_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); down(&chip->mixer_mutex); 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 return 0; } -static int vx_iec958_mask_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_iec958_mask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { ucontrol->value.iec958.status[0] = 0xff; 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 return 0; } -static int vx_iec958_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_iec958_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); unsigned int val; 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 return 0; } -static snd_kcontrol_new_t vx_control_iec958_mask = { +static struct snd_kcontrol_new vx_control_iec958_mask = { .access = SNDRV_CTL_ELEM_ACCESS_READ, .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,MASK), @@ -802,7 +802,7 @@ static snd_kcontrol_new_t vx_control_iec958_mask = { .get = vx_iec958_mask_get, }; -static snd_kcontrol_new_t vx_control_iec958 = { +static struct snd_kcontrol_new vx_control_iec958 = { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), .info = vx_iec958_info, @@ -818,7 +818,7 @@ static snd_kcontrol_new_t vx_control_iec958 = { #define METER_MAX 0xff #define METER_SHIFT 16 -static int vx_vu_meter_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int vx_vu_meter_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->count = 2; @@ -827,9 +827,9 @@ static int vx_vu_meter_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo return 0; } -static int vx_vu_meter_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_vu_meter_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); struct vx_vu_meter meter[2]; int audio = kcontrol->private_value & 0xff; 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 return 0; } -static int vx_peak_meter_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_peak_meter_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); struct vx_vu_meter meter[2]; int audio = kcontrol->private_value & 0xff; 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 return 0; } -static int vx_saturation_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int vx_saturation_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->count = 2; @@ -862,9 +862,9 @@ static int vx_saturation_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uin return 0; } -static int vx_saturation_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_saturation_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *chip = snd_kcontrol_chip(kcontrol); + struct vx_core *chip = snd_kcontrol_chip(kcontrol); struct vx_vu_meter meter[2]; int audio = kcontrol->private_value & 0xff; @@ -874,7 +874,7 @@ static int vx_saturation_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco return 0; } -static snd_kcontrol_new_t vx_control_vu_meter = { +static struct snd_kcontrol_new vx_control_vu_meter = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, /* name will be filled later */ @@ -882,7 +882,7 @@ static snd_kcontrol_new_t vx_control_vu_meter = { .get = vx_vu_meter_get, }; -static snd_kcontrol_new_t vx_control_peak_meter = { +static struct snd_kcontrol_new vx_control_peak_meter = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, /* name will be filled later */ @@ -890,7 +890,7 @@ static snd_kcontrol_new_t vx_control_peak_meter = { .get = vx_peak_meter_get, }; -static snd_kcontrol_new_t vx_control_saturation = { +static struct snd_kcontrol_new vx_control_saturation = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Input Saturation", .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, @@ -904,12 +904,12 @@ static snd_kcontrol_new_t vx_control_saturation = { * */ -int snd_vx_mixer_new(vx_core_t *chip) +int snd_vx_mixer_new(struct vx_core *chip) { unsigned int i, c; int err; - snd_kcontrol_new_t temp; - snd_card_t *card = chip->card; + struct snd_kcontrol_new temp; + struct snd_card *card = chip->card; char name[32]; 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 @@ */ /* get the physical page pointer on the given offset */ -static struct page *snd_pcm_get_vmalloc_page(snd_pcm_substream_t *subs, unsigned long offset) +static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs, + unsigned long offset) { void *pageptr = subs->runtime->dma_area + offset; return vmalloc_to_page(pageptr); @@ -72,9 +73,9 @@ static struct page *snd_pcm_get_vmalloc_page(snd_pcm_substream_t *subs, unsigned * called from hw_params * NOTE: this may be called not only once per pcm open! */ -static int snd_pcm_alloc_vmalloc_buffer(snd_pcm_substream_t *subs, size_t size) +static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t size) { - snd_pcm_runtime_t *runtime = subs->runtime; + struct snd_pcm_runtime *runtime = subs->runtime; if (runtime->dma_area) { /* already allocated */ if (runtime->dma_bytes >= size) @@ -94,9 +95,9 @@ static int snd_pcm_alloc_vmalloc_buffer(snd_pcm_substream_t *subs, size_t size) * called from hw_free callback * NOTE: this may be called not only once per pcm open! */ -static int snd_pcm_free_vmalloc_buffer(snd_pcm_substream_t *subs) +static int snd_pcm_free_vmalloc_buffer(struct snd_pcm_substream *subs) { - snd_pcm_runtime_t *runtime = subs->runtime; + struct snd_pcm_runtime *runtime = subs->runtime; if (runtime->dma_area) { vfree(runtime->dma_area); runtime->dma_area = NULL; @@ -108,7 +109,8 @@ static int snd_pcm_free_vmalloc_buffer(snd_pcm_substream_t *subs) /* * read three pending pcm bytes via inb() */ -static void vx_pcm_read_per_bytes(vx_core_t *chip, snd_pcm_runtime_t *runtime, vx_pipe_t *pipe) +static void vx_pcm_read_per_bytes(struct vx_core *chip, struct snd_pcm_runtime *runtime, + struct vx_pipe *pipe) { int offset = pipe->hw_ptr; 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 * @pc_time: the pointer for the PC-time to set * @dsp_time: the pointer for RMH status time array */ -static void vx_set_pcx_time(vx_core_t *chip, pcx_time_t *pc_time, unsigned int *dsp_time) +static void vx_set_pcx_time(struct vx_core *chip, pcx_time_t *pc_time, + unsigned int *dsp_time) { dsp_time[0] = (unsigned int)((*pc_time) >> 24) & PCX_TIME_HI_MASK; 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 * * * returns the increase of the command length. */ -static int vx_set_differed_time(vx_core_t *chip, struct vx_rmh *rmh, vx_pipe_t *pipe) +static int vx_set_differed_time(struct vx_core *chip, struct vx_rmh *rmh, + struct vx_pipe *pipe) { /* Update The length added to the RMH command by the timestamp */ 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 * * @pipe: the affected pipe * @data: format bitmask */ -static int vx_set_stream_format(vx_core_t *chip, vx_pipe_t *pipe, unsigned int data) +static int vx_set_stream_format(struct vx_core *chip, struct vx_pipe *pipe, + unsigned int data) { struct vx_rmh rmh; @@ -210,8 +215,8 @@ static int vx_set_stream_format(vx_core_t *chip, vx_pipe_t *pipe, unsigned int d * * returns 0 if successful, or a negative error code. */ -static int vx_set_format(vx_core_t *chip, vx_pipe_t *pipe, - snd_pcm_runtime_t *runtime) +static int vx_set_format(struct vx_core *chip, struct vx_pipe *pipe, + struct snd_pcm_runtime *runtime) { unsigned int header = HEADER_FMT_BASE; @@ -239,7 +244,7 @@ static int vx_set_format(vx_core_t *chip, vx_pipe_t *pipe, /* * set / query the IBL size */ -static int vx_set_ibl(vx_core_t *chip, struct vx_ibl_info *info) +static int vx_set_ibl(struct vx_core *chip, struct vx_ibl_info *info) { int err; struct vx_rmh rmh; @@ -269,7 +274,7 @@ static int vx_set_ibl(vx_core_t *chip, struct vx_ibl_info *info) * * called from trigger callback only */ -static int vx_get_pipe_state(vx_core_t *chip, vx_pipe_t *pipe, int *state) +static int vx_get_pipe_state(struct vx_core *chip, struct vx_pipe *pipe, int *state) { int err; struct vx_rmh rmh; @@ -294,7 +299,7 @@ static int vx_get_pipe_state(vx_core_t *chip, vx_pipe_t *pipe, int *state) * you'll need to disconnect the host to get back to the * normal mode. */ -static int vx_query_hbuffer_size(vx_core_t *chip, vx_pipe_t *pipe) +static int vx_query_hbuffer_size(struct vx_core *chip, struct vx_pipe *pipe) { int result; struct vx_rmh rmh; @@ -318,7 +323,7 @@ static int vx_query_hbuffer_size(vx_core_t *chip, vx_pipe_t *pipe) * * called from trigger callback only */ -static int vx_pipe_can_start(vx_core_t *chip, vx_pipe_t *pipe) +static int vx_pipe_can_start(struct vx_core *chip, struct vx_pipe *pipe) { int err; struct vx_rmh rmh; @@ -339,7 +344,7 @@ static int vx_pipe_can_start(vx_core_t *chip, vx_pipe_t *pipe) * vx_conf_pipe - tell the pipe to stand by and wait for IRQA. * @pipe: the pipe to be configured */ -static int vx_conf_pipe(vx_core_t *chip, vx_pipe_t *pipe) +static int vx_conf_pipe(struct vx_core *chip, struct vx_pipe *pipe) { struct vx_rmh rmh; @@ -353,7 +358,7 @@ static int vx_conf_pipe(vx_core_t *chip, vx_pipe_t *pipe) /* * vx_send_irqa - trigger IRQA */ -static int vx_send_irqa(vx_core_t *chip) +static int vx_send_irqa(struct vx_core *chip) { struct vx_rmh rmh; @@ -378,7 +383,7 @@ static int vx_send_irqa(vx_core_t *chip) * called from trigger callback only * */ -static int vx_toggle_pipe(vx_core_t *chip, vx_pipe_t *pipe, int state) +static int vx_toggle_pipe(struct vx_core *chip, struct vx_pipe *pipe, int state) { int err, i, cur_state; @@ -431,7 +436,7 @@ static int vx_toggle_pipe(vx_core_t *chip, vx_pipe_t *pipe, int state) * * called from trigger callback only */ -static int vx_stop_pipe(vx_core_t *chip, vx_pipe_t *pipe) +static int vx_stop_pipe(struct vx_core *chip, struct vx_pipe *pipe) { struct vx_rmh rmh; vx_init_rmh(&rmh, CMD_STOP_PIPE); @@ -449,12 +454,12 @@ static int vx_stop_pipe(vx_core_t *chip, vx_pipe_t *pipe) * * return 0 on success, or a negative error code. */ -static int vx_alloc_pipe(vx_core_t *chip, int capture, +static int vx_alloc_pipe(struct vx_core *chip, int capture, int audioid, int num_audio, - vx_pipe_t **pipep) + struct vx_pipe **pipep) { int err; - vx_pipe_t *pipe; + struct vx_pipe *pipe; struct vx_rmh rmh; int data_mode; @@ -499,7 +504,7 @@ static int vx_alloc_pipe(vx_core_t *chip, int capture, * vx_free_pipe - release a pipe * @pipe: pipe to be released */ -static int vx_free_pipe(vx_core_t *chip, vx_pipe_t *pipe) +static int vx_free_pipe(struct vx_core *chip, struct vx_pipe *pipe) { struct vx_rmh rmh; @@ -517,7 +522,7 @@ static int vx_free_pipe(vx_core_t *chip, vx_pipe_t *pipe) * * called from trigger callback only */ -static int vx_start_stream(vx_core_t *chip, vx_pipe_t *pipe) +static int vx_start_stream(struct vx_core *chip, struct vx_pipe *pipe) { struct vx_rmh rmh; @@ -533,7 +538,7 @@ static int vx_start_stream(vx_core_t *chip, vx_pipe_t *pipe) * * called from trigger callback only */ -static int vx_stop_stream(vx_core_t *chip, vx_pipe_t *pipe) +static int vx_stop_stream(struct vx_core *chip, struct vx_pipe *pipe) { struct vx_rmh rmh; @@ -547,11 +552,12 @@ static int vx_stop_stream(vx_core_t *chip, vx_pipe_t *pipe) * playback hw information */ -static snd_pcm_hardware_t vx_pcm_playback_hw = { +static struct snd_pcm_hardware vx_pcm_playback_hw = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_MMAP_VALID /*|*/ /*SNDRV_PCM_INFO_RESUME*/), - .formats = /*SNDRV_PCM_FMTBIT_U8 |*/ SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_3LE, + .formats = (/*SNDRV_PCM_FMTBIT_U8 |*/ + SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_3LE), .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, .rate_min = 5000, .rate_max = 48000, @@ -571,11 +577,11 @@ static void vx_pcm_delayed_start(unsigned long arg); /* * vx_pcm_playback_open - open callback for playback */ -static int vx_pcm_playback_open(snd_pcm_substream_t *subs) +static int vx_pcm_playback_open(struct snd_pcm_substream *subs) { - snd_pcm_runtime_t *runtime = subs->runtime; - vx_core_t *chip = snd_pcm_substream_chip(subs); - vx_pipe_t *pipe = NULL; + struct snd_pcm_runtime *runtime = subs->runtime; + struct vx_core *chip = snd_pcm_substream_chip(subs); + struct vx_pipe *pipe = NULL; unsigned int audio; int err; @@ -615,10 +621,10 @@ static int vx_pcm_playback_open(snd_pcm_substream_t *subs) /* * vx_pcm_playback_close - close callback for playback */ -static int vx_pcm_playback_close(snd_pcm_substream_t *subs) +static int vx_pcm_playback_close(struct snd_pcm_substream *subs) { - vx_core_t *chip = snd_pcm_substream_chip(subs); - vx_pipe_t *pipe; + struct vx_core *chip = snd_pcm_substream_chip(subs); + struct vx_pipe *pipe; if (! subs->runtime->private_data) return -EINVAL; @@ -641,7 +647,7 @@ static int vx_pcm_playback_close(snd_pcm_substream_t *subs) * * NB: call with a certain lock. */ -static int vx_notify_end_of_buffer(vx_core_t *chip, vx_pipe_t *pipe) +static int vx_notify_end_of_buffer(struct vx_core *chip, struct vx_pipe *pipe) { int err; 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) * * return 0 if ok. */ -static int vx_pcm_playback_transfer_chunk(vx_core_t *chip, snd_pcm_runtime_t *runtime, vx_pipe_t *pipe, int size) +static int vx_pcm_playback_transfer_chunk(struct vx_core *chip, + struct snd_pcm_runtime *runtime, + struct vx_pipe *pipe, int size) { int space, err = 0; @@ -705,7 +713,9 @@ static int vx_pcm_playback_transfer_chunk(vx_core_t *chip, snd_pcm_runtime_t *ru * so that the caller can check the total transferred size later * (to call snd_pcm_period_elapsed). */ -static int vx_update_pipe_position(vx_core_t *chip, snd_pcm_runtime_t *runtime, vx_pipe_t *pipe) +static int vx_update_pipe_position(struct vx_core *chip, + struct snd_pcm_runtime *runtime, + struct vx_pipe *pipe) { struct vx_rmh rmh; int err, update; @@ -731,10 +741,12 @@ static int vx_update_pipe_position(vx_core_t *chip, snd_pcm_runtime_t *runtime, * transfer the pending playback buffer data to DSP * called from interrupt handler */ -static void vx_pcm_playback_transfer(vx_core_t *chip, snd_pcm_substream_t *subs, vx_pipe_t *pipe, int nchunks) +static void vx_pcm_playback_transfer(struct vx_core *chip, + struct snd_pcm_substream *subs, + struct vx_pipe *pipe, int nchunks) { int i, err; - snd_pcm_runtime_t *runtime = subs->runtime; + struct snd_pcm_runtime *runtime = subs->runtime; if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE)) return; @@ -749,10 +761,12 @@ static void vx_pcm_playback_transfer(vx_core_t *chip, snd_pcm_substream_t *subs, * update the playback position and call snd_pcm_period_elapsed() if necessary * called from interrupt handler */ -static void vx_pcm_playback_update(vx_core_t *chip, snd_pcm_substream_t *subs, vx_pipe_t *pipe) +static void vx_pcm_playback_update(struct vx_core *chip, + struct snd_pcm_substream *subs, + struct vx_pipe *pipe) { int err; - snd_pcm_runtime_t *runtime = subs->runtime; + struct snd_pcm_runtime *runtime = subs->runtime; if (pipe->running && ! (chip->chip_status & VX_STAT_IS_STALE)) { 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 */ static void vx_pcm_delayed_start(unsigned long arg) { - snd_pcm_substream_t *subs = (snd_pcm_substream_t *)arg; - vx_core_t *chip = subs->pcm->private_data; - vx_pipe_t *pipe = subs->runtime->private_data; + struct snd_pcm_substream *subs = (struct snd_pcm_substream *)arg; + struct vx_core *chip = subs->pcm->private_data; + struct vx_pipe *pipe = subs->runtime->private_data; int err; /* printk( KERN_DEBUG "DDDD tasklet delayed start jiffies = %ld\n", jiffies);*/ @@ -792,10 +806,10 @@ static void vx_pcm_delayed_start(unsigned long arg) /* * vx_pcm_playback_trigger - trigger callback for playback */ -static int vx_pcm_trigger(snd_pcm_substream_t *subs, int cmd) +static int vx_pcm_trigger(struct snd_pcm_substream *subs, int cmd) { - vx_core_t *chip = snd_pcm_substream_chip(subs); - vx_pipe_t *pipe = subs->runtime->private_data; + struct vx_core *chip = snd_pcm_substream_chip(subs); + struct vx_pipe *pipe = subs->runtime->private_data; int err; if (chip->chip_status & VX_STAT_IS_STALE) @@ -839,18 +853,18 @@ static int vx_pcm_trigger(snd_pcm_substream_t *subs, int cmd) /* * vx_pcm_playback_pointer - pointer callback for playback */ -static snd_pcm_uframes_t vx_pcm_playback_pointer(snd_pcm_substream_t *subs) +static snd_pcm_uframes_t vx_pcm_playback_pointer(struct snd_pcm_substream *subs) { - snd_pcm_runtime_t *runtime = subs->runtime; - vx_pipe_t *pipe = runtime->private_data; + struct snd_pcm_runtime *runtime = subs->runtime; + struct vx_pipe *pipe = runtime->private_data; return pipe->position; } /* * vx_pcm_hw_params - hw_params callback for playback and capture */ -static int vx_pcm_hw_params(snd_pcm_substream_t *subs, - snd_pcm_hw_params_t *hw_params) +static int vx_pcm_hw_params(struct snd_pcm_substream *subs, + struct snd_pcm_hw_params *hw_params) { return snd_pcm_alloc_vmalloc_buffer(subs, params_buffer_bytes(hw_params)); } @@ -858,7 +872,7 @@ static int vx_pcm_hw_params(snd_pcm_substream_t *subs, /* * vx_pcm_hw_free - hw_free callback for playback and capture */ -static int vx_pcm_hw_free(snd_pcm_substream_t *subs) +static int vx_pcm_hw_free(struct snd_pcm_substream *subs) { return snd_pcm_free_vmalloc_buffer(subs); } @@ -866,11 +880,11 @@ static int vx_pcm_hw_free(snd_pcm_substream_t *subs) /* * vx_pcm_prepare - prepare callback for playback and capture */ -static int vx_pcm_prepare(snd_pcm_substream_t *subs) +static int vx_pcm_prepare(struct snd_pcm_substream *subs) { - vx_core_t *chip = snd_pcm_substream_chip(subs); - snd_pcm_runtime_t *runtime = subs->runtime; - vx_pipe_t *pipe = runtime->private_data; + struct vx_core *chip = snd_pcm_substream_chip(subs); + struct snd_pcm_runtime *runtime = subs->runtime; + struct vx_pipe *pipe = runtime->private_data; int err, data_mode; // int max_size, nchunks; @@ -897,7 +911,8 @@ static int vx_pcm_prepare(snd_pcm_substream_t *subs) } if (chip->pcm_running && chip->freq != runtime->rate) { - snd_printk(KERN_ERR "vx: cannot set different clock %d from the current %d\n", runtime->rate, chip->freq); + snd_printk(KERN_ERR "vx: cannot set different clock %d " + "from the current %d\n", runtime->rate, chip->freq); return -EINVAL; } vx_set_clock(chip, runtime->rate); @@ -930,7 +945,7 @@ static int vx_pcm_prepare(snd_pcm_substream_t *subs) /* * operators for PCM playback */ -static snd_pcm_ops_t vx_pcm_playback_ops = { +static struct snd_pcm_ops vx_pcm_playback_ops = { .open = vx_pcm_playback_open, .close = vx_pcm_playback_close, .ioctl = snd_pcm_lib_ioctl, @@ -947,11 +962,12 @@ static snd_pcm_ops_t vx_pcm_playback_ops = { * playback hw information */ -static snd_pcm_hardware_t vx_pcm_capture_hw = { +static struct snd_pcm_hardware vx_pcm_capture_hw = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_MMAP_VALID /*|*/ /*SNDRV_PCM_INFO_RESUME*/), - .formats = /*SNDRV_PCM_FMTBIT_U8 |*/ SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_3LE, + .formats = (/*SNDRV_PCM_FMTBIT_U8 |*/ + SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_3LE), .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, .rate_min = 5000, .rate_max = 48000, @@ -969,12 +985,12 @@ static snd_pcm_hardware_t vx_pcm_capture_hw = { /* * vx_pcm_capture_open - open callback for capture */ -static int vx_pcm_capture_open(snd_pcm_substream_t *subs) +static int vx_pcm_capture_open(struct snd_pcm_substream *subs) { - snd_pcm_runtime_t *runtime = subs->runtime; - vx_core_t *chip = snd_pcm_substream_chip(subs); - vx_pipe_t *pipe; - vx_pipe_t *pipe_out_monitoring = NULL; + struct snd_pcm_runtime *runtime = subs->runtime; + struct vx_core *chip = snd_pcm_substream_chip(subs); + struct vx_pipe *pipe; + struct vx_pipe *pipe_out_monitoring = NULL; unsigned int audio; int err; @@ -1005,9 +1021,11 @@ static int vx_pcm_capture_open(snd_pcm_substream_t *subs) if an output pipe is available, it's audios still may need to be unmuted. hence we'll have to call a mixer entry point. */ - vx_set_monitor_level(chip, audio, chip->audio_monitor[audio], chip->audio_monitor_active[audio]); + vx_set_monitor_level(chip, audio, chip->audio_monitor[audio], + chip->audio_monitor_active[audio]); /* assuming stereo */ - vx_set_monitor_level(chip, audio+1, chip->audio_monitor[audio+1], chip->audio_monitor_active[audio+1]); + vx_set_monitor_level(chip, audio+1, chip->audio_monitor[audio+1], + chip->audio_monitor_active[audio+1]); } pipe->monitoring_pipe = pipe_out_monitoring; /* default value NULL */ @@ -1026,11 +1044,11 @@ static int vx_pcm_capture_open(snd_pcm_substream_t *subs) /* * vx_pcm_capture_close - close callback for capture */ -static int vx_pcm_capture_close(snd_pcm_substream_t *subs) +static int vx_pcm_capture_close(struct snd_pcm_substream *subs) { - vx_core_t *chip = snd_pcm_substream_chip(subs); - vx_pipe_t *pipe; - vx_pipe_t *pipe_out_monitoring; + struct vx_core *chip = snd_pcm_substream_chip(subs); + struct vx_pipe *pipe; + struct vx_pipe *pipe_out_monitoring; if (! subs->runtime->private_data) return -EINVAL; @@ -1062,10 +1080,11 @@ static int vx_pcm_capture_close(snd_pcm_substream_t *subs) /* * vx_pcm_capture_update - update the capture buffer */ -static void vx_pcm_capture_update(vx_core_t *chip, snd_pcm_substream_t *subs, vx_pipe_t *pipe) +static void vx_pcm_capture_update(struct vx_core *chip, struct snd_pcm_substream *subs, + struct vx_pipe *pipe) { int size, space, count; - snd_pcm_runtime_t *runtime = subs->runtime; + struct snd_pcm_runtime *runtime = subs->runtime; if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE)) return; @@ -1135,17 +1154,17 @@ static void vx_pcm_capture_update(vx_core_t *chip, snd_pcm_substream_t *subs, vx /* * vx_pcm_capture_pointer - pointer callback for capture */ -static snd_pcm_uframes_t vx_pcm_capture_pointer(snd_pcm_substream_t *subs) +static snd_pcm_uframes_t vx_pcm_capture_pointer(struct snd_pcm_substream *subs) { - snd_pcm_runtime_t *runtime = subs->runtime; - vx_pipe_t *pipe = runtime->private_data; + struct snd_pcm_runtime *runtime = subs->runtime; + struct vx_pipe *pipe = runtime->private_data; return bytes_to_frames(runtime, pipe->hw_ptr); } /* * operators for PCM capture */ -static snd_pcm_ops_t vx_pcm_capture_ops = { +static struct snd_pcm_ops vx_pcm_capture_ops = { .open = vx_pcm_capture_open, .close = vx_pcm_capture_close, .ioctl = snd_pcm_lib_ioctl, @@ -1161,10 +1180,10 @@ static snd_pcm_ops_t vx_pcm_capture_ops = { /* * interrupt handler for pcm streams */ -void vx_pcm_update_intr(vx_core_t *chip, unsigned int events) +void vx_pcm_update_intr(struct vx_core *chip, unsigned int events) { unsigned int i; - vx_pipe_t *pipe; + struct vx_pipe *pipe; #define EVENT_MASK (END_OF_BUFFER_EVENTS_PENDING|ASYNC_EVENTS_PENDING) @@ -1218,7 +1237,7 @@ void vx_pcm_update_intr(vx_core_t *chip, unsigned int events) /* * vx_init_audio_io - check the availabe audio i/o and allocate pipe arrays */ -static int vx_init_audio_io(vx_core_t *chip) +static int vx_init_audio_io(struct vx_core *chip) { struct vx_rmh rmh; int preferred; @@ -1234,19 +1253,20 @@ static int vx_init_audio_io(vx_core_t *chip) chip->audio_info = rmh.Stat[1]; /* allocate pipes */ - chip->playback_pipes = kmalloc(sizeof(vx_pipe_t *) * chip->audio_outs, GFP_KERNEL); - chip->capture_pipes = kmalloc(sizeof(vx_pipe_t *) * chip->audio_ins, GFP_KERNEL); + chip->playback_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_outs, GFP_KERNEL); + chip->capture_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_ins, GFP_KERNEL); if (! chip->playback_pipes || ! chip->capture_pipes) return -ENOMEM; - memset(chip->playback_pipes, 0, sizeof(vx_pipe_t *) * chip->audio_outs); - memset(chip->capture_pipes, 0, sizeof(vx_pipe_t *) * chip->audio_ins); + memset(chip->playback_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_outs); + memset(chip->capture_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_ins); preferred = chip->ibl.size; chip->ibl.size = 0; vx_set_ibl(chip, &chip->ibl); /* query the info */ if (preferred > 0) { - chip->ibl.size = ((preferred + chip->ibl.granularity - 1) / chip->ibl.granularity) * chip->ibl.granularity; + chip->ibl.size = ((preferred + chip->ibl.granularity - 1) / + chip->ibl.granularity) * chip->ibl.granularity; if (chip->ibl.size > chip->ibl.max_size) chip->ibl.size = chip->ibl.max_size; } else @@ -1260,9 +1280,9 @@ static int vx_init_audio_io(vx_core_t *chip) /* * free callback for pcm */ -static void snd_vx_pcm_free(snd_pcm_t *pcm) +static void snd_vx_pcm_free(struct snd_pcm *pcm) { - vx_core_t *chip = pcm->private_data; + struct vx_core *chip = pcm->private_data; chip->pcm[pcm->device] = NULL; kfree(chip->playback_pipes); chip->playback_pipes = NULL; @@ -1273,9 +1293,9 @@ static void snd_vx_pcm_free(snd_pcm_t *pcm) /* * snd_vx_pcm_new - create and initialize a pcm */ -int snd_vx_pcm_new(vx_core_t *chip) +int snd_vx_pcm_new(struct vx_core *chip) { - snd_pcm_t *pcm; + struct snd_pcm *pcm; unsigned int i; int err; 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 @@ * vx_modify_board_clock - tell the board that its clock has been modified * @sync: DSP needs to resynchronize its FIFO */ -static int vx_modify_board_clock(vx_core_t *chip, int sync) +static int vx_modify_board_clock(struct vx_core *chip, int sync) { struct vx_rmh rmh; @@ -45,7 +45,7 @@ static int vx_modify_board_clock(vx_core_t *chip, int sync) /* * vx_modify_board_inputs - resync audio inputs */ -static int vx_modify_board_inputs(vx_core_t *chip) +static int vx_modify_board_inputs(struct vx_core *chip) { struct vx_rmh rmh; @@ -59,7 +59,7 @@ static int vx_modify_board_inputs(vx_core_t *chip) * @index: the bit index * returns 0 or 1. */ -static int vx_read_one_cbit(vx_core_t *chip, int index) +static int vx_read_one_cbit(struct vx_core *chip, int index) { unsigned long flags; int val; @@ -82,7 +82,7 @@ static int vx_read_one_cbit(vx_core_t *chip, int index) * @index: the bit index * @val: bit value, 0 or 1 */ -static void vx_write_one_cbit(vx_core_t *chip, int index, int val) +static void vx_write_one_cbit(struct vx_core *chip, int index, int val) { unsigned long flags; val = !!val; /* 0 or 1 */ @@ -104,7 +104,7 @@ static void vx_write_one_cbit(vx_core_t *chip, int index, int val) * returns the frequency of UER, or 0 if not sync, * or a negative error code. */ -static int vx_read_uer_status(vx_core_t *chip, int *mode) +static int vx_read_uer_status(struct vx_core *chip, int *mode) { int val, freq; @@ -160,7 +160,7 @@ static int vx_read_uer_status(vx_core_t *chip, int *mode) * default : HexFreq = (dword) ((double) 28224000 / (double) (Frequency*4)) - 0x000001FF */ -static int vx_calc_clock_from_freq(vx_core_t *chip, int freq) +static int vx_calc_clock_from_freq(struct vx_core *chip, int freq) { int hexfreq; @@ -187,7 +187,7 @@ static int vx_calc_clock_from_freq(vx_core_t *chip, int freq) * vx_change_clock_source - change the clock source * @source: the new source */ -static void vx_change_clock_source(vx_core_t *chip, int source) +static void vx_change_clock_source(struct vx_core *chip, int source) { unsigned long flags; @@ -205,7 +205,7 @@ static void vx_change_clock_source(vx_core_t *chip, int source) /* * set the internal clock */ -void vx_set_internal_clock(vx_core_t *chip, unsigned int freq) +void vx_set_internal_clock(struct vx_core *chip, unsigned int freq) { int clock; unsigned long flags; @@ -228,7 +228,7 @@ void vx_set_internal_clock(vx_core_t *chip, unsigned int freq) * set the iec958 status bits * @bits: 32-bit status bits */ -void vx_set_iec958_status(vx_core_t *chip, unsigned int bits) +void vx_set_iec958_status(struct vx_core *chip, unsigned int bits) { int i; @@ -243,7 +243,7 @@ void vx_set_iec958_status(vx_core_t *chip, unsigned int bits) /* * vx_set_clock - change the clock and audio source if necessary */ -int vx_set_clock(vx_core_t *chip, unsigned int freq) +int vx_set_clock(struct vx_core *chip, unsigned int freq) { int src_changed = 0; @@ -285,7 +285,7 @@ int vx_set_clock(vx_core_t *chip, unsigned int freq) /* * vx_change_frequency - called from interrupt handler */ -int vx_change_frequency(vx_core_t *chip) +int vx_change_frequency(struct vx_core *chip) { int freq; diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c index dca6bd2c7580..4ebbabedb3c3 100644 --- a/sound/pci/vx222/vx222.c +++ b/sound/pci/vx222/vx222.c @@ -108,7 +108,7 @@ static struct snd_vx_hardware vx222_mic_hw = { /* */ -static int snd_vx222_free(vx_core_t *chip) +static int snd_vx222_free(struct vx_core *chip) { struct snd_vx222 *vx = (struct snd_vx222 *)chip; @@ -121,21 +121,21 @@ static int snd_vx222_free(vx_core_t *chip) return 0; } -static int snd_vx222_dev_free(snd_device_t *device) +static int snd_vx222_dev_free(struct snd_device *device) { - vx_core_t *chip = device->device_data; + struct vx_core *chip = device->device_data; return snd_vx222_free(chip); } -static int __devinit snd_vx222_create(snd_card_t *card, struct pci_dev *pci, +static int __devinit snd_vx222_create(struct snd_card *card, struct pci_dev *pci, struct snd_vx_hardware *hw, struct snd_vx222 **rchip) { - vx_core_t *chip; + struct vx_core *chip; struct snd_vx222 *vx; int i, err; - static snd_device_ops_t ops = { + static struct snd_device_ops ops = { .dev_free = snd_vx222_dev_free, }; struct snd_vx_ops *vx_ops; @@ -147,7 +147,7 @@ static int __devinit snd_vx222_create(snd_card_t *card, struct pci_dev *pci, vx_ops = hw->type == VX_TYPE_BOARD ? &vx222_old_ops : &vx222_ops; chip = snd_vx_create(card, hw, vx_ops, - sizeof(struct snd_vx222) - sizeof(vx_core_t)); + sizeof(struct snd_vx222) - sizeof(struct vx_core)); if (! chip) { pci_disable_device(pci); return -ENOMEM; @@ -186,7 +186,7 @@ static int __devinit snd_vx222_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { static int dev; - snd_card_t *card; + struct snd_card *card; struct snd_vx_hardware *hw; struct snd_vx222 *vx; int err; diff --git a/sound/pci/vx222/vx222.h b/sound/pci/vx222/vx222.h index 18478ae124a9..2f0d78f609a6 100644 --- a/sound/pci/vx222/vx222.h +++ b/sound/pci/vx222/vx222.h @@ -25,7 +25,7 @@ struct snd_vx222 { - vx_core_t core; + struct vx_core core; /* h/w config; for PLX and for DSP */ struct pci_dev *pci; diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c index 2d4d0c29b4c4..c705af409b0f 100644 --- a/sound/pci/vx222/vx222_ops.c +++ b/sound/pci/vx222/vx222_ops.c @@ -82,7 +82,7 @@ static int vx2_reg_index[VX_REG_MAX] = { [VX_GPIOC] = 0, /* on the PLX */ }; -static inline unsigned long vx2_reg_addr(vx_core_t *_chip, int reg) +static inline unsigned long vx2_reg_addr(struct vx_core *_chip, int reg) { struct snd_vx222 *chip = (struct snd_vx222 *)_chip; return chip->port[vx2_reg_index[reg]] + vx2_reg_offset[reg]; @@ -92,7 +92,7 @@ static inline unsigned long vx2_reg_addr(vx_core_t *_chip, int reg) * snd_vx_inb - read a byte from the register * @offset: register enum */ -static unsigned char vx2_inb(vx_core_t *chip, int offset) +static unsigned char vx2_inb(struct vx_core *chip, int offset) { return inb(vx2_reg_addr(chip, offset)); } @@ -102,7 +102,7 @@ static unsigned char vx2_inb(vx_core_t *chip, int offset) * @offset: the register offset * @val: the value to write */ -static void vx2_outb(vx_core_t *chip, int offset, unsigned char val) +static void vx2_outb(struct vx_core *chip, int offset, unsigned char val) { outb(val, vx2_reg_addr(chip, offset)); //printk("outb: %x -> %x\n", val, vx2_reg_addr(chip, offset)); @@ -112,7 +112,7 @@ static void vx2_outb(vx_core_t *chip, int offset, unsigned char val) * snd_vx_inl - read a 32bit word from the register * @offset: register enum */ -static unsigned int vx2_inl(vx_core_t *chip, int offset) +static unsigned int vx2_inl(struct vx_core *chip, int offset) { return inl(vx2_reg_addr(chip, offset)); } @@ -122,7 +122,7 @@ static unsigned int vx2_inl(vx_core_t *chip, int offset) * @offset: the register enum * @val: the value to write */ -static void vx2_outl(vx_core_t *chip, int offset, unsigned int val) +static void vx2_outl(struct vx_core *chip, int offset, unsigned int val) { // printk("outl: %x -> %x\n", val, vx2_reg_addr(chip, offset)); outl(val, vx2_reg_addr(chip, offset)); @@ -132,13 +132,13 @@ static void vx2_outl(vx_core_t *chip, int offset, unsigned int val) * redefine macros to call directly */ #undef vx_inb -#define vx_inb(chip,reg) vx2_inb((vx_core_t*)(chip), VX_##reg) +#define vx_inb(chip,reg) vx2_inb((struct vx_core*)(chip), VX_##reg) #undef vx_outb -#define vx_outb(chip,reg,val) vx2_outb((vx_core_t*)(chip), VX_##reg, val) +#define vx_outb(chip,reg,val) vx2_outb((struct vx_core*)(chip), VX_##reg, val) #undef vx_inl -#define vx_inl(chip,reg) vx2_inl((vx_core_t*)(chip), VX_##reg) +#define vx_inl(chip,reg) vx2_inl((struct vx_core*)(chip), VX_##reg) #undef vx_outl -#define vx_outl(chip,reg,val) vx2_outl((vx_core_t*)(chip), VX_##reg, val) +#define vx_outl(chip,reg,val) vx2_outl((struct vx_core*)(chip), VX_##reg, val) /* @@ -147,7 +147,7 @@ static void vx2_outl(vx_core_t *chip, int offset, unsigned int val) #define XX_DSP_RESET_WAIT_TIME 2 /* ms */ -static void vx2_reset_dsp(vx_core_t *_chip) +static void vx2_reset_dsp(struct vx_core *_chip) { struct snd_vx222 *chip = (struct snd_vx222 *)_chip; @@ -162,7 +162,7 @@ static void vx2_reset_dsp(vx_core_t *_chip) } -static int vx2_test_xilinx(vx_core_t *_chip) +static int vx2_test_xilinx(struct vx_core *_chip) { struct snd_vx222 *chip = (struct snd_vx222 *)_chip; unsigned int data; @@ -219,7 +219,7 @@ static int vx2_test_xilinx(vx_core_t *_chip) * vx_setup_pseudo_dma - set up the pseudo dma read/write mode. * @do_write: 0 = read, 1 = set up for DMA write */ -static void vx2_setup_pseudo_dma(vx_core_t *chip, int do_write) +static void vx2_setup_pseudo_dma(struct vx_core *chip, int do_write) { /* Interrupt mode and HREQ pin enabled for host transmit data transfers * (in case of the use of the pseudo-dma facility). @@ -235,7 +235,7 @@ static void vx2_setup_pseudo_dma(vx_core_t *chip, int do_write) /* * vx_release_pseudo_dma - disable the pseudo-DMA mode */ -static inline void vx2_release_pseudo_dma(vx_core_t *chip) +static inline void vx2_release_pseudo_dma(struct vx_core *chip) { /* HREQ pin disabled. */ vx_outl(chip, ICR, 0); @@ -244,8 +244,8 @@ static inline void vx2_release_pseudo_dma(vx_core_t *chip) /* pseudo-dma write */ -static void vx2_dma_write(vx_core_t *chip, snd_pcm_runtime_t *runtime, - vx_pipe_t *pipe, int count) +static void vx2_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, + struct vx_pipe *pipe, int count) { unsigned long port = vx2_reg_addr(chip, VX_DMA); int offset = pipe->hw_ptr; @@ -282,8 +282,8 @@ static void vx2_dma_write(vx_core_t *chip, snd_pcm_runtime_t *runtime, /* pseudo dma read */ -static void vx2_dma_read(vx_core_t *chip, snd_pcm_runtime_t *runtime, - vx_pipe_t *pipe, int count) +static void vx2_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, + struct vx_pipe *pipe, int count) { int offset = pipe->hw_ptr; u32 *addr = (u32 *)(runtime->dma_area + offset); @@ -321,7 +321,7 @@ static void vx2_dma_read(vx_core_t *chip, snd_pcm_runtime_t *runtime, /* * transfer counts bits to PLX */ -static int put_xilinx_data(vx_core_t *chip, unsigned int port, unsigned int counts, unsigned char data) +static int put_xilinx_data(struct vx_core *chip, unsigned int port, unsigned int counts, unsigned char data) { unsigned int i; @@ -353,7 +353,7 @@ static int put_xilinx_data(vx_core_t *chip, unsigned int port, unsigned int coun /* * load the xilinx image */ -static int vx2_load_xilinx_binary(vx_core_t *chip, const struct firmware *xilinx) +static int vx2_load_xilinx_binary(struct vx_core *chip, const struct firmware *xilinx) { unsigned int i; unsigned int port; @@ -400,7 +400,7 @@ static int vx2_load_xilinx_binary(vx_core_t *chip, const struct firmware *xilinx /* * load the boot/dsp images */ -static int vx2_load_dsp(vx_core_t *vx, int index, const struct firmware *dsp) +static int vx2_load_dsp(struct vx_core *vx, int index, const struct firmware *dsp) { int err; @@ -432,7 +432,7 @@ static int vx2_load_dsp(vx_core_t *vx, int index, const struct firmware *dsp) * * spinlock held! */ -static int vx2_test_and_ack(vx_core_t *chip) +static int vx2_test_and_ack(struct vx_core *chip) { /* not booted yet? */ if (! (chip->chip_status & VX_STAT_XILINX_LOADED)) @@ -463,7 +463,7 @@ static int vx2_test_and_ack(vx_core_t *chip) /* * vx_validate_irq - enable/disable IRQ */ -static void vx2_validate_irq(vx_core_t *_chip, int enable) +static void vx2_validate_irq(struct vx_core *_chip, int enable) { struct snd_vx222 *chip = (struct snd_vx222 *)_chip; @@ -484,7 +484,7 @@ static void vx2_validate_irq(vx_core_t *_chip, int enable) /* * write an AKM codec data (24bit) */ -static void vx2_write_codec_reg(vx_core_t *chip, unsigned int data) +static void vx2_write_codec_reg(struct vx_core *chip, unsigned int data) { unsigned int i; @@ -660,7 +660,7 @@ static const u8 vx2_akm_gains_lut[VX2_AKM_LEVEL_MAX+1] = { /* * pseudo-codec write entry */ -static void vx2_write_akm(vx_core_t *chip, int reg, unsigned int data) +static void vx2_write_akm(struct vx_core *chip, int reg, unsigned int data) { unsigned int val; @@ -695,7 +695,7 @@ static void vx2_write_akm(vx_core_t *chip, int reg, unsigned int data) /* * write codec bit for old VX222 board */ -static void vx2_old_write_codec_bit(vx_core_t *chip, int codec, unsigned int data) +static void vx2_old_write_codec_bit(struct vx_core *chip, int codec, unsigned int data) { int i; @@ -713,7 +713,7 @@ static void vx2_old_write_codec_bit(vx_core_t *chip, int codec, unsigned int dat /* * reset codec bit */ -static void vx2_reset_codec(vx_core_t *_chip) +static void vx2_reset_codec(struct vx_core *_chip) { struct snd_vx222 *chip = (struct snd_vx222 *)_chip; @@ -755,7 +755,7 @@ static void vx2_reset_codec(vx_core_t *_chip) /* * change the audio source */ -static void vx2_change_audio_source(vx_core_t *_chip, int src) +static void vx2_change_audio_source(struct vx_core *_chip, int src) { struct snd_vx222 *chip = (struct snd_vx222 *)_chip; @@ -774,7 +774,7 @@ static void vx2_change_audio_source(vx_core_t *_chip, int src) /* * set the clock source */ -static void vx2_set_clock_source(vx_core_t *_chip, int source) +static void vx2_set_clock_source(struct vx_core *_chip, int source) { struct snd_vx222 *chip = (struct snd_vx222 *)_chip; @@ -788,7 +788,7 @@ static void vx2_set_clock_source(vx_core_t *_chip, int source) /* * reset the board */ -static void vx2_reset_board(vx_core_t *_chip, int cold_reset) +static void vx2_reset_board(struct vx_core *_chip, int cold_reset) { struct snd_vx222 *chip = (struct snd_vx222 *)_chip; @@ -848,7 +848,7 @@ static void vx2_set_input_level(struct snd_vx222 *chip) */ /* input levels */ -static int vx_input_level_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int vx_input_level_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->count = 2; @@ -857,9 +857,9 @@ static int vx_input_level_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *ui return 0; } -static int vx_input_level_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_input_level_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *_chip = snd_kcontrol_chip(kcontrol); + struct vx_core *_chip = snd_kcontrol_chip(kcontrol); struct snd_vx222 *chip = (struct snd_vx222 *)_chip; down(&_chip->mixer_mutex); ucontrol->value.integer.value[0] = chip->input_level[0]; @@ -868,9 +868,9 @@ static int vx_input_level_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uc return 0; } -static int vx_input_level_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_input_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *_chip = snd_kcontrol_chip(kcontrol); + struct vx_core *_chip = snd_kcontrol_chip(kcontrol); struct snd_vx222 *chip = (struct snd_vx222 *)_chip; down(&_chip->mixer_mutex); if (chip->input_level[0] != ucontrol->value.integer.value[0] || @@ -886,7 +886,7 @@ static int vx_input_level_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uc } /* mic level */ -static int vx_mic_level_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int vx_mic_level_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->count = 1; @@ -895,17 +895,17 @@ static int vx_mic_level_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinf return 0; } -static int vx_mic_level_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_mic_level_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *_chip = snd_kcontrol_chip(kcontrol); + struct vx_core *_chip = snd_kcontrol_chip(kcontrol); struct snd_vx222 *chip = (struct snd_vx222 *)_chip; ucontrol->value.integer.value[0] = chip->mic_level; return 0; } -static int vx_mic_level_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_mic_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *_chip = snd_kcontrol_chip(kcontrol); + struct vx_core *_chip = snd_kcontrol_chip(kcontrol); struct snd_vx222 *chip = (struct snd_vx222 *)_chip; down(&_chip->mixer_mutex); if (chip->mic_level != ucontrol->value.integer.value[0]) { @@ -918,7 +918,7 @@ static int vx_mic_level_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucon return 0; } -static snd_kcontrol_new_t vx_control_input_level = { +static struct snd_kcontrol_new vx_control_input_level = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Capture Volume", .info = vx_input_level_info, @@ -926,7 +926,7 @@ static snd_kcontrol_new_t vx_control_input_level = { .put = vx_input_level_put, }; -static snd_kcontrol_new_t vx_control_mic_level = { +static struct snd_kcontrol_new vx_control_mic_level = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Mic Capture Volume", .info = vx_mic_level_info, @@ -938,7 +938,7 @@ static snd_kcontrol_new_t vx_control_mic_level = { * FIXME: compressor/limiter implementation is missing yet... */ -static int vx2_add_mic_controls(vx_core_t *_chip) +static int vx2_add_mic_controls(struct vx_core *_chip) { struct snd_vx222 *chip = (struct snd_vx222 *)_chip; int err; diff --git a/sound/pcmcia/vx/vxp_mixer.c b/sound/pcmcia/vx/vxp_mixer.c index aeaef3d81801..9450149b931c 100644 --- a/sound/pcmcia/vx/vxp_mixer.c +++ b/sound/pcmcia/vx/vxp_mixer.c @@ -31,7 +31,7 @@ /* * mic level control (for VXPocket) */ -static int vx_mic_level_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int vx_mic_level_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->count = 1; @@ -40,17 +40,17 @@ static int vx_mic_level_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinf return 0; } -static int vx_mic_level_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_mic_level_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *_chip = snd_kcontrol_chip(kcontrol); + struct vx_core *_chip = snd_kcontrol_chip(kcontrol); struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; ucontrol->value.integer.value[0] = chip->mic_level; return 0; } -static int vx_mic_level_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_mic_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *_chip = snd_kcontrol_chip(kcontrol); + struct vx_core *_chip = snd_kcontrol_chip(kcontrol); struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; down(&_chip->mixer_mutex); if (chip->mic_level != ucontrol->value.integer.value[0]) { @@ -63,7 +63,7 @@ static int vx_mic_level_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucon return 0; } -static snd_kcontrol_new_t vx_control_mic_level = { +static struct snd_kcontrol_new vx_control_mic_level = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Mic Capture Volume", .info = vx_mic_level_info, @@ -74,7 +74,7 @@ static snd_kcontrol_new_t vx_control_mic_level = { /* * mic boost level control (for VXP440) */ -static int vx_mic_boost_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int vx_mic_boost_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; uinfo->count = 1; @@ -83,17 +83,17 @@ static int vx_mic_boost_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinf return 0; } -static int vx_mic_boost_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_mic_boost_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *_chip = snd_kcontrol_chip(kcontrol); + struct vx_core *_chip = snd_kcontrol_chip(kcontrol); struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; ucontrol->value.integer.value[0] = chip->mic_level; return 0; } -static int vx_mic_boost_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int vx_mic_boost_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - vx_core_t *_chip = snd_kcontrol_chip(kcontrol); + struct vx_core *_chip = snd_kcontrol_chip(kcontrol); struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; down(&_chip->mixer_mutex); if (chip->mic_level != ucontrol->value.integer.value[0]) { @@ -106,7 +106,7 @@ static int vx_mic_boost_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucon return 0; } -static snd_kcontrol_new_t vx_control_mic_boost = { +static struct snd_kcontrol_new vx_control_mic_boost = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Mic Boost", .info = vx_mic_boost_info, @@ -115,7 +115,7 @@ static snd_kcontrol_new_t vx_control_mic_boost = { }; -int vxp_add_mic_controls(vx_core_t *_chip) +int vxp_add_mic_controls(struct vx_core *_chip) { struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; int err; diff --git a/sound/pcmcia/vx/vxp_ops.c b/sound/pcmcia/vx/vxp_ops.c index 2754d657a4d6..7f82f619f9f4 100644 --- a/sound/pcmcia/vx/vxp_ops.c +++ b/sound/pcmcia/vx/vxp_ops.c @@ -49,7 +49,7 @@ static int vxp_reg_offset[VX_REG_MAX] = { }; -static inline unsigned long vxp_reg_addr(vx_core_t *_chip, int reg) +static inline unsigned long vxp_reg_addr(struct vx_core *_chip, int reg) { struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; return chip->port + vxp_reg_offset[reg]; @@ -59,7 +59,7 @@ static inline unsigned long vxp_reg_addr(vx_core_t *_chip, int reg) * snd_vx_inb - read a byte from the register * @offset: register offset */ -static unsigned char vxp_inb(vx_core_t *chip, int offset) +static unsigned char vxp_inb(struct vx_core *chip, int offset) { return inb(vxp_reg_addr(chip, offset)); } @@ -69,7 +69,7 @@ static unsigned char vxp_inb(vx_core_t *chip, int offset) * @offset: the register offset * @val: the value to write */ -static void vxp_outb(vx_core_t *chip, int offset, unsigned char val) +static void vxp_outb(struct vx_core *chip, int offset, unsigned char val) { outb(val, vxp_reg_addr(chip, offset)); } @@ -78,9 +78,9 @@ static void vxp_outb(vx_core_t *chip, int offset, unsigned char val) * redefine macros to call directly */ #undef vx_inb -#define vx_inb(chip,reg) vxp_inb((vx_core_t*)(chip), VX_##reg) +#define vx_inb(chip,reg) vxp_inb((struct vx_core *)(chip), VX_##reg) #undef vx_outb -#define vx_outb(chip,reg,val) vxp_outb((vx_core_t*)(chip), VX_##reg,val) +#define vx_outb(chip,reg,val) vxp_outb((struct vx_core *)(chip), VX_##reg,val) /* @@ -88,7 +88,7 @@ static void vxp_outb(vx_core_t *chip, int offset, unsigned char val) * * returns zero if a magic word is detected, or a negative error code. */ -static int vx_check_magic(vx_core_t *chip) +static int vx_check_magic(struct vx_core *chip) { unsigned long end_time = jiffies + HZ / 5; int c; @@ -109,7 +109,7 @@ static int vx_check_magic(vx_core_t *chip) #define XX_DSP_RESET_WAIT_TIME 2 /* ms */ -static void vxp_reset_dsp(vx_core_t *_chip) +static void vxp_reset_dsp(struct vx_core *_chip) { struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; @@ -127,7 +127,7 @@ static void vxp_reset_dsp(vx_core_t *_chip) /* * reset codec bit */ -static void vxp_reset_codec(vx_core_t *_chip) +static void vxp_reset_codec(struct vx_core *_chip) { struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; @@ -146,7 +146,7 @@ static void vxp_reset_codec(vx_core_t *_chip) * vx_load_xilinx_binary - load the xilinx binary image * the binary image is the binary array converted from the bitstream file. */ -static int vxp_load_xilinx_binary(vx_core_t *_chip, const struct firmware *fw) +static int vxp_load_xilinx_binary(struct vx_core *_chip, const struct firmware *fw) { struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; unsigned int i; @@ -244,7 +244,7 @@ static int vxp_load_xilinx_binary(vx_core_t *_chip, const struct firmware *fw) /* * vxp_load_dsp - load_dsp callback */ -static int vxp_load_dsp(vx_core_t *vx, int index, const struct firmware *fw) +static int vxp_load_dsp(struct vx_core *vx, int index, const struct firmware *fw) { int err; @@ -279,7 +279,7 @@ static int vxp_load_dsp(vx_core_t *vx, int index, const struct firmware *fw) * * spinlock held! */ -static int vxp_test_and_ack(vx_core_t *_chip) +static int vxp_test_and_ack(struct vx_core *_chip) { struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; @@ -306,7 +306,7 @@ static int vxp_test_and_ack(vx_core_t *_chip) /* * vx_validate_irq - enable/disable IRQ */ -static void vxp_validate_irq(vx_core_t *_chip, int enable) +static void vxp_validate_irq(struct vx_core *_chip, int enable) { struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; @@ -322,7 +322,7 @@ static void vxp_validate_irq(vx_core_t *_chip, int enable) * vx_setup_pseudo_dma - set up the pseudo dma read/write mode. * @do_write: 0 = read, 1 = set up for DMA write */ -static void vx_setup_pseudo_dma(vx_core_t *_chip, int do_write) +static void vx_setup_pseudo_dma(struct vx_core *_chip, int do_write) { struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; @@ -342,7 +342,7 @@ static void vx_setup_pseudo_dma(vx_core_t *_chip, int do_write) /* * vx_release_pseudo_dma - disable the pseudo-DMA mode */ -static void vx_release_pseudo_dma(vx_core_t *_chip) +static void vx_release_pseudo_dma(struct vx_core *_chip) { struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; @@ -362,8 +362,8 @@ static void vx_release_pseudo_dma(vx_core_t *_chip) * data size must be aligned to 6 bytes to ensure the 24bit alignment on DSP. * NB: call with a certain lock! */ -static void vxp_dma_write(vx_core_t *chip, snd_pcm_runtime_t *runtime, - vx_pipe_t *pipe, int count) +static void vxp_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, + struct vx_pipe *pipe, int count) { long port = vxp_reg_addr(chip, VX_DMA); int offset = pipe->hw_ptr; @@ -401,8 +401,8 @@ static void vxp_dma_write(vx_core_t *chip, snd_pcm_runtime_t *runtime, * the read length must be aligned to 6 bytes, as well as write. * NB: call with a certain lock! */ -static void vxp_dma_read(vx_core_t *chip, snd_pcm_runtime_t *runtime, - vx_pipe_t *pipe, int count) +static void vxp_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, + struct vx_pipe *pipe, int count) { struct snd_vxpocket *pchip = (struct snd_vxpocket *)chip; long port = vxp_reg_addr(chip, VX_DMA); @@ -442,7 +442,7 @@ static void vxp_dma_read(vx_core_t *chip, snd_pcm_runtime_t *runtime, /* * write a codec data (24bit) */ -static void vxp_write_codec_reg(vx_core_t *chip, int codec, unsigned int data) +static void vxp_write_codec_reg(struct vx_core *chip, int codec, unsigned int data) { int i; @@ -465,7 +465,7 @@ static void vxp_write_codec_reg(vx_core_t *chip, int codec, unsigned int data) * vx_set_mic_boost - set mic boost level (on vxp440 only) * @boost: 0 = 20dB, 1 = +38dB */ -void vx_set_mic_boost(vx_core_t *chip, int boost) +void vx_set_mic_boost(struct vx_core *chip, int boost) { struct snd_vxpocket *pchip = (struct snd_vxpocket *)chip; unsigned long flags; @@ -508,7 +508,7 @@ static int vx_compute_mic_level(int level) * vx_set_mic_level - set mic level (on vxpocket only) * @level: the mic level = 0 - 8 (max) */ -void vx_set_mic_level(vx_core_t *chip, int level) +void vx_set_mic_level(struct vx_core *chip, int level) { struct snd_vxpocket *pchip = (struct snd_vxpocket *)chip; unsigned long flags; @@ -528,7 +528,7 @@ void vx_set_mic_level(vx_core_t *chip, int level) /* * change the input audio source */ -static void vxp_change_audio_source(vx_core_t *_chip, int src) +static void vxp_change_audio_source(struct vx_core *_chip, int src) { struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; @@ -568,7 +568,7 @@ static void vxp_change_audio_source(vx_core_t *_chip, int src) * change the clock source * source = INTERNAL_QUARTZ or UER_SYNC */ -static void vxp_set_clock_source(vx_core_t *_chip, int source) +static void vxp_set_clock_source(struct vx_core *_chip, int source) { struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; @@ -583,7 +583,7 @@ static void vxp_set_clock_source(vx_core_t *_chip, int source) /* * reset the board */ -static void vxp_reset_board(vx_core_t *_chip, int cold_reset) +static void vxp_reset_board(struct vx_core *_chip, int cold_reset) { struct snd_vxpocket *chip = (struct snd_vxpocket *)_chip; diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index 1e8f16b4c073..009629714140 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c @@ -83,9 +83,9 @@ static void vxpocket_release(dev_link_t *link) /* * destructor, called from snd_card_free_in_thread() */ -static int snd_vxpocket_dev_free(snd_device_t *device) +static int snd_vxpocket_dev_free(struct snd_device *device) { - vx_core_t *chip = device->device_data; + struct vx_core *chip = device->device_data; snd_vx_free_firmware(chip); kfree(chip); @@ -142,19 +142,19 @@ static struct snd_vx_hardware vxp440_hw = { /* * create vxpocket instance */ -static struct snd_vxpocket *snd_vxpocket_new(snd_card_t *card, int ibl) +static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl) { client_reg_t client_reg; /* Register with cardmgr */ dev_link_t *link; /* Info for cardmgr */ - vx_core_t *chip; + struct vx_core *chip; struct snd_vxpocket *vxp; int ret; - static snd_device_ops_t ops = { + static struct snd_device_ops ops = { .dev_free = snd_vxpocket_dev_free, }; chip = snd_vx_create(card, &vxpocket_hw, &snd_vxpocket_ops, - sizeof(struct snd_vxpocket) - sizeof(vx_core_t)); + sizeof(struct snd_vxpocket) - sizeof(struct vx_core)); if (! chip) return NULL; @@ -218,10 +218,10 @@ static struct snd_vxpocket *snd_vxpocket_new(snd_card_t *card, int ibl) * * returns 0 if successful, or a negative error code. */ -static int snd_vxpocket_assign_resources(vx_core_t *chip, int port, int irq) +static int snd_vxpocket_assign_resources(struct vx_core *chip, int port, int irq) { int err; - snd_card_t *card = chip->card; + struct snd_card *card = chip->card; struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; snd_printdd(KERN_DEBUG "vxpocket assign resources: port = 0x%x, irq = %d\n", port, irq); @@ -250,7 +250,7 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) static void vxpocket_config(dev_link_t *link) { client_handle_t handle = link->handle; - vx_core_t *chip = link->priv; + struct vx_core *chip = link->priv; struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; tuple_t tuple; cisparse_t *parse; @@ -324,7 +324,7 @@ failed: static int vxpocket_event(event_t event, int priority, event_callback_args_t *args) { dev_link_t *link = args->client_data; - vx_core_t *chip = link->priv; + struct vx_core *chip = link->priv; switch (event) { case CS_EVENT_CARD_REMOVAL: @@ -379,7 +379,7 @@ static int vxpocket_event(event_t event, int priority, event_callback_args_t *ar */ static dev_link_t *vxpocket_attach(void) { - snd_card_t *card; + struct snd_card *card; struct snd_vxpocket *vxp; int i; @@ -421,14 +421,14 @@ static dev_link_t *vxpocket_attach(void) static void vxpocket_detach(dev_link_t *link) { struct snd_vxpocket *vxp; - vx_core_t *chip; + struct vx_core *chip; dev_link_t **linkp; if (! link) return; vxp = link->priv; - chip = (vx_core_t *)vxp; + chip = (struct vx_core *)vxp; card_alloc &= ~(1 << vxp->index); /* Remove the interface data from the linked list */ diff --git a/sound/pcmcia/vx/vxpocket.h b/sound/pcmcia/vx/vxpocket.h index 70754aa3dd11..67efae3f6c8d 100644 --- a/sound/pcmcia/vx/vxpocket.h +++ b/sound/pcmcia/vx/vxpocket.h @@ -30,7 +30,7 @@ struct snd_vxpocket { - vx_core_t core; + struct vx_core core; unsigned long port; @@ -48,10 +48,10 @@ struct snd_vxpocket { extern struct snd_vx_ops snd_vxpocket_ops; -void vx_set_mic_boost(vx_core_t *chip, int boost); -void vx_set_mic_level(vx_core_t *chip, int level); +void vx_set_mic_boost(struct vx_core *chip, int boost); +void vx_set_mic_level(struct vx_core *chip, int level); -int vxp_add_mic_controls(vx_core_t *chip); +int vxp_add_mic_controls(struct vx_core *chip); /* Constants used to access the CDSP register (0x08). */ #define CDSP_MAGIC 0xA7 /* magic value (for read) */ -- cgit v1.2.3 From db13154843cb2c99a93e9feed575e906f6e0e455 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 15:07:38 +0100 Subject: [ALSA] Remove xxx_t typedefs: PCMCIA PDaudioCF Modules: PDAudioCF driver Remove xxx_t typedefs from the PCMCIA PDaudioCF driver. Signed-off-by: Takashi Iwai --- sound/pcmcia/pdaudiocf/pdaudiocf.c | 24 +++++++-------- sound/pcmcia/pdaudiocf/pdaudiocf.h | 30 +++++++++---------- sound/pcmcia/pdaudiocf/pdaudiocf_core.c | 42 +++++++++++++------------- sound/pcmcia/pdaudiocf/pdaudiocf_irq.c | 6 ++-- sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c | 52 ++++++++++++++++----------------- 5 files changed, 77 insertions(+), 77 deletions(-) (limited to 'sound/pcmcia') diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c index d6918b453f28..0ba335d045f8 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c @@ -53,7 +53,7 @@ MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard."); */ static dev_info_t dev_info = "snd-pdaudiocf"; -static snd_card_t *card_list[SNDRV_CARDS]; +static struct snd_card *card_list[SNDRV_CARDS]; static dev_link_t *dev_list; /* @@ -77,7 +77,7 @@ static void pdacf_release(dev_link_t *link) /* * destructor */ -static int snd_pdacf_free(pdacf_t *pdacf) +static int snd_pdacf_free(struct snd_pdacf *pdacf) { dev_link_t *link = &pdacf->link; @@ -94,9 +94,9 @@ static int snd_pdacf_free(pdacf_t *pdacf) return 0; } -static int snd_pdacf_dev_free(snd_device_t *device) +static int snd_pdacf_dev_free(struct snd_device *device) { - pdacf_t *chip = device->device_data; + struct snd_pdacf *chip = device->device_data; return snd_pdacf_free(chip); } @@ -108,9 +108,9 @@ static dev_link_t *snd_pdacf_attach(void) client_reg_t client_reg; /* Register with cardmgr */ dev_link_t *link; /* Info for cardmgr */ int i, ret; - pdacf_t *pdacf; - snd_card_t *card; - static snd_device_ops_t ops = { + struct snd_pdacf *pdacf; + struct snd_card *card; + static struct snd_device_ops ops = { .dev_free = snd_pdacf_dev_free, }; @@ -194,10 +194,10 @@ static dev_link_t *snd_pdacf_attach(void) * * returns 0 if successful, or a negative error code. */ -static int snd_pdacf_assign_resources(pdacf_t *pdacf, int port, int irq) +static int snd_pdacf_assign_resources(struct snd_pdacf *pdacf, int port, int irq) { int err; - snd_card_t *card = pdacf->card; + struct snd_card *card = pdacf->card; snd_printdd(KERN_DEBUG "pdacf assign resources: port = 0x%x, irq = %d\n", port, irq); pdacf->port = port; @@ -231,7 +231,7 @@ static int snd_pdacf_assign_resources(pdacf_t *pdacf, int port, int irq) */ static void snd_pdacf_detach(dev_link_t *link) { - pdacf_t *chip = link->priv; + struct snd_pdacf *chip = link->priv; snd_printdd(KERN_DEBUG "pdacf_detach called\n"); /* Remove the interface data from the linked list */ @@ -261,7 +261,7 @@ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) static void pdacf_config(dev_link_t *link) { client_handle_t handle = link->handle; - pdacf_t *pdacf = link->priv; + struct snd_pdacf *pdacf = link->priv; tuple_t tuple; cisparse_t *parse = NULL; config_info_t conf; @@ -318,7 +318,7 @@ failed: static int pdacf_event(event_t event, int priority, event_callback_args_t *args) { dev_link_t *link = args->client_data; - pdacf_t *chip = link->priv; + struct snd_pdacf *chip = link->priv; switch (event) { case CS_EVENT_CARD_REMOVAL: diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.h b/sound/pcmcia/pdaudiocf/pdaudiocf.h index c7a9628256ee..ad8f32eedce5 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.h +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.h @@ -83,8 +83,8 @@ #define PDAUDIOCF_STAT_IS_CONFIGURED (1<<1) #define PDAUDIOCF_STAT_IS_SUSPENDED (1<<2) -typedef struct { - snd_card_t *card; +struct snd_pdacf { + struct snd_card *card; int index; unsigned long port; @@ -96,12 +96,12 @@ typedef struct { struct tasklet_struct tq; spinlock_t ak4117_lock; - ak4117_t *ak4117; + struct ak4117 *ak4117; unsigned int chip_status; - snd_pcm_t *pcm; - snd_pcm_substream_t *pcm_substream; + struct snd_pcm *pcm; + struct snd_pcm_substream *pcm_substream; unsigned int pcm_running: 1; unsigned int pcm_channels; unsigned int pcm_swab; @@ -118,28 +118,28 @@ typedef struct { /* pcmcia stuff */ dev_link_t link; dev_node_t node; -} pdacf_t; +}; -static inline void pdacf_reg_write(pdacf_t *chip, unsigned char reg, unsigned short val) +static inline void pdacf_reg_write(struct snd_pdacf *chip, unsigned char reg, unsigned short val) { outw(chip->regmap[reg>>1] = val, chip->port + reg); } -static inline unsigned short pdacf_reg_read(pdacf_t *chip, unsigned char reg) +static inline unsigned short pdacf_reg_read(struct snd_pdacf *chip, unsigned char reg) { return inw(chip->port + reg); } -pdacf_t *snd_pdacf_create(snd_card_t *card); -int snd_pdacf_ak4117_create(pdacf_t *pdacf); -void snd_pdacf_powerdown(pdacf_t *chip); +struct snd_pdacf *snd_pdacf_create(struct snd_card *card); +int snd_pdacf_ak4117_create(struct snd_pdacf *pdacf); +void snd_pdacf_powerdown(struct snd_pdacf *chip); #ifdef CONFIG_PM -int snd_pdacf_suspend(snd_card_t *card, pm_message_t state); -int snd_pdacf_resume(snd_card_t *card); +int snd_pdacf_suspend(struct snd_card *card, pm_message_t state); +int snd_pdacf_resume(struct snd_card *card); #endif -int snd_pdacf_pcm_new(pdacf_t *chip); +int snd_pdacf_pcm_new(struct snd_pdacf *chip); irqreturn_t pdacf_interrupt(int irq, void *dev, struct pt_regs *regs); void pdacf_tasklet(unsigned long private_data); -void pdacf_reinit(pdacf_t *chip, int resume); +void pdacf_reinit(struct snd_pdacf *chip, int resume); #endif /* __PDAUDIOCF_H */ diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_core.c b/sound/pcmcia/pdaudiocf/pdaudiocf_core.c index 0208c54896b3..4f898238e0aa 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf_core.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf_core.c @@ -30,7 +30,7 @@ */ static unsigned char pdacf_ak4117_read(void *private_data, unsigned char reg) { - pdacf_t *chip = private_data; + struct snd_pdacf *chip = private_data; unsigned long timeout; unsigned long flags; unsigned char res; @@ -62,7 +62,7 @@ static unsigned char pdacf_ak4117_read(void *private_data, unsigned char reg) static void pdacf_ak4117_write(void *private_data, unsigned char reg, unsigned char val) { - pdacf_t *chip = private_data; + struct snd_pdacf *chip = private_data; unsigned long timeout; unsigned long flags; @@ -81,7 +81,7 @@ static void pdacf_ak4117_write(void *private_data, unsigned char reg, unsigned c } #if 0 -void pdacf_dump(pdacf_t *chip) +void pdacf_dump(struct snd_pdacf *chip) { printk("PDAUDIOCF DUMP (0x%lx):\n", chip->port); printk("WPD : 0x%x\n", inw(chip->port + PDAUDIOCF_REG_WDP)); @@ -94,7 +94,7 @@ void pdacf_dump(pdacf_t *chip) } #endif -static int pdacf_reset(pdacf_t *chip, int powerdown) +static int pdacf_reset(struct snd_pdacf *chip, int powerdown) { u16 val; @@ -117,7 +117,7 @@ static int pdacf_reset(pdacf_t *chip, int powerdown) return 0; } -void pdacf_reinit(pdacf_t *chip, int resume) +void pdacf_reinit(struct snd_pdacf *chip, int resume) { pdacf_reset(chip, 0); if (resume) @@ -127,10 +127,10 @@ void pdacf_reinit(pdacf_t *chip, int resume) pdacf_reg_write(chip, PDAUDIOCF_REG_IER, chip->regmap[PDAUDIOCF_REG_IER>>1]); } -static void pdacf_proc_read(snd_info_entry_t * entry, - snd_info_buffer_t * buffer) +static void pdacf_proc_read(struct snd_info_entry * entry, + struct snd_info_buffer *buffer) { - pdacf_t *chip = entry->private_data; + struct snd_pdacf *chip = entry->private_data; u16 tmp; snd_iprintf(buffer, "PDAudioCF\n\n"); @@ -139,17 +139,17 @@ static void pdacf_proc_read(snd_info_entry_t * entry, } -static void pdacf_proc_init(pdacf_t *chip) +static void pdacf_proc_init(struct snd_pdacf *chip) { - snd_info_entry_t *entry; + struct snd_info_entry *entry; if (! snd_card_proc_new(chip->card, "pdaudiocf", &entry)) snd_info_set_text_ops(entry, chip, 1024, pdacf_proc_read); } -pdacf_t *snd_pdacf_create(snd_card_t *card) +struct snd_pdacf *snd_pdacf_create(struct snd_card *card) { - pdacf_t *chip; + struct snd_pdacf *chip; chip = kzalloc(sizeof(*chip), GFP_KERNEL); if (chip == NULL) @@ -164,9 +164,9 @@ pdacf_t *snd_pdacf_create(snd_card_t *card) return chip; } -static void snd_pdacf_ak4117_change(ak4117_t *ak4117, unsigned char c0, unsigned char c1) +static void snd_pdacf_ak4117_change(struct ak4117 *ak4117, unsigned char c0, unsigned char c1) { - pdacf_t *chip = ak4117->change_callback_private; + struct snd_pdacf *chip = ak4117->change_callback_private; unsigned long flags; u16 val; @@ -182,7 +182,7 @@ static void snd_pdacf_ak4117_change(ak4117_t *ak4117, unsigned char c0, unsigned spin_unlock_irqrestore(&chip->reg_lock, flags); } -int snd_pdacf_ak4117_create(pdacf_t *chip) +int snd_pdacf_ak4117_create(struct snd_pdacf *chip) { int err; u16 val; @@ -238,7 +238,7 @@ int snd_pdacf_ak4117_create(pdacf_t *chip) return 0; } -void snd_pdacf_powerdown(pdacf_t *chip) +void snd_pdacf_powerdown(struct snd_pdacf *chip) { u16 val; @@ -255,9 +255,9 @@ void snd_pdacf_powerdown(pdacf_t *chip) #ifdef CONFIG_PM -int snd_pdacf_suspend(snd_card_t *card, pm_message_t state) +int snd_pdacf_suspend(struct snd_card *card, pm_message_t state) { - pdacf_t *chip = card->pm_private_data; + struct snd_pdacf *chip = card->pm_private_data; u16 val; snd_pcm_suspend_all(chip->pcm); @@ -270,14 +270,14 @@ int snd_pdacf_suspend(snd_card_t *card, pm_message_t state) return 0; } -static inline int check_signal(pdacf_t *chip) +static inline int check_signal(struct snd_pdacf *chip) { return (chip->ak4117->rcs0 & AK4117_UNLCK) == 0; } -int snd_pdacf_resume(snd_card_t *card) +int snd_pdacf_resume(struct snd_card *card) { - pdacf_t *chip = card->pm_private_data; + struct snd_pdacf *chip = card->pm_private_data; int timeout = 40; pdacf_reinit(chip, 1); diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c b/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c index 255b63444b5d..7c5f21e45cb4 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf_irq.c @@ -28,7 +28,7 @@ */ irqreturn_t pdacf_interrupt(int irq, void *dev, struct pt_regs *regs) { - pdacf_t *chip = dev; + struct snd_pdacf *chip = dev; unsigned short stat; if ((chip->chip_status & (PDAUDIOCF_STAT_IS_STALE| @@ -204,7 +204,7 @@ static inline void pdacf_transfer_stereo24be(u8 *dst, u32 xor, unsigned int size } } -static void pdacf_transfer(pdacf_t *chip, unsigned int size, unsigned int off) +static void pdacf_transfer(struct snd_pdacf *chip, unsigned int size, unsigned int off) { unsigned long rdp_port = chip->port + PDAUDIOCF_REG_MD; unsigned int xor = chip->pcm_xor; @@ -258,7 +258,7 @@ static void pdacf_transfer(pdacf_t *chip, unsigned int size, unsigned int off) void pdacf_tasklet(unsigned long private_data) { - pdacf_t *chip = (pdacf_t *) private_data; + struct snd_pdacf *chip = (struct snd_pdacf *) private_data; int size, off, cont, rdp, wdp; if ((chip->chip_status & (PDAUDIOCF_STAT_IS_STALE|PDAUDIOCF_STAT_IS_CONFIGURED)) != PDAUDIOCF_STAT_IS_CONFIGURED) diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c b/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c index d54033ebd5e9..09cb250d5827 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c @@ -34,7 +34,7 @@ */ /* get the physical page pointer on the given offset */ -static struct page *snd_pcm_get_vmalloc_page(snd_pcm_substream_t *subs, unsigned long offset) +static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs, unsigned long offset) { void *pageptr = subs->runtime->dma_area + offset; return vmalloc_to_page(pageptr); @@ -44,9 +44,9 @@ static struct page *snd_pcm_get_vmalloc_page(snd_pcm_substream_t *subs, unsigned * hw_params callback * NOTE: this may be called not only once per pcm open! */ -static int snd_pcm_alloc_vmalloc_buffer(snd_pcm_substream_t *subs, size_t size) +static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t size) { - snd_pcm_runtime_t *runtime = subs->runtime; + struct snd_pcm_runtime *runtime = subs->runtime; if (runtime->dma_area) { if (runtime->dma_bytes >= size) return 0; /* already enough large */ @@ -63,9 +63,9 @@ static int snd_pcm_alloc_vmalloc_buffer(snd_pcm_substream_t *subs, size_t size) * hw_free callback * NOTE: this may be called not only once per pcm open! */ -static int snd_pcm_free_vmalloc_buffer(snd_pcm_substream_t *subs) +static int snd_pcm_free_vmalloc_buffer(struct snd_pcm_substream *subs) { - snd_pcm_runtime_t *runtime = subs->runtime; + struct snd_pcm_runtime *runtime = subs->runtime; if (runtime->dma_area) { vfree(runtime->dma_area); runtime->dma_area = NULL; @@ -76,7 +76,7 @@ static int snd_pcm_free_vmalloc_buffer(snd_pcm_substream_t *subs) /* * clear the SRAM contents */ -static int pdacf_pcm_clear_sram(pdacf_t *chip) +static int pdacf_pcm_clear_sram(struct snd_pdacf *chip) { int max_loop = 64 * 1024; @@ -91,10 +91,10 @@ static int pdacf_pcm_clear_sram(pdacf_t *chip) /* * pdacf_pcm_trigger - trigger callback for capture */ -static int pdacf_pcm_trigger(snd_pcm_substream_t *subs, int cmd) +static int pdacf_pcm_trigger(struct snd_pcm_substream *subs, int cmd) { - pdacf_t *chip = snd_pcm_substream_chip(subs); - snd_pcm_runtime_t *runtime = subs->runtime; + struct snd_pdacf *chip = snd_pcm_substream_chip(subs); + struct snd_pcm_runtime *runtime = subs->runtime; int inc, ret = 0, rate; unsigned short mask, val, tmp; @@ -146,8 +146,8 @@ static int pdacf_pcm_trigger(snd_pcm_substream_t *subs, int cmd) /* * pdacf_pcm_hw_params - hw_params callback for playback and capture */ -static int pdacf_pcm_hw_params(snd_pcm_substream_t *subs, - snd_pcm_hw_params_t *hw_params) +static int pdacf_pcm_hw_params(struct snd_pcm_substream *subs, + struct snd_pcm_hw_params *hw_params) { return snd_pcm_alloc_vmalloc_buffer(subs, params_buffer_bytes(hw_params)); } @@ -155,7 +155,7 @@ static int pdacf_pcm_hw_params(snd_pcm_substream_t *subs, /* * pdacf_pcm_hw_free - hw_free callback for playback and capture */ -static int pdacf_pcm_hw_free(snd_pcm_substream_t *subs) +static int pdacf_pcm_hw_free(struct snd_pcm_substream *subs) { return snd_pcm_free_vmalloc_buffer(subs); } @@ -163,10 +163,10 @@ static int pdacf_pcm_hw_free(snd_pcm_substream_t *subs) /* * pdacf_pcm_prepare - prepare callback for playback and capture */ -static int pdacf_pcm_prepare(snd_pcm_substream_t *subs) +static int pdacf_pcm_prepare(struct snd_pcm_substream *subs) { - pdacf_t *chip = snd_pcm_substream_chip(subs); - snd_pcm_runtime_t *runtime = subs->runtime; + struct snd_pdacf *chip = snd_pcm_substream_chip(subs); + struct snd_pcm_runtime *runtime = subs->runtime; u16 val, nval, aval; if (chip->chip_status & PDAUDIOCF_STAT_IS_STALE) @@ -239,7 +239,7 @@ static int pdacf_pcm_prepare(snd_pcm_substream_t *subs) * capture hw information */ -static snd_pcm_hardware_t pdacf_pcm_capture_hw = { +static struct snd_pcm_hardware pdacf_pcm_capture_hw = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID), @@ -269,10 +269,10 @@ static snd_pcm_hardware_t pdacf_pcm_capture_hw = { /* * pdacf_pcm_capture_open - open callback for capture */ -static int pdacf_pcm_capture_open(snd_pcm_substream_t *subs) +static int pdacf_pcm_capture_open(struct snd_pcm_substream *subs) { - snd_pcm_runtime_t *runtime = subs->runtime; - pdacf_t *chip = snd_pcm_substream_chip(subs); + struct snd_pcm_runtime *runtime = subs->runtime; + struct snd_pdacf *chip = snd_pcm_substream_chip(subs); if (chip->chip_status & PDAUDIOCF_STAT_IS_STALE) return -EBUSY; @@ -287,9 +287,9 @@ static int pdacf_pcm_capture_open(snd_pcm_substream_t *subs) /* * pdacf_pcm_capture_close - close callback for capture */ -static int pdacf_pcm_capture_close(snd_pcm_substream_t *subs) +static int pdacf_pcm_capture_close(struct snd_pcm_substream *subs) { - pdacf_t *chip = snd_pcm_substream_chip(subs); + struct snd_pdacf *chip = snd_pcm_substream_chip(subs); if (!chip) return -EINVAL; @@ -302,16 +302,16 @@ static int pdacf_pcm_capture_close(snd_pcm_substream_t *subs) /* * pdacf_pcm_capture_pointer - pointer callback for capture */ -static snd_pcm_uframes_t pdacf_pcm_capture_pointer(snd_pcm_substream_t *subs) +static snd_pcm_uframes_t pdacf_pcm_capture_pointer(struct snd_pcm_substream *subs) { - pdacf_t *chip = snd_pcm_substream_chip(subs); + struct snd_pdacf *chip = snd_pcm_substream_chip(subs); return chip->pcm_hwptr; } /* * operators for PCM capture */ -static snd_pcm_ops_t pdacf_pcm_capture_ops = { +static struct snd_pcm_ops pdacf_pcm_capture_ops = { .open = pdacf_pcm_capture_open, .close = pdacf_pcm_capture_close, .ioctl = snd_pcm_lib_ioctl, @@ -327,9 +327,9 @@ static snd_pcm_ops_t pdacf_pcm_capture_ops = { /* * snd_pdacf_pcm_new - create and initialize a pcm */ -int snd_pdacf_pcm_new(pdacf_t *chip) +int snd_pdacf_pcm_new(struct snd_pdacf *chip) { - snd_pcm_t *pcm; + struct snd_pcm *pcm; int err; err = snd_pcm_new(chip->card, "PDAudioCF", 0, 0, 1, &pcm); -- cgit v1.2.3 From 0ed1cad172176a4595f82e8cd9055938ad54bd4b Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 16:06:05 +0100 Subject: [ALSA] vx-driver - Fix PM support Fix PM support on VX drivers (vxpocket and vx222). Signed-off-by: Takashi Iwai --- include/sound/vx_core.h | 6 ++++++ sound/drivers/vx/vx_core.c | 18 ++++++++---------- sound/pci/vx222/vx222.c | 33 ++++++++++++++++++++++++++++++++- sound/pcmcia/vx/vxpocket.c | 9 +++++---- 4 files changed, 51 insertions(+), 15 deletions(-) (limited to 'sound/pcmcia') diff --git a/include/sound/vx_core.h b/include/sound/vx_core.h index 0a85c37d1bc7..5fd6f3305e0d 100644 --- a/include/sound/vx_core.h +++ b/include/sound/vx_core.h @@ -346,6 +346,12 @@ void vx_set_internal_clock(struct vx_core *chip, unsigned int freq); int vx_change_frequency(struct vx_core *chip); +/* + * PM + */ +int snd_vx_suspend(struct vx_core *card, pm_message_t state); +int snd_vx_resume(struct vx_core *card); + /* * hardware constants */ diff --git a/sound/drivers/vx/vx_core.c b/sound/drivers/vx/vx_core.c index 5abf42351772..43f615d7a545 100644 --- a/sound/drivers/vx/vx_core.c +++ b/sound/drivers/vx/vx_core.c @@ -709,13 +709,11 @@ int snd_vx_dsp_load(struct vx_core *chip, const struct firmware *dsp) /* * suspend */ -static int snd_vx_suspend(struct snd_card *card, pm_message_t state) +int snd_vx_suspend(struct vx_core *chip, pm_message_t state) { - struct vx_core *chip = card->pm_private_data; unsigned int i; - snd_assert(chip, return -EINVAL); - + snd_power_change_state(chip->card, SNDRV_CTL_POWER_D3hot); chip->chip_status |= VX_STAT_IN_SUSPEND; for (i = 0; i < chip->hw->num_codecs; i++) snd_pcm_suspend_all(chip->pcm[i]); @@ -726,13 +724,10 @@ static int snd_vx_suspend(struct snd_card *card, pm_message_t state) /* * resume */ -static int snd_vx_resume(struct snd_card *card) +int snd_vx_resume(struct vx_core *chip) { - struct vx_core *chip = card->pm_private_data; int i, err; - snd_assert(chip, return -EINVAL); - chip->chip_status &= ~VX_STAT_CHIP_INIT; for (i = 0; i < 4; i++) { @@ -748,6 +743,7 @@ static int snd_vx_resume(struct snd_card *card) chip->chip_status |= VX_STAT_CHIP_INIT; chip->chip_status &= ~VX_STAT_IN_SUSPEND; + snd_power_change_state(chip->card, SNDRV_CTL_POWER_D0); return 0; } @@ -789,8 +785,6 @@ struct vx_core *snd_vx_create(struct snd_card *card, struct snd_vx_hardware *hw, strcpy(card->driver, hw->name); sprintf(card->shortname, "Digigram %s", hw->name); - snd_card_set_pm_callback(card, snd_vx_suspend, snd_vx_resume, chip); - vx_proc_init(chip); return chip; @@ -822,3 +816,7 @@ EXPORT_SYMBOL(snd_vx_irq_handler); EXPORT_SYMBOL(snd_vx_dsp_boot); EXPORT_SYMBOL(snd_vx_dsp_load); EXPORT_SYMBOL(snd_vx_load_boot_image); +#ifdef CONFIG_PM +EXPORT_SYMBOL(snd_vx_suspend); +EXPORT_SYMBOL(snd_vx_resume); +#endif diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c index 4ebbabedb3c3..c816ddf1b215 100644 --- a/sound/pci/vx222/vx222.c +++ b/sound/pci/vx222/vx222.c @@ -218,6 +218,7 @@ static int __devinit snd_vx222_probe(struct pci_dev *pci, snd_card_free(card); return err; } + card->private_data = vx; vx->core.ibl.size = ibl[dev]; sprintf(card->longname, "%s at 0x%lx & 0x%lx, irq %i", @@ -250,12 +251,42 @@ static void __devexit snd_vx222_remove(struct pci_dev *pci) pci_set_drvdata(pci, NULL); } +#ifdef CONFIG_PM +static int snd_vx222_suspend(struct pci_dev *pci, pm_message_t state) +{ + struct snd_card *card = pci_get_drvdata(pci); + struct snd_vx222 *vx = card->private_data; + int err; + + err = snd_vx_suspend(&vx->core, state); + pci_set_power_state(pci, PCI_D3hot); + pci_disable_device(pci); + pci_save_state(pci); + return err; +} + +static int snd_vx222_resume(struct pci_dev *pci) +{ + struct snd_card *card = pci_get_drvdata(pci); + struct snd_vx222 *vx = card->private_data; + + pci_restore_state(pci); + pci_enable_device(pci); + pci_set_power_state(pci, PCI_D0); + pci_set_master(pci); + return snd_vx_resume(&vx->core); +} +#endif + static struct pci_driver driver = { .name = "Digigram VX222", .id_table = snd_vx222_ids, .probe = snd_vx222_probe, .remove = __devexit_p(snd_vx222_remove), - SND_PCI_PM_CALLBACKS +#ifdef CONFIG_PM + .suspend = snd_vx222_suspend, + .resume = snd_vx222_resume, +#endif }; static int __init alsa_card_vx222_init(void) diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index 009629714140..5bb079d17959 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c @@ -342,9 +342,9 @@ static int vxpocket_event(event_t event, int priority, event_callback_args_t *ar case CS_EVENT_PM_SUSPEND: snd_printdd(KERN_DEBUG "SUSPEND\n"); link->state |= DEV_SUSPEND; - if (chip && chip->card->pm_suspend) { + if (chip) { snd_printdd(KERN_DEBUG "snd_vx_suspend calling\n"); - chip->card->pm_suspend(chip->card, PMSG_SUSPEND); + snd_vx_suspend(chip, PMSG_SUSPEND); } /* Fall through... */ case CS_EVENT_RESET_PHYSICAL: @@ -362,9 +362,9 @@ static int vxpocket_event(event_t event, int priority, event_callback_args_t *ar //struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; snd_printdd(KERN_DEBUG "requestconfig...\n"); pcmcia_request_configuration(link->handle, &link->conf); - if (chip && chip->card->pm_resume) { + if (chip) { snd_printdd(KERN_DEBUG "calling snd_vx_resume\n"); - chip->card->pm_resume(chip->card); + snd_vx_resume(chip); } } snd_printdd(KERN_DEBUG "resume done!\n"); @@ -407,6 +407,7 @@ static dev_link_t *vxpocket_attach(void) snd_card_free(card); return NULL; } + card->private_data = vxp; vxp->index = i; card_alloc |= 1 << i; -- cgit v1.2.3 From e4f163d96080dda40fd02df725f3672d035e4c5a Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 17:15:58 +0100 Subject: [ALSA] pdaudiocf - Fix PM support Modules: PDAudioCF driver Fix the PM support on pdaudiocf driver. Signed-off-by: Takashi Iwai --- sound/pcmcia/pdaudiocf/pdaudiocf.c | 6 ++---- sound/pcmcia/pdaudiocf/pdaudiocf.h | 4 ++-- sound/pcmcia/pdaudiocf/pdaudiocf_core.c | 8 ++++---- 3 files changed, 8 insertions(+), 10 deletions(-) (limited to 'sound/pcmcia') diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c index 0ba335d045f8..a7cd2d4df757 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c @@ -217,8 +217,6 @@ static int snd_pdacf_assign_resources(struct snd_pdacf *pdacf, int port, int irq if (err < 0) return err; - snd_card_set_pm_callback(card, snd_pdacf_suspend, snd_pdacf_resume, pdacf); - if ((err = snd_card_register(card)) < 0) return err; @@ -339,7 +337,7 @@ static int pdacf_event(event_t event, int priority, event_callback_args_t *args) link->state |= DEV_SUSPEND; if (chip) { snd_printdd(KERN_DEBUG "snd_pdacf_suspend calling\n"); - snd_pdacf_suspend(chip->card, PMSG_SUSPEND); + snd_pdacf_suspend(chip, PMSG_SUSPEND); } /* Fall through... */ case CS_EVENT_RESET_PHYSICAL: @@ -358,7 +356,7 @@ static int pdacf_event(event_t event, int priority, event_callback_args_t *args) pcmcia_request_configuration(link->handle, &link->conf); if (chip) { snd_printdd(KERN_DEBUG "calling snd_pdacf_resume\n"); - snd_pdacf_resume(chip->card); + snd_pdacf_resume(chip); } } snd_printdd(KERN_DEBUG "resume done!\n"); diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.h b/sound/pcmcia/pdaudiocf/pdaudiocf.h index ad8f32eedce5..2744f189a613 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.h +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.h @@ -134,8 +134,8 @@ struct snd_pdacf *snd_pdacf_create(struct snd_card *card); int snd_pdacf_ak4117_create(struct snd_pdacf *pdacf); void snd_pdacf_powerdown(struct snd_pdacf *chip); #ifdef CONFIG_PM -int snd_pdacf_suspend(struct snd_card *card, pm_message_t state); -int snd_pdacf_resume(struct snd_card *card); +int snd_pdacf_suspend(struct snd_pdacf *chip, pm_message_t state); +int snd_pdacf_resume(struct snd_pdacf *chip); #endif int snd_pdacf_pcm_new(struct snd_pdacf *chip); irqreturn_t pdacf_interrupt(int irq, void *dev, struct pt_regs *regs); diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf_core.c b/sound/pcmcia/pdaudiocf/pdaudiocf_core.c index 4f898238e0aa..bd0d70ff3019 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf_core.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf_core.c @@ -255,11 +255,11 @@ void snd_pdacf_powerdown(struct snd_pdacf *chip) #ifdef CONFIG_PM -int snd_pdacf_suspend(struct snd_card *card, pm_message_t state) +int snd_pdacf_suspend(struct snd_pdacf *chip, pm_message_t state) { - struct snd_pdacf *chip = card->pm_private_data; u16 val; + snd_power_change_state(chip->card, SNDRV_CTL_POWER_D3hot); snd_pcm_suspend_all(chip->pcm); /* disable interrupts, but use direct write to preserve old register value in chip->regmap */ val = inw(chip->port + PDAUDIOCF_REG_IER); @@ -275,9 +275,8 @@ static inline int check_signal(struct snd_pdacf *chip) return (chip->ak4117->rcs0 & AK4117_UNLCK) == 0; } -int snd_pdacf_resume(struct snd_card *card) +int snd_pdacf_resume(struct snd_pdacf *chip) { - struct snd_pdacf *chip = card->pm_private_data; int timeout = 40; pdacf_reinit(chip, 1); @@ -286,6 +285,7 @@ int snd_pdacf_resume(struct snd_card *card) (snd_ak4117_external_rate(chip->ak4117) <= 0 || !check_signal(chip))) mdelay(1); chip->chip_status &= ~PDAUDIOCF_STAT_IS_SUSPENDED; + snd_power_change_state(chip->card, SNDRV_CTL_POWER_D0); return 0; } #endif -- cgit v1.2.3 From efe3cd105f2a19e72ce9280bb22c7c80752e4314 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Fri, 6 Jan 2006 00:27:16 +0100 Subject: [PATCH] pcmcia: fix sound drivers Update the PCMCIA sound drivers to handle the recent changes to the PCMCIA core. A part of this merge was done by Takashi Iwai . Signed-off-by: Dominik Brodowski --- sound/pcmcia/pdaudiocf/pdaudiocf.c | 154 ++++++++++++++---------------------- sound/pcmcia/vx/vxpocket.c | 155 +++++++++++++------------------------ 2 files changed, 115 insertions(+), 194 deletions(-) (limited to 'sound/pcmcia') diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c index a7cd2d4df757..77caf43a3109 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c @@ -52,16 +52,13 @@ MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard."); /* */ -static dev_info_t dev_info = "snd-pdaudiocf"; static struct snd_card *card_list[SNDRV_CARDS]; -static dev_link_t *dev_list; /* * prototypes */ static void pdacf_config(dev_link_t *link); -static int pdacf_event(event_t event, int priority, event_callback_args_t *args); -static void snd_pdacf_detach(dev_link_t *link); +static void snd_pdacf_detach(struct pcmcia_device *p_dev); static void pdacf_release(dev_link_t *link) { @@ -83,10 +80,6 @@ static int snd_pdacf_free(struct snd_pdacf *pdacf) pdacf_release(link); - /* Break the link with Card Services */ - if (link->handle) - pcmcia_deregister_client(link->handle); - card_list[pdacf->index] = NULL; pdacf->card = NULL; @@ -103,11 +96,10 @@ static int snd_pdacf_dev_free(struct snd_device *device) /* * snd_pdacf_attach - attach callback for cs */ -static dev_link_t *snd_pdacf_attach(void) +static int snd_pdacf_attach(struct pcmcia_device *p_dev) { - client_reg_t client_reg; /* Register with cardmgr */ - dev_link_t *link; /* Info for cardmgr */ - int i, ret; + int i; + dev_link_t *link; /* Info for cardmgr */ struct snd_pdacf *pdacf; struct snd_card *card; static struct snd_device_ops ops = { @@ -122,26 +114,26 @@ static dev_link_t *snd_pdacf_attach(void) } if (i >= SNDRV_CARDS) { snd_printk(KERN_ERR "pdacf: too many cards found\n"); - return NULL; + return -EINVAL; } if (! enable[i]) - return NULL; /* disabled explicitly */ + return -ENODEV; /* disabled explicitly */ /* ok, create a card instance */ card = snd_card_new(index[i], id[i], THIS_MODULE, 0); if (card == NULL) { snd_printk(KERN_ERR "pdacf: cannot create a card instance\n"); - return NULL; + return -ENOMEM; } pdacf = snd_pdacf_create(card); if (! pdacf) - return NULL; + return -EIO; if (snd_device_new(card, SNDRV_DEV_LOWLEVEL, pdacf, &ops) < 0) { kfree(pdacf); snd_card_free(card); - return NULL; + return -ENODEV; } pdacf->index = i; @@ -165,22 +157,12 @@ static dev_link_t *snd_pdacf_attach(void) link->conf.Present = PRESENT_OPTION; /* Chain drivers */ - link->next = dev_list; - dev_list = link; - - /* Register with Card Services */ - client_reg.dev_info = &dev_info; - client_reg.Version = 0x0210; - client_reg.event_callback_args.client_data = link; - - ret = pcmcia_register_client(&link->handle, &client_reg); - if (ret != CS_SUCCESS) { - cs_error(link->handle, RegisterClient, ret); - snd_pdacf_detach(link); - return NULL; - } + link->next = NULL; - return link; + link->handle = p_dev; + pdacf_config(link); + + return 0; } @@ -227,21 +209,13 @@ static int snd_pdacf_assign_resources(struct snd_pdacf *pdacf, int port, int irq /* * snd_pdacf_detach - detach callback for cs */ -static void snd_pdacf_detach(dev_link_t *link) +static void snd_pdacf_detach(struct pcmcia_device *p_dev) { + dev_link_t *link = dev_to_instance(p_dev); struct snd_pdacf *chip = link->priv; snd_printdd(KERN_DEBUG "pdacf_detach called\n"); - /* Remove the interface data from the linked list */ - { - dev_link_t **linkp; - /* Locate device structure */ - for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) - if (*linkp == link) - break; - if (*linkp) - *linkp = link->next; - } + if (chip->chip_status & PDAUDIOCF_STAT_IS_CONFIGURED) snd_pdacf_powerdown(chip); chip->chip_status |= PDAUDIOCF_STAT_IS_STALE; /* to be sure */ @@ -310,62 +284,51 @@ failed: pcmcia_release_irq(link->handle, &link->irq); } -/* - * event callback - */ -static int pdacf_event(event_t event, int priority, event_callback_args_t *args) +#ifdef CONFIG_PM + +static int pdacf_suspend(struct pcmcia_device *dev) { - dev_link_t *link = args->client_data; + dev_link_t *link = dev_to_instance(dev); struct snd_pdacf *chip = link->priv; - switch (event) { - case CS_EVENT_CARD_REMOVAL: - snd_printdd(KERN_DEBUG "CARD_REMOVAL..\n"); - link->state &= ~DEV_PRESENT; - if (link->state & DEV_CONFIG) { - chip->chip_status |= PDAUDIOCF_STAT_IS_STALE; - } - break; - case CS_EVENT_CARD_INSERTION: - snd_printdd(KERN_DEBUG "CARD_INSERTION..\n"); - link->state |= DEV_PRESENT; - pdacf_config(link); - break; -#ifdef CONFIG_PM - case CS_EVENT_PM_SUSPEND: - snd_printdd(KERN_DEBUG "SUSPEND\n"); - link->state |= DEV_SUSPEND; + snd_printdd(KERN_DEBUG "SUSPEND\n"); + link->state |= DEV_SUSPEND; + if (chip) { + snd_printdd(KERN_DEBUG "snd_pdacf_suspend calling\n"); + snd_pdacf_suspend(chip, PMSG_SUSPEND); + } + + snd_printdd(KERN_DEBUG "RESET_PHYSICAL\n"); + if (link->state & DEV_CONFIG) + pcmcia_release_configuration(link->handle); + + return 0; +} + +static int pdacf_resume(struct pcmcia_device *dev) +{ + dev_link_t *link = dev_to_instance(dev); + struct snd_pdacf *chip = link->priv; + + snd_printdd(KERN_DEBUG "RESUME\n"); + link->state &= ~DEV_SUSPEND; + + snd_printdd(KERN_DEBUG "CARD_RESET\n"); + if (DEV_OK(link)) { + snd_printdd(KERN_DEBUG "requestconfig...\n"); + pcmcia_request_configuration(link->handle, &link->conf); if (chip) { - snd_printdd(KERN_DEBUG "snd_pdacf_suspend calling\n"); - snd_pdacf_suspend(chip, PMSG_SUSPEND); - } - /* Fall through... */ - case CS_EVENT_RESET_PHYSICAL: - snd_printdd(KERN_DEBUG "RESET_PHYSICAL\n"); - if (link->state & DEV_CONFIG) - pcmcia_release_configuration(link->handle); - break; - case CS_EVENT_PM_RESUME: - snd_printdd(KERN_DEBUG "RESUME\n"); - link->state &= ~DEV_SUSPEND; - /* Fall through... */ - case CS_EVENT_CARD_RESET: - snd_printdd(KERN_DEBUG "CARD_RESET\n"); - if (DEV_OK(link)) { - snd_printdd(KERN_DEBUG "requestconfig...\n"); - pcmcia_request_configuration(link->handle, &link->conf); - if (chip) { - snd_printdd(KERN_DEBUG "calling snd_pdacf_resume\n"); - snd_pdacf_resume(chip); - } + snd_printdd(KERN_DEBUG "calling snd_pdacf_resume\n"); + snd_pdacf_resume(chip); } - snd_printdd(KERN_DEBUG "resume done!\n"); - break; -#endif } + snd_printdd(KERN_DEBUG "resume done!\n"); + return 0; } +#endif + /* * Module entry points */ @@ -380,10 +343,14 @@ static struct pcmcia_driver pdacf_cs_driver = { .drv = { .name = "snd-pdaudiocf", }, - .attach = snd_pdacf_attach, - .event = pdacf_event, - .detach = snd_pdacf_detach, + .probe = snd_pdacf_attach, + .remove = snd_pdacf_detach, .id_table = snd_pdacf_ids, +#ifdef CONFIG_PM + .suspend = pdacf_suspend, + .resume = pdacf_resume, +#endif + }; static int __init init_pdacf(void) @@ -394,7 +361,6 @@ static int __init init_pdacf(void) static void __exit exit_pdacf(void) { pcmcia_unregister_driver(&pdacf_cs_driver); - BUG_ON(dev_list != NULL); } module_init(init_pdacf); diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index 5bb079d17959..66900d20a42f 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c @@ -55,11 +55,6 @@ MODULE_PARM_DESC(ibl, "Capture IBL size for VXPocket soundcard."); */ static unsigned int card_alloc; -static dev_link_t *dev_list; /* Linked list of devices */ -static dev_info_t dev_info = "snd-vxpocket"; - - -static int vxpocket_event(event_t event, int priority, event_callback_args_t *args); /* @@ -73,11 +68,6 @@ static void vxpocket_release(dev_link_t *link) pcmcia_release_irq(link->handle, &link->irq); link->state &= ~DEV_CONFIG; } - if (link->handle) { - /* Break the link with Card Services */ - pcmcia_deregister_client(link->handle); - link->handle = NULL; - } } /* @@ -144,11 +134,9 @@ static struct snd_vx_hardware vxp440_hw = { */ static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl) { - client_reg_t client_reg; /* Register with cardmgr */ dev_link_t *link; /* Info for cardmgr */ struct vx_core *chip; struct snd_vxpocket *vxp; - int ret; static struct snd_device_ops ops = { .dev_free = snd_vxpocket_dev_free, }; @@ -184,26 +172,6 @@ static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl) link->conf.ConfigIndex = 1; link->conf.Present = PRESENT_OPTION; - /* Register with Card Services */ - memset(&client_reg, 0, sizeof(client_reg)); - client_reg.dev_info = &dev_info; - client_reg.EventMask = - CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL -#ifdef CONFIG_PM - | CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET - | CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME -#endif - ; - client_reg.event_handler = &vxpocket_event; - client_reg.Version = 0x0210; - client_reg.event_callback_args.client_data = link; - - ret = pcmcia_register_client(&link->handle, &client_reg); - if (ret != CS_SUCCESS) { - cs_error(link->handle, RegisterClient, ret); - return NULL; - } - return vxp; } @@ -317,67 +285,55 @@ failed: kfree(parse); } +#ifdef CONFIG_PM -/* - * event callback - */ -static int vxpocket_event(event_t event, int priority, event_callback_args_t *args) +static int vxp_suspend(struct pcmcia_device *dev) { - dev_link_t *link = args->client_data; + dev_link_t *link = dev_to_instance(dev); struct vx_core *chip = link->priv; - switch (event) { - case CS_EVENT_CARD_REMOVAL: - snd_printdd(KERN_DEBUG "CARD_REMOVAL..\n"); - link->state &= ~DEV_PRESENT; - if (link->state & DEV_CONFIG) - chip->chip_status |= VX_STAT_IS_STALE; - break; - case CS_EVENT_CARD_INSERTION: - snd_printdd(KERN_DEBUG "CARD_INSERTION..\n"); - link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; - vxpocket_config(link); - break; -#ifdef CONFIG_PM - case CS_EVENT_PM_SUSPEND: - snd_printdd(KERN_DEBUG "SUSPEND\n"); - link->state |= DEV_SUSPEND; + snd_printdd(KERN_DEBUG "SUSPEND\n"); + link->state |= DEV_SUSPEND; + if (chip) { + snd_printdd(KERN_DEBUG "snd_vx_suspend calling\n"); + snd_vx_suspend(chip, PMSG_SUSPEND); + } + snd_printdd(KERN_DEBUG "RESET_PHYSICAL\n"); + if (link->state & DEV_CONFIG) + pcmcia_release_configuration(link->handle); + + return 0; +} + +static int vxp_resume(struct pcmcia_device *dev) +{ + dev_link_t *link = dev_to_instance(dev); + struct vx_core *chip = link->priv; + + snd_printdd(KERN_DEBUG "RESUME\n"); + link->state &= ~DEV_SUSPEND; + + snd_printdd(KERN_DEBUG "CARD_RESET\n"); + if (DEV_OK(link)) { + //struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; + snd_printdd(KERN_DEBUG "requestconfig...\n"); + pcmcia_request_configuration(link->handle, &link->conf); if (chip) { - snd_printdd(KERN_DEBUG "snd_vx_suspend calling\n"); - snd_vx_suspend(chip, PMSG_SUSPEND); + snd_printdd(KERN_DEBUG "calling snd_vx_resume\n"); + snd_vx_resume(chip); } - /* Fall through... */ - case CS_EVENT_RESET_PHYSICAL: - snd_printdd(KERN_DEBUG "RESET_PHYSICAL\n"); - if (link->state & DEV_CONFIG) - pcmcia_release_configuration(link->handle); - break; - case CS_EVENT_PM_RESUME: - snd_printdd(KERN_DEBUG "RESUME\n"); - link->state &= ~DEV_SUSPEND; - /* Fall through... */ - case CS_EVENT_CARD_RESET: - snd_printdd(KERN_DEBUG "CARD_RESET\n"); - if (DEV_OK(link)) { - //struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; - snd_printdd(KERN_DEBUG "requestconfig...\n"); - pcmcia_request_configuration(link->handle, &link->conf); - if (chip) { - snd_printdd(KERN_DEBUG "calling snd_vx_resume\n"); - snd_vx_resume(chip); - } - } - snd_printdd(KERN_DEBUG "resume done!\n"); - break; -#endif } + snd_printdd(KERN_DEBUG "resume done!\n"); + return 0; } +#endif + /* */ -static dev_link_t *vxpocket_attach(void) +static int vxpocket_attach(struct pcmcia_device *p_dev) { struct snd_card *card; struct snd_vxpocket *vxp; @@ -390,22 +346,22 @@ static dev_link_t *vxpocket_attach(void) } if (i >= SNDRV_CARDS) { snd_printk(KERN_ERR "vxpocket: too many cards found\n"); - return NULL; + return -EINVAL; } if (! enable[i]) - return NULL; /* disabled explicitly */ + return -ENODEV; /* disabled explicitly */ /* ok, create a card instance */ card = snd_card_new(index[i], id[i], THIS_MODULE, 0); if (card == NULL) { snd_printk(KERN_ERR "vxpocket: cannot create a card instance\n"); - return NULL; + return -ENOMEM; } vxp = snd_vxpocket_new(card, ibl[i]); if (! vxp) { snd_card_free(card); - return NULL; + return -ENODEV; } card->private_data = vxp; @@ -413,17 +369,21 @@ static dev_link_t *vxpocket_attach(void) card_alloc |= 1 << i; /* Chain drivers */ - vxp->link.next = dev_list; - dev_list = &vxp->link; + vxp->link.next = NULL; + + vxp->link.handle = p_dev; + vxp->link.state |= DEV_PRESENT | DEV_CONFIG_PENDING; + p_dev->instance = &vxp->link; + vxpocket_config(&vxp->link); - return &vxp->link; + return 0; } -static void vxpocket_detach(dev_link_t *link) +static void vxpocket_detach(struct pcmcia_device *p_dev) { + dev_link_t *link = dev_to_instance(p_dev); struct snd_vxpocket *vxp; struct vx_core *chip; - dev_link_t **linkp; if (! link) return; @@ -432,13 +392,6 @@ static void vxpocket_detach(dev_link_t *link) chip = (struct vx_core *)vxp; card_alloc &= ~(1 << vxp->index); - /* Remove the interface data from the linked list */ - for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) - if (*linkp == link) { - *linkp = link->next; - break; - } - chip->chip_status |= VX_STAT_IS_STALE; /* to be sure */ snd_card_disconnect(chip->card); vxpocket_release(link); @@ -460,10 +413,13 @@ static struct pcmcia_driver vxp_cs_driver = { .drv = { .name = "snd-vxpocket", }, - .attach = vxpocket_attach, - .detach = vxpocket_detach, - .event = vxpocket_event, + .probe = vxpocket_attach, + .remove = vxpocket_detach, .id_table = vxp_ids, +#ifdef CONFIG_PM + .suspend = vxp_suspend, + .resume = vxp_resume, +#endif }; static int __init init_vxpocket(void) @@ -474,7 +430,6 @@ static int __init init_vxpocket(void) static void __exit exit_vxpocket(void) { pcmcia_unregister_driver(&vxp_cs_driver); - BUG_ON(dev_list != NULL); } module_init(init_vxpocket); -- cgit v1.2.3