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

Function tsadc_init_sysctl

freebsd/arm64/rockchip/rk_tsadc.c:548–573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546}
547
548static int
549tsadc_init_sysctl(struct tsadc_softc *sc)
550{
551 int i;
552 struct sysctl_oid *oid, *tmp;
553
554 sysctl_ctx_init(&tsadc_sysctl_ctx);
555 /* create node for hw.temp */
556 oid = SYSCTL_ADD_NODE(&tsadc_sysctl_ctx,
557 SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, "temperature",
558 CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "");
559 if (oid == NULL)
560 return (ENXIO);
561
562 /* Add sensors */
563 for (i = sc->conf->ntsensors - 1; i >= 0; i--) {
564 tmp = SYSCTL_ADD_PROC(&tsadc_sysctl_ctx,
565 SYSCTL_CHILDREN(oid), OID_AUTO, sc->conf->tsensors[i].name,
566 CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, i,
567 tsadc_sysctl_temperature, "IK", "SoC Temperature");
568 if (tmp == NULL)
569 return (ENXIO);
570 }
571
572 return (0);
573}
574
575static int
576tsadc_intr(void *arg)

Callers 1

tsadc_attachFunction · 0.85

Calls 1

sysctl_ctx_initFunction · 0.85

Tested by

no test coverage detected