Lines Matching +full:syscon +full:- +full:dev
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
36 #include <dev/fdt/simplebus.h>
38 #include <dev/clk/clk.h>
39 #include <dev/clk/clk_fixed.h>
40 #include <dev/syscon/syscon.h>
42 #include <dev/ofw/ofw_bus.h>
43 #include <dev/ofw/ofw_bus_subr.h>
53 device_t dev; member
57 static int a37x0_xtal_attach(device_t dev);
58 static int a37x0_xtal_detach(device_t dev);
59 static int a37x0_xtal_probe(device_t dev);
69 "a37x0-xtal",
78 a37x0_xtal_attach(device_t dev) in a37x0_xtal_attach() argument
82 struct syscon *syscon; in a37x0_xtal_attach() local
86 sc = device_get_softc(dev); in a37x0_xtal_attach()
88 def.clkdef.name = "armada-3700-xtal"; in a37x0_xtal_attach()
95 if (SYSCON_GET_HANDLE(dev, &syscon) != 0 || syscon == NULL){ in a37x0_xtal_attach()
96 device_printf(dev, "Cannot get syscon driver handle\n"); in a37x0_xtal_attach()
100 reg = SYSCON_READ_4(syscon, NB_GPIO1_PIN_LT_L); in a37x0_xtal_attach()
106 sc->clkdom = clkdom_create(dev); in a37x0_xtal_attach()
107 error = clknode_fixed_register(sc->clkdom, &def); in a37x0_xtal_attach()
109 device_printf(dev, "Cannot register clock node\n"); in a37x0_xtal_attach()
113 error = clkdom_finit(sc->clkdom); in a37x0_xtal_attach()
115 device_printf(dev, "Cannot finalize clock domain initialization\n"); in a37x0_xtal_attach()
120 clkdom_dump(sc->clkdom); in a37x0_xtal_attach()
126 a37x0_xtal_probe(device_t dev) in a37x0_xtal_probe() argument
129 if (!ofw_bus_status_okay(dev)) in a37x0_xtal_probe()
132 if (!ofw_bus_is_compatible(dev, "marvell,armada-3700-xtal-clock")) in a37x0_xtal_probe()
135 device_set_desc(dev, "Marvell Armada 3700 Oscillator"); in a37x0_xtal_probe()
140 a37x0_xtal_detach(device_t dev) in a37x0_xtal_detach() argument