From 674a20f8fb7c1db60abb153c01bfb963de7a935d Mon Sep 17 00:00:00 2001 From: perry Date: Mon, 15 Jan 2001 23:25:39 +0000 Subject: [PATCH] powerhook fixes, from thorpej, tested by me. Thinkpad T20 sound now perfect. --- sys/dev/pci/cs4280.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/sys/dev/pci/cs4280.c b/sys/dev/pci/cs4280.c index 584201f6ba0c..895816c6c539 100644 --- a/sys/dev/pci/cs4280.c +++ b/sys/dev/pci/cs4280.c @@ -1,4 +1,4 @@ -/* $NetBSD: cs4280.c,v 1.10 2001/01/15 22:28:20 perry Exp $ */ +/* $NetBSD: cs4280.c,v 1.11 2001/01/15 23:25:39 perry Exp $ */ /* * Copyright (c) 1999, 2000 Tatoku Ogaito. All rights reserved. @@ -158,7 +158,6 @@ struct cs4280_softc { char sc_suspend; void *sc_powerhook; /* Power Hook */ - u_int16_t ac97_reg[CS4280_SAVE_REG_MAX + 1]; /* Save ac97 registers */ }; #define BA0READ4(sc, r) bus_space_read_4((sc)->ba0t, (sc)->ba0h, (r)) @@ -1782,7 +1781,6 @@ cs4280_power(why, v) void *v; { struct cs4280_softc *sc = (struct cs4280_softc *)v; - int i; DPRINTF(("%s: cs4280_power why=%d\n", sc->sc_dev.dv_xname, why)); @@ -1793,12 +1791,6 @@ cs4280_power(why, v) cs4280_halt_output(sc); cs4280_halt_input(sc); - /* Save AC97 registers */ - for(i = 1; i <= CS4280_SAVE_REG_MAX; i++) { - if(i == 0x04) /* AC97_REG_MASTER_TONE */ - continue; - cs4280_read_codec(sc, 2*i, &sc->ac97_reg[i]); - } /* should I powerdown here ? */ cs4280_write_codec(sc, AC97_REG_POWER, CS4280_POWER_DOWN_ALL); break; @@ -1812,12 +1804,7 @@ cs4280_power(why, v) cs4280_init(sc, 0); cs4280_reset_codec(sc); - /* restore ac97 registers */ - for(i = 1; i <= CS4280_SAVE_REG_MAX; i++) { - if(i == 0x04) /* AC97_REG_MASTER_TONE */ - continue; - cs4280_write_codec(sc, 2*i, sc->ac97_reg[i >> 1]); - } + (*sc->codec_if->vtbl->restore_ports)(sc->codec_if); break; case PWR_SOFTSUSPEND: case PWR_SOFTSTANDBY: