dect
/
linux-2.6
Archived
13
0
Fork 0

[ALSA] Remove xxx_t typedefs: PARISC Harmony

Modules: PARISC Harmony driver

Remove xxx_t typedefs from the PARIC Harmony driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2005-11-17 15:12:11 +01:00 committed by Jaroslav Kysela
parent 475675d693
commit 67b1020d88
2 changed files with 91 additions and 92 deletions

View File

@ -99,32 +99,32 @@ static unsigned int rate_bits[14] = {
HARMONY_SR_44KHZ, HARMONY_SR_48KHZ HARMONY_SR_44KHZ, HARMONY_SR_48KHZ
}; };
static snd_pcm_hw_constraint_list_t hw_constraint_rates = { static struct snd_pcm_hw_constraint_list hw_constraint_rates = {
.count = ARRAY_SIZE(snd_harmony_rates), .count = ARRAY_SIZE(snd_harmony_rates),
.list = snd_harmony_rates, .list = snd_harmony_rates,
.mask = 0, .mask = 0,
}; };
inline unsigned long static inline unsigned long
harmony_read(harmony_t *h, unsigned r) harmony_read(struct snd_harmony *h, unsigned r)
{ {
return __raw_readl(h->iobase + r); return __raw_readl(h->iobase + r);
} }
inline void static inline void
harmony_write(harmony_t *h, unsigned r, unsigned long v) harmony_write(struct snd_harmony *h, unsigned r, unsigned long v)
{ {
__raw_writel(v, h->iobase + r); __raw_writel(v, h->iobase + r);
} }
static void static inline void
harmony_wait_for_control(harmony_t *h) harmony_wait_for_control(struct snd_harmony *h)
{ {
while (harmony_read(h, HARMONY_CNTL) & HARMONY_CNTL_C) ; while (harmony_read(h, HARMONY_CNTL) & HARMONY_CNTL_C) ;
} }
inline void static inline void
harmony_reset(harmony_t *h) harmony_reset(struct snd_harmony *h)
{ {
harmony_write(h, HARMONY_RESET, 1); harmony_write(h, HARMONY_RESET, 1);
mdelay(50); mdelay(50);
@ -132,7 +132,7 @@ harmony_reset(harmony_t *h)
} }
static void static void
harmony_disable_interrupts(harmony_t *h) harmony_disable_interrupts(struct snd_harmony *h)
{ {
u32 dstatus; u32 dstatus;
harmony_wait_for_control(h); harmony_wait_for_control(h);
@ -142,7 +142,7 @@ harmony_disable_interrupts(harmony_t *h)
} }
static void static void
harmony_enable_interrupts(harmony_t *h) harmony_enable_interrupts(struct snd_harmony *h)
{ {
u32 dstatus; u32 dstatus;
harmony_wait_for_control(h); harmony_wait_for_control(h);
@ -152,7 +152,7 @@ harmony_enable_interrupts(harmony_t *h)
} }
static void static void
harmony_mute(harmony_t *h) harmony_mute(struct snd_harmony *h)
{ {
unsigned long flags; unsigned long flags;
@ -163,7 +163,7 @@ harmony_mute(harmony_t *h)
} }
static void static void
harmony_unmute(harmony_t *h) harmony_unmute(struct snd_harmony *h)
{ {
unsigned long flags; unsigned long flags;
@ -174,7 +174,7 @@ harmony_unmute(harmony_t *h)
} }
static void static void
harmony_set_control(harmony_t *h) harmony_set_control(struct snd_harmony *h)
{ {
u32 ctrl; u32 ctrl;
unsigned long flags; unsigned long flags;
@ -196,7 +196,7 @@ static irqreturn_t
snd_harmony_interrupt(int irq, void *dev, struct pt_regs *regs) snd_harmony_interrupt(int irq, void *dev, struct pt_regs *regs)
{ {
u32 dstatus; u32 dstatus;
harmony_t *h = dev; struct snd_harmony *h = dev;
spin_lock(&h->lock); spin_lock(&h->lock);
harmony_disable_interrupts(h); harmony_disable_interrupts(h);
@ -261,7 +261,7 @@ snd_harmony_rate_bits(int rate)
return HARMONY_SR_44KHZ; return HARMONY_SR_44KHZ;
} }
static snd_pcm_hardware_t snd_harmony_playback = static struct snd_pcm_hardware snd_harmony_playback =
{ {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_JOINT_DUPLEX | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_JOINT_DUPLEX | SNDRV_PCM_INFO_MMAP_VALID |
@ -282,7 +282,7 @@ static snd_pcm_hardware_t snd_harmony_playback =
.fifo_size = 0, .fifo_size = 0,
}; };
static snd_pcm_hardware_t snd_harmony_capture = static struct snd_pcm_hardware snd_harmony_capture =
{ {
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_JOINT_DUPLEX | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_JOINT_DUPLEX | SNDRV_PCM_INFO_MMAP_VALID |
@ -304,9 +304,9 @@ static snd_pcm_hardware_t snd_harmony_capture =
}; };
static int static int
snd_harmony_playback_trigger(snd_pcm_substream_t *ss, int cmd) snd_harmony_playback_trigger(struct snd_pcm_substream *ss, int cmd)
{ {
harmony_t *h = snd_pcm_substream_chip(ss); struct snd_harmony *h = snd_pcm_substream_chip(ss);
if (h->st.capturing) if (h->st.capturing)
return -EBUSY; return -EBUSY;
@ -340,9 +340,9 @@ snd_harmony_playback_trigger(snd_pcm_substream_t *ss, int cmd)
} }
static int static int
snd_harmony_capture_trigger(snd_pcm_substream_t *ss, int cmd) snd_harmony_capture_trigger(struct snd_pcm_substream *ss, int cmd)
{ {
harmony_t *h = snd_pcm_substream_chip(ss); struct snd_harmony *h = snd_pcm_substream_chip(ss);
if (h->st.playing) if (h->st.playing)
return -EBUSY; return -EBUSY;
@ -376,7 +376,7 @@ snd_harmony_capture_trigger(snd_pcm_substream_t *ss, int cmd)
} }
static int static int
snd_harmony_set_data_format(harmony_t *h, int fmt, int force) snd_harmony_set_data_format(struct snd_harmony *h, int fmt, int force)
{ {
int o = h->st.format; int o = h->st.format;
int n; int n;
@ -406,10 +406,10 @@ snd_harmony_set_data_format(harmony_t *h, int fmt, int force)
} }
static int static int
snd_harmony_playback_prepare(snd_pcm_substream_t *ss) snd_harmony_playback_prepare(struct snd_pcm_substream *ss)
{ {
harmony_t *h = snd_pcm_substream_chip(ss); struct snd_harmony *h = snd_pcm_substream_chip(ss);
snd_pcm_runtime_t *rt = ss->runtime; struct snd_pcm_runtime *rt = ss->runtime;
if (h->st.capturing) if (h->st.capturing)
return -EBUSY; return -EBUSY;
@ -436,10 +436,10 @@ snd_harmony_playback_prepare(snd_pcm_substream_t *ss)
} }
static int static int
snd_harmony_capture_prepare(snd_pcm_substream_t *ss) snd_harmony_capture_prepare(struct snd_pcm_substream *ss)
{ {
harmony_t *h = snd_pcm_substream_chip(ss); struct snd_harmony *h = snd_pcm_substream_chip(ss);
snd_pcm_runtime_t *rt = ss->runtime; struct snd_pcm_runtime *rt = ss->runtime;
if (h->st.playing) if (h->st.playing)
return -EBUSY; return -EBUSY;
@ -466,10 +466,10 @@ snd_harmony_capture_prepare(snd_pcm_substream_t *ss)
} }
static snd_pcm_uframes_t static snd_pcm_uframes_t
snd_harmony_playback_pointer(snd_pcm_substream_t *ss) snd_harmony_playback_pointer(struct snd_pcm_substream *ss)
{ {
snd_pcm_runtime_t *rt = ss->runtime; struct snd_pcm_runtime *rt = ss->runtime;
harmony_t *h = snd_pcm_substream_chip(ss); struct snd_harmony *h = snd_pcm_substream_chip(ss);
unsigned long pcuradd; unsigned long pcuradd;
unsigned long played; unsigned long played;
@ -495,10 +495,10 @@ snd_harmony_playback_pointer(snd_pcm_substream_t *ss)
} }
static snd_pcm_uframes_t static snd_pcm_uframes_t
snd_harmony_capture_pointer(snd_pcm_substream_t *ss) snd_harmony_capture_pointer(struct snd_pcm_substream *ss)
{ {
snd_pcm_runtime_t *rt = ss->runtime; struct snd_pcm_runtime *rt = ss->runtime;
harmony_t *h = snd_pcm_substream_chip(ss); struct snd_harmony *h = snd_pcm_substream_chip(ss);
unsigned long rcuradd; unsigned long rcuradd;
unsigned long caught; unsigned long caught;
@ -524,10 +524,10 @@ snd_harmony_capture_pointer(snd_pcm_substream_t *ss)
} }
static int static int
snd_harmony_playback_open(snd_pcm_substream_t *ss) snd_harmony_playback_open(struct snd_pcm_substream *ss)
{ {
harmony_t *h = snd_pcm_substream_chip(ss); struct snd_harmony *h = snd_pcm_substream_chip(ss);
snd_pcm_runtime_t *rt = ss->runtime; struct snd_pcm_runtime *rt = ss->runtime;
int err; int err;
h->psubs = ss; h->psubs = ss;
@ -543,10 +543,10 @@ snd_harmony_playback_open(snd_pcm_substream_t *ss)
} }
static int static int
snd_harmony_capture_open(snd_pcm_substream_t *ss) snd_harmony_capture_open(struct snd_pcm_substream *ss)
{ {
harmony_t *h = snd_pcm_substream_chip(ss); struct snd_harmony *h = snd_pcm_substream_chip(ss);
snd_pcm_runtime_t *rt = ss->runtime; struct snd_pcm_runtime *rt = ss->runtime;
int err; int err;
h->csubs = ss; h->csubs = ss;
@ -562,27 +562,27 @@ snd_harmony_capture_open(snd_pcm_substream_t *ss)
} }
static int static int
snd_harmony_playback_close(snd_pcm_substream_t *ss) snd_harmony_playback_close(struct snd_pcm_substream *ss)
{ {
harmony_t *h = snd_pcm_substream_chip(ss); struct snd_harmony *h = snd_pcm_substream_chip(ss);
h->psubs = NULL; h->psubs = NULL;
return 0; return 0;
} }
static int static int
snd_harmony_capture_close(snd_pcm_substream_t *ss) snd_harmony_capture_close(struct snd_pcm_substream *ss)
{ {
harmony_t *h = snd_pcm_substream_chip(ss); struct snd_harmony *h = snd_pcm_substream_chip(ss);
h->csubs = NULL; h->csubs = NULL;
return 0; return 0;
} }
static int static int
snd_harmony_hw_params(snd_pcm_substream_t *ss, snd_harmony_hw_params(struct snd_pcm_substream *ss,
snd_pcm_hw_params_t *hw) struct snd_pcm_hw_params *hw)
{ {
int err; int err;
harmony_t *h = snd_pcm_substream_chip(ss); struct snd_harmony *h = snd_pcm_substream_chip(ss);
err = snd_pcm_lib_malloc_pages(ss, params_buffer_bytes(hw)); err = snd_pcm_lib_malloc_pages(ss, params_buffer_bytes(hw));
if (err > 0 && h->dma.type == SNDRV_DMA_TYPE_CONTINUOUS) if (err > 0 && h->dma.type == SNDRV_DMA_TYPE_CONTINUOUS)
@ -592,12 +592,12 @@ snd_harmony_hw_params(snd_pcm_substream_t *ss,
} }
static int static int
snd_harmony_hw_free(snd_pcm_substream_t *ss) snd_harmony_hw_free(struct snd_pcm_substream *ss)
{ {
return snd_pcm_lib_free_pages(ss); return snd_pcm_lib_free_pages(ss);
} }
static snd_pcm_ops_t snd_harmony_playback_ops = { static struct snd_pcm_ops snd_harmony_playback_ops = {
.open = snd_harmony_playback_open, .open = snd_harmony_playback_open,
.close = snd_harmony_playback_close, .close = snd_harmony_playback_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
@ -608,7 +608,7 @@ static snd_pcm_ops_t snd_harmony_playback_ops = {
.pointer = snd_harmony_playback_pointer, .pointer = snd_harmony_playback_pointer,
}; };
static snd_pcm_ops_t snd_harmony_capture_ops = { static struct snd_pcm_ops snd_harmony_capture_ops = {
.open = snd_harmony_capture_open, .open = snd_harmony_capture_open,
.close = snd_harmony_capture_close, .close = snd_harmony_capture_close,
.ioctl = snd_pcm_lib_ioctl, .ioctl = snd_pcm_lib_ioctl,
@ -620,9 +620,9 @@ static snd_pcm_ops_t snd_harmony_capture_ops = {
}; };
static int static int
snd_harmony_pcm_init(harmony_t *h) snd_harmony_pcm_init(struct snd_harmony *h)
{ {
snd_pcm_t *pcm; struct snd_pcm *pcm;
int err; int err;
harmony_disable_interrupts(h); harmony_disable_interrupts(h);
@ -683,15 +683,15 @@ snd_harmony_pcm_init(harmony_t *h)
} }
static void static void
snd_harmony_set_new_gain(harmony_t *h) snd_harmony_set_new_gain(struct snd_harmony *h)
{ {
harmony_wait_for_control(h); harmony_wait_for_control(h);
harmony_write(h, HARMONY_GAINCTL, h->st.gain); harmony_write(h, HARMONY_GAINCTL, h->st.gain);
} }
static int static int
snd_harmony_mixercontrol_info(snd_kcontrol_t *kc, snd_harmony_mixercontrol_info(struct snd_kcontrol *kc,
snd_ctl_elem_info_t *uinfo) struct snd_ctl_elem_info *uinfo)
{ {
int mask = (kc->private_value >> 16) & 0xff; int mask = (kc->private_value >> 16) & 0xff;
int left_shift = (kc->private_value) & 0xff; int left_shift = (kc->private_value) & 0xff;
@ -707,10 +707,10 @@ snd_harmony_mixercontrol_info(snd_kcontrol_t *kc,
} }
static int static int
snd_harmony_volume_get(snd_kcontrol_t *kc, snd_harmony_volume_get(struct snd_kcontrol *kc,
snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
harmony_t *h = snd_kcontrol_chip(kc); struct snd_harmony *h = snd_kcontrol_chip(kc);
int shift_left = (kc->private_value) & 0xff; int shift_left = (kc->private_value) & 0xff;
int shift_right = (kc->private_value >> 8) & 0xff; int shift_right = (kc->private_value >> 8) & 0xff;
int mask = (kc->private_value >> 16) & 0xff; int mask = (kc->private_value >> 16) & 0xff;
@ -736,10 +736,10 @@ snd_harmony_volume_get(snd_kcontrol_t *kc,
} }
static int static int
snd_harmony_volume_put(snd_kcontrol_t *kc, snd_harmony_volume_put(struct snd_kcontrol *kc,
snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
harmony_t *h = snd_kcontrol_chip(kc); struct snd_harmony *h = snd_kcontrol_chip(kc);
int shift_left = (kc->private_value) & 0xff; int shift_left = (kc->private_value) & 0xff;
int shift_right = (kc->private_value >> 8) & 0xff; int shift_right = (kc->private_value >> 8) & 0xff;
int mask = (kc->private_value >> 16) & 0xff; int mask = (kc->private_value >> 16) & 0xff;
@ -771,8 +771,8 @@ snd_harmony_volume_put(snd_kcontrol_t *kc,
} }
static int static int
snd_harmony_captureroute_info(snd_kcontrol_t *kc, snd_harmony_captureroute_info(struct snd_kcontrol *kc,
snd_ctl_elem_info_t *uinfo) struct snd_ctl_elem_info *uinfo)
{ {
static char *texts[2] = { "Line", "Mic" }; static char *texts[2] = { "Line", "Mic" };
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
@ -786,10 +786,10 @@ snd_harmony_captureroute_info(snd_kcontrol_t *kc,
} }
static int static int
snd_harmony_captureroute_get(snd_kcontrol_t *kc, snd_harmony_captureroute_get(struct snd_kcontrol *kc,
snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
harmony_t *h = snd_kcontrol_chip(kc); struct snd_harmony *h = snd_kcontrol_chip(kc);
int value; int value;
spin_lock_irq(&h->mixer_lock); spin_lock_irq(&h->mixer_lock);
@ -803,10 +803,10 @@ snd_harmony_captureroute_get(snd_kcontrol_t *kc,
} }
static int static int
snd_harmony_captureroute_put(snd_kcontrol_t *kc, snd_harmony_captureroute_put(struct snd_kcontrol *kc,
snd_ctl_elem_value_t *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
harmony_t *h = snd_kcontrol_chip(kc); struct snd_harmony *h = snd_kcontrol_chip(kc);
int value; int value;
int old_gain = h->st.gain; int old_gain = h->st.gain;
@ -823,8 +823,7 @@ snd_harmony_captureroute_put(snd_kcontrol_t *kc,
return h->st.gain != old_gain; return h->st.gain != old_gain;
} }
#define HARMONY_CONTROLS (sizeof(snd_harmony_controls)/ \ #define HARMONY_CONTROLS ARRAY_SIZE(snd_harmony_controls)
sizeof(snd_kcontrol_new_t))
#define HARMONY_VOLUME(xname, left_shift, right_shift, mask, invert) \ #define HARMONY_VOLUME(xname, left_shift, right_shift, mask, invert) \
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
@ -833,7 +832,7 @@ snd_harmony_captureroute_put(snd_kcontrol_t *kc,
.private_value = ((left_shift) | ((right_shift) << 8) | \ .private_value = ((left_shift) | ((right_shift) << 8) | \
((mask) << 16) | ((invert) << 24)) } ((mask) << 16) | ((invert) << 24)) }
static snd_kcontrol_new_t snd_harmony_controls[] = { static struct snd_kcontrol_new snd_harmony_controls[] = {
HARMONY_VOLUME("Master Playback Volume", HARMONY_GAIN_LO_SHIFT, HARMONY_VOLUME("Master Playback Volume", HARMONY_GAIN_LO_SHIFT,
HARMONY_GAIN_RO_SHIFT, HARMONY_GAIN_OUT, 1), HARMONY_GAIN_RO_SHIFT, HARMONY_GAIN_OUT, 1),
HARMONY_VOLUME("Capture Volume", HARMONY_GAIN_LI_SHIFT, HARMONY_VOLUME("Capture Volume", HARMONY_GAIN_LI_SHIFT,
@ -856,7 +855,7 @@ static snd_kcontrol_new_t snd_harmony_controls[] = {
}; };
static void __init static void __init
snd_harmony_mixer_reset(harmony_t *h) snd_harmony_mixer_reset(struct snd_harmony *h)
{ {
harmony_mute(h); harmony_mute(h);
harmony_reset(h); harmony_reset(h);
@ -865,9 +864,9 @@ snd_harmony_mixer_reset(harmony_t *h)
} }
static int __init static int __init
snd_harmony_mixer_init(harmony_t *h) snd_harmony_mixer_init(struct snd_harmony *h)
{ {
snd_card_t *card = h->card; struct snd_card *card = h->card;
int idx, err; int idx, err;
snd_assert(h != NULL, return -EINVAL); snd_assert(h != NULL, return -EINVAL);
@ -886,7 +885,7 @@ snd_harmony_mixer_init(harmony_t *h)
} }
static int static int
snd_harmony_free(harmony_t *h) snd_harmony_free(struct snd_harmony *h)
{ {
if (h->gdma.addr) if (h->gdma.addr)
snd_dma_free_pages(&h->gdma); snd_dma_free_pages(&h->gdma);
@ -906,20 +905,20 @@ snd_harmony_free(harmony_t *h)
} }
static int static int
snd_harmony_dev_free(snd_device_t *dev) snd_harmony_dev_free(struct snd_device *dev)
{ {
harmony_t *h = dev->device_data; struct snd_harmony *h = dev->device_data;
return snd_harmony_free(h); return snd_harmony_free(h);
} }
static int __devinit static int __devinit
snd_harmony_create(snd_card_t *card, snd_harmony_create(struct snd_card *card,
struct parisc_device *padev, struct parisc_device *padev,
harmony_t **rchip) struct snd_harmony **rchip)
{ {
int err; int err;
harmony_t *h; struct snd_harmony *h;
static snd_device_ops_t ops = { static struct snd_device_ops ops = {
.dev_free = snd_harmony_dev_free, .dev_free = snd_harmony_dev_free,
}; };
@ -973,8 +972,8 @@ static int __devinit
snd_harmony_probe(struct parisc_device *padev) snd_harmony_probe(struct parisc_device *padev)
{ {
int err; int err;
snd_card_t *card; struct snd_card *card;
harmony_t *h; struct snd_harmony *h;
card = snd_card_new(index, id, THIS_MODULE, 0); card = snd_card_new(index, id, THIS_MODULE, 0);
if (card == NULL) if (card == NULL)
@ -1033,7 +1032,7 @@ alsa_harmony_init(void)
static void __exit static void __exit
alsa_harmony_fini(void) alsa_harmony_fini(void)
{ {
return unregister_parisc_driver(&snd_harmony_driver); unregister_parisc_driver(&snd_harmony_driver);
} }
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");

View File

@ -13,7 +13,7 @@ struct harmony_buffer {
int coherent; int coherent;
}; };
typedef struct snd_card_harmony { struct snd_harmony {
int irq; int irq;
unsigned long hpa; /* hard physical address */ unsigned long hpa; /* hard physical address */
@ -44,15 +44,15 @@ typedef struct snd_card_harmony {
unsigned long silence_intr; unsigned long silence_intr;
} stats; } stats;
snd_pcm_t *pcm; struct snd_pcm *pcm;
snd_card_t *card; struct snd_card *card;
snd_pcm_substream_t *psubs; struct snd_pcm_substream *psubs;
snd_pcm_substream_t *csubs; struct snd_pcm_substream *csubs;
snd_info_entry_t *proc; struct snd_info_entry *proc;
spinlock_t lock; spinlock_t lock;
spinlock_t mixer_lock; spinlock_t mixer_lock;
} harmony_t; };
#define MAX_PCM_DEVICES 1 #define MAX_PCM_DEVICES 1
#define MAX_PCM_SUBSTREAMS 4 #define MAX_PCM_SUBSTREAMS 4