| 80 | void codec_print_registers(struct codec_softc *sc); |
| 81 | |
| 82 | static int |
| 83 | codec_write(struct codec_softc *sc, uint32_t reg, uint32_t val) |
| 84 | { |
| 85 | uint32_t tmp; |
| 86 | |
| 87 | clk_enable(sc->clk); |
| 88 | |
| 89 | tmp = (reg << RGADW_RGADDR_S); |
| 90 | tmp |= (val << RGADW_RGDIN_S); |
| 91 | tmp |= RGADW_RGWR; |
| 92 | |
| 93 | WRITE4(sc, CODEC_RGADW, tmp); |
| 94 | |
| 95 | while(READ4(sc, CODEC_RGADW) & RGADW_RGWR) |
| 96 | ; |
| 97 | |
| 98 | clk_disable(sc->clk); |
| 99 | |
| 100 | return (0); |
| 101 | } |
| 102 | |
| 103 | static int |
| 104 | codec_read(struct codec_softc *sc, uint32_t reg) |