Lines Matching +full:sys +full:- +full:syscon

1 /*-
27 #include <sys/param.h>
28 #include <sys/systm.h>
29 #include <sys/bus.h>
30 #include <sys/kernel.h>
31 #include <sys/module.h>
32 #include <sys/sysctl.h>
40 #include <dev/syscon/syscon.h>
48 struct syscon *syscon; member
63 for(i = 50; i > 0; i--) { in am335x_scm_temp_sysctl()
64 reg = SYSCON_READ_4(sc->syscon, SCM_BGAP_CTRL); in am335x_scm_temp_sysctl()
70 sc->sc_last_temp = in am335x_scm_temp_sysctl()
72 sc->sc_last_temp *= 10; in am335x_scm_temp_sysctl()
74 temp = sc->sc_last_temp + TZ_ZEROC; in am335x_scm_temp_sysctl()
121 /* FIXME: For now; Go and kidnap syscon from opp-table */ in am335x_scm_attach()
122 opp_table = OF_finddevice("/opp-table"); in am335x_scm_attach()
123 if (opp_table == -1) { in am335x_scm_attach()
124 device_printf(dev, "Cant find /opp-table\n"); in am335x_scm_attach()
127 if (!OF_hasprop(opp_table, "syscon")) { in am335x_scm_attach()
128 device_printf(dev, "/opp-table missing syscon property\n"); in am335x_scm_attach()
131 err = syscon_get_by_ofw_property(dev, opp_table, "syscon", &sc->syscon); in am335x_scm_attach()
133 device_printf(dev, "Failed to get syscon\n"); in am335x_scm_attach()
138 SYSCON_WRITE_4(sc->syscon, SCM_BGAP_CTRL, 0); in am335x_scm_attach()
139 reg = SYSCON_READ_4(sc->syscon, SCM_BGAP_CTRL); in am335x_scm_attach()
142 SYSCON_WRITE_4(sc->syscon, SCM_BGAP_CTRL, SCM_BGAP_CONTCONV); in am335x_scm_attach()
143 reg = SYSCON_READ_4(sc->syscon, SCM_BGAP_CTRL); in am335x_scm_attach()
147 SYSCON_WRITE_4(sc->syscon, SCM_BGAP_CTRL, reg); in am335x_scm_attach()
152 sc->sc_temp_oid = SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, in am335x_scm_attach()
167 if (sc->sc_temp_oid != NULL) in am335x_scm_detach()
168 sysctl_remove_oid(sc->sc_temp_oid, 1, 0); in am335x_scm_detach()
171 SYSCON_WRITE_4(sc->syscon, SCM_BGAP_CTRL, SCM_BGAP_BGOFF); in am335x_scm_detach()