diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2010-07-31 16:52:38 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2010-07-31 16:52:38 +0000 |
commit | a06850f8bcd4cf207c4d4763db33cce277bb8c49 (patch) | |
tree | 301c9f22fd25ec5c08b2486e2629673bb446df56 /sys/dev/pci/envy.c | |
parent | c437786000a1cd7f34976d83e527e2d220277a3e (diff) |
add support for M-audio Audiophile 192k
Diffstat (limited to 'sys/dev/pci/envy.c')
-rw-r--r-- | sys/dev/pci/envy.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sys/dev/pci/envy.c b/sys/dev/pci/envy.c index 7ac164bb79a..3ba0358dbfd 100644 --- a/sys/dev/pci/envy.c +++ b/sys/dev/pci/envy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: envy.c,v 1.39 2010/07/21 07:49:48 ratchov Exp $ */ +/* $OpenBSD: envy.c,v 1.40 2010/07/31 16:52:37 ratchov Exp $ */ /* * Copyright (c) 2007 Alexandre Ratchov <alex@caoua.org> * @@ -381,20 +381,31 @@ delta_codec_write(struct envy_softc *sc, int dev, int addr, int data) */ #define AP192K_GPIO_CLK 0x2 #define AP192K_GPIO_DOUT 0x8 -#define AP192K_GPIO_CSMASK 0x70 +#define AP192K_GPIO_CSMASK 0x30 #define AP192K_GPIO_CS(dev) ((dev) << 4) - +#define AP192K_GPIO_ADC_PWR 0x800 +#define AP192K_GPIO_MUTE 0x400000 void ap192k_init(struct envy_softc *sc) { - int i; + int i, reg; + /* AK4358 */ envy_codec_write(sc, 0, 0, 0); /* reset */ delay(300); envy_codec_write(sc, 0, 0, 0x87); /* i2s mode */ + delay(1); for (i = 0; i < sc->card->noch; i++) { sc->shadow[0][AK4358_ATT(i)] = 0xff; } + + /* ADC */ + delay(1); + reg = envy_gpio_getstate(sc); + reg &= ~AP192K_GPIO_ADC_PWR; + envy_gpio_setstate(sc, reg); + reg |= AP192K_GPIO_ADC_PWR; + envy_gpio_setstate(sc, reg); } void |