diff options
Diffstat (limited to 'sound/sparc')
-rw-r--r-- | sound/sparc/Kconfig | 5 | ||||
-rw-r--r-- | sound/sparc/amd7930.c | 142 | ||||
-rw-r--r-- | sound/sparc/cs4231.c | 353 | ||||
-rw-r--r-- | sound/sparc/dbri.c | 233 |
4 files changed, 349 insertions, 384 deletions
diff --git a/sound/sparc/Kconfig b/sound/sparc/Kconfig index 09ab138..079e22a 100644 --- a/sound/sparc/Kconfig +++ b/sound/sparc/Kconfig @@ -1,13 +1,12 @@ # ALSA Sparc drivers menu "ALSA Sparc devices" - depends on SND!=n && (SPARC32 || SPARC64) + depends on SND!=n && SPARC config SND_SUN_AMD7930 tristate "Sun AMD7930" depends on SBUS && SND select SND_PCM - select SND_GENERIC_DRIVER help Say Y here to include support for AMD7930 sound device on Sun. @@ -18,7 +17,6 @@ config SND_SUN_CS4231 tristate "Sun CS4231" depends on SND select SND_PCM - select SND_GENERIC_DRIVER help Say Y here to include support for CS4231 sound device on Sun. @@ -29,7 +27,6 @@ config SND_SUN_DBRI tristate "Sun DBRI" depends on SND && SBUS select SND_PCM - select SND_GENERIC_DRIVER help Say Y here to include support for DBRI sound device on Sun. diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c index 46d504b..5549334 100644 --- a/sound/sparc/amd7930.c +++ b/sound/sparc/amd7930.c @@ -311,7 +311,7 @@ struct amd7930_map { #define AMR_PP_PPCR2 0xC8 #define AMR_PP_PPCR3 0xC9 -typedef struct snd_amd7930 { +struct snd_amd7930 { spinlock_t lock; void __iomem *regs; u32 flags; @@ -320,10 +320,10 @@ typedef struct snd_amd7930 { struct amd7930_map map; - snd_card_t *card; - snd_pcm_t *pcm; - snd_pcm_substream_t *playback_substream; - snd_pcm_substream_t *capture_substream; + struct snd_card *card; + struct snd_pcm *pcm; + struct snd_pcm_substream *playback_substream; + struct snd_pcm_substream *capture_substream; /* Playback/Capture buffer state. */ unsigned char *p_orig, *p_cur; @@ -339,12 +339,12 @@ typedef struct snd_amd7930 { unsigned int irq; unsigned int regs_size; struct snd_amd7930 *next; -} amd7930_t; +}; -static amd7930_t *amd7930_list; +static struct snd_amd7930 *amd7930_list; /* Idle the AMD7930 chip. The amd->lock is not held. */ -static __inline__ void amd7930_idle(amd7930_t *amd) +static __inline__ void amd7930_idle(struct snd_amd7930 *amd) { unsigned long flags; @@ -355,7 +355,7 @@ static __inline__ void amd7930_idle(amd7930_t *amd) } /* Enable chip interrupts. The amd->lock is not held. */ -static __inline__ void amd7930_enable_ints(amd7930_t *amd) +static __inline__ void amd7930_enable_ints(struct snd_amd7930 *amd) { unsigned long flags; @@ -366,7 +366,7 @@ static __inline__ void amd7930_enable_ints(amd7930_t *amd) } /* Disable chip interrupts. The amd->lock is not held. */ -static __inline__ void amd7930_disable_ints(amd7930_t *amd) +static __inline__ void amd7930_disable_ints(struct snd_amd7930 *amd) { unsigned long flags; @@ -379,7 +379,7 @@ static __inline__ void amd7930_disable_ints(amd7930_t *amd) /* Commit amd7930_map settings to the hardware. * The amd->lock is held and local interrupts are disabled. */ -static void __amd7930_write_map(amd7930_t *amd) +static void __amd7930_write_map(struct snd_amd7930 *amd) { struct amd7930_map *map = &amd->map; @@ -473,7 +473,7 @@ static __const__ __u16 ger_coeff[] = { /* Update amd7930_map settings and program them into the hardware. * The amd->lock is held and local interrupts are disabled. */ -static void __amd7930_update_map(amd7930_t *amd) +static void __amd7930_update_map(struct snd_amd7930 *amd) { struct amd7930_map *map = &amd->map; int level; @@ -493,7 +493,7 @@ static void __amd7930_update_map(amd7930_t *amd) static irqreturn_t snd_amd7930_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - amd7930_t *amd = dev_id; + struct snd_amd7930 *amd = dev_id; unsigned int elapsed; u8 ir; @@ -534,7 +534,7 @@ static irqreturn_t snd_amd7930_interrupt(int irq, void *dev_id, struct pt_regs * return IRQ_HANDLED; } -static int snd_amd7930_trigger(amd7930_t *amd, unsigned int flag, int cmd) +static int snd_amd7930_trigger(struct snd_amd7930 *amd, unsigned int flag, int cmd) { unsigned long flags; int result = 0; @@ -564,24 +564,24 @@ static int snd_amd7930_trigger(amd7930_t *amd, unsigned int flag, int cmd) return result; } -static int snd_amd7930_playback_trigger(snd_pcm_substream_t * substream, +static int snd_amd7930_playback_trigger(struct snd_pcm_substream *substream, int cmd) { - amd7930_t *amd = snd_pcm_substream_chip(substream); + struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); return snd_amd7930_trigger(amd, AMD7930_FLAG_PLAYBACK, cmd); } -static int snd_amd7930_capture_trigger(snd_pcm_substream_t * substream, +static int snd_amd7930_capture_trigger(struct snd_pcm_substream *substream, int cmd) { - amd7930_t *amd = snd_pcm_substream_chip(substream); + struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); return snd_amd7930_trigger(amd, AMD7930_FLAG_CAPTURE, cmd); } -static int snd_amd7930_playback_prepare(snd_pcm_substream_t * substream) +static int snd_amd7930_playback_prepare(struct snd_pcm_substream *substream) { - amd7930_t *amd = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; unsigned int size = snd_pcm_lib_buffer_bytes(substream); unsigned long flags; u8 new_mmr1; @@ -610,10 +610,10 @@ static int snd_amd7930_playback_prepare(snd_pcm_substream_t * substream) return 0; } -static int snd_amd7930_capture_prepare(snd_pcm_substream_t * substream) +static int snd_amd7930_capture_prepare(struct snd_pcm_substream *substream) { - amd7930_t *amd = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; unsigned int size = snd_pcm_lib_buffer_bytes(substream); unsigned long flags; u8 new_mmr1; @@ -642,9 +642,9 @@ static int snd_amd7930_capture_prepare(snd_pcm_substream_t * substream) return 0; } -static snd_pcm_uframes_t snd_amd7930_playback_pointer(snd_pcm_substream_t * substream) +static snd_pcm_uframes_t snd_amd7930_playback_pointer(struct snd_pcm_substream *substream) { - amd7930_t *amd = snd_pcm_substream_chip(substream); + struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); size_t ptr; if (!(amd->flags & AMD7930_FLAG_PLAYBACK)) @@ -653,9 +653,9 @@ static snd_pcm_uframes_t snd_amd7930_playback_pointer(snd_pcm_substream_t * subs return bytes_to_frames(substream->runtime, ptr); } -static snd_pcm_uframes_t snd_amd7930_capture_pointer(snd_pcm_substream_t * substream) +static snd_pcm_uframes_t snd_amd7930_capture_pointer(struct snd_pcm_substream *substream) { - amd7930_t *amd = snd_pcm_substream_chip(substream); + struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); size_t ptr; if (!(amd->flags & AMD7930_FLAG_CAPTURE)) @@ -666,7 +666,7 @@ static snd_pcm_uframes_t snd_amd7930_capture_pointer(snd_pcm_substream_t * subst } /* Playback and capture have identical properties. */ -static snd_pcm_hardware_t snd_amd7930_pcm_hw = +static struct snd_pcm_hardware snd_amd7930_pcm_hw = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | @@ -686,54 +686,54 @@ static snd_pcm_hardware_t snd_amd7930_pcm_hw = .periods_max = 1024, }; -static int snd_amd7930_playback_open(snd_pcm_substream_t * substream) +static int snd_amd7930_playback_open(struct snd_pcm_substream *substream) { - amd7930_t *amd = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; amd->playback_substream = substream; runtime->hw = snd_amd7930_pcm_hw; return 0; } -static int snd_amd7930_capture_open(snd_pcm_substream_t * substream) +static int snd_amd7930_capture_open(struct snd_pcm_substream *substream) { - amd7930_t *amd = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; amd->capture_substream = substream; runtime->hw = snd_amd7930_pcm_hw; return 0; } -static int snd_amd7930_playback_close(snd_pcm_substream_t * substream) +static int snd_amd7930_playback_close(struct snd_pcm_substream *substream) { - amd7930_t *amd = snd_pcm_substream_chip(substream); + struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); amd->playback_substream = NULL; return 0; } -static int snd_amd7930_capture_close(snd_pcm_substream_t * substream) +static int snd_amd7930_capture_close(struct snd_pcm_substream *substream) { - amd7930_t *amd = snd_pcm_substream_chip(substream); + struct snd_amd7930 *amd = snd_pcm_substream_chip(substream); amd->capture_substream = NULL; return 0; } -static int snd_amd7930_hw_params(snd_pcm_substream_t * substream, - snd_pcm_hw_params_t * hw_params) +static int snd_amd7930_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *hw_params) { return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); } -static int snd_amd7930_hw_free(snd_pcm_substream_t * substream) +static int snd_amd7930_hw_free(struct snd_pcm_substream *substream) { return snd_pcm_lib_free_pages(substream); } -static snd_pcm_ops_t snd_amd7930_playback_ops = { +static struct snd_pcm_ops snd_amd7930_playback_ops = { .open = snd_amd7930_playback_open, .close = snd_amd7930_playback_close, .ioctl = snd_pcm_lib_ioctl, @@ -744,7 +744,7 @@ static snd_pcm_ops_t snd_amd7930_playback_ops = { .pointer = snd_amd7930_playback_pointer, }; -static snd_pcm_ops_t snd_amd7930_capture_ops = { +static struct snd_pcm_ops snd_amd7930_capture_ops = { .open = snd_amd7930_capture_open, .close = snd_amd7930_capture_close, .ioctl = snd_pcm_lib_ioctl, @@ -755,17 +755,9 @@ static snd_pcm_ops_t snd_amd7930_capture_ops = { .pointer = snd_amd7930_capture_pointer, }; -static void snd_amd7930_pcm_free(snd_pcm_t *pcm) +static int __init snd_amd7930_pcm(struct snd_amd7930 *amd) { - amd7930_t *amd = pcm->private_data; - - amd->pcm = NULL; - snd_pcm_lib_preallocate_free_for_all(pcm); -} - -static int __init snd_amd7930_pcm(amd7930_t *amd) -{ - snd_pcm_t *pcm; + struct snd_pcm *pcm; int err; if ((err = snd_pcm_new(amd->card, @@ -780,7 +772,6 @@ static int __init snd_amd7930_pcm(amd7930_t *amd) snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_amd7930_capture_ops); pcm->private_data = amd; - pcm->private_free = snd_amd7930_pcm_free; pcm->info_flags = 0; strcpy(pcm->name, amd->card->shortname); amd->pcm = pcm; @@ -796,7 +787,7 @@ static int __init snd_amd7930_pcm(amd7930_t *amd) #define VOLUME_CAPTURE 1 #define VOLUME_PLAYBACK 2 -static int snd_amd7930_info_volume(snd_kcontrol_t *kctl, snd_ctl_elem_info_t *uinfo) +static int snd_amd7930_info_volume(struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo) { int type = kctl->private_value; @@ -813,9 +804,9 @@ static int snd_amd7930_info_volume(snd_kcontrol_t *kctl, snd_ctl_elem_info_t *ui return 0; } -static int snd_amd7930_get_volume(snd_kcontrol_t *kctl, snd_ctl_elem_value_t *ucontrol) +static int snd_amd7930_get_volume(struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol) { - amd7930_t *amd = snd_kcontrol_chip(kctl); + struct snd_amd7930 *amd = snd_kcontrol_chip(kctl); int type = kctl->private_value; int *swval; @@ -841,9 +832,9 @@ static int snd_amd7930_get_volume(snd_kcontrol_t *kctl, snd_ctl_elem_value_t *uc return 0; } -static int snd_amd7930_put_volume(snd_kcontrol_t *kctl, snd_ctl_elem_value_t *ucontrol) +static int snd_amd7930_put_volume(struct snd_kcontrol *kctl, struct snd_ctl_elem_value *ucontrol) { - amd7930_t *amd = snd_kcontrol_chip(kctl); + struct snd_amd7930 *amd = snd_kcontrol_chip(kctl); unsigned long flags; int type = kctl->private_value; int *swval, change; @@ -879,7 +870,7 @@ static int snd_amd7930_put_volume(snd_kcontrol_t *kctl, snd_ctl_elem_value_t *uc return change; } -static snd_kcontrol_new_t amd7930_controls[] __initdata = { +static struct snd_kcontrol_new amd7930_controls[] __initdata = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Monitor Volume", @@ -909,9 +900,9 @@ static snd_kcontrol_new_t amd7930_controls[] __initdata = { }, }; -static int __init snd_amd7930_mixer(amd7930_t *amd) +static int __init snd_amd7930_mixer(struct snd_amd7930 *amd) { - snd_card_t *card; + struct snd_card *card; int idx, err; snd_assert(amd != NULL && amd->card != NULL, return -EINVAL); @@ -928,7 +919,7 @@ static int __init snd_amd7930_mixer(amd7930_t *amd) return 0; } -static int snd_amd7930_free(amd7930_t *amd) +static int snd_amd7930_free(struct snd_amd7930 *amd) { amd7930_idle(amd); @@ -943,27 +934,27 @@ static int snd_amd7930_free(amd7930_t *amd) return 0; } -static int snd_amd7930_dev_free(snd_device_t *device) +static int snd_amd7930_dev_free(struct snd_device *device) { - amd7930_t *amd = device->device_data; + struct snd_amd7930 *amd = device->device_data; return snd_amd7930_free(amd); } -static snd_device_ops_t snd_amd7930_dev_ops = { +static struct snd_device_ops snd_amd7930_dev_ops = { .dev_free = snd_amd7930_dev_free, }; -static int __init snd_amd7930_create(snd_card_t *card, +static int __init snd_amd7930_create(struct snd_card *card, struct sbus_dev *sdev, struct resource *rp, unsigned int reg_size, struct linux_prom_irqs *irq_prop, int dev, - amd7930_t **ramd) + struct snd_amd7930 **ramd) { unsigned long flags; - amd7930_t *amd; + struct snd_amd7930 *amd; int err; *ramd = NULL; @@ -1032,8 +1023,8 @@ static int __init amd7930_attach(int prom_node, struct sbus_dev *sdev) struct linux_prom_registers reg_prop; struct linux_prom_irqs irq_prop; struct resource res, *rp; - snd_card_t *card; - amd7930_t *amd; + struct snd_card *card; + struct snd_amd7930 *amd; int err; if (dev >= SNDRV_CARDS) @@ -1088,9 +1079,6 @@ static int __init amd7930_attach(int prom_node, struct sbus_dev *sdev) if ((err = snd_amd7930_mixer(amd)) < 0) goto out_err; - if ((err = snd_card_set_generic_dev(card)) < 0) - goto out_err; - if ((err = snd_card_register(card)) < 0) goto out_err; @@ -1132,10 +1120,10 @@ static int __init amd7930_init(void) static void __exit amd7930_exit(void) { - amd7930_t *p = amd7930_list; + struct snd_amd7930 *p = amd7930_list; while (p != NULL) { - amd7930_t *next = p->next; + struct snd_amd7930 *next = p->next; snd_card_free(p->card); diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c index 1f8d27a..e9086e9 100644 --- a/sound/sparc/cs4231.c +++ b/sound/sparc/cs4231.c @@ -62,49 +62,47 @@ MODULE_LICENSE("GPL"); MODULE_SUPPORTED_DEVICE("{{Sun,CS4231}}"); #ifdef SBUS_SUPPORT -typedef struct sbus_dma_info { +struct sbus_dma_info { spinlock_t lock; int dir; void __iomem *regs; -} sbus_dma_info_t; +}; #endif -typedef struct snd_cs4231 cs4231_t; - -typedef struct cs4231_dma_control { +struct cs4231_dma_control { void (*prepare)(struct cs4231_dma_control *dma_cont, int dir); void (*enable)(struct cs4231_dma_control *dma_cont, int on); int (*request)(struct cs4231_dma_control *dma_cont, dma_addr_t bus_addr, size_t len); unsigned int (*address)(struct cs4231_dma_control *dma_cont); - void (*reset)(cs4231_t *chip); - void (*preallocate)(cs4231_t *chip, snd_pcm_t *pcm); + void (*reset)(struct snd_cs4231 *chip); + void (*preallocate)(struct snd_cs4231 *chip, struct snd_snd_pcm *pcm); #ifdef EBUS_SUPPORT struct ebus_dma_info ebus_info; #endif #ifdef SBUS_SUPPORT struct sbus_dma_info sbus_info; #endif -} cs4231_dma_control_t; +}; struct snd_cs4231 { spinlock_t lock; void __iomem *port; - cs4231_dma_control_t p_dma; - cs4231_dma_control_t c_dma; + struct cs4231_dma_control p_dma; + struct cs4231_dma_control c_dma; u32 flags; #define CS4231_FLAG_EBUS 0x00000001 #define CS4231_FLAG_PLAYBACK 0x00000002 #define CS4231_FLAG_CAPTURE 0x00000004 - snd_card_t *card; - snd_pcm_t *pcm; - snd_pcm_substream_t *playback_substream; + struct snd_card *card; + struct snd_pcm *pcm; + struct snd_pcm_substream *playback_substream; unsigned int p_periods_sent; - snd_pcm_substream_t *capture_substream; + struct snd_pcm_substream *capture_substream; unsigned int c_periods_sent; - snd_timer_t *timer; + struct snd_timer *timer; unsigned short mode; #define CS4231_MODE_NONE 0x0000 @@ -132,7 +130,7 @@ struct snd_cs4231 { struct snd_cs4231 *next; }; -static cs4231_t *cs4231_list; +static struct snd_cs4231 *cs4231_list; /* Eventually we can use sound/isa/cs423x/cs4231_lib.c directly, but for * now.... -DaveM @@ -341,12 +339,12 @@ static unsigned int rates[14] = { 27042, 32000, 33075, 37800, 44100, 48000 }; -static snd_pcm_hw_constraint_list_t hw_constraints_rates = { +static struct snd_pcm_hw_constraint_list hw_constraints_rates = { .count = 14, .list = rates, }; -static int snd_cs4231_xrate(snd_pcm_runtime_t *runtime) +static int snd_cs4231_xrate(struct snd_pcm_runtime *runtime) { return snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, @@ -389,7 +387,7 @@ static unsigned char snd_cs4231_original_image[32] = 0x00, /* 1f/31 - cbrl */ }; -static u8 __cs4231_readb(cs4231_t *cp, void __iomem *reg_addr) +static u8 __cs4231_readb(struct snd_cs4231 *cp, void __iomem *reg_addr) { #ifdef EBUS_SUPPORT if (cp->flags & CS4231_FLAG_EBUS) { @@ -404,7 +402,7 @@ static u8 __cs4231_readb(cs4231_t *cp, void __iomem *reg_addr) #endif } -static void __cs4231_writeb(cs4231_t *cp, u8 val, void __iomem *reg_addr) +static void __cs4231_writeb(struct snd_cs4231 *cp, u8 val, void __iomem *reg_addr) { #ifdef EBUS_SUPPORT if (cp->flags & CS4231_FLAG_EBUS) { @@ -423,7 +421,7 @@ static void __cs4231_writeb(cs4231_t *cp, u8 val, void __iomem *reg_addr) * Basic I/O functions */ -static void snd_cs4231_outm(cs4231_t *chip, unsigned char reg, +static void snd_cs4231_outm(struct snd_cs4231 *chip, unsigned char reg, unsigned char mask, unsigned char value) { int timeout; @@ -450,7 +448,7 @@ static void snd_cs4231_outm(cs4231_t *chip, unsigned char reg, } } -static void snd_cs4231_dout(cs4231_t *chip, unsigned char reg, unsigned char value) +static void snd_cs4231_dout(struct snd_cs4231 *chip, unsigned char reg, unsigned char value) { int timeout; @@ -467,7 +465,7 @@ static void snd_cs4231_dout(cs4231_t *chip, unsigned char reg, unsigned char val mb(); } -static void snd_cs4231_out(cs4231_t *chip, unsigned char reg, unsigned char value) +static void snd_cs4231_out(struct snd_cs4231 *chip, unsigned char reg, unsigned char value) { int timeout; @@ -485,7 +483,7 @@ static void snd_cs4231_out(cs4231_t *chip, unsigned char reg, unsigned char valu mb(); } -static unsigned char snd_cs4231_in(cs4231_t *chip, unsigned char reg) +static unsigned char snd_cs4231_in(struct snd_cs4231 *chip, unsigned char reg) { int timeout; unsigned char ret; @@ -508,7 +506,7 @@ static unsigned char snd_cs4231_in(cs4231_t *chip, unsigned char reg) * CS4231 detection / MCE routines */ -static void snd_cs4231_busy_wait(cs4231_t *chip) +static void snd_cs4231_busy_wait(struct snd_cs4231 *chip) { int timeout; @@ -523,7 +521,7 @@ static void snd_cs4231_busy_wait(cs4231_t *chip) udelay(1000); } -static void snd_cs4231_mce_up(cs4231_t *chip) +static void snd_cs4231_mce_up(struct snd_cs4231 *chip) { unsigned long flags; int timeout; @@ -544,7 +542,7 @@ static void snd_cs4231_mce_up(cs4231_t *chip) spin_unlock_irqrestore(&chip->lock, flags); } -static void snd_cs4231_mce_down(cs4231_t *chip) +static void snd_cs4231_mce_down(struct snd_cs4231 *chip) { unsigned long flags; int timeout; @@ -602,9 +600,11 @@ static void snd_cs4231_mce_down(cs4231_t *chip) spin_unlock_irqrestore(&chip->lock, flags); } -static void snd_cs4231_advance_dma(struct cs4231_dma_control *dma_cont, snd_pcm_substream_t *substream, unsigned int *periods_sent) +static void snd_cs4231_advance_dma(struct cs4231_dma_control *dma_cont, + struct snd_pcm_substream *substream, + unsigned int *periods_sent) { - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_pcm_runtime *runtime = substream->runtime; while (1) { unsigned int period_size = snd_pcm_lib_period_bytes(substream); @@ -619,10 +619,11 @@ static void snd_cs4231_advance_dma(struct cs4231_dma_control *dma_cont, snd_pcm_ } } -static void cs4231_dma_trigger(snd_pcm_substream_t *substream, unsigned int what, int on) +static void cs4231_dma_trigger(struct snd_pcm_substream *substream, + unsigned int what, int on) { - cs4231_t *chip = snd_pcm_substream_chip(substream); - cs4231_dma_control_t *dma_cont; + struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); + struct cs4231_dma_control *dma_cont; if (what & CS4231_PLAYBACK_ENABLE) { dma_cont = &chip->p_dma; @@ -650,9 +651,9 @@ static void cs4231_dma_trigger(snd_pcm_substream_t *substream, unsigned int what } } -static int snd_cs4231_trigger(snd_pcm_substream_t *substream, int cmd) +static int snd_cs4231_trigger(struct snd_pcm_substream *substream, int cmd) { - cs4231_t *chip = snd_pcm_substream_chip(substream); + struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); int result = 0; switch (cmd) { @@ -660,7 +661,7 @@ static int snd_cs4231_trigger(snd_pcm_substream_t *substream, int cmd) case SNDRV_PCM_TRIGGER_STOP: { unsigned int what = 0; - snd_pcm_substream_t *s; + struct snd_pcm_substream *s; struct list_head *pos; unsigned long flags; @@ -711,7 +712,7 @@ static unsigned char snd_cs4231_get_rate(unsigned int rate) return freq_bits[13]; } -static unsigned char snd_cs4231_get_format(cs4231_t *chip, int format, int channels) +static unsigned char snd_cs4231_get_format(struct snd_cs4231 *chip, int format, int channels) { unsigned char rformat; @@ -728,7 +729,7 @@ static unsigned char snd_cs4231_get_format(cs4231_t *chip, int format, int chann return rformat; } -static void snd_cs4231_calibrate_mute(cs4231_t *chip, int mute) +static void snd_cs4231_calibrate_mute(struct snd_cs4231 *chip, int mute) { unsigned long flags; @@ -768,7 +769,7 @@ static void snd_cs4231_calibrate_mute(cs4231_t *chip, int mute) spin_unlock_irqrestore(&chip->lock, flags); } -static void snd_cs4231_playback_format(cs4231_t *chip, snd_pcm_hw_params_t *params, +static void snd_cs4231_playback_format(struct snd_cs4231 *chip, struct snd_pcm_hw_params *params, unsigned char pdfr) { unsigned long flags; @@ -791,7 +792,7 @@ static void snd_cs4231_playback_format(cs4231_t *chip, snd_pcm_hw_params_t *para up(&chip->mce_mutex); } -static void snd_cs4231_capture_format(cs4231_t *chip, snd_pcm_hw_params_t *params, +static void snd_cs4231_capture_format(struct snd_cs4231 *chip, struct snd_pcm_hw_params *params, unsigned char cdfr) { unsigned long flags; @@ -824,18 +825,18 @@ static void snd_cs4231_capture_format(cs4231_t *chip, snd_pcm_hw_params_t *param * Timer interface */ -static unsigned long snd_cs4231_timer_resolution(snd_timer_t *timer) +static unsigned long snd_cs4231_timer_resolution(struct snd_timer *timer) { - cs4231_t *chip = snd_timer_chip(timer); + struct snd_cs4231 *chip = snd_timer_chip(timer); return chip->image[CS4231_PLAYBK_FORMAT] & 1 ? 9969 : 9920; } -static int snd_cs4231_timer_start(snd_timer_t *timer) +static int snd_cs4231_timer_start(struct snd_timer *timer) { unsigned long flags; unsigned int ticks; - cs4231_t *chip = snd_timer_chip(timer); + struct snd_cs4231 *chip = snd_timer_chip(timer); spin_lock_irqsave(&chip->lock, flags); ticks = timer->sticks; @@ -856,10 +857,10 @@ static int snd_cs4231_timer_start(snd_timer_t *timer) return 0; } -static int snd_cs4231_timer_stop(snd_timer_t *timer) +static int snd_cs4231_timer_stop(struct snd_timer *timer) { unsigned long flags; - cs4231_t *chip = snd_timer_chip(timer); + struct snd_cs4231 *chip = snd_timer_chip(timer); spin_lock_irqsave(&chip->lock, flags); snd_cs4231_out(chip, CS4231_ALT_FEATURE_1, @@ -869,7 +870,7 @@ static int snd_cs4231_timer_stop(snd_timer_t *timer) return 0; } -static void snd_cs4231_init(cs4231_t *chip) +static void __init snd_cs4231_init(struct snd_cs4231 *chip) { unsigned long flags; @@ -927,7 +928,7 @@ static void snd_cs4231_init(cs4231_t *chip) #endif } -static int snd_cs4231_open(cs4231_t *chip, unsigned int mode) +static int snd_cs4231_open(struct snd_cs4231 *chip, unsigned int mode) { unsigned long flags; @@ -962,7 +963,7 @@ static int snd_cs4231_open(cs4231_t *chip, unsigned int mode) return 0; } -static void snd_cs4231_close(cs4231_t *chip, unsigned int mode) +static void snd_cs4231_close(struct snd_cs4231 *chip, unsigned int mode) { unsigned long flags; @@ -1013,21 +1014,21 @@ static void snd_cs4231_close(cs4231_t *chip, unsigned int mode) * timer open/close */ -static int snd_cs4231_timer_open(snd_timer_t *timer) +static int snd_cs4231_timer_open(struct snd_timer *timer) { - cs4231_t *chip = snd_timer_chip(timer); + struct snd_cs4231 *chip = snd_timer_chip(timer); snd_cs4231_open(chip, CS4231_MODE_TIMER); return 0; } -static int snd_cs4231_timer_close(snd_timer_t * timer) +static int snd_cs4231_timer_close(struct snd_timer * timer) { - cs4231_t *chip = snd_timer_chip(timer); + struct snd_cs4231 *chip = snd_timer_chip(timer); snd_cs4231_close(chip, CS4231_MODE_TIMER); return 0; } -static struct _snd_timer_hardware snd_cs4231_timer_table = +static struct snd_timer_hardware snd_cs4231_timer_table = { .flags = SNDRV_TIMER_HW_AUTO, .resolution = 9945, @@ -1043,10 +1044,10 @@ static struct _snd_timer_hardware snd_cs4231_timer_table = * ok.. exported functions.. */ -static int snd_cs4231_playback_hw_params(snd_pcm_substream_t *substream, - snd_pcm_hw_params_t *hw_params) +static int snd_cs4231_playback_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *hw_params) { - cs4231_t *chip = snd_pcm_substream_chip(substream); + struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); unsigned char new_pdfr; int err; @@ -1061,15 +1062,15 @@ static int snd_cs4231_playback_hw_params(snd_pcm_substream_t *substream, return 0; } -static int snd_cs4231_playback_hw_free(snd_pcm_substream_t *substream) +static int snd_cs4231_playback_hw_free(struct snd_pcm_substream *substream) { return snd_pcm_lib_free_pages(substream); } -static int snd_cs4231_playback_prepare(snd_pcm_substream_t *substream) +static int snd_cs4231_playback_prepare(struct snd_pcm_substream *substream) { - cs4231_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; unsigned long flags; spin_lock_irqsave(&chip->lock, flags); @@ -1086,10 +1087,10 @@ static int snd_cs4231_playback_prepare(snd_pcm_substream_t *substream) return 0; } -static int snd_cs4231_capture_hw_params(snd_pcm_substream_t *substream, - snd_pcm_hw_params_t *hw_params) +static int snd_cs4231_capture_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *hw_params) { - cs4231_t *chip = snd_pcm_substream_chip(substream); + struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); unsigned char new_cdfr; int err; @@ -1104,14 +1105,14 @@ static int snd_cs4231_capture_hw_params(snd_pcm_substream_t *substream, return 0; } -static int snd_cs4231_capture_hw_free(snd_pcm_substream_t *substream) +static int snd_cs4231_capture_hw_free(struct snd_pcm_substream *substream) { return snd_pcm_lib_free_pages(substream); } -static int snd_cs4231_capture_prepare(snd_pcm_substream_t *substream) +static int snd_cs4231_capture_prepare(struct snd_pcm_substream *substream) { - cs4231_t *chip = snd_pcm_substream_chip(substream); + struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); unsigned long flags; spin_lock_irqsave(&chip->lock, flags); @@ -1125,7 +1126,7 @@ static int snd_cs4231_capture_prepare(snd_pcm_substream_t *substream) return 0; } -static void snd_cs4231_overrange(cs4231_t *chip) +static void snd_cs4231_overrange(struct snd_cs4231 *chip) { unsigned long flags; unsigned char res; @@ -1138,10 +1139,8 @@ static void snd_cs4231_overrange(cs4231_t *chip) chip->capture_substream->runtime->overrange++; } -static void snd_cs4231_play_callback(cs4231_t *cookie) +static void snd_cs4231_play_callback(struct snd_cs4231 *chip) { - cs4231_t *chip = cookie; - if (chip->image[CS4231_IFACE_CTRL] & CS4231_PLAYBACK_ENABLE) { snd_pcm_period_elapsed(chip->playback_substream); snd_cs4231_advance_dma(&chip->p_dma, chip->playback_substream, @@ -1149,10 +1148,8 @@ static void snd_cs4231_play_callback(cs4231_t *cookie) } } -static void snd_cs4231_capture_callback(cs4231_t *cookie) +static void snd_cs4231_capture_callback(struct snd_cs4231 *chip) { - cs4231_t *chip = cookie; - if (chip->image[CS4231_IFACE_CTRL] & CS4231_RECORD_ENABLE) { snd_pcm_period_elapsed(chip->capture_substream); snd_cs4231_advance_dma(&chip->c_dma, chip->capture_substream, @@ -1160,10 +1157,10 @@ static void snd_cs4231_capture_callback(cs4231_t *cookie) } } -static snd_pcm_uframes_t snd_cs4231_playback_pointer(snd_pcm_substream_t *substream) +static snd_pcm_uframes_t snd_cs4231_playback_pointer(struct snd_pcm_substream *substream) { - cs4231_t *chip = snd_pcm_substream_chip(substream); - cs4231_dma_control_t *dma_cont = &chip->p_dma; + struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); + struct cs4231_dma_control *dma_cont = &chip->p_dma; size_t ptr; if (!(chip->image[CS4231_IFACE_CTRL] & CS4231_PLAYBACK_ENABLE)) @@ -1175,10 +1172,10 @@ static snd_pcm_uframes_t snd_cs4231_playback_pointer(snd_pcm_substream_t *substr return bytes_to_frames(substream->runtime, ptr); } -static snd_pcm_uframes_t snd_cs4231_capture_pointer(snd_pcm_substream_t * substream) +static snd_pcm_uframes_t snd_cs4231_capture_pointer(struct snd_pcm_substream *substream) { - cs4231_t *chip = snd_pcm_substream_chip(substream); - cs4231_dma_control_t *dma_cont = &chip->c_dma; + struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); + struct cs4231_dma_control *dma_cont = &chip->c_dma; size_t ptr; if (!(chip->image[CS4231_IFACE_CTRL] & CS4231_RECORD_ENABLE)) @@ -1194,7 +1191,7 @@ static snd_pcm_uframes_t snd_cs4231_capture_pointer(snd_pcm_substream_t * substr */ -static int snd_cs4231_probe(cs4231_t *chip) +static int __init snd_cs4231_probe(struct snd_cs4231 *chip) { unsigned long flags; int i, id, vers; @@ -1259,7 +1256,7 @@ static int snd_cs4231_probe(cs4231_t *chip) return 0; /* all things are ok.. */ } -static snd_pcm_hardware_t snd_cs4231_playback = +static struct snd_pcm_hardware snd_cs4231_playback = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START), @@ -1279,7 +1276,7 @@ static snd_pcm_hardware_t snd_cs4231_playback = .periods_max = 1024, }; -static snd_pcm_hardware_t snd_cs4231_capture = +static struct snd_pcm_hardware snd_cs4231_capture = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_SYNC_START), @@ -1299,10 +1296,10 @@ static snd_pcm_hardware_t snd_cs4231_capture = .periods_max = 1024, }; -static int snd_cs4231_playback_open(snd_pcm_substream_t *substream) +static int snd_cs4231_playback_open(struct snd_pcm_substream *substream) { - cs4231_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; int err; runtime->hw = snd_cs4231_playback; @@ -1319,10 +1316,10 @@ static int snd_cs4231_playback_open(snd_pcm_substream_t *substream) return 0; } -static int snd_cs4231_capture_open(snd_pcm_substream_t *substream) +static int snd_cs4231_capture_open(struct snd_pcm_substream *substream) { - cs4231_t *chip = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; int err; runtime->hw = snd_cs4231_capture; @@ -1339,9 +1336,9 @@ static int snd_cs4231_capture_open(snd_pcm_substream_t *substream) return 0; } -static int snd_cs4231_playback_close(snd_pcm_substream_t *substream) +static int snd_cs4231_playback_close(struct snd_pcm_substream *substream) { - cs4231_t *chip = snd_pcm_substream_chip(substream); + struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); snd_cs4231_close(chip, CS4231_MODE_PLAY); chip->playback_substream = NULL; @@ -1349,9 +1346,9 @@ static int snd_cs4231_playback_close(snd_pcm_substream_t *substream) return 0; } -static int snd_cs4231_capture_close(snd_pcm_substream_t *substream) +static int snd_cs4231_capture_close(struct snd_pcm_substream *substream) { - cs4231_t *chip = snd_pcm_substream_chip(substream); + struct snd_cs4231 *chip = snd_pcm_substream_chip(substream); snd_cs4231_close(chip, CS4231_MODE_RECORD); chip->capture_substream = NULL; @@ -1363,7 +1360,7 @@ static int snd_cs4231_capture_close(snd_pcm_substream_t *substream) * XXX the audio AUXIO register... */ -static snd_pcm_ops_t snd_cs4231_playback_ops = { +static struct snd_pcm_ops snd_cs4231_playback_ops = { .open = snd_cs4231_playback_open, .close = snd_cs4231_playback_close, .ioctl = snd_pcm_lib_ioctl, @@ -1374,7 +1371,7 @@ static snd_pcm_ops_t snd_cs4231_playback_ops = { .pointer = snd_cs4231_playback_pointer, }; -static snd_pcm_ops_t snd_cs4231_capture_ops = { +static struct snd_pcm_ops snd_cs4231_capture_ops = { .open = snd_cs4231_capture_open, .close = snd_cs4231_capture_close, .ioctl = snd_pcm_lib_ioctl, @@ -1385,16 +1382,9 @@ static snd_pcm_ops_t snd_cs4231_capture_ops = { .pointer = snd_cs4231_capture_pointer, }; -static void snd_cs4231_pcm_free(snd_pcm_t *pcm) -{ - cs4231_t *chip = pcm->private_data; - chip->pcm = NULL; - snd_pcm_lib_preallocate_free_for_all(pcm); -} - -int snd_cs4231_pcm(cs4231_t *chip) +static int __init snd_cs4231_pcm(struct snd_cs4231 *chip) { - snd_pcm_t *pcm; + struct snd_pcm *pcm; int err; if ((err = snd_pcm_new(chip->card, "CS4231", 0, 1, 1, &pcm)) < 0) @@ -1405,7 +1395,6 @@ int snd_cs4231_pcm(cs4231_t *chip) /* global setup */ pcm->private_data = chip; - pcm->private_free = snd_cs4231_pcm_free; pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX; strcpy(pcm->name, "CS4231"); @@ -1416,16 +1405,10 @@ int snd_cs4231_pcm(cs4231_t *chip) return 0; } -static void snd_cs4231_timer_free(snd_timer_t *timer) -{ - cs4231_t *chip = timer->private_data; - chip->timer = NULL; -} - -int snd_cs4231_timer(cs4231_t *chip) +static int __init snd_cs4231_timer(struct snd_cs4231 *chip) { - snd_timer_t *timer; - snd_timer_id_t tid; + struct snd_timer *timer; + struct snd_timer_id tid; int err; /* Timer initialization */ @@ -1438,7 +1421,6 @@ int snd_cs4231_timer(cs4231_t *chip) return err; strcpy(timer->name, "CS4231"); timer->private_data = chip; - timer->private_free = snd_cs4231_timer_free; timer->hw = snd_cs4231_timer_table; chip->timer = timer; @@ -1449,12 +1431,13 @@ int snd_cs4231_timer(cs4231_t *chip) * MIXER part */ -static int snd_cs4231_info_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int snd_cs4231_info_mux(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) { static char *texts[4] = { "Line", "CD", "Mic", "Mix" }; - cs4231_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs4231 *chip = snd_kcontrol_chip(kcontrol); snd_assert(chip->card != NULL, return -EINVAL); uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; @@ -1467,9 +1450,10 @@ static int snd_cs4231_info_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *ui return 0; } -static int snd_cs4231_get_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int snd_cs4231_get_mux(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs4231_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs4231 *chip = snd_kcontrol_chip(kcontrol); unsigned long flags; spin_lock_irqsave(&chip->lock, flags); @@ -1482,9 +1466,10 @@ static int snd_cs4231_get_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uc return 0; } -static int snd_cs4231_put_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int snd_cs4231_put_mux(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs4231_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs4231 *chip = snd_kcontrol_chip(kcontrol); unsigned long flags; unsigned short left, right; int change; @@ -1509,7 +1494,8 @@ static int snd_cs4231_put_mux(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uc return change; } -int snd_cs4231_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int snd_cs4231_info_single(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) { int mask = (kcontrol->private_value >> 16) & 0xff; @@ -1522,9 +1508,10 @@ int snd_cs4231_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) return 0; } -int snd_cs4231_get_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int snd_cs4231_get_single(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs4231_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs4231 *chip = snd_kcontrol_chip(kcontrol); unsigned long flags; int reg = kcontrol->private_value & 0xff; int shift = (kcontrol->private_value >> 8) & 0xff; @@ -1544,9 +1531,10 @@ int snd_cs4231_get_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontr return 0; } -int snd_cs4231_put_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int snd_cs4231_put_single(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs4231_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs4231 *chip = snd_kcontrol_chip(kcontrol); unsigned long flags; int reg = kcontrol->private_value & 0xff; int shift = (kcontrol->private_value >> 8) & 0xff; @@ -1571,7 +1559,8 @@ int snd_cs4231_put_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontr return change; } -int snd_cs4231_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) +static int snd_cs4231_info_double(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) { int mask = (kcontrol->private_value >> 24) & 0xff; @@ -1584,9 +1573,10 @@ int snd_cs4231_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) return 0; } -int snd_cs4231_get_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int snd_cs4231_get_double(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs4231_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs4231 *chip = snd_kcontrol_chip(kcontrol); unsigned long flags; int left_reg = kcontrol->private_value & 0xff; int right_reg = (kcontrol->private_value >> 8) & 0xff; @@ -1612,9 +1602,10 @@ int snd_cs4231_get_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontr return 0; } -int snd_cs4231_put_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) +static int snd_cs4231_put_double(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - cs4231_t *chip = snd_kcontrol_chip(kcontrol); + struct snd_cs4231 *chip = snd_kcontrol_chip(kcontrol); unsigned long flags; int left_reg = kcontrol->private_value & 0xff; int right_reg = (kcontrol->private_value >> 8) & 0xff; @@ -1659,7 +1650,7 @@ int snd_cs4231_put_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontr .get = snd_cs4231_get_double, .put = snd_cs4231_put_double, \ .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } -static snd_kcontrol_new_t snd_cs4231_controls[] = { +static struct snd_kcontrol_new snd_cs4231_controls[] __initdata = { CS4231_DOUBLE("PCM Playback Switch", 0, CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1), CS4231_DOUBLE("PCM Playback Volume", 0, CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 0, 0, 63, 1), CS4231_DOUBLE("Line Playback Switch", 0, CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 7, 7, 1, 1), @@ -1688,9 +1679,9 @@ CS4231_SINGLE("Line Out Switch", 0, CS4231_PIN_CTRL, 6, 1, 1), CS4231_SINGLE("Headphone Out Switch", 0, CS4231_PIN_CTRL, 7, 1, 1) }; -int snd_cs4231_mixer(cs4231_t *chip) +static int __init snd_cs4231_mixer(struct snd_cs4231 *chip) { - snd_card_t *card; + struct snd_card *card; int err, idx; snd_assert(chip != NULL && chip->pcm != NULL, return -EINVAL); @@ -1710,9 +1701,9 @@ int snd_cs4231_mixer(cs4231_t *chip) static int dev; -static int cs4231_attach_begin(snd_card_t **rcard) +static int __init cs4231_attach_begin(struct snd_card **rcard) { - snd_card_t *card; + struct snd_card *card; *rcard = NULL; @@ -1735,7 +1726,7 @@ static int cs4231_attach_begin(snd_card_t **rcard) return 0; } -static int cs4231_attach_finish(snd_card_t *card, cs4231_t *chip) +static int __init cs4231_attach_finish(struct snd_card *card, struct snd_cs4231 *chip) { int err; @@ -1748,9 +1739,6 @@ static int cs4231_attach_finish(snd_card_t *card, cs4231_t *chip) if ((err = snd_cs4231_timer(chip)) < 0) goto out_err; - if ((err = snd_card_set_generic_dev(card)) < 0) - goto out_err; - if ((err = snd_card_register(card)) < 0) goto out_err; @@ -1772,7 +1760,7 @@ static irqreturn_t snd_cs4231_sbus_interrupt(int irq, void *dev_id, struct pt_re unsigned long flags; unsigned char status; u32 csr; - cs4231_t *chip = dev_id; + struct snd_cs4231 *chip = dev_id; /*This is IRQ is not raised by the cs4231*/ if (!(__cs4231_readb(chip, CS4231P(chip, STATUS)) & CS4231_GLOBALIRQ)) @@ -1817,12 +1805,12 @@ static irqreturn_t snd_cs4231_sbus_interrupt(int irq, void *dev_id, struct pt_re * SBUS DMA routines */ -int sbus_dma_request(struct cs4231_dma_control *dma_cont, dma_addr_t bus_addr, size_t len) +static int sbus_dma_request(struct cs4231_dma_control *dma_cont, dma_addr_t bus_addr, size_t len) { unsigned long flags; u32 test, csr; int err; - sbus_dma_info_t *base = &dma_cont->sbus_info; + struct sbus_dma_info *base = &dma_cont->sbus_info; if (len >= (1 << 24)) return -EINVAL; @@ -1849,11 +1837,11 @@ out: return err; } -void sbus_dma_prepare(struct cs4231_dma_control *dma_cont, int d) +static void sbus_dma_prepare(struct cs4231_dma_control *dma_cont, int d) { unsigned long flags; u32 csr, test; - sbus_dma_info_t *base = &dma_cont->sbus_info; + struct sbus_dma_info *base = &dma_cont->sbus_info; spin_lock_irqsave(&base->lock, flags); csr = sbus_readl(base->regs + APCCSR); @@ -1868,11 +1856,11 @@ void sbus_dma_prepare(struct cs4231_dma_control *dma_cont, int d) spin_unlock_irqrestore(&base->lock, flags); } -void sbus_dma_enable(struct cs4231_dma_control *dma_cont, int on) +static void sbus_dma_enable(struct cs4231_dma_control *dma_cont, int on) { unsigned long flags; u32 csr, shift; - sbus_dma_info_t *base = &dma_cont->sbus_info; + struct sbus_dma_info *base = &dma_cont->sbus_info; spin_lock_irqsave(&base->lock, flags); if (!on) { @@ -1905,14 +1893,14 @@ void sbus_dma_enable(struct cs4231_dma_control *dma_cont, int on) spin_unlock_irqrestore(&base->lock, flags); } -unsigned int sbus_dma_addr(struct cs4231_dma_control *dma_cont) +static unsigned int sbus_dma_addr(struct cs4231_dma_control *dma_cont) { - sbus_dma_info_t *base = &dma_cont->sbus_info; + struct sbus_dma_info *base = &dma_cont->sbus_info; return sbus_readl(base->regs + base->dir + APCVA); } -void sbus_dma_reset(cs4231_t *chip) +static void sbus_dma_reset(struct snd_cs4231 *chip) { sbus_writel(APC_CHIP_RESET, chip->port + APCCSR); sbus_writel(0x00, chip->port + APCCSR); @@ -1929,7 +1917,7 @@ void sbus_dma_reset(cs4231_t *chip) chip->port + APCCSR); } -void sbus_dma_preallocate(cs4231_t *chip, snd_pcm_t *pcm) +static void sbus_dma_preallocate(struct snd_cs4231 *chip, struct snd_pcm *pcm) { snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_SBUS, snd_dma_sbus_data(chip->dev_u.sdev), @@ -1940,7 +1928,7 @@ void sbus_dma_preallocate(cs4231_t *chip, snd_pcm_t *pcm) * Init and exit routines */ -static int snd_cs4231_sbus_free(cs4231_t *chip) +static int snd_cs4231_sbus_free(struct snd_cs4231 *chip) { if (chip->irq[0]) free_irq(chip->irq[0], chip); @@ -1948,31 +1936,28 @@ static int snd_cs4231_sbus_free(cs4231_t *chip) if (chip->port) sbus_iounmap(chip->port, chip->regs_size); - if (chip->timer) - snd_device_free(chip->card, chip->timer); - kfree(chip); return 0; } -static int snd_cs4231_sbus_dev_free(snd_device_t *device) +static int snd_cs4231_sbus_dev_free(struct snd_device *device) { - cs4231_t *cp = device->device_data; + struct snd_cs4231 *cp = device->device_data; return snd_cs4231_sbus_free(cp); } -static snd_device_ops_t snd_cs4231_sbus_dev_ops = { +static struct snd_device_ops snd_cs4231_sbus_dev_ops = { .dev_free = snd_cs4231_sbus_dev_free, }; -static int __init snd_cs4231_sbus_create(snd_card_t *card, +static int __init snd_cs4231_sbus_create(struct snd_card *card, struct sbus_dev *sdev, int dev, - cs4231_t **rchip) + struct snd_cs4231 **rchip) { - cs4231_t *chip; + struct snd_cs4231 *chip; int err; *rchip = NULL; @@ -2043,11 +2028,11 @@ static int __init snd_cs4231_sbus_create(snd_card_t *card, return 0; } -static int cs4231_sbus_attach(struct sbus_dev *sdev) +static int __init cs4231_sbus_attach(struct sbus_dev *sdev) { struct resource *rp = &sdev->resource[0]; - cs4231_t *cp; - snd_card_t *card; + struct snd_cs4231 *cp; + struct snd_card *card; int err; err = cs4231_attach_begin(&card); @@ -2073,14 +2058,14 @@ static int cs4231_sbus_attach(struct sbus_dev *sdev) static void snd_cs4231_ebus_play_callback(struct ebus_dma_info *p, int event, void *cookie) { - cs4231_t *chip = cookie; + struct snd_cs4231 *chip = cookie; snd_cs4231_play_callback(chip); } static void snd_cs4231_ebus_capture_callback(struct ebus_dma_info *p, int event, void *cookie) { - cs4231_t *chip = cookie; + struct snd_cs4231 *chip = cookie; snd_cs4231_capture_callback(chip); } @@ -2089,32 +2074,32 @@ static void snd_cs4231_ebus_capture_callback(struct ebus_dma_info *p, int event, * EBUS DMA wrappers */ -int _ebus_dma_request(struct cs4231_dma_control *dma_cont, dma_addr_t bus_addr, size_t len) +static int _ebus_dma_request(struct cs4231_dma_control *dma_cont, dma_addr_t bus_addr, size_t len) { return ebus_dma_request(&dma_cont->ebus_info, bus_addr, len); } -void _ebus_dma_enable(struct cs4231_dma_control *dma_cont, int on) +static void _ebus_dma_enable(struct cs4231_dma_control *dma_cont, int on) { ebus_dma_enable(&dma_cont->ebus_info, on); } -void _ebus_dma_prepare(struct cs4231_dma_control *dma_cont, int dir) +static void _ebus_dma_prepare(struct cs4231_dma_control *dma_cont, int dir) { ebus_dma_prepare(&dma_cont->ebus_info, dir); } -unsigned int _ebus_dma_addr(struct cs4231_dma_control *dma_cont) +static unsigned int _ebus_dma_addr(struct cs4231_dma_control *dma_cont) { return ebus_dma_addr(&dma_cont->ebus_info); } -void _ebus_dma_reset(cs4231_t *chip) +static void _ebus_dma_reset(struct snd_cs4231 *chip) { return; } -void _ebus_dma_preallocate(cs4231_t *chip, snd_pcm_t *pcm) +static void _ebus_dma_preallocate(struct snd_cs4231 *chip, struct snd_pcm *pcm) { snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->dev_u.pdev), @@ -2125,7 +2110,7 @@ void _ebus_dma_preallocate(cs4231_t *chip, snd_pcm_t *pcm) * Init and exit routines */ -static int snd_cs4231_ebus_free(cs4231_t *chip) +static int snd_cs4231_ebus_free(struct snd_cs4231 *chip) { if (chip->c_dma.ebus_info.regs) { ebus_dma_unregister(&chip->c_dma.ebus_info); @@ -2138,31 +2123,29 @@ static int snd_cs4231_ebus_free(cs4231_t *chip) if (chip->port) iounmap(chip->port); - if (chip->timer) - snd_device_free(chip->card, chip->timer); kfree(chip); return 0; } -static int snd_cs4231_ebus_dev_free(snd_device_t *device) +static int snd_cs4231_ebus_dev_free(struct snd_device *device) { - cs4231_t *cp = device->device_data; + struct snd_cs4231 *cp = device->device_data; return snd_cs4231_ebus_free(cp); } -static snd_device_ops_t snd_cs4231_ebus_dev_ops = { +static struct snd_device_ops snd_cs4231_ebus_dev_ops = { .dev_free = snd_cs4231_ebus_dev_free, }; -static int __init snd_cs4231_ebus_create(snd_card_t *card, +static int __init snd_cs4231_ebus_create(struct snd_card *card, struct linux_ebus_device *edev, int dev, - cs4231_t **rchip) + struct snd_cs4231 **rchip) { - cs4231_t *chip; + struct snd_cs4231 *chip; int err; *rchip = NULL; @@ -2252,10 +2235,10 @@ static int __init snd_cs4231_ebus_create(snd_card_t *card, return 0; } -static int cs4231_ebus_attach(struct linux_ebus_device *edev) +static int __init cs4231_ebus_attach(struct linux_ebus_device *edev) { - snd_card_t *card; - cs4231_t *chip; + struct snd_card *card; + struct snd_cs4231 *chip; int err; err = cs4231_attach_begin(&card); @@ -2328,10 +2311,10 @@ static int __init cs4231_init(void) static void __exit cs4231_exit(void) { - cs4231_t *p = cs4231_list; + struct snd_cs4231 *p = cs4231_list; while (p != NULL) { - cs4231_t *next = p->next; + struct snd_cs4231 *next = p->next; snd_card_free(p->card); diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c index 59a77129..2164b7d 100644 --- a/sound/sparc/dbri.c +++ b/sound/sparc/dbri.c @@ -299,8 +299,8 @@ struct dbri_desc { }; /* Per stream (playback or record) information */ -typedef struct dbri_streaminfo { - snd_pcm_substream_t *substream; +struct dbri_streaminfo { + struct snd_pcm_substream *substream; u32 dvma_buffer; /* Device view of Alsa DMA buffer */ int left; /* # of bytes left in DMA buffer */ int size; /* Size of DMA buffer */ @@ -309,12 +309,12 @@ typedef struct dbri_streaminfo { int left_gain; /* mixer elements */ int right_gain; int balance; -} dbri_streaminfo_t; +}; /* This structure holds the information for both chips (DBRI & CS4215) */ -typedef struct snd_dbri { - snd_card_t *card; /* ALSA card */ - snd_pcm_t *pcm; +struct snd_dbri { + struct snd_card *card; /* ALSA card */ + struct snd_pcm *pcm; int regs_size, irq; /* Needed for unload */ struct sbus_dev *sdev; /* SBUS device info */ @@ -341,7 +341,7 @@ typedef struct snd_dbri { struct dbri_streaminfo stream_info[DBRI_NO_STREAMS]; struct snd_dbri *next; -} snd_dbri_t; +}; #define DBRI_MAX_VOLUME 63 /* Output volume */ #define DBRI_MAX_GAIN 15 /* Input gain */ @@ -593,7 +593,7 @@ typedef struct snd_dbri { /* Return a pointer to dbri_streaminfo */ #define DBRI_STREAM(dbri, substream) &dbri->stream_info[DBRI_STREAMNO(substream)] -static snd_dbri_t *dbri_list = NULL; /* All DBRI devices */ +static struct snd_dbri *dbri_list = NULL; /* All DBRI devices */ /* * Short data pipes transmit LSB first. The CS4215 receives MSB first. Grrr. @@ -652,12 +652,12 @@ to the DBRI. */ -static void dbri_process_interrupt_buffer(snd_dbri_t * dbri); +static void dbri_process_interrupt_buffer(struct snd_dbri * dbri); -enum dbri_lock_t { NoGetLock, GetLock }; +enum dbri_lock { NoGetLock, GetLock }; #define MAXLOOPS 10 -static volatile s32 *dbri_cmdlock(snd_dbri_t * dbri, enum dbri_lock_t get) +static volatile s32 *dbri_cmdlock(struct snd_dbri * dbri, enum dbri_lock get) { int maxloops = MAXLOOPS; @@ -687,7 +687,7 @@ static volatile s32 *dbri_cmdlock(snd_dbri_t * dbri, enum dbri_lock_t get) return &dbri->dma->cmd[0]; } -static void dbri_cmdsend(snd_dbri_t * dbri, volatile s32 * cmd) +static void dbri_cmdsend(struct snd_dbri * dbri, volatile s32 * cmd) { volatile s32 *ptr; u32 reg; @@ -717,7 +717,7 @@ static void dbri_cmdsend(snd_dbri_t * dbri, volatile s32 * cmd) } /* Lock must be held when calling this */ -static void dbri_reset(snd_dbri_t * dbri) +static void dbri_reset(struct snd_dbri * dbri) { int i; @@ -732,7 +732,7 @@ static void dbri_reset(snd_dbri_t * dbri) } /* Lock must not be held before calling this */ -static void dbri_initialize(snd_dbri_t * dbri) +static void dbri_initialize(struct snd_dbri * dbri) { volatile s32 *cmd; u32 dma_addr, tmp; @@ -795,7 +795,7 @@ list ordering, among other things. The transmit and receive functions here interface closely with the transmit and receive interrupt code. */ -static int pipe_active(snd_dbri_t * dbri, int pipe) +static int pipe_active(struct snd_dbri * dbri, int pipe) { return ((pipe >= 0) && (dbri->pipes[pipe].desc != -1)); } @@ -805,7 +805,7 @@ static int pipe_active(snd_dbri_t * dbri, int pipe) * Called on an in-use pipe to clear anything being transmitted or received * Lock must be held before calling this. */ -static void reset_pipe(snd_dbri_t * dbri, int pipe) +static void reset_pipe(struct snd_dbri * dbri, int pipe) { int sdp; int desc; @@ -838,7 +838,7 @@ static void reset_pipe(snd_dbri_t * dbri, int pipe) } /* FIXME: direction as an argument? */ -static void setup_pipe(snd_dbri_t * dbri, int pipe, int sdp) +static void setup_pipe(struct snd_dbri * dbri, int pipe, int sdp) { if (pipe < 0 || pipe > 31) { printk(KERN_ERR "DBRI: setup_pipe called with illegal pipe number\n"); @@ -869,7 +869,7 @@ static void setup_pipe(snd_dbri_t * dbri, int pipe, int sdp) } /* FIXME: direction not needed */ -static void link_time_slot(snd_dbri_t * dbri, int pipe, +static void link_time_slot(struct snd_dbri * dbri, int pipe, enum in_or_out direction, int basepipe, int length, int cycle) { @@ -959,7 +959,7 @@ static void link_time_slot(snd_dbri_t * dbri, int pipe, dbri_cmdsend(dbri, cmd); } -static void unlink_time_slot(snd_dbri_t * dbri, int pipe, +static void unlink_time_slot(struct snd_dbri * dbri, int pipe, enum in_or_out direction, int prevpipe, int nextpipe) { @@ -1003,7 +1003,7 @@ static void unlink_time_slot(snd_dbri_t * dbri, int pipe, * in the low-order 8 bits, filled either MSB-first or LSB-first, * depending on the settings passed to setup_pipe() */ -static void xmit_fixed(snd_dbri_t * dbri, int pipe, unsigned int data) +static void xmit_fixed(struct snd_dbri * dbri, int pipe, unsigned int data) { volatile s32 *cmd; @@ -1040,7 +1040,7 @@ static void xmit_fixed(snd_dbri_t * dbri, int pipe, unsigned int data) dbri_cmdsend(dbri, cmd); } -static void recv_fixed(snd_dbri_t * dbri, int pipe, volatile __u32 * ptr) +static void recv_fixed(struct snd_dbri * dbri, int pipe, volatile __u32 * ptr) { if (pipe < 16 || pipe > 31) { printk(KERN_ERR "DBRI: recv_fixed called with illegal pipe number\n"); @@ -1072,9 +1072,9 @@ static void recv_fixed(snd_dbri_t * dbri, int pipe, volatile __u32 * ptr) * data buffers. Buffers too large for a single descriptor will * be spread across multiple descriptors. */ -static int setup_descs(snd_dbri_t * dbri, int streamno, unsigned int period) +static int setup_descs(struct snd_dbri * dbri, int streamno, unsigned int period) { - dbri_streaminfo_t *info = &dbri->stream_info[streamno]; + struct dbri_streaminfo *info = &dbri->stream_info[streamno]; __u32 dvma_buffer; int desc = 0; int len; @@ -1207,7 +1207,7 @@ multiplexed serial interface which the DBRI can operate in either master enum master_or_slave { CHImaster, CHIslave }; -static void reset_chi(snd_dbri_t * dbri, enum master_or_slave master_or_slave, +static void reset_chi(struct snd_dbri * dbri, enum master_or_slave master_or_slave, int bits_per_frame) { volatile s32 *cmd; @@ -1308,7 +1308,7 @@ In the standard SPARC audio configuration, the CS4215 codec is attached to the DBRI via the CHI interface and few of the DBRI's PIO pins. */ -static void cs4215_setup_pipes(snd_dbri_t * dbri) +static void cs4215_setup_pipes(struct snd_dbri * dbri) { /* * Data mode: @@ -1369,7 +1369,7 @@ static int cs4215_init_data(struct cs4215 *mm) return 0; } -static void cs4215_setdata(snd_dbri_t * dbri, int muted) +static void cs4215_setdata(struct snd_dbri * dbri, int muted) { if (muted) { dbri->mm.data[0] |= 63; @@ -1378,7 +1378,7 @@ static void cs4215_setdata(snd_dbri_t * dbri, int muted) dbri->mm.data[3] &= ~15; } else { /* Start by setting the playback attenuation. */ - dbri_streaminfo_t *info = &dbri->stream_info[DBRI_PLAY]; + struct dbri_streaminfo *info = &dbri->stream_info[DBRI_PLAY]; int left_gain = info->left_gain % 64; int right_gain = info->right_gain % 64; @@ -1409,7 +1409,7 @@ static void cs4215_setdata(snd_dbri_t * dbri, int muted) /* * Set the CS4215 to data mode. */ -static void cs4215_open(snd_dbri_t * dbri) +static void cs4215_open(struct snd_dbri * dbri) { int data_width; u32 tmp; @@ -1471,7 +1471,7 @@ static void cs4215_open(snd_dbri_t * dbri) /* * Send the control information (i.e. audio format) */ -static int cs4215_setctrl(snd_dbri_t * dbri) +static int cs4215_setctrl(struct snd_dbri * dbri) { int i, val; u32 tmp; @@ -1570,7 +1570,7 @@ static int cs4215_setctrl(snd_dbri_t * dbri) * As part of the process we resend the settings for the data * timeslots as well. */ -static int cs4215_prepare(snd_dbri_t * dbri, unsigned int rate, +static int cs4215_prepare(struct snd_dbri * dbri, unsigned int rate, snd_pcm_format_t format, unsigned int channels) { int freq_idx; @@ -1628,7 +1628,7 @@ static int cs4215_prepare(snd_dbri_t * dbri, unsigned int rate, /* * */ -static int cs4215_init(snd_dbri_t * dbri) +static int cs4215_init(struct snd_dbri * dbri) { u32 reg2 = sbus_readl(dbri->regs + REG2); dprintk(D_MM, "cs4215_init: reg2=0x%x\n", reg2); @@ -1697,8 +1697,8 @@ even if we're running cli'ed. */ static void xmit_descs(unsigned long data) { - snd_dbri_t *dbri = (snd_dbri_t *) data; - dbri_streaminfo_t *info; + struct snd_dbri *dbri = (struct snd_dbri *) data; + struct dbri_streaminfo *info; volatile s32 *cmd; unsigned long flags; int first_td; @@ -1780,9 +1780,9 @@ static DECLARE_TASKLET(xmit_descs_task, xmit_descs, 0); * done by the xmit_descs() tasklet above since that could take longer. */ -static void transmission_complete_intr(snd_dbri_t * dbri, int pipe) +static void transmission_complete_intr(struct snd_dbri * dbri, int pipe) { - dbri_streaminfo_t *info; + struct dbri_streaminfo *info; int td; int status; @@ -1830,9 +1830,9 @@ static void transmission_complete_intr(snd_dbri_t * dbri, int pipe) snd_pcm_period_elapsed(info->substream); } -static void reception_complete_intr(snd_dbri_t * dbri, int pipe) +static void reception_complete_intr(struct snd_dbri * dbri, int pipe) { - dbri_streaminfo_t *info; + struct dbri_streaminfo *info; int rd = dbri->pipes[pipe].desc; s32 status; @@ -1874,7 +1874,7 @@ static void reception_complete_intr(snd_dbri_t * dbri, int pipe) snd_pcm_period_elapsed(info->substream); } -static void dbri_process_one_interrupt(snd_dbri_t * dbri, int x) +static void dbri_process_one_interrupt(struct snd_dbri * dbri, int x) { int val = D_INTR_GETVAL(x); int channel = D_INTR_GETCHAN(x); @@ -1950,7 +1950,7 @@ static void dbri_process_one_interrupt(snd_dbri_t * dbri, int x) * order is important since we might recurse back into this function * and need to make sure the pointer has been advanced first. */ -static void dbri_process_interrupt_buffer(snd_dbri_t * dbri) +static void dbri_process_interrupt_buffer(struct snd_dbri * dbri) { s32 x; @@ -1969,7 +1969,7 @@ static void dbri_process_interrupt_buffer(snd_dbri_t * dbri) static irqreturn_t snd_dbri_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - snd_dbri_t *dbri = dev_id; + struct snd_dbri *dbri = dev_id; static int errcnt = 0; int x; @@ -2030,7 +2030,7 @@ static irqreturn_t snd_dbri_interrupt(int irq, void *dev_id, /**************************************************************************** PCM Interface ****************************************************************************/ -static snd_pcm_hardware_t snd_dbri_pcm_hw = { +static struct snd_pcm_hardware snd_dbri_pcm_hw = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | @@ -2051,11 +2051,11 @@ static snd_pcm_hardware_t snd_dbri_pcm_hw = { .periods_max = 1024, }; -static int snd_dbri_open(snd_pcm_substream_t * substream) +static int snd_dbri_open(struct snd_pcm_substream *substream) { - snd_dbri_t *dbri = snd_pcm_substream_chip(substream); - snd_pcm_runtime_t *runtime = substream->runtime; - dbri_streaminfo_t *info = DBRI_STREAM(dbri, substream); + struct snd_dbri *dbri = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; + struct dbri_streaminfo *info = DBRI_STREAM(dbri, substream); unsigned long flags; dprintk(D_USR, "open audio output.\n"); @@ -2074,10 +2074,10 @@ static int snd_dbri_open(snd_pcm_substream_t * substream) return 0; } -static int snd_dbri_close(snd_pcm_substream_t * substream) +static int snd_dbri_close(struct snd_pcm_substream *substream) { - snd_dbri_t *dbri = snd_pcm_substream_chip(substream); - dbri_streaminfo_t *info = DBRI_STREAM(dbri, substream); + struct snd_dbri *dbri = snd_pcm_substream_chip(substream); + struct dbri_streaminfo *info = DBRI_STREAM(dbri, substream); dprintk(D_USR, "close audio output.\n"); info->substream = NULL; @@ -2087,12 +2087,12 @@ static int snd_dbri_close(snd_pcm_substream_t * substream) return 0; } -static int snd_dbri_hw_params(snd_pcm_substream_t * substream, - snd_pcm_hw_params_t * hw_params) +static int snd_dbri_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *hw_params) { - snd_pcm_runtime_t *runtime = substream->runtime; - snd_dbri_t *dbri = snd_pcm_substream_chip(substream); - dbri_streaminfo_t *info = DBRI_STREAM(dbri, substream); + struct snd_pcm_runtime *runtime = substream->runtime; + struct snd_dbri *dbri = snd_pcm_substream_chip(substream); + struct dbri_streaminfo *info = DBRI_STREAM(dbri, substream); int direction; int ret; @@ -2129,10 +2129,10 @@ static int snd_dbri_hw_params(snd_pcm_substream_t * substream, return 0; } -static int snd_dbri_hw_free(snd_pcm_substream_t * substream) +static int snd_dbri_hw_free(struct snd_pcm_substream *substream) { - snd_dbri_t *dbri = snd_pcm_substream_chip(substream); - dbri_streaminfo_t *info = DBRI_STREAM(dbri, substream); + struct snd_dbri *dbri = snd_pcm_substream_chip(substream); + struct dbri_streaminfo *info = DBRI_STREAM(dbri, substream); int direction; dprintk(D_USR, "hw_free.\n"); @@ -2153,11 +2153,11 @@ static int snd_dbri_hw_free(snd_pcm_substream_t * substream) return snd_pcm_lib_free_pages(substream); } -static int snd_dbri_prepare(snd_pcm_substream_t * substream) +static int snd_dbri_prepare(struct snd_pcm_substream *substream) { - snd_dbri_t *dbri = snd_pcm_substream_chip(substream); - dbri_streaminfo_t *info = DBRI_STREAM(dbri, substream); - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_dbri *dbri = snd_pcm_substream_chip(substream); + struct dbri_streaminfo *info = DBRI_STREAM(dbri, substream); + struct snd_pcm_runtime *runtime = substream->runtime; int ret; info->size = snd_pcm_lib_buffer_bytes(substream); @@ -2184,10 +2184,10 @@ static int snd_dbri_prepare(snd_pcm_substream_t * substream) return ret; } -static int snd_dbri_trigger(snd_pcm_substream_t * substream, int cmd) +static int snd_dbri_trigger(struct snd_pcm_substream *substream, int cmd) { - snd_dbri_t *dbri = snd_pcm_substream_chip(substream); - dbri_streaminfo_t *info = DBRI_STREAM(dbri, substream); + struct snd_dbri *dbri = snd_pcm_substream_chip(substream); + struct dbri_streaminfo *info = DBRI_STREAM(dbri, substream); int ret = 0; switch (cmd) { @@ -2211,10 +2211,10 @@ static int snd_dbri_trigger(snd_pcm_substream_t * substream, int cmd) return ret; } -static snd_pcm_uframes_t snd_dbri_pointer(snd_pcm_substream_t * substream) +static snd_pcm_uframes_t snd_dbri_pointer(struct snd_pcm_substream *substream) { - snd_dbri_t *dbri = snd_pcm_substream_chip(substream); - dbri_streaminfo_t *info = DBRI_STREAM(dbri, substream); + struct snd_dbri *dbri = snd_pcm_substream_chip(substream); + struct dbri_streaminfo *info = DBRI_STREAM(dbri, substream); snd_pcm_uframes_t ret; ret = bytes_to_frames(substream->runtime, info->offset) @@ -2224,7 +2224,7 @@ static snd_pcm_uframes_t snd_dbri_pointer(snd_pcm_substream_t * substream) return ret; } -static snd_pcm_ops_t snd_dbri_ops = { +static struct snd_pcm_ops snd_dbri_ops = { .open = snd_dbri_open, .close = snd_dbri_close, .ioctl = snd_pcm_lib_ioctl, @@ -2235,9 +2235,9 @@ static snd_pcm_ops_t snd_dbri_ops = { .pointer = snd_dbri_pointer, }; -static int __devinit snd_dbri_pcm(snd_dbri_t * dbri) +static int __devinit snd_dbri_pcm(struct snd_dbri * dbri) { - snd_pcm_t *pcm; + struct snd_pcm *pcm; int err; if ((err = snd_pcm_new(dbri->card, @@ -2270,8 +2270,8 @@ static int __devinit snd_dbri_pcm(snd_dbri_t * dbri) Mixer interface *****************************************************************************/ -static int snd_cs4215_info_volume(snd_kcontrol_t * kcontrol, - snd_ctl_elem_info_t * uinfo) +static int snd_cs4215_info_volume(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) { uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->count = 2; @@ -2284,11 +2284,11 @@ static int snd_cs4215_info_volume(snd_kcontrol_t * kcontrol, return 0; } -static int snd_cs4215_get_volume(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_cs4215_get_volume(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - snd_dbri_t *dbri = snd_kcontrol_chip(kcontrol); - dbri_streaminfo_t *info; + struct snd_dbri *dbri = snd_kcontrol_chip(kcontrol); + struct dbri_streaminfo *info; snd_assert(dbri != NULL, return -EINVAL); info = &dbri->stream_info[kcontrol->private_value]; snd_assert(info != NULL, return -EINVAL); @@ -2298,11 +2298,11 @@ static int snd_cs4215_get_volume(snd_kcontrol_t * kcontrol, return 0; } -static int snd_cs4215_put_volume(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_cs4215_put_volume(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - snd_dbri_t *dbri = snd_kcontrol_chip(kcontrol); - dbri_streaminfo_t *info = &dbri->stream_info[kcontrol->private_value]; + struct snd_dbri *dbri = snd_kcontrol_chip(kcontrol); + struct dbri_streaminfo *info = &dbri->stream_info[kcontrol->private_value]; unsigned long flags; int changed = 0; @@ -2329,8 +2329,8 @@ static int snd_cs4215_put_volume(snd_kcontrol_t * kcontrol, return changed; } -static int snd_cs4215_info_single(snd_kcontrol_t * kcontrol, - snd_ctl_elem_info_t * uinfo) +static int snd_cs4215_info_single(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_info *uinfo) { int mask = (kcontrol->private_value >> 16) & 0xff; @@ -2342,10 +2342,10 @@ static int snd_cs4215_info_single(snd_kcontrol_t * kcontrol, return 0; } -static int snd_cs4215_get_single(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_cs4215_get_single(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - snd_dbri_t *dbri = snd_kcontrol_chip(kcontrol); + struct snd_dbri *dbri = snd_kcontrol_chip(kcontrol); int elem = kcontrol->private_value & 0xff; int shift = (kcontrol->private_value >> 8) & 0xff; int mask = (kcontrol->private_value >> 16) & 0xff; @@ -2367,10 +2367,10 @@ static int snd_cs4215_get_single(snd_kcontrol_t * kcontrol, return 0; } -static int snd_cs4215_put_single(snd_kcontrol_t * kcontrol, - snd_ctl_elem_value_t * ucontrol) +static int snd_cs4215_put_single(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) { - snd_dbri_t *dbri = snd_kcontrol_chip(kcontrol); + struct snd_dbri *dbri = snd_kcontrol_chip(kcontrol); unsigned long flags; int elem = kcontrol->private_value & 0xff; int shift = (kcontrol->private_value >> 8) & 0xff; @@ -2425,7 +2425,7 @@ static int snd_cs4215_put_single(snd_kcontrol_t * kcontrol, .get = snd_cs4215_get_single, .put = snd_cs4215_put_single, \ .private_value = entry | (shift << 8) | (mask << 16) | (invert << 24) }, -static snd_kcontrol_new_t dbri_controls[] __devinitdata = { +static struct snd_kcontrol_new dbri_controls[] __devinitdata = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Playback Volume", @@ -2452,11 +2452,11 @@ static snd_kcontrol_new_t dbri_controls[] __devinitdata = { CS4215_SINGLE("Mic boost", 4, 4, 1, 1) }; -#define NUM_CS4215_CONTROLS (sizeof(dbri_controls)/sizeof(snd_kcontrol_new_t)) +#define NUM_CS4215_CONTROLS (sizeof(dbri_controls)/sizeof(struct snd_kcontrol_new)) -static int __init snd_dbri_mixer(snd_dbri_t * dbri) +static int __init snd_dbri_mixer(struct snd_dbri * dbri) { - snd_card_t *card; + struct snd_card *card; int idx, err; snd_assert(dbri != NULL && dbri->card != NULL, return -EINVAL); @@ -2482,9 +2482,9 @@ static int __init snd_dbri_mixer(snd_dbri_t * dbri) /**************************************************************************** /proc interface ****************************************************************************/ -static void dbri_regs_read(snd_info_entry_t * entry, snd_info_buffer_t * buffer) +static void dbri_regs_read(struct snd_info_entry * entry, struct snd_info_buffer *buffer) { - snd_dbri_t *dbri = entry->private_data; + struct snd_dbri *dbri = entry->private_data; snd_iprintf(buffer, "REG0: 0x%x\n", sbus_readl(dbri->regs + REG0)); snd_iprintf(buffer, "REG2: 0x%x\n", sbus_readl(dbri->regs + REG2)); @@ -2493,10 +2493,10 @@ static void dbri_regs_read(snd_info_entry_t * entry, snd_info_buffer_t * buffer) } #ifdef DBRI_DEBUG -static void dbri_debug_read(snd_info_entry_t * entry, - snd_info_buffer_t * buffer) +static void dbri_debug_read(struct snd_info_entry * entry, + struct snd_info_buffer *buffer) { - snd_dbri_t *dbri = entry->private_data; + struct snd_dbri *dbri = entry->private_data; int pipe; snd_iprintf(buffer, "debug=%d\n", dbri_debug); @@ -2516,18 +2516,18 @@ static void dbri_debug_read(snd_info_entry_t * entry, } #endif -void snd_dbri_proc(snd_dbri_t * dbri) +void snd_dbri_proc(struct snd_dbri * dbri) { - snd_info_entry_t *entry; - int err; + struct snd_info_entry *entry; - err = snd_card_proc_new(dbri->card, "regs", &entry); - snd_info_set_text_ops(entry, dbri, 1024, dbri_regs_read); + if (! snd_card_proc_new(dbri->card, "regs", &entry)) + snd_info_set_text_ops(entry, dbri, 1024, dbri_regs_read); #ifdef DBRI_DEBUG - err = snd_card_proc_new(dbri->card, "debug", &entry); - snd_info_set_text_ops(entry, dbri, 4096, dbri_debug_read); - entry->mode = S_IFREG | S_IRUGO; /* Readable only. */ + if (! snd_card_proc_new(dbri->card, "debug", &entry)) { + snd_info_set_text_ops(entry, dbri, 4096, dbri_debug_read); + entry->mode = S_IFREG | S_IRUGO; /* Readable only. */ + } #endif } @@ -2536,13 +2536,13 @@ void snd_dbri_proc(snd_dbri_t * dbri) **************************** Initialization ******************************** **************************************************************************** */ -static void snd_dbri_free(snd_dbri_t * dbri); +static void snd_dbri_free(struct snd_dbri * dbri); -static int __init snd_dbri_create(snd_card_t * card, +static int __init snd_dbri_create(struct snd_card *card, struct sbus_dev *sdev, struct linux_prom_irqs *irq, int dev) { - snd_dbri_t *dbri = card->private_data; + struct snd_dbri *dbri = card->private_data; int err; spin_lock_init(&dbri->lock); @@ -2593,7 +2593,7 @@ static int __init snd_dbri_create(snd_card_t * card, return 0; } -static void snd_dbri_free(snd_dbri_t * dbri) +static void snd_dbri_free(struct snd_dbri * dbri) { dprintk(D_GEN, "snd_dbri_free\n"); dbri_reset(dbri); @@ -2611,10 +2611,10 @@ static void snd_dbri_free(snd_dbri_t * dbri) static int __init dbri_attach(int prom_node, struct sbus_dev *sdev) { - snd_dbri_t *dbri; + struct snd_dbri *dbri; struct linux_prom_irqs irq; struct resource *rp; - snd_card_t *card; + struct snd_card *card; static int dev = 0; int err; @@ -2638,7 +2638,7 @@ static int __init dbri_attach(int prom_node, struct sbus_dev *sdev) } card = snd_card_new(index[dev], id[dev], THIS_MODULE, - sizeof(snd_dbri_t)); + sizeof(struct snd_dbri)); if (card == NULL) return -ENOMEM; @@ -2654,7 +2654,7 @@ static int __init dbri_attach(int prom_node, struct sbus_dev *sdev) return err; } - dbri = (snd_dbri_t *) card->private_data; + dbri = card->private_data; if ((err = snd_dbri_pcm(dbri)) < 0) goto _err; @@ -2664,9 +2664,6 @@ static int __init dbri_attach(int prom_node, struct sbus_dev *sdev) /* /proc file handling */ snd_dbri_proc(dbri); - if ((err = snd_card_set_generic_dev(card)) < 0) - goto _err; - if ((err = snd_card_register(card)) < 0) goto _err; @@ -2709,11 +2706,11 @@ static int __init dbri_init(void) static void __exit dbri_exit(void) { - snd_dbri_t *this = dbri_list; + struct snd_dbri *this = dbri_list; while (this != NULL) { - snd_dbri_t *next = this->next; - snd_card_t *card = this->card; + struct snd_dbri *next = this->next; + struct snd_card *card = this->card; snd_dbri_free(this); snd_card_free(card); |