summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Courtier-Dutton <James@superbug.co.uk>2005-12-21 22:05:29 +0100
committerJaroslav Kysela <perex@suse.cz>2006-01-03 12:31:07 +0100
commit18f3c59f2b14225bd23c41a87a5eec39439bc8b9 (patch)
tree8677f39cc15c19ee9e0bb33226d66841a1c995ba
parentc6a02ca29388a806df3df73015ee494a6e055309 (diff)
downloadlinux-stable-18f3c59f2b14225bd23c41a87a5eec39439bc8b9.tar.gz
linux-stable-18f3c59f2b14225bd23c41a87a5eec39439bc8b9.tar.bz2
linux-stable-18f3c59f2b14225bd23c41a87a5eec39439bc8b9.zip
[ALSA] snd-emu10k1: Tidy SPI code.
Modules: EMU10K1/EMU10K2 driver Signed-off-by: James Courtier-Dutton <James@superbug.co.uk>
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c52
1 files changed, 30 insertions, 22 deletions
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index e3a14068115c..615460f55138 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -92,6 +92,30 @@ void snd_emu10k1_voice_init(struct snd_emu10k1 * emu, int ch)
}
}
+static unsigned int spi_dac_init[] = {
+ 0x00ff,
+ 0x02ff,
+ 0x0400,
+ 0x0520,
+ 0x0600,
+ 0x08ff,
+ 0x0aff,
+ 0x0cff,
+ 0x0eff,
+ 0x10ff,
+ 0x1200,
+ 0x1400,
+ 0x1480,
+ 0x1800,
+ 0x1aff,
+ 0x1cff,
+ 0x1e00,
+ 0x0530,
+ 0x0602,
+ 0x0622,
+ 0x1400,
+};
+
static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
{
unsigned int silent_page;
@@ -182,28 +206,12 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
outl(tmp, emu->port + A_IOCFG);
}
if (emu->card_capabilities->spi_dac) { /* Audigy 2 ZS Notebook with DAC Wolfson WM8768/WM8568 */
- u32 tmp;
- tmp = snd_emu10k1_spi_write(emu, 0x00ff);
- tmp = snd_emu10k1_spi_write(emu, 0x02ff);
- tmp = snd_emu10k1_spi_write(emu, 0x0400);
- tmp = snd_emu10k1_spi_write(emu, 0x0520);
- tmp = snd_emu10k1_spi_write(emu, 0x0600);
- tmp = snd_emu10k1_spi_write(emu, 0x08ff);
- tmp = snd_emu10k1_spi_write(emu, 0x0aff);
- tmp = snd_emu10k1_spi_write(emu, 0x0cff);
- tmp = snd_emu10k1_spi_write(emu, 0x0eff);
- tmp = snd_emu10k1_spi_write(emu, 0x10ff);
- tmp = snd_emu10k1_spi_write(emu, 0x1200);
- tmp = snd_emu10k1_spi_write(emu, 0x1400);
- tmp = snd_emu10k1_spi_write(emu, 0x1480);
- tmp = snd_emu10k1_spi_write(emu, 0x1800);
- tmp = snd_emu10k1_spi_write(emu, 0x1aff);
- tmp = snd_emu10k1_spi_write(emu, 0x1cff);
- tmp = snd_emu10k1_spi_write(emu, 0x1e00);
- tmp = snd_emu10k1_spi_write(emu, 0x0530);
- tmp = snd_emu10k1_spi_write(emu, 0x0602);
- tmp = snd_emu10k1_spi_write(emu, 0x0622);
- tmp = snd_emu10k1_spi_write(emu, 0x1400);
+ int size, n;
+
+ size = ARRAY_SIZE(spi_dac_init);
+ for (n=0; n < size; n++)
+ snd_emu10k1_spi_write(emu, spi_dac_init[n]);
+
snd_emu10k1_ptr20_write(emu, 0x60, 0, 0x10);
/* Enable GPIOs
* GPIO0: Unknown