static void nm_wrcd(void *devinfo, int regno, u_int32_t data) { struct sc_info *sc = (struct sc_info *)devinfo; int cnt = 3; if (!nm_waitcd(sc)) { while (cnt-- > 0) { nm_wr(sc, sc->ac97_base + regno, data, 2); if (!nm_waitcd(sc)) { DELAY(1000); return; } } } device_printf(sc->dev, "ac97 codec not ready\n"); }
int neo_write_codec(void *sc_, u_int8_t a, u_int16_t d) { struct neo_softc *sc = sc_; int cnt = 3; if (!nm_waitcd(sc)) { while (cnt-- > 0) { nm_wr(sc, sc->ac97_base + a, d, 2); if (!nm_waitcd(sc)) { DELAY(1000); return (0); } } } return (ENXIO); }
int neo_read_codec(void *sc_, u_int8_t a, u_int16_t *d) { struct neo_softc *sc = sc_; if (!nm_waitcd(sc)) { *d = nm_rd(sc, sc->ac97_base + a, 2); DELAY(1000); return 0; } return (ENXIO); }
static int nm_rdcd(kobj_t obj, void *devinfo, int regno) { struct sc_info *sc = (struct sc_info *)devinfo; u_int32_t x; if (!nm_waitcd(sc)) { x = nm_rd(sc, sc->ac97_base + regno, 2); DELAY(1000); return x; } else { device_printf(sc->dev, "ac97 codec not ready\n"); return -1; } }