Lines Matching +full:chan +full:- +full:name
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
57 ofw_pwmbus_add_child(device_t dev, u_int order, const char *name, int unit) in ofw_pwmbus_add_child() argument
67 if ((child = device_add_child_ordered(dev, order, name, unit)) == NULL) { in ofw_pwmbus_add_child()
72 ivars->devinfo.obd_node = -1; in ofw_pwmbus_add_child()
85 ofw_bus_gen_destroy_devinfo(&ivars->devinfo); in ofw_pwmbus_child_deleted()
96 return (&ivars->devinfo); in ofw_pwmbus_get_devinfo()
107 if (ofw_bus_get_node(dev) == -1) { in ofw_pwmbus_probe()
122 pcell_t chan; in ofw_pwmbus_attach() local
126 sc->base.dev = dev; in ofw_pwmbus_attach()
129 if (PWMBUS_CHANNEL_COUNT(parent, &sc->base.nchannels) != 0 || in ofw_pwmbus_attach()
130 sc->base.nchannels == 0) { in ofw_pwmbus_attach()
146 * channel number so range-check it. in ofw_pwmbus_attach()
148 if (OF_getencprop(node, "reg", &chan, sizeof(chan)) == -1) in ofw_pwmbus_attach()
150 if (chan >= sc->base.nchannels) in ofw_pwmbus_attach()
153 if ((child = ofw_pwmbus_add_child(dev, 0, NULL, -1)) == NULL) in ofw_pwmbus_attach()
157 ivars->base.pi_channel = chan; in ofw_pwmbus_attach()
160 if (ofw_bus_gen_setup_devinfo(&ivars->devinfo, node) != 0) { in ofw_pwmbus_attach()
175 for (chan = 0; chan < sc->base.nchannels; ++chan) { in ofw_pwmbus_attach()
176 child = ofw_pwmbus_add_child(dev, 0, "pwmc", -1); in ofw_pwmbus_attach()
179 " device for channel %u\n", chan); in ofw_pwmbus_attach()
183 ivars->base.pi_channel = chan; in ofw_pwmbus_attach()