From 0948e3c8bb187b3dea38be1e1ffd1797866014f1 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 10:25:22 +0100 Subject: [ALSA] Clean up sa11xx-uda1341 driver Modules: SA11xx UDA1341 driver,L3 drivers,UDA1341 Clean up sa11xx-uda1341 driver: - Fix buggy destructor - Remove the global variable - Move array definitions from uda1341.h - Make functions in uda1341.c static Signed-off-by: Takashi Iwai --- sound/arm/sa11xx-uda1341.c | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'sound/arm') diff --git a/sound/arm/sa11xx-uda1341.c b/sound/arm/sa11xx-uda1341.c index 6ee912259cc5..97dffcc3f75f 100644 --- a/sound/arm/sa11xx-uda1341.c +++ b/sound/arm/sa11xx-uda1341.c @@ -21,7 +21,7 @@ * merged HAL layer (patches from Brian) */ -/* $Id: sa11xx-uda1341.c,v 1.23 2005/09/09 13:22:34 tiwai Exp $ */ +/* $Id: sa11xx-uda1341.c,v 1.24 2005/11/17 10:25:22 tiwai Exp $ */ /*************************************************************************************************** * @@ -141,8 +141,6 @@ typedef struct snd_card_sa11xx_uda1341 { audio_stream_t s[2]; /* playback & capture */ } sa11xx_uda1341_t; -static struct snd_card_sa11xx_uda1341 *sa11xx_uda1341 = NULL; - static unsigned int rates[] = { 8000, 10666, 10985, 14647, 16000, 21970, 22050, 24000, @@ -411,8 +409,8 @@ static int audio_dma_request(audio_stream_t *s, void (*callback)(void *)) static void audio_dma_free(audio_stream_t *s) { - sa1100_free_dma((s)->dma_regs); - (s)->dma_regs = 0; + sa1100_free_dma(s->dma_regs); + s->dma_regs = 0; } #endif @@ -835,8 +833,8 @@ static int __init snd_card_sa11xx_uda1341_pcm(sa11xx_uda1341_t *sa11xx_uda1341, * isa works but I'm not sure why (or if) it's the right choice * this may be too large, trying it for now */ - snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_ISA, - snd_pcm_dma_flags(0), + snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, + snd_dma_isa_data(), 64*1024, 64*1024); snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_card_sa11xx_uda1341_playback_ops); @@ -900,15 +898,15 @@ void snd_sa11xx_uda1341_free(snd_card_t *card) audio_dma_free(&chip->s[SNDRV_PCM_STREAM_PLAYBACK]); audio_dma_free(&chip->s[SNDRV_PCM_STREAM_CAPTURE]); - sa11xx_uda1341 = NULL; - card->private_data = NULL; - kfree(chip); } +static snd_card_t *sa11xx_uda1341_card; + static int __init sa11xx_uda1341_init(void) { int err; snd_card_t *card; + sa11xx_uda1341_t *chip; if (!machine_is_h3xxx()) return -ENODEV; @@ -921,26 +919,25 @@ static int __init sa11xx_uda1341_init(void) sa11xx_uda1341 = kzalloc(sizeof(*sa11xx_uda1341), GFP_KERNEL); if (sa11xx_uda1341 == NULL) return -ENOMEM; + card->private_free = snd_sa11xx_uda1341_free; + chip = card->private_data; spin_lock_init(&chip->s[0].dma_lock); spin_lock_init(&chip->s[1].dma_lock); - card->private_data = (void *)sa11xx_uda1341; - card->private_free = snd_sa11xx_uda1341_free; - - sa11xx_uda1341->card = card; - sa11xx_uda1341->samplerate = AUDIO_RATE_DEFAULT; + chip->card = card; + chip->samplerate = AUDIO_RATE_DEFAULT; // mixer - if ((err = snd_chip_uda1341_mixer_new(sa11xx_uda1341->card, &sa11xx_uda1341->uda1341))) + if ((err = snd_chip_uda1341_mixer_new(chip->card, &sa11xx_uda1341->uda1341))) goto nodev; // PCM - if ((err = snd_card_sa11xx_uda1341_pcm(sa11xx_uda1341, 0)) < 0) + if ((err = snd_card_sa11xx_uda1341_pcm(chip, 0)) < 0) goto nodev; snd_card_set_generic_pm_callback(card, - snd_sa11xx_uda1341_suspend, snd_sa11_uda1341_resume, - sa11xx_uda1341); + snd_sa11xx_uda1341_suspend, snd_sa11_uda1341_resume, + chip); strcpy(card->driver, "UDA1341"); strcpy(card->shortname, "H3600 UDA1341TS"); @@ -951,6 +948,7 @@ static int __init sa11xx_uda1341_init(void) if ((err = snd_card_register(card)) == 0) { printk( KERN_INFO "iPAQ audio support initialized\n" ); + sa11xx_uda1341_card = card; return 0; } @@ -961,7 +959,7 @@ static int __init sa11xx_uda1341_init(void) static void __exit sa11xx_uda1341_exit(void) { - snd_card_free(sa11xx_uda1341->card); + snd_card_free(sa11xx_uda1341_card); } module_init(sa11xx_uda1341_init); -- cgit v1.2.2 From ceb9e476c89f50e9ba7de914bbec2c05e9647915 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 15:10:16 +0100 Subject: [ALSA] Remove xxx_t typedefs: ARM AACI Modules: ARM AACI PL041 driver,ARM DMA routines Remove xxx_t typedefs from the ARM AACI driver. Signed-off-by: Takashi Iwai --- sound/arm/aaci.c | 72 +++++++++++++++++++++++++++--------------------------- sound/arm/aaci.h | 6 ++--- sound/arm/devdma.c | 12 ++++----- sound/arm/devdma.h | 6 ++--- 4 files changed, 48 insertions(+), 48 deletions(-) (limited to 'sound/arm') diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index 559ead6367da..691f6dd81c30 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c @@ -40,7 +40,7 @@ */ #undef CONFIG_PM -static void aaci_ac97_select_codec(struct aaci *aaci, ac97_t *ac97) +static void aaci_ac97_select_codec(struct aaci *aaci, struct snd_ac97 *ac97) { u32 v, maincr = aaci->maincr | MAINCR_SCRA(ac97->num); @@ -65,7 +65,7 @@ static void aaci_ac97_select_codec(struct aaci *aaci, ac97_t *ac97) * SI1TxEn, SI2TxEn and SI12TxEn bits are set in the AACI_MAINCR * register. */ -static void aaci_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short val) +static void aaci_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val) { struct aaci *aaci = ac97->private_data; u32 v; @@ -97,7 +97,7 @@ static void aaci_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short val /* * Read an AC'97 register. */ -static unsigned short aaci_ac97_read(ac97_t *ac97, unsigned short reg) +static unsigned short aaci_ac97_read(struct snd_ac97 *ac97, unsigned short reg) { struct aaci *aaci = ac97->private_data; u32 v; @@ -284,11 +284,11 @@ static unsigned int rate_list[] = { * (unimplemented) */ static int -aaci_rule_rate_by_channels(snd_pcm_hw_params_t *p, snd_pcm_hw_rule_t *rule) +aaci_rule_rate_by_channels(struct snd_pcm_hw_params *p, struct snd_pcm_hw_rule *rule) { struct aaci *aaci = rule->private; unsigned int rate_mask = SNDRV_PCM_RATE_8000_48000|SNDRV_PCM_RATE_5512; - snd_interval_t *c = hw_param_interval(p, SNDRV_PCM_HW_PARAM_CHANNELS); + struct snd_interval *c = hw_param_interval(p, SNDRV_PCM_HW_PARAM_CHANNELS); switch (c->max) { case 6: @@ -304,7 +304,7 @@ aaci_rule_rate_by_channels(snd_pcm_hw_params_t *p, snd_pcm_hw_rule_t *rule) rate_mask); } -static snd_pcm_hardware_t aaci_hw_info = { +static struct snd_pcm_hardware aaci_hw_info = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_INTERLEAVED | @@ -330,10 +330,10 @@ static snd_pcm_hardware_t aaci_hw_info = { .periods_max = PAGE_SIZE / 16, }; -static int aaci_pcm_open(struct aaci *aaci, snd_pcm_substream_t *substream, +static int aaci_pcm_open(struct aaci *aaci, struct snd_pcm_substream *substream, struct aaci_runtime *aacirun) { - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_pcm_runtime *runtime = substream->runtime; int ret; aacirun->substream = substream; @@ -375,7 +375,7 @@ static int aaci_pcm_open(struct aaci *aaci, snd_pcm_substream_t *substream, /* * Common ALSA stuff */ -static int aaci_pcm_close(snd_pcm_substream_t *substream) +static int aaci_pcm_close(struct snd_pcm_substream *substream) { struct aaci *aaci = substream->private_data; struct aaci_runtime *aacirun = substream->runtime->private_data; @@ -388,7 +388,7 @@ static int aaci_pcm_close(snd_pcm_substream_t *substream) return 0; } -static int aaci_pcm_hw_free(snd_pcm_substream_t *substream) +static int aaci_pcm_hw_free(struct snd_pcm_substream *substream) { struct aaci_runtime *aacirun = substream->runtime->private_data; @@ -409,9 +409,9 @@ static int aaci_pcm_hw_free(snd_pcm_substream_t *substream) return 0; } -static int aaci_pcm_hw_params(snd_pcm_substream_t *substream, +static int aaci_pcm_hw_params(struct snd_pcm_substream *substream, struct aaci_runtime *aacirun, - snd_pcm_hw_params_t *params) + struct snd_pcm_hw_params *params) { int err; @@ -434,9 +434,9 @@ static int aaci_pcm_hw_params(snd_pcm_substream_t *substream, return err; } -static int aaci_pcm_prepare(snd_pcm_substream_t *substream) +static int aaci_pcm_prepare(struct snd_pcm_substream *substream) { - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_pcm_runtime *runtime = substream->runtime; struct aaci_runtime *aacirun = runtime->private_data; aacirun->start = (void *)runtime->dma_area; @@ -448,16 +448,16 @@ static int aaci_pcm_prepare(snd_pcm_substream_t *substream) return 0; } -static snd_pcm_uframes_t aaci_pcm_pointer(snd_pcm_substream_t *substream) +static snd_pcm_uframes_t aaci_pcm_pointer(struct snd_pcm_substream *substream) { - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_pcm_runtime *runtime = substream->runtime; struct aaci_runtime *aacirun = runtime->private_data; ssize_t bytes = aacirun->ptr - aacirun->start; return bytes_to_frames(runtime, bytes); } -static int aaci_pcm_mmap(snd_pcm_substream_t *substream, struct vm_area_struct *vma) +static int aaci_pcm_mmap(struct snd_pcm_substream *substream, struct vm_area_struct *vma) { return devdma_mmap(NULL, substream, vma); } @@ -484,7 +484,7 @@ static const u32 channels_to_txmask[] = { static unsigned int channel_list[] = { 2, 4, 6 }; static int -aaci_rule_channels(snd_pcm_hw_params_t *p, snd_pcm_hw_rule_t *rule) +aaci_rule_channels(struct snd_pcm_hw_params *p, struct snd_pcm_hw_rule *rule) { struct aaci *aaci = rule->private; unsigned int chan_mask = 1 << 0, slots; @@ -504,7 +504,7 @@ aaci_rule_channels(snd_pcm_hw_params_t *p, snd_pcm_hw_rule_t *rule) chan_mask); } -static int aaci_pcm_playback_open(snd_pcm_substream_t *substream) +static int aaci_pcm_playback_open(struct snd_pcm_substream *substream) { struct aaci *aaci = substream->private_data; int ret; @@ -522,8 +522,8 @@ static int aaci_pcm_playback_open(snd_pcm_substream_t *substream) return aaci_pcm_open(aaci, substream, &aaci->playback); } -static int aaci_pcm_playback_hw_params(snd_pcm_substream_t *substream, - snd_pcm_hw_params_t *params) +static int aaci_pcm_playback_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) { struct aaci *aaci = substream->private_data; struct aaci_runtime *aacirun = substream->runtime->private_data; @@ -575,7 +575,7 @@ static void aaci_pcm_playback_start(struct aaci_runtime *aacirun) writel(aacirun->cr, aacirun->base + AACI_TXCR); } -static int aaci_pcm_playback_trigger(snd_pcm_substream_t *substream, int cmd) +static int aaci_pcm_playback_trigger(struct snd_pcm_substream *substream, int cmd) { struct aaci *aaci = substream->private_data; struct aaci_runtime *aacirun = substream->runtime->private_data; @@ -614,7 +614,7 @@ static int aaci_pcm_playback_trigger(snd_pcm_substream_t *substream, int cmd) return ret; } -static snd_pcm_ops_t aaci_playback_ops = { +static struct snd_pcm_ops aaci_playback_ops = { .open = aaci_pcm_playback_open, .close = aaci_pcm_close, .ioctl = snd_pcm_lib_ioctl, @@ -632,7 +632,7 @@ static snd_pcm_ops_t aaci_playback_ops = { * Power Management. */ #ifdef CONFIG_PM -static int aaci_do_suspend(snd_card_t *card, unsigned int state) +static int aaci_do_suspend(struct snd_card *card, unsigned int state) { struct aaci *aaci = card->private_data; if (aaci->card->power_state != SNDRV_CTL_POWER_D3cold) { @@ -642,7 +642,7 @@ static int aaci_do_suspend(snd_card_t *card, unsigned int state) return 0; } -static int aaci_do_resume(snd_card_t *card, unsigned int state) +static int aaci_do_resume(struct snd_card *card, unsigned int state) { struct aaci *aaci = card->private_data; if (aaci->card->power_state != SNDRV_CTL_POWER_D0) { @@ -653,13 +653,13 @@ static int aaci_do_resume(snd_card_t *card, unsigned int state) static int aaci_suspend(struct amba_device *dev, pm_message_t state) { - snd_card_t *card = amba_get_drvdata(dev); + struct snd_card *card = amba_get_drvdata(dev); return card ? aaci_do_suspend(card) : 0; } static int aaci_resume(struct amba_device *dev) { - snd_card_t *card = amba_get_drvdata(dev); + struct snd_card *card = amba_get_drvdata(dev); return card ? aaci_do_resume(card) : 0; } #else @@ -705,16 +705,16 @@ static struct ac97_pcm ac97_defs[] __devinitdata = { } }; -static ac97_bus_ops_t aaci_bus_ops = { +static struct snd_ac97_bus_ops aaci_bus_ops = { .write = aaci_ac97_write, .read = aaci_ac97_read, }; static int __devinit aaci_probe_ac97(struct aaci *aaci) { - ac97_template_t ac97_template; - ac97_bus_t *ac97_bus; - ac97_t *ac97; + struct snd_ac97_template ac97_template; + struct snd_ac97_bus *ac97_bus; + struct snd_ac97 *ac97; int ret; /* @@ -737,7 +737,7 @@ static int __devinit aaci_probe_ac97(struct aaci *aaci) ac97_bus->clock = 48000; aaci->ac97_bus = ac97_bus; - memset(&ac97_template, 0, sizeof(ac97_template_t)); + memset(&ac97_template, 0, sizeof(struct snd_ac97_template)); ac97_template.private_data = aaci; ac97_template.num = 0; ac97_template.scaps = AC97_SCAP_SKIP_MODEM; @@ -762,7 +762,7 @@ static int __devinit aaci_probe_ac97(struct aaci *aaci) return ret; } -static void aaci_free_card(snd_card_t *card) +static void aaci_free_card(struct snd_card *card) { struct aaci *aaci = card->private_data; if (aaci->base) @@ -772,7 +772,7 @@ static void aaci_free_card(snd_card_t *card) static struct aaci * __devinit aaci_init_card(struct amba_device *dev) { struct aaci *aaci; - snd_card_t *card; + struct snd_card *card; card = snd_card_new(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, THIS_MODULE, sizeof(struct aaci)); @@ -803,7 +803,7 @@ static struct aaci * __devinit aaci_init_card(struct amba_device *dev) static int __devinit aaci_init_pcm(struct aaci *aaci) { - snd_pcm_t *pcm; + struct snd_pcm *pcm; int ret; ret = snd_pcm_new(aaci->card, "AACI AC'97", 0, 1, 0, &pcm); @@ -920,7 +920,7 @@ static int __devinit aaci_probe(struct amba_device *dev, void *id) static int __devexit aaci_remove(struct amba_device *dev) { - snd_card_t *card = amba_get_drvdata(dev); + struct snd_card *card = amba_get_drvdata(dev); amba_set_drvdata(dev, NULL); diff --git a/sound/arm/aaci.h b/sound/arm/aaci.h index b2f969bc7845..83f73c2505c6 100644 --- a/sound/arm/aaci.h +++ b/sound/arm/aaci.h @@ -207,7 +207,7 @@ struct aaci_runtime { int pcm_open; u32 cr; - snd_pcm_substream_t *substream; + struct snd_pcm_substream *substream; /* * PIO support @@ -222,7 +222,7 @@ struct aaci_runtime { struct aaci { struct amba_device *dev; - snd_card_t *card; + struct snd_card *card; void __iomem *base; unsigned int fifosize; @@ -236,7 +236,7 @@ struct aaci { struct aaci_runtime playback; struct aaci_runtime capture; - snd_pcm_t *pcm; + struct snd_pcm *pcm; }; #define ACSTREAM_FRONT 0 diff --git a/sound/arm/devdma.c b/sound/arm/devdma.c index 60826a5324b4..ca3bf4ee05a3 100644 --- a/sound/arm/devdma.c +++ b/sound/arm/devdma.c @@ -18,9 +18,9 @@ #include "devdma.h" -void devdma_hw_free(struct device *dev, snd_pcm_substream_t *substream) +void devdma_hw_free(struct device *dev, struct snd_pcm_substream *substream) { - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_pcm_runtime *runtime = substream->runtime; struct snd_dma_buffer *buf = runtime->dma_buffer_p; if (runtime->dma_area == NULL) @@ -34,9 +34,9 @@ void devdma_hw_free(struct device *dev, snd_pcm_substream_t *substream) snd_pcm_set_runtime_buffer(substream, NULL); } -int devdma_hw_alloc(struct device *dev, snd_pcm_substream_t *substream, size_t size) +int devdma_hw_alloc(struct device *dev, struct snd_pcm_substream *substream, size_t size) { - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_pcm_runtime *runtime = substream->runtime; struct snd_dma_buffer *buf = runtime->dma_buffer_p; int ret = 0; @@ -74,8 +74,8 @@ int devdma_hw_alloc(struct device *dev, snd_pcm_substream_t *substream, size_t s return -ENOMEM; } -int devdma_mmap(struct device *dev, snd_pcm_substream_t *substream, struct vm_area_struct *vma) +int devdma_mmap(struct device *dev, struct snd_pcm_substream *substream, struct vm_area_struct *vma) { - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_pcm_runtime *runtime = substream->runtime; return dma_mmap_coherent(dev, vma, runtime->dma_area, runtime->dma_addr, runtime->dma_bytes); } diff --git a/sound/arm/devdma.h b/sound/arm/devdma.h index 5a33b6bacc34..d025329c8a0f 100644 --- a/sound/arm/devdma.h +++ b/sound/arm/devdma.h @@ -1,3 +1,3 @@ -void devdma_hw_free(struct device *dev, snd_pcm_substream_t *substream); -int devdma_hw_alloc(struct device *dev, snd_pcm_substream_t *substream, size_t size); -int devdma_mmap(struct device *dev, snd_pcm_substream_t *substream, struct vm_area_struct *vma); +void devdma_hw_free(struct device *dev, struct snd_pcm_substream *substream); +int devdma_hw_alloc(struct device *dev, struct snd_pcm_substream *substream, size_t size); +int devdma_mmap(struct device *dev, struct snd_pcm_substream *substream, struct vm_area_struct *vma); -- cgit v1.2.2 From d18f83764e376dea9e14a8ac53d1e14004fa9c13 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 15:10:38 +0100 Subject: [ALSA] Remove xxx_t typedefs: ARM PXA2xx Modules: ARM PXA2XX driver Remove xxx_t typedefs from the ARM PXA2xx driver. Signed-off-by: Takashi Iwai --- sound/arm/pxa2xx-ac97.c | 44 ++++++++++++++++++------------------ sound/arm/pxa2xx-pcm.c | 59 +++++++++++++++++++++++++------------------------ sound/arm/pxa2xx-pcm.h | 20 ++++++++--------- 3 files changed, 62 insertions(+), 61 deletions(-) (limited to 'sound/arm') diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c index c96c8a2aa1c2..d9efc37393ee 100644 --- a/sound/arm/pxa2xx-ac97.c +++ b/sound/arm/pxa2xx-ac97.c @@ -37,7 +37,7 @@ static DECLARE_MUTEX(car_mutex); static DECLARE_WAIT_QUEUE_HEAD(gsr_wq); static volatile long gsr_bits; -static unsigned short pxa2xx_ac97_read(ac97_t *ac97, unsigned short reg) +static unsigned short pxa2xx_ac97_read(struct snd_ac97 *ac97, unsigned short reg) { unsigned short val = -1; volatile u32 *reg_addr; @@ -75,7 +75,7 @@ out: up(&car_mutex); return val; } -static void pxa2xx_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short val) +static void pxa2xx_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val) { volatile u32 *reg_addr; @@ -99,7 +99,7 @@ static void pxa2xx_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short v out: up(&car_mutex); } -static void pxa2xx_ac97_reset(ac97_t *ac97) +static void pxa2xx_ac97_reset(struct snd_ac97 *ac97) { /* First, try cold reset */ GCR &= GCR_COLD_RST; /* clear everything but nCRST */ @@ -172,13 +172,13 @@ static irqreturn_t pxa2xx_ac97_irq(int irq, void *dev_id, struct pt_regs *regs) return IRQ_NONE; } -static ac97_bus_ops_t pxa2xx_ac97_ops = { +static struct snd_ac97_bus_ops pxa2xx_ac97_ops = { .read = pxa2xx_ac97_read, .write = pxa2xx_ac97_write, .reset = pxa2xx_ac97_reset, }; -static pxa2xx_pcm_dma_params_t pxa2xx_ac97_pcm_out = { +static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_out = { .name = "AC97 PCM out", .dev_addr = __PREG(PCDR), .drcmr = &DRCMRTXPCDR, @@ -186,7 +186,7 @@ static pxa2xx_pcm_dma_params_t pxa2xx_ac97_pcm_out = { DCMD_BURST32 | DCMD_WIDTH4, }; -static pxa2xx_pcm_dma_params_t pxa2xx_ac97_pcm_in = { +static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_in = { .name = "AC97 PCM in", .dev_addr = __PREG(PCDR), .drcmr = &DRCMRRXPCDR, @@ -194,12 +194,12 @@ static pxa2xx_pcm_dma_params_t pxa2xx_ac97_pcm_in = { DCMD_BURST32 | DCMD_WIDTH4, }; -static snd_pcm_t *pxa2xx_ac97_pcm; -static ac97_t *pxa2xx_ac97_ac97; +static struct snd_pcm *pxa2xx_ac97_pcm; +static struct snd_ac97 *pxa2xx_ac97_ac97; -static int pxa2xx_ac97_pcm_startup(snd_pcm_substream_t *substream) +static int pxa2xx_ac97_pcm_startup(struct snd_pcm_substream *substream) { - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_pcm_runtime *runtime = substream->runtime; pxa2xx_audio_ops_t *platform_ops; int r; @@ -218,7 +218,7 @@ static int pxa2xx_ac97_pcm_startup(snd_pcm_substream_t *substream) return 0; } -static void pxa2xx_ac97_pcm_shutdown(snd_pcm_substream_t *substream) +static void pxa2xx_ac97_pcm_shutdown(struct snd_pcm_substream *substream) { pxa2xx_audio_ops_t *platform_ops; @@ -227,15 +227,15 @@ static void pxa2xx_ac97_pcm_shutdown(snd_pcm_substream_t *substream) platform_ops->shutdown(substream, platform_ops->priv); } -static int pxa2xx_ac97_pcm_prepare(snd_pcm_substream_t *substream) +static int pxa2xx_ac97_pcm_prepare(struct snd_pcm_substream *substream) { - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_pcm_runtime *runtime = substream->runtime; int reg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? AC97_PCM_FRONT_DAC_RATE : AC97_PCM_LR_ADC_RATE; return snd_ac97_set_rate(pxa2xx_ac97_ac97, reg, runtime->rate); } -static pxa2xx_pcm_client_t pxa2xx_ac97_pcm_client = { +static struct pxa2xx_pcm_client pxa2xx_ac97_pcm_client = { .playback_params = &pxa2xx_ac97_pcm_out, .capture_params = &pxa2xx_ac97_pcm_in, .startup = pxa2xx_ac97_pcm_startup, @@ -245,7 +245,7 @@ static pxa2xx_pcm_client_t pxa2xx_ac97_pcm_client = { #ifdef CONFIG_PM -static int pxa2xx_ac97_do_suspend(snd_card_t *card, pm_message_t state) +static int pxa2xx_ac97_do_suspend(struct snd_card *card, pm_message_t state) { if (card->power_state != SNDRV_CTL_POWER_D3cold) { pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; @@ -261,7 +261,7 @@ static int pxa2xx_ac97_do_suspend(snd_card_t *card, pm_message_t state) return 0; } -static int pxa2xx_ac97_do_resume(snd_card_t *card) +static int pxa2xx_ac97_do_resume(struct snd_card *card) { if (card->power_state != SNDRV_CTL_POWER_D0) { pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; @@ -277,7 +277,7 @@ static int pxa2xx_ac97_do_resume(snd_card_t *card) static int pxa2xx_ac97_suspend(struct platform_device *dev, pm_message_t state) { - snd_card_t *card = platform_get_drvdata(dev); + struct snd_card *card = platform_get_drvdata(dev); int ret = 0; if (card) @@ -288,7 +288,7 @@ static int pxa2xx_ac97_suspend(struct platform_device *dev, pm_message_t state) static int pxa2xx_ac97_resume(struct platform_device *dev) { - snd_card_t *card = platform_get_drvdata(dev); + struct snd_card *card = platform_get_drvdata(dev); int ret = 0; if (card) @@ -304,9 +304,9 @@ static int pxa2xx_ac97_resume(struct platform_device *dev) static int pxa2xx_ac97_probe(struct platform_device *dev) { - snd_card_t *card; - ac97_bus_t *ac97_bus; - ac97_template_t ac97_template; + struct snd_card *card; + struct snd_ac97_bus *ac97_bus; + struct snd_ac97_template ac97_template; int ret; ret = -ENOMEM; @@ -370,7 +370,7 @@ static int pxa2xx_ac97_probe(struct platform_device *dev) static int pxa2xx_ac97_remove(struct platform_device *dev) { - snd_card_t *card = platform_get_drvdata(dev); + struct snd_card *card = platform_get_drvdata(dev); if (card) { snd_card_free(card); diff --git a/sound/arm/pxa2xx-pcm.c b/sound/arm/pxa2xx-pcm.c index b1eb53b02eae..4938ef10b813 100644 --- a/sound/arm/pxa2xx-pcm.c +++ b/sound/arm/pxa2xx-pcm.c @@ -28,7 +28,7 @@ #include "pxa2xx-pcm.h" -static const snd_pcm_hardware_t pxa2xx_pcm_hardware = { +static const struct snd_pcm_hardware pxa2xx_pcm_hardware = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_INTERLEAVED | @@ -44,15 +44,15 @@ static const snd_pcm_hardware_t pxa2xx_pcm_hardware = { struct pxa2xx_runtime_data { int dma_ch; - pxa2xx_pcm_dma_params_t *params; + struct pxa2xx_pcm_dma_params *params; pxa_dma_desc *dma_desc_array; dma_addr_t dma_desc_array_phys; }; -static int pxa2xx_pcm_hw_params(snd_pcm_substream_t *substream, - snd_pcm_hw_params_t *params) +static int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) { - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_pcm_runtime *runtime = substream->runtime; struct pxa2xx_runtime_data *rtd = runtime->private_data; size_t totsize = params_buffer_bytes(params); size_t period = params_period_bytes(params); @@ -86,7 +86,7 @@ static int pxa2xx_pcm_hw_params(snd_pcm_substream_t *substream, return 0; } -static int pxa2xx_pcm_hw_free(snd_pcm_substream_t *substream) +static int pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream) { struct pxa2xx_runtime_data *rtd = substream->runtime->private_data; @@ -95,10 +95,10 @@ static int pxa2xx_pcm_hw_free(snd_pcm_substream_t *substream) return 0; } -static int pxa2xx_pcm_prepare(snd_pcm_substream_t *substream) +static int pxa2xx_pcm_prepare(struct snd_pcm_substream *substream) { - pxa2xx_pcm_client_t *client = substream->private_data; - snd_pcm_runtime_t *runtime = substream->runtime; + struct pxa2xx_pcm_client *client = substream->private_data; + struct snd_pcm_runtime *runtime = substream->runtime; struct pxa2xx_runtime_data *rtd = runtime->private_data; DCSR(rtd->dma_ch) &= ~DCSR_RUN; @@ -109,7 +109,7 @@ static int pxa2xx_pcm_prepare(snd_pcm_substream_t *substream) return client->prepare(substream); } -static int pxa2xx_pcm_trigger(snd_pcm_substream_t *substream, int cmd) +static int pxa2xx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) { struct pxa2xx_runtime_data *rtd = substream->runtime->private_data; int ret = 0; @@ -139,7 +139,7 @@ static int pxa2xx_pcm_trigger(snd_pcm_substream_t *substream, int cmd) static void pxa2xx_pcm_dma_irq(int dma_ch, void *dev_id, struct pt_regs *regs) { - snd_pcm_substream_t *substream = dev_id; + struct snd_pcm_substream *substream = dev_id; struct pxa2xx_runtime_data *rtd = substream->runtime->private_data; int dcsr; @@ -155,9 +155,9 @@ static void pxa2xx_pcm_dma_irq(int dma_ch, void *dev_id, struct pt_regs *regs) } } -static snd_pcm_uframes_t pxa2xx_pcm_pointer(snd_pcm_substream_t *substream) +static snd_pcm_uframes_t pxa2xx_pcm_pointer(struct snd_pcm_substream *substream) { - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_pcm_runtime *runtime = substream->runtime; struct pxa2xx_runtime_data *rtd = runtime->private_data; dma_addr_t ptr = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? DSADR(rtd->dma_ch) : DTADR(rtd->dma_ch); @@ -168,9 +168,9 @@ static snd_pcm_uframes_t pxa2xx_pcm_pointer(snd_pcm_substream_t *substream) } static int -pxa2xx_pcm_hw_rule_mult32(snd_pcm_hw_params_t *params, snd_pcm_hw_rule_t *rule) +pxa2xx_pcm_hw_rule_mult32(struct snd_pcm_hw_params *params, struct snd_pcm_hw_rule *rule) { - snd_interval_t *i = hw_param_interval(params, rule->var); + struct snd_interval *i = hw_param_interval(params, rule->var); int changed = 0; if (i->min & 31) { @@ -188,10 +188,10 @@ pxa2xx_pcm_hw_rule_mult32(snd_pcm_hw_params_t *params, snd_pcm_hw_rule_t *rule) return changed; } -static int pxa2xx_pcm_open(snd_pcm_substream_t *substream) +static int pxa2xx_pcm_open(struct snd_pcm_substream *substream) { - pxa2xx_pcm_client_t *client = substream->private_data; - snd_pcm_runtime_t *runtime = substream->runtime; + struct pxa2xx_pcm_client *client = substream->private_data; + struct snd_pcm_runtime *runtime = substream->runtime; struct pxa2xx_runtime_data *rtd; int ret; @@ -246,9 +246,9 @@ static int pxa2xx_pcm_open(snd_pcm_substream_t *substream) return ret; } -static int pxa2xx_pcm_close(snd_pcm_substream_t *substream) +static int pxa2xx_pcm_close(struct snd_pcm_substream *substream) { - pxa2xx_pcm_client_t *client = substream->private_data; + struct pxa2xx_pcm_client *client = substream->private_data; struct pxa2xx_runtime_data *rtd = substream->runtime->private_data; pxa_free_dma(rtd->dma_ch); @@ -260,16 +260,16 @@ static int pxa2xx_pcm_close(snd_pcm_substream_t *substream) } static int -pxa2xx_pcm_mmap(snd_pcm_substream_t *substream, struct vm_area_struct *vma) +pxa2xx_pcm_mmap(struct snd_pcm_substream *substream, struct vm_area_struct *vma) { - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_pcm_runtime *runtime = substream->runtime; return dma_mmap_writecombine(substream->pcm->card->dev, vma, runtime->dma_area, runtime->dma_addr, runtime->dma_bytes); } -static snd_pcm_ops_t pxa2xx_pcm_ops = { +static struct snd_pcm_ops pxa2xx_pcm_ops = { .open = pxa2xx_pcm_open, .close = pxa2xx_pcm_close, .ioctl = snd_pcm_lib_ioctl, @@ -281,9 +281,9 @@ static snd_pcm_ops_t pxa2xx_pcm_ops = { .mmap = pxa2xx_pcm_mmap, }; -static int pxa2xx_pcm_preallocate_dma_buffer(snd_pcm_t *pcm, int stream) +static int pxa2xx_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) { - snd_pcm_substream_t *substream = pcm->streams[stream].substream; + struct snd_pcm_substream *substream = pcm->streams[stream].substream; struct snd_dma_buffer *buf = &substream->dma_buffer; size_t size = pxa2xx_pcm_hardware.buffer_bytes_max; buf->dev.type = SNDRV_DMA_TYPE_DEV; @@ -297,9 +297,9 @@ static int pxa2xx_pcm_preallocate_dma_buffer(snd_pcm_t *pcm, int stream) return 0; } -static void pxa2xx_pcm_free_dma_buffers(snd_pcm_t *pcm) +static void pxa2xx_pcm_free_dma_buffers(struct snd_pcm *pcm) { - snd_pcm_substream_t *substream; + struct snd_pcm_substream *substream; struct snd_dma_buffer *buf; int stream; @@ -318,9 +318,10 @@ static void pxa2xx_pcm_free_dma_buffers(snd_pcm_t *pcm) static u64 pxa2xx_pcm_dmamask = 0xffffffff; -int pxa2xx_pcm_new(snd_card_t *card, pxa2xx_pcm_client_t *client, snd_pcm_t **rpcm) +int pxa2xx_pcm_new(struct snd_card *card, struct pxa2xx_pcm_client *client, + struct snd_pcm **rpcm) { - snd_pcm_t *pcm; + struct snd_pcm *pcm; int play = client->playback_params ? 1 : 0; int capt = client->capture_params ? 1 : 0; int ret; diff --git a/sound/arm/pxa2xx-pcm.h b/sound/arm/pxa2xx-pcm.h index 43517597cab9..b79f1e803780 100644 --- a/sound/arm/pxa2xx-pcm.h +++ b/sound/arm/pxa2xx-pcm.h @@ -10,20 +10,20 @@ * published by the Free Software Foundation. */ -typedef struct { +struct pxa2xx_pcm_dma_params { char *name; /* stream identifier */ u32 dcmd; /* DMA descriptor dcmd field */ volatile u32 *drcmr; /* the DMA request channel to use */ u32 dev_addr; /* device physical address for DMA */ -} pxa2xx_pcm_dma_params_t; +}; -typedef struct { - pxa2xx_pcm_dma_params_t *playback_params; - pxa2xx_pcm_dma_params_t *capture_params; - int (*startup)(snd_pcm_substream_t *); - void (*shutdown)(snd_pcm_substream_t *); - int (*prepare)(snd_pcm_substream_t *); -} pxa2xx_pcm_client_t; +struct pxa2xx_pcm_client { + struct pxa2xx_pcm_dma_params *playback_params; + struct pxa2xx_pcm_dma_params *capture_params; + int (*startup)(struct snd_pcm_substream *); + void (*shutdown)(struct snd_pcm_substream *); + int (*prepare)(struct snd_pcm_substream *); +}; -extern int pxa2xx_pcm_new(snd_card_t *, pxa2xx_pcm_client_t *, snd_pcm_t **); +extern int pxa2xx_pcm_new(struct snd_card *, struct pxa2xx_pcm_client *, struct snd_pcm **); -- cgit v1.2.2 From af0fbfb58dbb2081ae91789892933321ee95d71f Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 15:10:58 +0100 Subject: [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: Takashi Iwai --- sound/arm/sa11xx-uda1341.c | 125 ++++++++++++++++++++++----------------------- 1 file changed, 61 insertions(+), 64 deletions(-) (limited to 'sound/arm') diff --git a/sound/arm/sa11xx-uda1341.c b/sound/arm/sa11xx-uda1341.c index 97dffcc3f75f..785726e627d0 100644 --- a/sound/arm/sa11xx-uda1341.c +++ b/sound/arm/sa11xx-uda1341.c @@ -21,7 +21,7 @@ * 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 */ module_param(id, charp, 0444); MODULE_PARM_DESC(id, "ID string for SA1100/SA1111 + UDA1341TS soundcard."); -typedef struct audio_stream { +struct audio_stream { char *id; /* identification string */ int stream_id; /* numeric identification */ dma_device_t dma_dev; /* device identifier for DMA */ @@ -130,16 +130,16 @@ typedef struct audio_stream { int tx_spin; /* are we recoding - flag used to do DMA trans. for sync */ unsigned int old_offset; spinlock_t dma_lock; /* for locking in DMA operations (see dma-sa1100.c in the kernel) */ - snd_pcm_substream_t *stream; -}audio_stream_t; + struct snd_pcm_substream *stream; +}; -typedef struct snd_card_sa11xx_uda1341 { - snd_card_t *card; +struct sa11xx_uda1341 { + struct snd_card *card; struct l3_client *uda1341; - snd_pcm_t *pcm; + struct snd_pcm *pcm; long samplerate; - audio_stream_t s[2]; /* playback & capture */ -} sa11xx_uda1341_t; + struct audio_stream s[2]; /* playback & capture */ +}; static unsigned int rates[] = { 8000, 10666, 10985, 14647, @@ -147,7 +147,7 @@ static unsigned int rates[] = { 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), .list = rates, .mask = 0, @@ -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=0; @@ -278,7 +278,7 @@ static void sa11xx_uda1341_set_samplerate(sa11xx_uda1341_t *sa11xx_uda1341, long /* {{{ 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; @@ -335,7 +335,7 @@ static void sa11xx_uda1341_audio_init(sa11xx_uda1341_t *sa11xx_uda1341) #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 */ #ifdef CONFIG_H3600_HAL @@ -376,7 +376,7 @@ static void sa11xx_uda1341_audio_shutdown(sa11xx_uda1341_t *sa11xx_uda1341) #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; @@ -389,7 +389,7 @@ static int audio_dma_request(audio_stream_t *s, void (*callback)(void *, int)) 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); s->dmach = -1; @@ -397,7 +397,7 @@ static inline void audio_dma_free(audio_stream_t *s) #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; @@ -407,7 +407,7 @@ static int audio_dma_request(audio_stream_t *s, void (*callback)(void *)) 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); s->dma_regs = 0; @@ -415,10 +415,10 @@ static void audio_dma_free(audio_stream_t *s) #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; - snd_pcm_runtime_t *runtime = substream->runtime; + struct snd_pcm_substream *substream = s->stream; + struct snd_pcm_runtime *runtime = substream->runtime; unsigned int offset; unsigned long flags; dma_addr_t addr; @@ -443,7 +443,7 @@ static u_int audio_get_dma_pos(audio_stream_t *s) /* * 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; @@ -459,10 +459,10 @@ static void audio_stop_dma(audio_stream_t *s) 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; - snd_pcm_runtime_t *runtime; + struct snd_pcm_substream *substream = s->stream; + struct snd_pcm_runtime *runtime; unsigned int dma_size; unsigned int offset; int ret; @@ -525,7 +525,7 @@ static void audio_dma_callback(void *data, int size) static void audio_dma_callback(void *data) #endif { - audio_stream_t *s = data; + struct audio_stream *s = data; /* * If we are getting a callback for an active stream then we inform @@ -547,12 +547,12 @@ static void audio_dma_callback(void *data) /* {{{ 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; - audio_stream_t *s = &chip->s[stream_id]; - audio_stream_t *s1 = &chip->s[stream_id ^ 1]; + struct audio_stream *s = &chip->s[stream_id]; + struct audio_stream *s1 = &chip->s[stream_id ^ 1]; int err = 0; /* 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) 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); - snd_pcm_runtime_t *runtime = substream->runtime; - audio_stream_t *s = &chip->s[substream->pstr->stream]; + struct sa11xx_uda1341 *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; + struct audio_stream *s = &chip->s[substream->pstr->stream]; /* set requested samplerate */ sa11xx_uda1341_set_samplerate(chip, runtime->rate); @@ -699,15 +699,15 @@ static int snd_sa11xx_uda1341_prepare(snd_pcm_substream_t * substream) 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]); } /* }}} */ -static snd_pcm_hardware_t snd_sa11xx_uda1341_capture = +static struct snd_pcm_hardware snd_sa11xx_uda1341_capture = { .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | @@ -730,7 +730,7 @@ static snd_pcm_hardware_t snd_sa11xx_uda1341_capture = .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 | SNDRV_PCM_INFO_BLOCK_TRANSFER | @@ -753,10 +753,10 @@ static snd_pcm_hardware_t snd_sa11xx_uda1341_playback = .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); - snd_pcm_runtime_t *runtime = substream->runtime; + struct sa11xx_uda1341 *chip = snd_pcm_substream_chip(substream); + struct snd_pcm_runtime *runtime = substream->runtime; int stream_id = substream->pstr->stream; int err; @@ -774,9 +774,9 @@ static int snd_card_sa11xx_uda1341_open(snd_pcm_substream_t * substream) 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; return 0; @@ -784,21 +784,21 @@ static int snd_card_sa11xx_uda1341_close(snd_pcm_substream_t * substream) /* {{{ HW params & free */ -static int snd_sa11xx_uda1341_hw_params(snd_pcm_substream_t * substream, - snd_pcm_hw_params_t * hw_params) +static int snd_sa11xx_uda1341_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_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); } /* }}} */ -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, .close = snd_card_sa11xx_uda1341_close, .ioctl = snd_pcm_lib_ioctl, @@ -809,7 +809,7 @@ static snd_pcm_ops_t snd_card_sa11xx_uda1341_playback_ops = { .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, .close = snd_card_sa11xx_uda1341_close, .ioctl = snd_pcm_lib_ioctl, @@ -820,9 +820,9 @@ static snd_pcm_ops_t snd_card_sa11xx_uda1341_capture_ops = { .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; 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, #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); #ifdef HH_VERSION @@ -876,9 +876,9 @@ static int snd_sa11xx_uda1341_suspend(snd_card_t *card, pm_message_t state) 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); l3_command(chip->uda1341, CMD_RESUME, NULL); @@ -892,43 +892,40 @@ static int snd_sa11xx_uda1341_resume(snd_card_t *card) } #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_CAPTURE]); } -static snd_card_t *sa11xx_uda1341_card; +static struct snd_card *sa11xx_uda1341_card; static int __init sa11xx_uda1341_init(void) { int err; - snd_card_t *card; - sa11xx_uda1341_t *chip; + struct snd_card *card; + struct sa11xx_uda1341 *chip; if (!machine_is_h3xxx()) return -ENODEV; /* 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) return -ENOMEM; - sa11xx_uda1341 = kzalloc(sizeof(*sa11xx_uda1341), GFP_KERNEL); - if (sa11xx_uda1341 == NULL) - return -ENOMEM; card->private_free = snd_sa11xx_uda1341_free; chip = card->private_data; spin_lock_init(&chip->s[0].dma_lock); spin_lock_init(&chip->s[1].dma_lock); - + chip->card = card; chip->samplerate = AUDIO_RATE_DEFAULT; // 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; // PCM -- cgit v1.2.2 From 792a6c51875c9d3b4a7b9af553b7fd18e8d84684 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 17:19:25 +0100 Subject: [ALSA] Fix PM support Modules: ARM AACI PL041 driver,ARM PXA2XX driver Fix PM support of aaci and pxa2xx drivers. Signed-off-by: Takashi Iwai --- sound/arm/aaci.c | 12 +++--------- sound/arm/pxa2xx-ac97.c | 36 ++++++++++++++++-------------------- 2 files changed, 19 insertions(+), 29 deletions(-) (limited to 'sound/arm') diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index 691f6dd81c30..5e9a81ab990b 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c @@ -635,19 +635,14 @@ static struct snd_pcm_ops aaci_playback_ops = { static int aaci_do_suspend(struct snd_card *card, unsigned int state) { struct aaci *aaci = card->private_data; - if (aaci->card->power_state != SNDRV_CTL_POWER_D3cold) { - snd_pcm_suspend_all(aaci->pcm); - snd_power_change_state(aaci->card, SNDRV_CTL_POWER_D3cold); - } + snd_power_change_state(card, SNDRV_CTL_POWER_D3cold); + snd_pcm_suspend_all(aaci->pcm); return 0; } static int aaci_do_resume(struct snd_card *card, unsigned int state) { - struct aaci *aaci = card->private_data; - if (aaci->card->power_state != SNDRV_CTL_POWER_D0) { - snd_power_change_state(aaci->card, SNDRV_CTL_POWER_D0); - } + snd_power_change_state(card, SNDRV_CTL_POWER_D0); return 0; } @@ -780,7 +775,6 @@ static struct aaci * __devinit aaci_init_card(struct amba_device *dev) return ERR_PTR(-ENOMEM); card->private_free = aaci_free_card; - snd_card_set_pm_callback(card, aaci_do_suspend, aaci_do_resume, NULL); strlcpy(card->driver, DRIVER_NAME, sizeof(card->driver)); strlcpy(card->shortname, "ARM AC'97 Interface", sizeof(card->shortname)); diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c index d9efc37393ee..dda64beb202b 100644 --- a/sound/arm/pxa2xx-ac97.c +++ b/sound/arm/pxa2xx-ac97.c @@ -247,30 +247,28 @@ static struct pxa2xx_pcm_client pxa2xx_ac97_pcm_client = { static int pxa2xx_ac97_do_suspend(struct snd_card *card, pm_message_t state) { - if (card->power_state != SNDRV_CTL_POWER_D3cold) { - pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; - snd_pcm_suspend_all(pxa2xx_ac97_pcm); - snd_ac97_suspend(pxa2xx_ac97_ac97); - snd_power_change_state(card, SNDRV_CTL_POWER_D3cold); - if (platform_ops && platform_ops->suspend) - platform_ops->suspend(platform_ops->priv); - GCR |= GCR_ACLINK_OFF; - pxa_set_cken(CKEN2_AC97, 0); - } + pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; + + snd_power_change_state(card, SNDRV_CTL_POWER_D3cold); + snd_pcm_suspend_all(pxa2xx_ac97_pcm); + snd_ac97_suspend(pxa2xx_ac97_ac97); + if (platform_ops && platform_ops->suspend) + platform_ops->suspend(platform_ops->priv); + GCR |= GCR_ACLINK_OFF; + pxa_set_cken(CKEN2_AC97, 0); return 0; } static int pxa2xx_ac97_do_resume(struct snd_card *card) { - if (card->power_state != SNDRV_CTL_POWER_D0) { - pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; - pxa_set_cken(CKEN2_AC97, 1); - if (platform_ops && platform_ops->resume) - platform_ops->resume(platform_ops->priv); - snd_ac97_resume(pxa2xx_ac97_ac97); - snd_power_change_state(card, SNDRV_CTL_POWER_D0); - } + pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; + + pxa_set_cken(CKEN2_AC97, 1); + if (platform_ops && platform_ops->resume) + platform_ops->resume(platform_ops->priv); + snd_ac97_resume(pxa2xx_ac97_ac97); + snd_power_change_state(card, SNDRV_CTL_POWER_D0); return 0; } @@ -349,8 +347,6 @@ static int pxa2xx_ac97_probe(struct platform_device *dev) snprintf(card->longname, sizeof(card->longname), "%s (%s)", dev->dev.driver->name, card->mixername); - snd_card_set_pm_callback(card, pxa2xx_ac97_do_suspend, - pxa2xx_ac97_do_resume, NULL); ret = snd_card_register(card); if (ret == 0) { platform_set_drvdata(dev, card); -- cgit v1.2.2 From 2b3f558727244efb6edb0866952331f537da13a4 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 17:19:50 +0100 Subject: [ALSA] Use platform_device Modules: SA11xx UDA1341 driver Rewrite the probe/remove with platform_device. Fix PM support, too. Signed-off-by: Takashi Iwai --- sound/arm/sa11xx-uda1341.c | 78 +++++++++++++++++++++++++++++++++------------- 1 file changed, 57 insertions(+), 21 deletions(-) (limited to 'sound/arm') diff --git a/sound/arm/sa11xx-uda1341.c b/sound/arm/sa11xx-uda1341.c index 785726e627d0..3c342c1a7c80 100644 --- a/sound/arm/sa11xx-uda1341.c +++ b/sound/arm/sa11xx-uda1341.c @@ -21,7 +21,7 @@ * merged HAL layer (patches from Brian) */ -/* $Id: sa11xx-uda1341.c,v 1.25 2005/11/17 15:10:58 tiwai Exp $ */ +/* $Id: sa11xx-uda1341.c,v 1.26 2005/11/17 17:19:50 tiwai Exp $ */ /*************************************************************************************************** * @@ -64,6 +64,8 @@ #include #include #include +#include +#include #include #include #include @@ -860,12 +862,15 @@ static int __init snd_card_sa11xx_uda1341_pcm(struct sa11xx_uda1341 *sa11xx_uda1 #ifdef CONFIG_PM -static int snd_sa11xx_uda1341_suspend(struct snd_card *card, pm_message_t state) +static int snd_sa11xx_uda1341_suspend(struct platform_device *devptr, + pm_message_t state) { - struct sa11xx_uda1341 *chip = card->pm_private_data; + struct snd_card *card = platform_get_drvdata(devptr); + struct sa11xx_uda1341 *chip = card->private_data; + snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); snd_pcm_suspend_all(chip->pcm); -#ifdef HH_VERSION +#ifdef HH_VERSION sa1100_dma_sleep(chip->s[SNDRV_PCM_STREAM_PLAYBACK].dmach); sa1100_dma_sleep(chip->s[SNDRV_PCM_STREAM_CAPTURE].dmach); #else @@ -873,12 +878,14 @@ static int snd_sa11xx_uda1341_suspend(struct snd_card *card, pm_message_t state) #endif l3_command(chip->uda1341, CMD_SUSPEND, NULL); sa11xx_uda1341_audio_shutdown(chip); + return 0; } -static int snd_sa11xx_uda1341_resume(struct snd_card *card) +static int snd_sa11xx_uda1341_resume(struct platform_device *devptr) { - struct sa11xx_uda1341 *chip = card->pm_private_data; + struct snd_card *card = platform_get_drvdata(devptr); + struct sa11xx_uda1341 *chip = card->private_data; sa11xx_uda1341_audio_init(chip); l3_command(chip->uda1341, CMD_RESUME, NULL); @@ -888,6 +895,7 @@ static int snd_sa11xx_uda1341_resume(struct snd_card *card) #else //FIXME #endif + snd_power_change_state(card, SNDRV_CTL_POWER_D0); return 0; } #endif /* COMFIG_PM */ @@ -900,27 +908,22 @@ void snd_sa11xx_uda1341_free(struct snd_card *card) audio_dma_free(&chip->s[SNDRV_PCM_STREAM_CAPTURE]); } -static struct snd_card *sa11xx_uda1341_card; - -static int __init sa11xx_uda1341_init(void) +static int __init sa11xx_uda1341_probe(struct platform_device *devptr) { int err; struct snd_card *card; struct sa11xx_uda1341 *chip; - if (!machine_is_h3xxx()) - return -ENODEV; - /* register the soundcard */ card = snd_card_new(-1, id, THIS_MODULE, sizeof(struct sa11xx_uda1341)); if (card == NULL) return -ENOMEM; - card->private_free = snd_sa11xx_uda1341_free; chip = card->private_data; spin_lock_init(&chip->s[0].dma_lock); spin_lock_init(&chip->s[1].dma_lock); + card->private_free = snd_sa11xx_uda1341_free; chip->card = card; chip->samplerate = AUDIO_RATE_DEFAULT; @@ -932,20 +935,15 @@ static int __init sa11xx_uda1341_init(void) if ((err = snd_card_sa11xx_uda1341_pcm(chip, 0)) < 0) goto nodev; - snd_card_set_generic_pm_callback(card, - snd_sa11xx_uda1341_suspend, snd_sa11_uda1341_resume, - chip); - strcpy(card->driver, "UDA1341"); strcpy(card->shortname, "H3600 UDA1341TS"); sprintf(card->longname, "Compaq iPAQ H3600 with Philips UDA1341TS"); - if ((err = snd_card_set_generic_dev(card)) < 0) - goto nodev; + snd_card_set_dev(card, &devptr->dev); if ((err = snd_card_register(card)) == 0) { printk( KERN_INFO "iPAQ audio support initialized\n" ); - sa11xx_uda1341_card = card; + platform_set_drvdata(devptr, card); return 0; } @@ -954,9 +952,47 @@ static int __init sa11xx_uda1341_init(void) return err; } +static int __devexit sa11xx_uda1341_remove(struct platform_device *devptr) +{ + snd_card_free(platform_get_drvdata(devptr)); + platform_set_drvdata(devptr, NULL); + return 0; +} + +#define SA11XX_UDA1341_DRIVER "sa11xx_uda1341" + +static struct platform_driver sa11xx_uda1341_driver = { + .probe = sa11xx_uda1341_probe, + .remove = __devexit_p(sa11xx_uda1341_remove), +#ifdef CONFIG_PM + .suspend = snd_sa11xx_uda1341_suspend, + .resume = snd_sa11xx_uda1341_resume, +#endif + .driver = { + .name = SA11XX_UDA1341_DRIVER, + }, +}; + +static int __init sa11xx_uda1341_init(void) +{ + int err; + struct platform_device *device; + + if (!machine_is_h3xxx()) + return -ENODEV; + if ((err = platform_driver_register(&sa11xx_uda1341_driver)) < 0) + return err; + device = platform_device_register_simple(SA11XX_UDA1341_DRIVER, -1, NULL, 0); + if (IS_ERR(device)) { + platform_driver_unregister(&sa11xx_uda1341_driver); + return PTR_ERR(device); + } + return 0; +} + static void __exit sa11xx_uda1341_exit(void) { - snd_card_free(sa11xx_uda1341_card); + platform_driver_unregister(&sa11xx_uda1341_driver); } module_init(sa11xx_uda1341_init); -- cgit v1.2.2 From fa8174db0fd032c3d48cc0873946358c68e44d4f Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 17:20:15 +0100 Subject: [ALSA] Remove SND_GENERIC_DRIVER from arm/Kconfig Modules: ARM Remove the obsolete SND_GENERIC_DRIVER from arm/Kconfig. Signed-off-by: Takashi Iwai --- sound/arm/Kconfig | 1 - 1 file changed, 1 deletion(-) (limited to 'sound/arm') diff --git a/sound/arm/Kconfig b/sound/arm/Kconfig index 0864a7ce414d..2e4a5e0d16db 100644 --- a/sound/arm/Kconfig +++ b/sound/arm/Kconfig @@ -7,7 +7,6 @@ config SND_SA11XX_UDA1341 tristate "SA11xx UDA1341TS driver (iPaq H3600)" depends on ARCH_SA1100 && SND && L3 select SND_PCM - select SND_GENERIC_DRIVER help Say Y here if you have a Compaq iPaq H3x00 handheld computer and want to use its Philips UDA 1341 audio chip. -- cgit v1.2.2 From f7a9275d949cb0bf1f259a1546e52a0bf518151c Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Wed, 7 Dec 2005 09:13:42 +0100 Subject: [ALSA] unregister platform devices Call platform_device_unregister() for all platform devices that we've registered. Signed-off-by: Clemens Ladisch --- sound/arm/sa11xx-uda1341.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sound/arm') diff --git a/sound/arm/sa11xx-uda1341.c b/sound/arm/sa11xx-uda1341.c index 3c342c1a7c80..13057d92f08a 100644 --- a/sound/arm/sa11xx-uda1341.c +++ b/sound/arm/sa11xx-uda1341.c @@ -21,7 +21,7 @@ * merged HAL layer (patches from Brian) */ -/* $Id: sa11xx-uda1341.c,v 1.26 2005/11/17 17:19:50 tiwai Exp $ */ +/* $Id: sa11xx-uda1341.c,v 1.27 2005/12/07 09:13:42 cladisch Exp $ */ /*************************************************************************************************** * @@ -155,6 +155,8 @@ static struct snd_pcm_hw_constraint_list hw_constraints_rates = { .mask = 0, }; +static struct platform_device *device; + /* }}} */ /* {{{ Clock and sample rate stuff */ @@ -976,7 +978,6 @@ static struct platform_driver sa11xx_uda1341_driver = { static int __init sa11xx_uda1341_init(void) { int err; - struct platform_device *device; if (!machine_is_h3xxx()) return -ENODEV; @@ -992,6 +993,7 @@ static int __init sa11xx_uda1341_init(void) static void __exit sa11xx_uda1341_exit(void) { + platform_device_unregister(device); platform_driver_unregister(&sa11xx_uda1341_driver); } -- cgit v1.2.2 From ea265c0a433fda15fb69b9fd733e0ea4215c216e Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Mon, 12 Dec 2005 15:41:47 +0100 Subject: [ALSA] make the pxa2xx-ac97 module more robust against PXA27x bugs Modules: ARM PXA2XX driver The SDONE and CDONE interrupt on the PXA27x might become unusable in some conditions. Let's use an hybrid approach (interrupt with timeout) to have the best possible behavior in all conditions. Also let's not care about CAR_CAIP anymore. This is useless. Signed-off-by: Nicolas Pitre Signed-off-by: Takashi Iwai --- sound/arm/pxa2xx-ac97.c | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'sound/arm') diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c index dda64beb202b..3acbc6023d19 100644 --- a/sound/arm/pxa2xx-ac97.c +++ b/sound/arm/pxa2xx-ac97.c @@ -37,39 +37,47 @@ static DECLARE_MUTEX(car_mutex); static DECLARE_WAIT_QUEUE_HEAD(gsr_wq); static volatile long gsr_bits; +/* + * Beware PXA27x bugs: + * + * o Slot 12 read from modem space will hang controller. + * o CDONE, SDONE interrupt fails after any slot 12 IO. + * + * We therefore have an hybrid approach for waiting on SDONE (interrupt or + * 1 jiffy timeout if interrupt never comes). + */ + static unsigned short pxa2xx_ac97_read(struct snd_ac97 *ac97, unsigned short reg) { unsigned short val = -1; volatile u32 *reg_addr; down(&car_mutex); - if (CAR & CAR_CAIP) { - printk(KERN_CRIT"%s: CAR_CAIP already set\n", __FUNCTION__); - goto out; - } /* set up primary or secondary codec space */ reg_addr = (ac97->num & 1) ? &SAC_REG_BASE : &PAC_REG_BASE; reg_addr += (reg >> 1); /* start read access across the ac97 link */ + GSR = GSR_CDONE | GSR_SDONE; gsr_bits = 0; val = *reg_addr; if (reg == AC97_GPIO_STATUS) goto out; - wait_event_timeout(gsr_wq, gsr_bits & GSR_SDONE, 1); - if (!gsr_bits & GSR_SDONE) { + if (wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_SDONE, 1) <= 0 && + !((GSR | gsr_bits) & GSR_SDONE)) { printk(KERN_ERR "%s: read error (ac97_reg=%d GSR=%#lx)\n", - __FUNCTION__, reg, gsr_bits); + __FUNCTION__, reg, GSR | gsr_bits); val = -1; goto out; } /* valid data now */ + GSR = GSR_CDONE | GSR_SDONE; gsr_bits = 0; val = *reg_addr; /* but we've just started another cycle... */ - wait_event_timeout(gsr_wq, gsr_bits & GSR_SDONE, 1); + wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_SDONE, 1); out: up(&car_mutex); return val; @@ -81,22 +89,19 @@ static void pxa2xx_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigne down(&car_mutex); - if (CAR & CAR_CAIP) { - printk(KERN_CRIT "%s: CAR_CAIP already set\n", __FUNCTION__); - goto out; - } - /* set up primary or secondary codec space */ reg_addr = (ac97->num & 1) ? &SAC_REG_BASE : &PAC_REG_BASE; reg_addr += (reg >> 1); + + GSR = GSR_CDONE | GSR_SDONE; gsr_bits = 0; *reg_addr = val; - wait_event_timeout(gsr_wq, gsr_bits & GSR_CDONE, 1); - if (!gsr_bits & GSR_SDONE) + if (wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_CDONE, 1) <= 0 && + !((GSR | gsr_bits) & GSR_CDONE)) printk(KERN_ERR "%s: write error (ac97_reg=%d GSR=%#lx)\n", - __FUNCTION__, reg, gsr_bits); + __FUNCTION__, reg, GSR | gsr_bits); -out: up(&car_mutex); + up(&car_mutex); } static void pxa2xx_ac97_reset(struct snd_ac97 *ac97) -- cgit v1.2.2