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

Function as3722_init

freebsd/arm/nvidia/as3722.c:217–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217static int
218as3722_init(struct as3722_softc *sc)
219{
220 uint32_t reg;
221 int rv;
222
223 reg = 0;
224 if (sc->int_pullup)
225 reg |= AS3722_INT_PULL_UP;
226 if (sc->i2c_pullup)
227 reg |= AS3722_I2C_PULL_UP;
228
229 rv = RM1(sc, AS3722_IO_VOLTAGE,
230 AS3722_INT_PULL_UP | AS3722_I2C_PULL_UP, reg);
231 if (rv != 0)
232 return (ENXIO);
233
234 /* mask interrupts */
235 rv = WR1(sc, AS3722_INTERRUPT_MASK1, 0);
236 if (rv != 0)
237 return (ENXIO);
238 rv = WR1(sc, AS3722_INTERRUPT_MASK2, 0);
239 if (rv != 0)
240 return (ENXIO);
241 rv = WR1(sc, AS3722_INTERRUPT_MASK3, 0);
242 if (rv != 0)
243 return (ENXIO);
244 rv = WR1(sc, AS3722_INTERRUPT_MASK4, 0);
245 if (rv != 0)
246 return (ENXIO);
247 return (0);
248}
249
250static int
251as3722_parse_fdt(struct as3722_softc *sc, phandle_t node)

Callers 1

as3722_attachFunction · 0.85

Calls 1

WR1Function · 0.85

Tested by

no test coverage detected