MCPcopy Create free account
hub / github.com/F-Stack/f-stack / codec_write

Function codec_write

freebsd/mips/ingenic/jz4780_codec.c:82–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80void codec_print_registers(struct codec_softc *sc);
81
82static int
83codec_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
103static int
104codec_read(struct codec_softc *sc, uint32_t reg)

Callers 1

codec_attachFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected