From 03334a99fe701e6a74203b9af4314c0d90fc0e8f Mon Sep 17 00:00:00 2001 From: ratchov Date: Sat, 31 Jul 2010 16:52:37 +0000 Subject: [PATCH] add support for M-audio Audiophile 192k --- sys/dev/pci/envy.c | 19 +++++++++++++++---- 1 file 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 * @@ -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 -- 2.20.1