diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2013-03-14 08:14:48 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2013-03-14 08:14:48 +0000 |
commit | be3d6424ce9dd1006a888bfd5d1fba1dde308b08 (patch) | |
tree | 181494e36a71b4a8337f7a99f16857cb0e252f00 | |
parent | a48b59a9d6b2d511bcfdd2d48fae31e80f43fb89 (diff) |
add macros for ap192k cards, no behavior change
-rw-r--r-- | sys/dev/pci/envy.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/pci/envy.c b/sys/dev/pci/envy.c index ed805d3d33b..2277cf002b3 100644 --- a/sys/dev/pci/envy.c +++ b/sys/dev/pci/envy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: envy.c,v 1.52 2013/02/15 14:26:24 ratchov Exp $ */ +/* $OpenBSD: envy.c,v 1.53 2013/03/14 08:14:47 ratchov Exp $ */ /* * Copyright (c) 2007 Alexandre Ratchov <alex@caoua.org> * @@ -428,7 +428,10 @@ delta_codec_write(struct envy_softc *sc, int dev, int addr, int data) #define AP192K_GPIO_CSMASK 0x30 #define AP192K_GPIO_CS(dev) ((dev) << 4) #define AP192K_GPIO_ADC_PWR 0x800 +#define AP192K_GPIO_ADC_DFSMASK (3 << 9) +#define AP192K_GPIO_ADC_DFS(v) ((v) << 9) #define AP192K_GPIO_MUTE 0x400000 + void ap192k_init(struct envy_softc *sc) { @@ -443,10 +446,11 @@ ap192k_init(struct envy_softc *sc) sc->shadow[0][AK4358_ATT(i)] = 0xff; } - /* ADC */ + /* AK5385 */ delay(1); reg = envy_gpio_getstate(sc); - reg &= ~AP192K_GPIO_ADC_PWR; + reg &= ~(AP192K_GPIO_ADC_PWR | AP192K_GPIO_ADC_DFSMASK); + reg |= AP192K_GPIO_ADC_DFS(0); envy_gpio_setstate(sc, reg); reg |= AP192K_GPIO_ADC_PWR; envy_gpio_setstate(sc, reg); |