FreeBSD/sys/arm/ti/ti_pinmux.c
/**
 *	ti_pinmux_attach - attaches the pinmux to the simplebus
 *	@dev: new device
 *
 *	RETURNS
 *	Zero on success or ENXIO if an error occuried.
 */
attaches the pinmux to the simplebus
@dev: new device

RETURNS
Zero on success or ENXIO if an error occuried.
attaches the pinmux to the simplebus @dev : new device RETURNS Zero on success or ENXIO if an error occuried .
static int
ti_pinmux_attach(device_t dev)
{
	struct ti_pinmux_softc *sc = device_get_softc(dev);
#if 0
	if (ti_pinmux_sc)
		return (ENXIO);
#endif
	sc->sc_dev = dev;
	if (bus_alloc_resources(dev, ti_pinmux_res_spec, sc->sc_res)) {
		device_printf(dev, "could not allocate resources\n");
		return (ENXIO);
	}
	sc->sc_bst = rman_get_bustag(sc->sc_res[0]);
	sc->sc_bsh = rman_get_bushandle(sc->sc_res[0]);
	if (ti_pinmux_sc == NULL)
		ti_pinmux_sc = sc;
	fdt_pinctrl_register(dev, "pinctrl-single,pins");
	fdt_pinctrl_configure_tree(dev);
	return (0);
}
static int ti_pinmux_attach ( device_t dev ) { struct ti_pinmux_softc * sc = device_get_softc ( dev ) ; #if 0 if ( ti_pinmux_sc ) return ( ENXIO ) ; #endif sc -> sc_dev = dev ; if ( bus_alloc_resources ( dev , ti_pinmux_res_spec , sc -> sc_res ) ) { device_printf ( dev , " \n " ) ; return ( ENXIO ) ; } sc -> sc_bst = rman_get_bustag ( sc -> sc_res [ 0 ] ) ; sc -> sc_bsh = rman_get_bushandle ( sc -> sc_res [ 0 ] ) ; if ( ti_pinmux_sc == NULL ) ti_pinmux_sc = sc ; fdt_pinctrl_register ( dev , " " ) ; fdt_pinctrl_configure_tree ( dev ) ; return ( 0 ) ; }
ti_pinmux_attach - attaches the pinmux to the simplebus
      @dev: new device
ti_pinmux_attach - attaches the pinmux to the simplebus @dev : new device