Exemple #1
0
		device_printf(dev, "bus_setup_intr() failed! (%d)\n", error);
		goto bad;
	}
	return (0);

bad:
	if (eisa_io)
		bus_release_resource(dev, SYS_RES_IOPORT, 0, eisa_io);

	ep_free(dev);
	return (error);
}

static device_method_t ep_eisa_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe, ep_eisa_probe),
	DEVMETHOD(device_attach, ep_eisa_attach),
	DEVMETHOD(device_detach, ep_detach),

	DEVMETHOD_END
};

static driver_t ep_eisa_driver = {
	"ep",
	ep_eisa_methods,
	sizeof(struct ep_softc),
};

extern devclass_t ep_devclass;

DRIVER_MODULE(ep, eisa, ep_eisa_driver, ep_devclass, 0, 0);
Exemple #2
0
	usb_bus_mem_free_all(&sc->sc_dci.sc_bus, NULL);

	/* disable clocks */
	at91_pmc_clock_disable(sc->sc_iclk);
	at91_pmc_clock_disable(sc->sc_fclk);
	at91_pmc_clock_disable(sc->sc_mclk);
	at91_pmc_clock_deref(sc->sc_fclk);
	at91_pmc_clock_deref(sc->sc_iclk);
	at91_pmc_clock_deref(sc->sc_mclk);

	return (0);
}

static device_method_t at91_udp_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe, at91_udp_probe),
	DEVMETHOD(device_attach, at91_udp_attach),
	DEVMETHOD(device_detach, at91_udp_detach),
	DEVMETHOD(device_suspend, bus_generic_suspend),
	DEVMETHOD(device_resume, bus_generic_resume),
	DEVMETHOD(device_shutdown, bus_generic_shutdown),

	DEVMETHOD_END
};

static driver_t at91_udp_driver = {
	.name = "at91_udp",
	.methods = at91_udp_methods,
	.size = sizeof(struct at91_udp_softc),
};
Exemple #3
0

struct km_softc {
	struct device		*sc_dev;
	struct ksensor		sc_sensor;
	struct ksensordev	sc_sensordev;
};

static void	km_identify(driver_t *, struct device *);
static int	km_probe(struct device *);
static int	km_attach(struct device *);
static int	km_detach(struct device *);
static void	km_refresh(void *);

static device_method_t km_methods[] = {
	DEVMETHOD(device_identify,	km_identify),
	DEVMETHOD(device_probe,		km_probe),
	DEVMETHOD(device_attach,	km_attach),
	DEVMETHOD(device_detach,	km_detach),
	{ NULL, NULL }
};

static driver_t km_driver = {
	"km",
	km_methods,
	sizeof(struct km_softc)
};

static devclass_t km_devclass;

DRIVER_MODULE(km, hostb, km_driver, km_devclass, NULL, NULL);
Exemple #4
0
ti_mmchs_detach(device_t dev)
{
	struct ti_mmchs_softc *sc = device_get_softc(dev);

	ti_mmchs_hw_fini(dev);
	ti_mmchs_deactivate(dev);

	ti_sdma_deactivate_channel(sc->sc_dmach_wr);
	ti_sdma_deactivate_channel(sc->sc_dmach_rd);

	return (0);
}

static device_method_t ti_mmchs_methods[] = {
	/* device_if */
	DEVMETHOD(device_probe, ti_mmchs_probe),
	DEVMETHOD(device_attach, ti_mmchs_attach),
	DEVMETHOD(device_detach, ti_mmchs_detach),

	/* Bus interface */
	DEVMETHOD(bus_read_ivar,	ti_mmchs_read_ivar),
	DEVMETHOD(bus_write_ivar,	ti_mmchs_write_ivar),

	/* mmcbr_if - MMC state machine callbacks */
	DEVMETHOD(mmcbr_update_ios, ti_mmchs_update_ios),
	DEVMETHOD(mmcbr_request, ti_mmchs_request),
	DEVMETHOD(mmcbr_get_ro, ti_mmchs_get_ro),
	DEVMETHOD(mmcbr_acquire_host, ti_mmchs_acquire_host),
	DEVMETHOD(mmcbr_release_host, ti_mmchs_release_host),

	{0, 0},
	clk->pll_min_in    = SAM9260_PLL_B_MIN_IN_FREQ;		/*   1 MHz */
	clk->pll_max_in    = SAM9260_PLL_B_MAX_IN_FREQ;		/*   5 MHz */
	clk->pll_max_in    = 2999999;				/*  ~3 MHz */
	clk->pll_min_out   = SAM9260_PLL_B_MIN_OUT_FREQ;	/*  70 MHz */
	clk->pll_max_out   = SAM9260_PLL_B_MAX_OUT_FREQ;	/* 130 MHz */
	clk->pll_mul_shift = SAM9260_PLL_B_MUL_SHIFT;
	clk->pll_mul_mask  = SAM9260_PLL_B_MUL_MASK;
	clk->pll_div_shift = SAM9260_PLL_B_DIV_SHIFT;
	clk->pll_div_mask  = SAM9260_PLL_B_DIV_MASK;
	clk->set_outb      = at91_pll_outb;
	at91_pmc_clock_deref(clk);
	return (0);
}

static device_method_t at91sam9260_methods[] = {
	DEVMETHOD(device_probe, at91_probe),
	DEVMETHOD(device_attach, at91_attach),
	DEVMETHOD(device_identify, at91_identify),
	{0, 0},
};

static driver_t at91sam9260_driver = {
	"at91sam9260",
	at91sam9260_methods,
	sizeof(struct at91sam9_softc),
};

static devclass_t at91sam9260_devclass;

DRIVER_MODULE(at91sam9260, atmelarm, at91sam9260_driver, at91sam9260_devclass, 0, 0);
#include <mips/cavium/octeon_pcmap_regs.h>

#include <contrib/octeon-sdk/cvmx.h>

#include "uart_if.h"

extern struct uart_class uart_oct16550_class;


static int uart_octeon_probe(device_t dev);

extern struct uart_class octeon_uart_class;

static device_method_t uart_octeon_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe, uart_octeon_probe),
	DEVMETHOD(device_attach, uart_bus_attach),
	DEVMETHOD(device_detach, uart_bus_detach),
	{0, 0}
};

static driver_t uart_octeon_driver = {
	uart_driver_name,
	uart_octeon_methods,
	sizeof(struct uart_softc),
};

extern 
SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs;

static int
Exemple #7
0
				void *);
static struct resource_list *nexus_get_reslist(device_t dev, device_t child);
static	int nexus_set_resource(device_t, device_t, int, int, u_long, u_long);
static	int nexus_get_resource(device_t, device_t, int, int, u_long *, u_long *);
static void nexus_delete_resource(device_t, device_t, int, int);
#ifdef DEV_APIC
static	int nexus_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs);
static	int nexus_release_msi(device_t pcib, device_t dev, int count, int *irqs);
static	int nexus_alloc_msix(device_t pcib, device_t dev, int *irq);
static	int nexus_release_msix(device_t pcib, device_t dev, int irq);
static	int nexus_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data);
#endif

static device_method_t nexus_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe,		nexus_probe),
	DEVMETHOD(device_attach,	nexus_attach),
	DEVMETHOD(device_detach,	bus_generic_detach),
	DEVMETHOD(device_shutdown,	bus_generic_shutdown),
	DEVMETHOD(device_suspend,	bus_generic_suspend),
	DEVMETHOD(device_resume,	bus_generic_resume),

	/* Bus interface */
	DEVMETHOD(bus_print_child,	nexus_print_child),
	DEVMETHOD(bus_add_child,	nexus_add_child),
	DEVMETHOD(bus_alloc_resource,	nexus_alloc_resource),
	DEVMETHOD(bus_adjust_resource,	nexus_adjust_resource),
	DEVMETHOD(bus_release_resource,	nexus_release_resource),
	DEVMETHOD(bus_activate_resource, nexus_activate_resource),
	DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource),
	DEVMETHOD(bus_setup_intr,	nexus_setup_intr),
Exemple #8
0
#include <bus/pccard/pccarddevs.h>
#include "card_if.h"

#include "if_aironet_ieee.h"
#include "if_anreg.h"

/*
 * Support for PCMCIA cards.
 */
static int  an_pccard_match(device_t);
static int  an_pccard_probe(device_t);
static int  an_pccard_attach(device_t);

static device_method_t an_pccard_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe,		pccard_compat_probe),
	DEVMETHOD(device_attach,	pccard_compat_attach),
	DEVMETHOD(device_shutdown,	an_shutdown),
	DEVMETHOD(device_detach,	an_detach),

	/* Card interface */
	DEVMETHOD(card_compat_match,	an_pccard_match),
	DEVMETHOD(card_compat_probe,	an_pccard_probe),
	DEVMETHOD(card_compat_attach,	an_pccard_attach),

	{ 0, 0 }
};

static driver_t an_pccard_driver = {
	"an",
	an_pccard_methods,
Exemple #9
0
static device_probe_t g_modem_probe;
static device_attach_t g_modem_attach;
static device_detach_t g_modem_detach;
static usb_handle_request_t g_modem_handle_request;
static usb_callback_t g_modem_intr_callback;
static usb_callback_t g_modem_bulk_read_callback;
static usb_callback_t g_modem_bulk_write_callback;

static void g_modem_timeout(void *arg);

static devclass_t g_modem_devclass;

static device_method_t g_modem_methods[] = {
	/* USB interface */
	DEVMETHOD(usb_handle_request, g_modem_handle_request),

	/* Device interface */
	DEVMETHOD(device_probe, g_modem_probe),
	DEVMETHOD(device_attach, g_modem_attach),
	DEVMETHOD(device_detach, g_modem_detach),

	DEVMETHOD_END
};

static driver_t g_modem_driver = {
	.name = "g_modem",
	.methods = g_modem_methods,
	.size = sizeof(struct g_modem_softc),
};
Exemple #10
0
ACPI_HANDLE acpi_lid_handle;

ACPI_SERIAL_DECL(lid, "ACPI lid");

static int	acpi_lid_probe(device_t dev);
static int	acpi_lid_attach(device_t dev);
static int	acpi_lid_suspend(device_t dev);
static int	acpi_lid_resume(device_t dev);
static void	acpi_lid_notify_status_changed(void *arg);
static void 	acpi_lid_notify_handler(ACPI_HANDLE h, UINT32 notify,
					void *context);

static device_method_t acpi_lid_methods[] = {
    /* Device interface */
    DEVMETHOD(device_probe,	acpi_lid_probe),
    DEVMETHOD(device_attach,	acpi_lid_attach),
    DEVMETHOD(device_suspend,	acpi_lid_suspend),
    DEVMETHOD(device_resume,	acpi_lid_resume),

    DEVMETHOD_END
};

static driver_t acpi_lid_driver = {
    "acpi_lid",
    acpi_lid_methods,
    sizeof(struct acpi_lid_softc),
};

static devclass_t acpi_lid_devclass;
DRIVER_MODULE(acpi_lid, acpi, acpi_lid_driver, acpi_lid_devclass, 0, 0);
Exemple #11
0
	bus_space_tag_t		bst;
};

static phandle_t i2c_get_node(device_t, device_t);
static int i2c_probe(device_t);
static int i2c_attach(device_t);

static int i2c_repeated_start(device_t, u_char, int);
static int i2c_start(device_t, u_char, int);
static int i2c_stop(device_t);
static int i2c_reset(device_t, u_char, u_char, u_char *);
static int i2c_read(device_t, char *, int, int *, int, int);
static int i2c_write(device_t, const char *, int, int *, int);

static device_method_t i2c_methods[] = {
	DEVMETHOD(device_probe,			i2c_probe),
	DEVMETHOD(device_attach,		i2c_attach),

	/* OFW methods */
	DEVMETHOD(ofw_bus_get_node,		i2c_get_node),

	DEVMETHOD(iicbus_callback,		iicbus_null_callback),
	DEVMETHOD(iicbus_repeated_start,	i2c_repeated_start),
	DEVMETHOD(iicbus_start,			i2c_start),
	DEVMETHOD(iicbus_stop,			i2c_stop),
	DEVMETHOD(iicbus_reset,			i2c_reset),
	DEVMETHOD(iicbus_read,			i2c_read),
	DEVMETHOD(iicbus_write,			i2c_write),
	DEVMETHOD(iicbus_transfer,		iicbus_transfer_gen),

	{ 0, 0 }
Exemple #12
0
	bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, NULL, adv_intr, 
	    adv, &ih);

	/* Attach sub-devices - always succeeds */
	adv_attach(adv);
	if (adv_b != NULL)
		adv_attach(adv_b);

	return 0;

 bad:
	bus_release_resource(dev, SYS_RES_IOPORT, 0, io);
	bus_release_resource(dev, SYS_RES_IRQ, 0, irq);
	return -1;
}

static device_method_t adv_eisa_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe,		adv_eisa_probe),
	DEVMETHOD(device_attach,	adv_eisa_attach),
	{ 0, 0 }
};

static driver_t adv_eisa_driver = {
	"adv", adv_eisa_methods, sizeof(struct adv_softc)
};

static devclass_t adv_eisa_devclass;
DRIVER_MODULE(adv, eisa, adv_eisa_driver, adv_eisa_devclass, 0, 0);
MODULE_DEPEND(adv, eisa, 1, 1, 1);
Exemple #13
0
	}

	if (sc->sc_enabled)
		platform_pl310_init(sc);

	pl310_wbinv_all();

	/* Set the l2 functions in the set of cpufuncs */
	cpufuncs.cf_l2cache_wbinv_all = pl310_wbinv_all;
	cpufuncs.cf_l2cache_wbinv_range = pl310_wbinv_range;
	cpufuncs.cf_l2cache_inv_range = pl310_inv_range;
	cpufuncs.cf_l2cache_wb_range = pl310_wb_range;

	return (0);
}

static device_method_t pl310_methods[] = {
	DEVMETHOD(device_probe, pl310_probe),
	DEVMETHOD(device_attach, pl310_attach),
	{0, 0},
};

static driver_t pl310_driver = {
        "l2cache",
        pl310_methods,
        sizeof(struct pl310_softc),
};
static devclass_t pl310_devclass;

DRIVER_MODULE(pl310, simplebus, pl310_driver, pl310_devclass, 0, 0);
Exemple #14
0
	}
#ifdef CLK_DEBUG
	clkdom_dump(sc->clkdom);
#endif
	free(__DECONST(char *, def.clkdef.name), M_OFWPROP);
	free(def.clkdef.parent_names, M_OFWPROP);
	return (bus_generic_attach(dev));

fail:
	free(__DECONST(char *, def.clkdef.name), M_OFWPROP);
	free(def.clkdef.parent_names, M_OFWPROP);
	return (rv);
}

static device_method_t clk_fixed_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe,		clk_fixed_probe),
	DEVMETHOD(device_attach,	clk_fixed_attach),

	DEVMETHOD_END
};

DEFINE_CLASS_0(clk_fixed, clk_fixed_driver, clk_fixed_methods,
    sizeof(struct clk_fixed_softc));
static devclass_t clk_fixed_devclass;
EARLY_DRIVER_MODULE(clk_fixed, simplebus, clk_fixed_driver,
    clk_fixed_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE);
MODULE_VERSION(clk_fixed, 1);

#endif
Exemple #15
0
	(bus_space_write_1(rman_get_bustag((reg)), 	\
	    rman_get_bushandle((reg)), 0, (val)))

static void	ichss_identify(driver_t *driver, device_t parent);
static int	ichss_probe(device_t dev);
static int	ichss_attach(device_t dev);
static int	ichss_detach(device_t dev);
static int	ichss_settings(device_t dev, struct cf_setting *sets,
		    int *count);
static int	ichss_set(device_t dev, const struct cf_setting *set);
static int	ichss_get(device_t dev, struct cf_setting *set);
static int	ichss_type(device_t dev, int *type);

static device_method_t ichss_methods[] = {
	/* Device interface */
	DEVMETHOD(device_identify,	ichss_identify),
	DEVMETHOD(device_probe,		ichss_probe),
	DEVMETHOD(device_attach,	ichss_attach),
	DEVMETHOD(device_detach,	ichss_detach),

	/* cpufreq interface */
	DEVMETHOD(cpufreq_drv_set,	ichss_set),
	DEVMETHOD(cpufreq_drv_get,	ichss_get),
	DEVMETHOD(cpufreq_drv_type,	ichss_type),
	DEVMETHOD(cpufreq_drv_settings,	ichss_settings),
	DEVMETHOD_END
};
static driver_t ichss_driver = {
	"ichss", ichss_methods, sizeof(struct ichss_softc)
};
static devclass_t ichss_devclass;
Exemple #16
0
#include <dev/uart/uart.h>
#include <dev/uart/uart_bus.h>
#include <dev/uart/uart_cpu.h>

#include <dev/ic/ns16550.h>

#include "uart_if.h"

static int uart_rc32434_probe(device_t dev);

extern struct uart_class uart_rc32434_uart_class;

static device_method_t uart_rc32434_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe,		uart_rc32434_probe),
	DEVMETHOD(device_attach,	uart_bus_attach),
	DEVMETHOD(device_detach,	uart_bus_detach),
	{ 0, 0 }
};

static driver_t uart_rc32434_driver = {
	uart_driver_name,
	uart_rc32434_methods,
	sizeof(struct uart_softc),
};

extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs;

static int
uart_rc32434_probe(device_t dev)
Exemple #17
0
	for (i = 0; i < 10; i++) {
		reg = bus_space_read_4(sc->bst, sc->bsh, MCT_WRITE_STAT);
		if (reg & mask) {
			bus_space_write_4(sc->bst, sc->bsh,
			    MCT_WRITE_STAT, mask);
			return (0);
		}
		cpufunc_nullop();
	}

	/* NOTREACHED */

	panic("Can't enable timer\n");
}

static device_method_t arm_tmr_methods[] = {
	DEVMETHOD(device_probe,		arm_tmr_probe),
	DEVMETHOD(device_attach,	arm_tmr_attach),
	{ 0, 0 }
};

static driver_t arm_tmr_driver = {
	"arch_timer",
	arm_tmr_methods,
	sizeof(struct arm_tmr_softc),
};

static devclass_t arm_tmr_devclass;

DRIVER_MODULE(arch_timer, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0);
Exemple #18
0
static void		amr_pci_intr(void *arg);
static void		amr_pci_free(struct amr_softc *sc);
static void		amr_sglist_helper(void *arg, bus_dma_segment_t *segs, int nseg, int error);
static int		amr_sglist_map(struct amr_softc *sc);
static int		amr_setup_mbox(struct amr_softc *sc);
static int		amr_ccb_map(struct amr_softc *sc);

static u_int amr_force_sg32 = 0;
TUNABLE_INT("hw.amr.force_sg32", &amr_force_sg32);
SYSCTL_DECL(_hw_amr);
SYSCTL_UINT(_hw_amr, OID_AUTO, force_sg32, CTLFLAG_RD, &amr_force_sg32, 0,
    "Force the AMR driver to use 32bit scatter gather");

static device_method_t amr_methods[] = {
    /* Device interface */
    DEVMETHOD(device_probe,	amr_pci_probe),
    DEVMETHOD(device_attach,	amr_pci_attach),
    DEVMETHOD(device_detach,	amr_pci_detach),
    DEVMETHOD(device_shutdown,	amr_pci_shutdown),
    DEVMETHOD(device_suspend,	amr_pci_suspend),
    DEVMETHOD(device_resume,	amr_pci_resume),

    DEVMETHOD(bus_print_child,	bus_generic_print_child),
    DEVMETHOD(bus_driver_added,	bus_generic_driver_added),
    { 0, 0 }
};

static driver_t amr_pci_driver = {
	"amr",
	amr_methods,
	sizeof(struct amr_softc)
Exemple #19
0
static bus_get_resource_list_t nexus_get_resource_list;
#ifdef SMP
static bus_bind_intr_t nexus_bind_intr;
#endif
static bus_describe_intr_t nexus_describe_intr;
static bus_get_dma_tag_t nexus_get_dma_tag;
static ofw_bus_get_devinfo_t nexus_get_devinfo;

static int nexus_inlist(const char *, const char *const *);
static struct nexus_devinfo * nexus_setup_dinfo(device_t, phandle_t);
static void nexus_destroy_dinfo(struct nexus_devinfo *);
static int nexus_print_res(struct nexus_devinfo *);

static device_method_t nexus_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe,		nexus_probe),
	DEVMETHOD(device_attach,	nexus_attach),
	DEVMETHOD(device_detach,	bus_generic_detach),
	DEVMETHOD(device_shutdown,	bus_generic_shutdown),
	DEVMETHOD(device_suspend,	bus_generic_suspend),
	DEVMETHOD(device_resume,	bus_generic_resume),

	/* Bus interface */
	DEVMETHOD(bus_print_child,	nexus_print_child),
	DEVMETHOD(bus_probe_nomatch,	nexus_probe_nomatch),
	DEVMETHOD(bus_read_ivar,	bus_generic_read_ivar),
	DEVMETHOD(bus_write_ivar,	bus_generic_write_ivar),
	DEVMETHOD(bus_add_child,	nexus_add_child),
	DEVMETHOD(bus_alloc_resource,	nexus_alloc_resource),
	DEVMETHOD(bus_activate_resource,	nexus_activate_resource),
	DEVMETHOD(bus_deactivate_resource,	nexus_deactivate_resource),
Exemple #20
0
#include "gic_v3_reg.h"
#include "gic_v3_var.h"

/*
 * FDT glue.
 */
static int gic_v3_fdt_probe(device_t);
static int gic_v3_fdt_attach(device_t);

static struct resource *gic_v3_ofw_bus_alloc_res(device_t, device_t, int, int *,
    rman_res_t, rman_res_t, rman_res_t, u_int);
static const struct ofw_bus_devinfo *gic_v3_ofw_get_devinfo(device_t, device_t);

static device_method_t gic_v3_fdt_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe,		gic_v3_fdt_probe),
	DEVMETHOD(device_attach,	gic_v3_fdt_attach),

	/* Bus interface */
	DEVMETHOD(bus_alloc_resource,		gic_v3_ofw_bus_alloc_res),
	DEVMETHOD(bus_activate_resource,	bus_generic_activate_resource),

	/* ofw_bus interface */
	DEVMETHOD(ofw_bus_get_devinfo,	gic_v3_ofw_get_devinfo),
	DEVMETHOD(ofw_bus_get_compat,	ofw_bus_gen_get_compat),
	DEVMETHOD(ofw_bus_get_model,	ofw_bus_gen_get_model),
	DEVMETHOD(ofw_bus_get_name,	ofw_bus_gen_get_name),
	DEVMETHOD(ofw_bus_get_node,	ofw_bus_gen_get_node),
	DEVMETHOD(ofw_bus_get_type,	ofw_bus_gen_get_type),

	/* End */
Exemple #21
0
#include <net/if.h>
#include <net/ethernet.h>
#include <net/if_arp.h>

#include <isa/isavar.h>

#include <dev/sbni/if_sbnireg.h>
#include <dev/sbni/if_sbnivar.h>

static int	sbni_probe_isa(device_t);
static int	sbni_attach_isa(device_t);

static device_method_t sbni_isa_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe,	sbni_probe_isa),
	DEVMETHOD(device_attach, sbni_attach_isa),
	{ 0, 0 }
};

static driver_t sbni_isa_driver = {
	"sbni",
	sbni_isa_methods,
	sizeof(struct sbni_softc)
};

static devclass_t sbni_isa_devclass;
static struct isa_pnp_id  sbni_ids[] = {
	{ 0, NULL }	/* we have no pnp sbni cards atm.  */
};
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#include USB_GLOBAL_INCLUDE_FILE

#include <dev/usb/controller/saf1761_otg.h>
#include <dev/usb/controller/saf1761_otg_reg.h>

static device_probe_t saf1761_otg_fdt_probe;
static device_attach_t saf1761_otg_fdt_attach;
static device_detach_t saf1761_otg_fdt_detach;

static device_method_t saf1761_otg_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe, saf1761_otg_fdt_probe),
	DEVMETHOD(device_attach, saf1761_otg_fdt_attach),
	DEVMETHOD(device_detach, saf1761_otg_fdt_detach),
	DEVMETHOD(device_suspend, bus_generic_suspend),
	DEVMETHOD(device_resume, bus_generic_resume),
	DEVMETHOD(device_shutdown, bus_generic_shutdown),

	DEVMETHOD_END
};

static driver_t saf1761_otg_driver = {
	.name = "saf1761otg",
	.methods = saf1761_otg_methods,
	.size = sizeof(struct saf1761_otg_softc),
};
Exemple #23
0
static int
mga_detach(device_t kdev)
{
	struct drm_device *dev = device_get_softc(kdev);
	int ret;

	ret = drm_detach(kdev);

	free(dev->driver, DRM_MEM_DRIVER);

	return ret;
}

static device_method_t mga_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe,		mga_probe),
	DEVMETHOD(device_attach,	mga_attach),
	DEVMETHOD(device_detach,	mga_detach),

	{ 0, 0 }
};

static driver_t mga_driver = {
	"drm",
	mga_methods,
	sizeof(struct drm_device)
};

extern devclass_t drm_devclass;
#if __FreeBSD_version >= 700010
DRIVER_MODULE(mga, vgapci, mga_driver, drm_devclass, 0, 0);
static uint32_t
ehci_bs_r_4(void *t, bus_space_handle_t h, bus_size_t o)
{
	return bus_space_read_4((bus_space_tag_t) t, h, 0x100 + o);
}

static void
ehci_bs_w_4(void *t, bus_space_handle_t h, bus_size_t o, uint32_t v)
{
	bus_space_write_4((bus_space_tag_t) t, h, 0x100 + o, v);
}

static device_method_t ehci_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe, ehci_ixp_probe),
	DEVMETHOD(device_attach, ehci_ixp_attach),
	DEVMETHOD(device_detach, ehci_ixp_detach),
	DEVMETHOD(device_suspend, ehci_ixp_suspend),
	DEVMETHOD(device_resume, ehci_ixp_resume),
	DEVMETHOD(device_shutdown, ehci_ixp_shutdown),

	/* Bus interface */
	DEVMETHOD(bus_print_child, bus_generic_print_child),

	{0, 0}
};

static driver_t ehci_driver = {
	"ehci",
	ehci_methods,
/* Table of sysctl names and HKEY functions to call. */
static struct {
	char		*name;
	hkey_fn_t	*handler;
} sysctl_table[] = {
	/* name,		handler */
	{"lcd_brightness_max",	hkey_lcd_brightness_max},
	{"lcd_brightness_min",	hkey_lcd_brightness_min},
	{"lcd_brightness",	hkey_lcd_brightness},
	{"sound_mute",		hkey_sound_mute},
	{NULL, NULL}
};

static device_method_t acpi_panasonic_methods[] = {
	DEVMETHOD(device_probe,		acpi_panasonic_probe),
	DEVMETHOD(device_attach,	acpi_panasonic_attach),
	DEVMETHOD(device_detach,	acpi_panasonic_detach),
	DEVMETHOD(device_shutdown,	acpi_panasonic_shutdown),

	{0, 0}
};

static driver_t acpi_panasonic_driver = {
	"acpi_panasonic",
	acpi_panasonic_methods,
	sizeof(struct acpi_panasonic_softc),
};

static devclass_t acpi_panasonic_devclass;
Exemple #26
0
		device_printf(dev, "detach failed\n");
		return (error);
	}

	error = bus_teardown_intr(dev, sc->sc_irq, sc->sc_ih);
	if (error) {
		device_printf(dev, "failed to unregister interrupt handler\n");
	}

	aic_isa_release_resources(dev);
	return (0);
}

static device_method_t aic_isa_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe,		aic_isa_probe),
	DEVMETHOD(device_attach,	aic_isa_attach),
	DEVMETHOD(device_detach,	aic_isa_detach),
	{ 0, 0 }
};

static driver_t aic_isa_driver = {
	"aic",
	aic_isa_methods, sizeof(struct aic_isa_softc),
};

extern devclass_t aic_devclass;

MODULE_DEPEND(aic, cam, 1,1,1);
DRIVER_MODULE(aic, isa, aic_isa_driver, aic_devclass, 0, 0);
Exemple #27
0
static int aac_disk_probe(device_t dev);
static int aac_disk_attach(device_t dev);
static int aac_disk_detach(device_t dev);

/*
 * Interface to the device switch.
 */
static	disk_open_t	aac_disk_open;
static	disk_close_t	aac_disk_close;
static	disk_strategy_t	aac_disk_strategy;
static	dumper_t	aac_disk_dump;

static devclass_t	aac_disk_devclass;

static device_method_t aac_disk_methods[] = {
	DEVMETHOD(device_probe,	aac_disk_probe),
	DEVMETHOD(device_attach,	aac_disk_attach),
	DEVMETHOD(device_detach,	aac_disk_detach),
	DEVMETHOD_END
};

static driver_t aac_disk_driver = {
	"aacd",
	aac_disk_methods,
	sizeof(struct aac_disk)
};

DRIVER_MODULE(aacd, aac, aac_disk_driver, aac_disk_devclass, NULL, NULL);

/*
 * Handle open from generic layer.
Exemple #28
0
u_int32_t
csa_readmem(csa_res *resp, u_long offset)
{
	return bus_space_read_4(rman_get_bustag(resp->mem), rman_get_bushandle(resp->mem), offset);
}

void
csa_writemem(csa_res *resp, u_long offset, u_int32_t data)
{
	bus_space_write_4(rman_get_bustag(resp->mem), rman_get_bushandle(resp->mem), offset, data);
}

static device_method_t csa_methods[] = {
	/* Device interface */
	DEVMETHOD(device_probe,		csa_probe),
	DEVMETHOD(device_attach,	csa_attach),
	DEVMETHOD(device_detach,	csa_detach),
	DEVMETHOD(device_shutdown,	bus_generic_shutdown),
	DEVMETHOD(device_suspend,	bus_generic_suspend),
	DEVMETHOD(device_resume,	csa_resume),

	/* Bus interface */
	DEVMETHOD(bus_alloc_resource,	csa_alloc_resource),
	DEVMETHOD(bus_release_resource,	csa_release_resource),
	DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
	DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
	DEVMETHOD(bus_setup_intr,	csa_setup_intr),
	DEVMETHOD(bus_teardown_intr,	csa_teardown_intr),

	DEVMETHOD_END
Exemple #29
0
done:
	if (error)
		device_printf(dev, "Unable to initialize\n");
	return (error);
}

static int cyapa_probe(device_t);
static int cyapa_attach(device_t);
static int cyapa_detach(device_t);
static void cyapa_cdevpriv_dtor(void*);

static devclass_t cyapa_devclass;

static device_method_t cyapa_methods[] = {
	/* device interface */
	DEVMETHOD(device_probe,		cyapa_probe),
	DEVMETHOD(device_attach,	cyapa_attach),
	DEVMETHOD(device_detach,	cyapa_detach),

	DEVMETHOD_END
};

static driver_t cyapa_driver = {
	"cyapa",
	cyapa_methods,
	sizeof(struct cyapa_softc),
};

static	d_open_t	cyapaopen;
static	d_ioctl_t	cyapaioctl;
static	d_read_t	cyaparead;
Exemple #30
0
static int
bhnd_pcib_suspend(device_t dev)
{
	return (bhnd_pci_generic_suspend(dev));
}

static int
bhnd_pcib_resume(device_t dev)
{
	return (bhnd_pci_generic_resume(dev));
}

static device_method_t bhnd_pcib_methods[] = {
	/* Device interface */
	DEVMETHOD(device_attach,	bhnd_pcib_attach),
	DEVMETHOD(device_detach,	bhnd_pcib_detach),
	DEVMETHOD(device_suspend,	bhnd_pcib_suspend),
	DEVMETHOD(device_resume,	bhnd_pcib_resume),
	DEVMETHOD_END
};

DEFINE_CLASS_1(pcib, bhnd_pcib_driver, bhnd_pcib_methods, sizeof(struct bhnd_pcib_softc), bhnd_pci_driver);

static devclass_t pcib_devclass;
DRIVER_MODULE(bhnd_pcib, bhnd, bhnd_pcib_driver, pcib_devclass, 0, 0);

MODULE_VERSION(bhnd_pcib, 1);
MODULE_DEPEND(bhnd_pcib, bhnd, 1, 1, 1);
MODULE_DEPEND(bhnd_pcib, bhnd_pci, 1, 1, 1);
MODULE_DEPEND(bhnd_pcib, pci, 1, 1, 1);