Commit af0fbfb5 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Remove xxx_t typedefs: ARM SA11xx-UDA1341

Modules: SA11xx UDA1341 driver

Remove xxx_t typedefs from the ARM SA11xx-UDA1341 driver.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d18f8376
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* merged HAL layer (patches from Brian) * merged HAL layer (patches from Brian)
*/ */
/* $Id: sa11xx-uda1341.c,v 1.24 2005/11/17 10:25:22 tiwai Exp $ */ /* $Id: sa11xx-uda1341.c,v 1.25 2005/11/17 15:10:58 tiwai Exp $ */
/*************************************************************************************************** /***************************************************************************************************
* *
...@@ -115,7 +115,7 @@ static char *id = NULL; /* ID for this card */ ...@@ -115,7 +115,7 @@ static char *id = NULL; /* ID for this card */
module_param(id, charp, 0444); module_param(id, charp, 0444);
MODULE_PARM_DESC(id, "ID string for SA1100/SA1111 + UDA1341TS soundcard."); MODULE_PARM_DESC(id, "ID string for SA1100/SA1111 + UDA1341TS soundcard.");
typedef struct audio_stream { struct audio_stream {
char *id; /* identification string */ char *id; /* identification string */
int stream_id; /* numeric identification */ int stream_id; /* numeric identification */
dma_device_t dma_dev; /* device identifier for DMA */ dma_device_t dma_dev; /* device identifier for DMA */
...@@ -130,16 +130,16 @@ typedef struct audio_stream { ...@@ -130,16 +130,16 @@ typedef struct audio_stream {
int tx_spin; /* are we recoding - flag used to do DMA trans. for sync */ int tx_spin; /* are we recoding - flag used to do DMA trans. for sync */
unsigned int old_offset; unsigned int old_offset;
spinlock_t dma_lock; /* for locking in DMA operations (see dma-sa1100.c in the kernel) */ spinlock_t dma_lock; /* for locking in DMA operations (see dma-sa1100.c in the kernel) */
snd_pcm_substream_t *stream; struct snd_pcm_substream *stream;
}audio_stream_t; };
typedef struct snd_card_sa11xx_uda1341 { struct sa11xx_uda1341 {
snd_card_t *card; struct snd_card *card;
struct l3_client *uda1341; struct l3_client *uda1341;
snd_pcm_t *pcm; struct snd_pcm *pcm;
long samplerate; long samplerate;
audio_stream_t s[2]; /* playback & capture */ struct audio_stream s[2]; /* playback & capture */
} sa11xx_uda1341_t; };
static unsigned int rates[] = { static unsigned int rates[] = {
8000, 10666, 10985, 14647, 8000, 10666, 10985, 14647,
...@@ -147,7 +147,7 @@ static unsigned int rates[] = { ...@@ -147,7 +147,7 @@ static unsigned int rates[] = {
29400, 32000, 44100, 48000, 29400, 32000, 44100, 48000,
}; };
static snd_pcm_hw_constraint_list_t hw_constraints_rates = { static struct snd_pcm_hw_constraint_list hw_constraints_rates = {
.count = ARRAY_SIZE(rates), .count = ARRAY_SIZE(rates),
.list = rates, .list = rates,
.mask = 0, .mask = 0,
...@@ -193,7 +193,7 @@ static void sa11xx_uda1341_set_audio_clock(long val) ...@@ -193,7 +193,7 @@ static void sa11xx_uda1341_set_audio_clock(long val)
} }
} }
static void sa11xx_uda1341_set_samplerate(sa11xx_uda1341_t *sa11xx_uda1341, long rate) static void sa11xx_uda1341_set_samplerate(struct sa11xx_uda1341 *sa11xx_uda1341, long rate)
{ {
int clk_div = 0; int clk_div = 0;
int clk=0; int clk=0;
...@@ -278,7 +278,7 @@ static void sa11xx_uda1341_set_samplerate(sa11xx_uda1341_t *sa11xx_uda1341, long ...@@ -278,7 +278,7 @@ static void sa11xx_uda1341_set_samplerate(sa11xx_uda1341_t *sa11xx_uda1341, long
/* {{{ HW init and shutdown */ /* {{{ HW init and shutdown */
static void sa11xx_uda1341_audio_init(sa11xx_uda1341_t *sa11xx_uda1341) static void sa11xx_uda1341_audio_init(struct sa11xx_uda1341 *sa11xx_uda1341)
{ {
unsigned long flags; unsigned long flags;
...@@ -335,7 +335,7 @@ static void sa11xx_uda1341_audio_init(sa11xx_uda1341_t *sa11xx_uda1341) ...@@ -335,7 +335,7 @@ static void sa11xx_uda1341_audio_init(sa11xx_uda1341_t *sa11xx_uda1341)
#endif #endif
} }
static void sa11xx_uda1341_audio_shutdown(sa11xx_uda1341_t *sa11xx_uda1341) static void sa11xx_uda1341_audio_shutdown(struct sa11xx_uda1341 *sa11xx_uda1341)
{ {
/* mute on */ /* mute on */
#ifdef CONFIG_H3600_HAL #ifdef CONFIG_H3600_HAL
...@@ -376,7 +376,7 @@ static void sa11xx_uda1341_audio_shutdown(sa11xx_uda1341_t *sa11xx_uda1341) ...@@ -376,7 +376,7 @@ static void sa11xx_uda1341_audio_shutdown(sa11xx_uda1341_t *sa11xx_uda1341)
#ifdef HH_VERSION #ifdef HH_VERSION
static int audio_dma_request(audio_stream_t *s, void (*callback)(void *, int)) static int audio_dma_request(struct audio_stream *s, void (*callback)(void *, int))
{ {
int ret; int ret;
...@@ -389,7 +389,7 @@ static int audio_dma_request(audio_stream_t *s, void (*callback)(void *, int)) ...@@ -389,7 +389,7 @@ static int audio_dma_request(audio_stream_t *s, void (*callback)(void *, int))
return 0; return 0;
} }
static inline void audio_dma_free(audio_stream_t *s) static inline void audio_dma_free(struct audio_stream *s)
{ {
sa1100_free_dma(s->dmach); sa1100_free_dma(s->dmach);
s->dmach = -1; s->dmach = -1;
...@@ -397,7 +397,7 @@ static inline void audio_dma_free(audio_stream_t *s) ...@@ -397,7 +397,7 @@ static inline void audio_dma_free(audio_stream_t *s)
#else #else
static int audio_dma_request(audio_stream_t *s, void (*callback)(void *)) static int audio_dma_request(struct audio_stream *s, void (*callback)(void *))
{ {
int ret; int ret;
...@@ -407,7 +407,7 @@ static int audio_dma_request(audio_stream_t *s, void (*callback)(void *)) ...@@ -407,7 +407,7 @@ static int audio_dma_request(audio_stream_t *s, void (*callback)(void *))
return ret; return ret;
} }
static void audio_dma_free(audio_stream_t *s) static void audio_dma_free(struct audio_stream *s)
{ {
sa1100_free_dma(s->dma_regs); sa1100_free_dma(s->dma_regs);
s->dma_regs = 0; s->dma_regs = 0;
...@@ -415,10 +415,10 @@ static void audio_dma_free(audio_stream_t *s) ...@@ -415,10 +415,10 @@ static void audio_dma_free(audio_stream_t *s)
#endif #endif
static u_int audio_get_dma_pos(audio_stream_t *s) static u_int audio_get_dma_pos(struct audio_stream *s)
{ {
snd_pcm_substream_t * substream = s->stream; struct snd_pcm_substream *substream = s->stream;
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
unsigned int offset; unsigned int offset;
unsigned long flags; unsigned long flags;
dma_addr_t addr; dma_addr_t addr;
...@@ -443,7 +443,7 @@ static u_int audio_get_dma_pos(audio_stream_t *s) ...@@ -443,7 +443,7 @@ static u_int audio_get_dma_pos(audio_stream_t *s)
/* /*
* this stops the dma and clears the dma ptrs * this stops the dma and clears the dma ptrs
*/ */
static void audio_stop_dma(audio_stream_t *s) static void audio_stop_dma(struct audio_stream *s)
{ {
unsigned long flags; unsigned long flags;
...@@ -459,10 +459,10 @@ static void audio_stop_dma(audio_stream_t *s) ...@@ -459,10 +459,10 @@ static void audio_stop_dma(audio_stream_t *s)
spin_unlock_irqrestore(&s->dma_lock, flags); spin_unlock_irqrestore(&s->dma_lock, flags);
} }
static void audio_process_dma(audio_stream_t *s) static void audio_process_dma(struct audio_stream *s)
{ {
snd_pcm_substream_t *substream = s->stream; struct snd_pcm_substream *substream = s->stream;
snd_pcm_runtime_t *runtime; struct snd_pcm_runtime *runtime;
unsigned int dma_size; unsigned int dma_size;
unsigned int offset; unsigned int offset;
int ret; int ret;
...@@ -525,7 +525,7 @@ static void audio_dma_callback(void *data, int size) ...@@ -525,7 +525,7 @@ static void audio_dma_callback(void *data, int size)
static void audio_dma_callback(void *data) static void audio_dma_callback(void *data)
#endif #endif
{ {
audio_stream_t *s = data; struct audio_stream *s = data;
/* /*
* If we are getting a callback for an active stream then we inform * If we are getting a callback for an active stream then we inform
...@@ -547,12 +547,12 @@ static void audio_dma_callback(void *data) ...@@ -547,12 +547,12 @@ static void audio_dma_callback(void *data)
/* {{{ trigger & timer */ /* {{{ trigger & timer */
static int snd_sa11xx_uda1341_trigger(snd_pcm_substream_t * substream, int cmd) static int snd_sa11xx_uda1341_trigger(struct snd_pcm_substream *substream, int cmd)
{ {
sa11xx_uda1341_t *chip = snd_pcm_substream_chip(substream); struct sa11xx_uda1341 *chip = snd_pcm_substream_chip(substream);
int stream_id = substream->pstr->stream; int stream_id = substream->pstr->stream;
audio_stream_t *s = &chip->s[stream_id]; struct audio_stream *s = &chip->s[stream_id];
audio_stream_t *s1 = &chip->s[stream_id ^ 1]; struct audio_stream *s1 = &chip->s[stream_id ^ 1];
int err = 0; int err = 0;
/* note local interrupts are already disabled in the midlevel code */ /* note local interrupts are already disabled in the midlevel code */
...@@ -681,11 +681,11 @@ static int snd_sa11xx_uda1341_trigger(snd_pcm_substream_t * substream, int cmd) ...@@ -681,11 +681,11 @@ static int snd_sa11xx_uda1341_trigger(snd_pcm_substream_t * substream, int cmd)
return err; return err;
} }
static int snd_sa11xx_uda1341_prepare(snd_pcm_substream_t * substream) static int snd_sa11xx_uda1341_prepare(struct snd_pcm_substream *substream)
{ {
sa11xx_uda1341_t *chip = snd_pcm_substream_chip(substream); struct sa11xx_uda1341 *chip = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
audio_stream_t *s = &chip->s[substream->pstr->stream]; struct audio_stream *s = &chip->s[substream->pstr->stream];
/* set requested samplerate */ /* set requested samplerate */
sa11xx_uda1341_set_samplerate(chip, runtime->rate); sa11xx_uda1341_set_samplerate(chip, runtime->rate);
...@@ -699,15 +699,15 @@ static int snd_sa11xx_uda1341_prepare(snd_pcm_substream_t * substream) ...@@ -699,15 +699,15 @@ static int snd_sa11xx_uda1341_prepare(snd_pcm_substream_t * substream)
return 0; return 0;
} }
static snd_pcm_uframes_t snd_sa11xx_uda1341_pointer(snd_pcm_substream_t * substream) static snd_pcm_uframes_t snd_sa11xx_uda1341_pointer(struct snd_pcm_substream *substream)
{ {
sa11xx_uda1341_t *chip = snd_pcm_substream_chip(substream); struct sa11xx_uda1341 *chip = snd_pcm_substream_chip(substream);
return audio_get_dma_pos(&chip->s[substream->pstr->stream]); return audio_get_dma_pos(&chip->s[substream->pstr->stream]);
} }
/* }}} */ /* }}} */
static snd_pcm_hardware_t snd_sa11xx_uda1341_capture = static struct snd_pcm_hardware snd_sa11xx_uda1341_capture =
{ {
.info = (SNDRV_PCM_INFO_INTERLEAVED | .info = (SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_BLOCK_TRANSFER |
...@@ -730,7 +730,7 @@ static snd_pcm_hardware_t snd_sa11xx_uda1341_capture = ...@@ -730,7 +730,7 @@ static snd_pcm_hardware_t snd_sa11xx_uda1341_capture =
.fifo_size = 0, .fifo_size = 0,
}; };
static snd_pcm_hardware_t snd_sa11xx_uda1341_playback = static struct snd_pcm_hardware snd_sa11xx_uda1341_playback =
{ {
.info = (SNDRV_PCM_INFO_INTERLEAVED | .info = (SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_BLOCK_TRANSFER |
...@@ -753,10 +753,10 @@ static snd_pcm_hardware_t snd_sa11xx_uda1341_playback = ...@@ -753,10 +753,10 @@ static snd_pcm_hardware_t snd_sa11xx_uda1341_playback =
.fifo_size = 0, .fifo_size = 0,
}; };
static int snd_card_sa11xx_uda1341_open(snd_pcm_substream_t * substream) static int snd_card_sa11xx_uda1341_open(struct snd_pcm_substream *substream)
{ {
sa11xx_uda1341_t *chip = snd_pcm_substream_chip(substream); struct sa11xx_uda1341 *chip = snd_pcm_substream_chip(substream);
snd_pcm_runtime_t *runtime = substream->runtime; struct snd_pcm_runtime *runtime = substream->runtime;
int stream_id = substream->pstr->stream; int stream_id = substream->pstr->stream;
int err; int err;
...@@ -774,9 +774,9 @@ static int snd_card_sa11xx_uda1341_open(snd_pcm_substream_t * substream) ...@@ -774,9 +774,9 @@ static int snd_card_sa11xx_uda1341_open(snd_pcm_substream_t * substream)
return 0; return 0;
} }
static int snd_card_sa11xx_uda1341_close(snd_pcm_substream_t * substream) static int snd_card_sa11xx_uda1341_close(struct snd_pcm_substream *substream)
{ {
sa11xx_uda1341_t *chip = snd_pcm_substream_chip(substream); struct sa11xx_uda1341 *chip = snd_pcm_substream_chip(substream);
chip->s[substream->pstr->stream].stream = NULL; chip->s[substream->pstr->stream].stream = NULL;
return 0; return 0;
...@@ -784,21 +784,21 @@ static int snd_card_sa11xx_uda1341_close(snd_pcm_substream_t * substream) ...@@ -784,21 +784,21 @@ static int snd_card_sa11xx_uda1341_close(snd_pcm_substream_t * substream)
/* {{{ HW params & free */ /* {{{ HW params & free */
static int snd_sa11xx_uda1341_hw_params(snd_pcm_substream_t * substream, static int snd_sa11xx_uda1341_hw_params(struct snd_pcm_substream *substream,
snd_pcm_hw_params_t * hw_params) struct snd_pcm_hw_params *hw_params)
{ {
return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
} }
static int snd_sa11xx_uda1341_hw_free(snd_pcm_substream_t * substream) static int snd_sa11xx_uda1341_hw_free(struct snd_pcm_substream *substream)
{ {
return snd_pcm_lib_free_pages(substream); return snd_pcm_lib_free_pages(substream);
} }
/* }}} */ /* }}} */
static snd_pcm_ops_t snd_card_sa11xx_uda1341_playback_ops = { static struct snd_pcm_ops snd_card_sa11xx_uda1341_playback_ops = {
.open = snd_card_sa11xx_uda1341_open, .open = snd_card_sa11xx_uda1341_open,
.close = snd_card_sa11xx_uda1341_close, .close = snd_card_sa11xx_uda1341_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
...@@ -809,7 +809,7 @@ static snd_pcm_ops_t snd_card_sa11xx_uda1341_playback_ops = { ...@@ -809,7 +809,7 @@ static snd_pcm_ops_t snd_card_sa11xx_uda1341_playback_ops = {
.pointer = snd_sa11xx_uda1341_pointer, .pointer = snd_sa11xx_uda1341_pointer,
}; };
static snd_pcm_ops_t snd_card_sa11xx_uda1341_capture_ops = { static struct snd_pcm_ops snd_card_sa11xx_uda1341_capture_ops = {
.open = snd_card_sa11xx_uda1341_open, .open = snd_card_sa11xx_uda1341_open,
.close = snd_card_sa11xx_uda1341_close, .close = snd_card_sa11xx_uda1341_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
...@@ -820,9 +820,9 @@ static snd_pcm_ops_t snd_card_sa11xx_uda1341_capture_ops = { ...@@ -820,9 +820,9 @@ static snd_pcm_ops_t snd_card_sa11xx_uda1341_capture_ops = {
.pointer = snd_sa11xx_uda1341_pointer, .pointer = snd_sa11xx_uda1341_pointer,
}; };
static int __init snd_card_sa11xx_uda1341_pcm(sa11xx_uda1341_t *sa11xx_uda1341, int device) static int __init snd_card_sa11xx_uda1341_pcm(struct sa11xx_uda1341 *sa11xx_uda1341, int device)
{ {
snd_pcm_t *pcm; struct snd_pcm *pcm;
int err; int err;
if ((err = snd_pcm_new(sa11xx_uda1341->card, "UDA1341 PCM", device, 1, 1, &pcm)) < 0) if ((err = snd_pcm_new(sa11xx_uda1341->card, "UDA1341 PCM", device, 1, 1, &pcm)) < 0)
...@@ -860,9 +860,9 @@ static int __init snd_card_sa11xx_uda1341_pcm(sa11xx_uda1341_t *sa11xx_uda1341, ...@@ -860,9 +860,9 @@ static int __init snd_card_sa11xx_uda1341_pcm(sa11xx_uda1341_t *sa11xx_uda1341,
#ifdef CONFIG_PM #ifdef CONFIG_PM
static int snd_sa11xx_uda1341_suspend(snd_card_t *card, pm_message_t state) static int snd_sa11xx_uda1341_suspend(struct snd_card *card, pm_message_t state)
{ {
sa11xx_uda1341_t *chip = card->pm_private_data; struct sa11xx_uda1341 *chip = card->pm_private_data;
snd_pcm_suspend_all(chip->pcm); snd_pcm_suspend_all(chip->pcm);
#ifdef HH_VERSION #ifdef HH_VERSION
...@@ -876,9 +876,9 @@ static int snd_sa11xx_uda1341_suspend(snd_card_t *card, pm_message_t state) ...@@ -876,9 +876,9 @@ static int snd_sa11xx_uda1341_suspend(snd_card_t *card, pm_message_t state)
return 0; return 0;
} }
static int snd_sa11xx_uda1341_resume(snd_card_t *card) static int snd_sa11xx_uda1341_resume(struct snd_card *card)
{ {
sa11xx_uda1341_t *chip = card->pm_private_data; struct sa11xx_uda1341 *chip = card->pm_private_data;
sa11xx_uda1341_audio_init(chip); sa11xx_uda1341_audio_init(chip);
l3_command(chip->uda1341, CMD_RESUME, NULL); l3_command(chip->uda1341, CMD_RESUME, NULL);
...@@ -892,33 +892,30 @@ static int snd_sa11xx_uda1341_resume(snd_card_t *card) ...@@ -892,33 +892,30 @@ static int snd_sa11xx_uda1341_resume(snd_card_t *card)
} }
#endif /* COMFIG_PM */ #endif /* COMFIG_PM */
void snd_sa11xx_uda1341_free(snd_card_t *card) void snd_sa11xx_uda1341_free(struct snd_card *card)
{ {
sa11xx_uda1341_t *chip = card->private_data; struct sa11xx_uda1341 *chip = card->private_data;
audio_dma_free(&chip->s[SNDRV_PCM_STREAM_PLAYBACK]); audio_dma_free(&chip->s[SNDRV_PCM_STREAM_PLAYBACK]);
audio_dma_free(&chip->s[SNDRV_PCM_STREAM_CAPTURE]); audio_dma_free(&chip->s[SNDRV_PCM_STREAM_CAPTURE]);
} }
static snd_card_t *sa11xx_uda1341_card; static struct snd_card *sa11xx_uda1341_card;
static int __init sa11xx_uda1341_init(void) static int __init sa11xx_uda1341_init(void)
{ {
int err; int err;
snd_card_t *card; struct snd_card *card;
sa11xx_uda1341_t *chip; struct sa11xx_uda1341 *chip;
if (!machine_is_h3xxx()) if (!machine_is_h3xxx())
return -ENODEV; return -ENODEV;
/* register the soundcard */ /* register the soundcard */
card = snd_card_new(-1, id, THIS_MODULE, sizeof(sa11xx_uda1341_t)); card = snd_card_new(-1, id, THIS_MODULE, sizeof(struct sa11xx_uda1341));
if (card == NULL) if (card == NULL)
return -ENOMEM; return -ENOMEM;
sa11xx_uda1341 = kzalloc(sizeof(*sa11xx_uda1341), GFP_KERNEL);
if (sa11xx_uda1341 == NULL)
return -ENOMEM;
card->private_free = snd_sa11xx_uda1341_free; card->private_free = snd_sa11xx_uda1341_free;
chip = card->private_data; chip = card->private_data;
spin_lock_init(&chip->s[0].dma_lock); spin_lock_init(&chip->s[0].dma_lock);
...@@ -928,7 +925,7 @@ static int __init sa11xx_uda1341_init(void) ...@@ -928,7 +925,7 @@ static int __init sa11xx_uda1341_init(void)
chip->samplerate = AUDIO_RATE_DEFAULT; chip->samplerate = AUDIO_RATE_DEFAULT;
// mixer // mixer
if ((err = snd_chip_uda1341_mixer_new(chip->card, &sa11xx_uda1341->uda1341))) if ((err = snd_chip_uda1341_mixer_new(card, &chip->uda1341)))
goto nodev; goto nodev;
// PCM // PCM
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment