Esempio n. 1
0
static int __init snd_tscm_init(void)
{
	return driver_register(&tscm_driver.driver);
}
Esempio n. 2
0
static int __init ide_gd_init(void)
{
	printk(KERN_INFO DRV_NAME " driver " IDE_GD_VERSION "\n");
	return driver_register(&ide_gd_driver.gen_driver);
}
Esempio n. 3
0
int s3c24xx_serial_init(struct device_driver *drv,
			struct s3c24xx_uart_info *info)
{
	dbg("s3c24xx_serial_init(%p,%p)\n", drv, info);
	return driver_register(drv);
}
Esempio n. 4
0
/**
 * register_rpmsg_driver() - register an rpmsg driver with the rpmsg bus
 * @rpdrv: pointer to a struct rpmsg_driver
 *
 * Returns 0 on success, and an appropriate error value on failure.
 */
int register_rpmsg_driver(struct rpmsg_driver *rpdrv)
{
	rpdrv->drv.bus = &rpmsg_bus;
	return driver_register(&rpdrv->drv);
}
Esempio n. 5
0
static int __init fsl_i2c_init(void)
{
	return driver_register(&fsl_i2c_driver);
}
Esempio n. 6
0
/**
 * sunxi_rsb_driver_register() - Register device driver with RSB core
 * @rdrv:	device driver to be associated with slave-device.
 *
 * This API will register the client driver with the RSB framework.
 * It is typically called from the driver's module-init function.
 */
int sunxi_rsb_driver_register(struct sunxi_rsb_driver *rdrv)
{
	rdrv->driver.bus = &sunxi_rsb_bus;
	return driver_register(&rdrv->driver);
}
Esempio n. 7
0
static int __init pxa2xx_ac97_init(void)
{
	return driver_register(&pxa2xx_ac97_driver);
}
Esempio n. 8
0
int mcp_driver_register(struct mcp_driver *mcpdrv)
{
	mcpdrv->drv.bus = &mcp_bus_type;
	return driver_register(&mcpdrv->drv);
}
Esempio n. 9
0
int nvec_register_driver(struct nvec_driver *drv)
{
	drv->driver.name = drv->name;
	drv->driver.bus = &nvec_bus_type;
	return driver_register(&drv->driver);
}
Esempio n. 10
0
int htif_register_driver(struct htif_driver *drv)
{
	drv->driver.bus = &htif_bus_type;
	return driver_register(&drv->driver);
}
Esempio n. 11
0
static int __init init_tcic(void)
{
    int i, sock, ret = 0;
    u_int mask, scan;

    if (driver_register(&tcic_driver))
	return -1;
    
    printk(KERN_INFO "Databook TCIC-2 PCMCIA probe: ");
    sock = 0;

    if (!request_region(tcic_base, 16, "tcic-2")) {
	printk("could not allocate ports,\n ");
	driver_unregister(&tcic_driver);
	return -ENODEV;
    }
    else {
	tcic_setw(TCIC_ADDR, 0);
	if (tcic_getw(TCIC_ADDR) == 0) {
	    tcic_setw(TCIC_ADDR, 0xc3a5);
	    if (tcic_getw(TCIC_ADDR) == 0xc3a5) sock = 2;
	}
	if (sock == 0) {
	    /* See if resetting the controller does any good */
	    tcic_setb(TCIC_SCTRL, TCIC_SCTRL_RESET);
	    tcic_setb(TCIC_SCTRL, 0);
	    tcic_setw(TCIC_ADDR, 0);
	    if (tcic_getw(TCIC_ADDR) == 0) {
		tcic_setw(TCIC_ADDR, 0xc3a5);
		if (tcic_getw(TCIC_ADDR) == 0xc3a5) sock = 2;
	    }
	}
    }
    if (sock == 0) {
	printk("not found.\n");
	release_region(tcic_base, 16);
	driver_unregister(&tcic_driver);
	return -ENODEV;
    }

    sockets = 0;
    for (i = 0; i < sock; i++) {
	if ((i == ignore) || is_active(i)) continue;
	socket_table[sockets].psock = i;
	socket_table[sockets].id = get_tcic_id();

	socket_table[sockets].socket.owner = THIS_MODULE;
	/* only 16-bit cards, memory windows must be size-aligned */
	/* No PCI or CardBus support */
	socket_table[sockets].socket.features = SS_CAP_PCCARD | SS_CAP_MEM_ALIGN;
	/* irq 14, 11, 10, 7, 6, 5, 4, 3 */
	socket_table[sockets].socket.irq_mask = 0x4cf8;
	/* 4K minimum window size */
	socket_table[sockets].socket.map_size = 0x1000;		
	sockets++;
    }

    switch (socket_table[0].id) {
    case TCIC_ID_DB86082:
	printk("DB86082"); break;
    case TCIC_ID_DB86082A:
	printk("DB86082A"); break;
    case TCIC_ID_DB86084:
	printk("DB86084"); break;
    case TCIC_ID_DB86084A:
	printk("DB86084A"); break;
    case TCIC_ID_DB86072:
	printk("DB86072"); break;
    case TCIC_ID_DB86184:
	printk("DB86184"); break;
    case TCIC_ID_DB86082B:
	printk("DB86082B"); break;
    default:
	printk("Unknown ID 0x%02x", socket_table[0].id);
    }
    
    /* Set up polling */
    poll_timer.function = &tcic_timer;
    poll_timer.data = 0;
    init_timer(&poll_timer);

    /* Build interrupt mask */
    printk(", %d sockets\n" KERN_INFO "  irq list (", sockets);
    if (irq_list_count == 0)
	mask = irq_mask;
    else
	for (i = mask = 0; i < irq_list_count; i++)
	    mask |= (1<<irq_list[i]);

    /* irq 14, 11, 10, 7, 6, 5, 4, 3 */
    mask &= 0x4cf8;
    /* Scan interrupts */
    mask = irq_scan(mask);
    for (i=0;i<sockets;i++)
	    socket_table[i].socket.irq_mask = mask;
    
    /* Check for only two interrupts available */
    scan = (mask & (mask-1));
    if (((scan & (scan-1)) == 0) && (poll_interval == 0))
	poll_interval = HZ;
    
    if (poll_interval == 0) {
	/* Avoid irq 12 unless it is explicitly requested */
	u_int cs_mask = mask & ((cs_irq) ? (1<<cs_irq) : ~(1<<12));
	for (i = 15; i > 0; i--)
	    if ((cs_mask & (1 << i)) &&
		(request_irq(i, tcic_interrupt, 0, "tcic",
			     tcic_interrupt) == 0))
		break;
	cs_irq = i;
	if (cs_irq == 0) poll_interval = HZ;
    }
    
    if (socket_table[0].socket.irq_mask & (1 << 11))
	printk("sktirq is irq 11, ");
    if (cs_irq != 0)
	printk("status change on irq %d\n", cs_irq);
    else
	printk("polled status, interval = %d ms\n",
	       poll_interval * 1000 / HZ);
    
    for (i = 0; i < sockets; i++) {
	tcic_setw(TCIC_ADDR+2, socket_table[i].psock << TCIC_SS_SHFT);
	socket_table[i].last_sstat = tcic_getb(TCIC_SSTAT);
    }
    
    /* jump start interrupt handler, if needed */
    tcic_interrupt(0, NULL, NULL);

    platform_device_register(&tcic_device);

    for (i = 0; i < sockets; i++) {
	    socket_table[i].socket.ops = &tcic_operations;
	    socket_table[i].socket.resource_ops = &pccard_nonstatic_ops;
	    socket_table[i].socket.dev.dev = &tcic_device.dev;
	    ret = pcmcia_register_socket(&socket_table[i].socket);
	    if (ret && i)
		    pcmcia_unregister_socket(&socket_table[0].socket);
    }
    
    return ret;

    return 0;
    
} /* init_tcic */
Esempio n. 12
0
static int __init snd_oxfw_init(void)
{
	return driver_register(&oxfw_driver.driver);
}
Esempio n. 13
0
static int __init
h5400_ohci_init (void)
{
	return driver_register (&h5400_usb_device_driver);
}
static int __init ucb1400_ts_init(void)
{
	return driver_register(&ucb1400_ts_driver);
}
Esempio n. 15
0
static int __init cpustate_init(void)
{
	int rc;
	rc = driver_register(&hdpu_cpustate_driver);
	return rc;
}
Esempio n. 16
0
int lm_driver_register(struct lm_driver *drv)
{
	drv->drv.bus = &lm_bustype;
	return driver_register(&drv->drv);
}
Esempio n. 17
0
/*
=====================rsz_init===========================
function to	register resizer character driver
*/
static __init int rsz_init(void)
{

	int result;

	/* Register     the     driver in the kernel */

	result = alloc_chrdev_region(&dev, 0, 1, DRIVER_NAME);
	if (result < 0) {
		printk(KERN_ERR
		       "DaVinciresizer: could not register character device");
		return -ENODEV;
	}
	/* Initialize of character device */
	cdev_init(&c_dev, &rsz_fops);
	c_dev.owner = THIS_MODULE;
	c_dev.ops = &rsz_fops;

	/* addding character device */
	result = cdev_add(&c_dev, dev, 1);

	if (result) {
		printk(KERN_ERR
		       "DaVinciresizer:Error %d adding"
			" Davinciresizer ..error no:",
		       result);
		unregister_chrdev_region(dev, 1);
		return result;
	}

	/* registeration of     character device */
	register_chrdev(MAJOR(dev), DRIVER_NAME, &rsz_fops);

	/* register driver as a platform driver */
	if (driver_register(&resizer_driver) != 0) {
		unregister_chrdev_region(dev, 1);
		cdev_del(&c_dev);
		return -EINVAL;
	}

	/* Register the drive as a platform device */
	if (platform_device_register(&resizer_device) != 0) {
		driver_unregister(&resizer_driver);
		unregister_chrdev_region(dev, 1);
		unregister_chrdev(MAJOR(dev), DRIVER_NAME);
		cdev_del(&c_dev);
		return -EINVAL;
	}

	rsz_class = class_create(THIS_MODULE, "davinci_resizer");

	if (!rsz_class) {

		platform_device_unregister(&resizer_device);
		cdev_del(&c_dev);
		unregister_chrdev(MAJOR(dev), DRIVER_NAME);

		return -EIO;
	}

	device_create(rsz_class, NULL, dev, NULL, "davinci_resizer");

	rsz_dev.users = 0;

	mutex_init(&rsz_dev.lock);
	/* Initialize the serializer */
	imp_init_serializer();
	imp_hw_if = imp_get_hw_if();
	printk(KERN_NOTICE "davinci_resizer initialized\n");
	return 0;
}				/* End   of function  resizer_init */
Esempio n. 18
0
static int __init ide_gd_init(void)
{
    ;
    return driver_register(&ide_gd_driver.gen_driver);
}
Esempio n. 19
0
void test_driver_register(void)
{
	driver_register(test_driver_ops.name, &test_driver_ops);
}
Esempio n. 20
0
static int __init ixp4xx_flash_init(void)
{
	return driver_register(&ixp4xx_flash_driver);
}
Esempio n. 21
0
File: vlynq.c Progetto: 020gzh/linux
int __vlynq_register_driver(struct vlynq_driver *driver, struct module *owner)
{
	driver->driver.name = driver->name;
	driver->driver.bus = &vlynq_bus_type;
	return driver_register(&driver->driver);
}
Esempio n. 22
0
static int __init brf6150_init(void)
{
	struct brf6150_info *info;
	int irq, err;

	info = kmalloc(sizeof(struct brf6150_info), GFP_KERNEL);
	if (!info)
		return -ENOMEM;
	memset(info, 0, sizeof(struct brf6150_info));

	brf6150_device.dev.driver_data = info;
	init_completion(&info->init_completion);
	init_completion(&info->fw_completion);
	info->pm_enabled = 0;
	info->rx_pm_enabled = 0;
	info->tx_pm_enabled = 0;
	info->garbage_bytes = 0;
	tasklet_init(&info->tx_task, brf6150_tx_tasklet, (unsigned long)info);
	spin_lock_init(&info->lock);
	skb_queue_head_init(&info->txq);
	init_timer(&info->pm_timer);
	info->pm_timer.function = brf6150_pm_timer;
	info->pm_timer.data = (unsigned long)info;
	exit_info = NULL;

	info->btinfo = omap_get_config(OMAP_TAG_NOKIA_BT, struct omap_bluetooth_config);
	if (info->btinfo == NULL)
		return -1;

	NBT_DBG("RESET gpio: %d\n", info->btinfo->reset_gpio);
	NBT_DBG("BTWU gpio: %d\n", info->btinfo->bt_wakeup_gpio);
	NBT_DBG("HOSTWU gpio: %d\n", info->btinfo->host_wakeup_gpio);
	NBT_DBG("Uart: %d\n", info->btinfo->bt_uart);
	NBT_DBG("sysclk: %d\n", info->btinfo->bt_sysclk);

	err = omap_request_gpio(info->btinfo->reset_gpio);
	if (err < 0)
	{
		printk(KERN_WARNING "Cannot get GPIO line %d", 
		       info->btinfo->reset_gpio);
		kfree(info);
		return err;
	}

	err = omap_request_gpio(info->btinfo->bt_wakeup_gpio);
	if (err < 0)
	{
		printk(KERN_WARNING "Cannot get GPIO line 0x%d",
		       info->btinfo->bt_wakeup_gpio);
		omap_free_gpio(info->btinfo->reset_gpio);
		kfree(info);
		return err;
	}

	err = omap_request_gpio(info->btinfo->host_wakeup_gpio);
	if (err < 0)
	{
		printk(KERN_WARNING "Cannot get GPIO line %d",
		       info->btinfo->host_wakeup_gpio);
		omap_free_gpio(info->btinfo->reset_gpio);
		omap_free_gpio(info->btinfo->bt_wakeup_gpio);
		kfree(info);
		return err;
	}

	omap_set_gpio_direction(info->btinfo->reset_gpio, 0);
	omap_set_gpio_direction(info->btinfo->bt_wakeup_gpio, 0);
	omap_set_gpio_direction(info->btinfo->host_wakeup_gpio, 1);
	set_irq_type(OMAP_GPIO_IRQ(info->btinfo->host_wakeup_gpio), IRQ_TYPE_NONE);

	switch (info->btinfo->bt_uart) {
	case 1:
		irq = INT_UART1;
		info->uart_ck = clk_get(NULL, "uart1_ck");
		/* FIXME: Use platform_get_resource for the port */
		info->uart_base = ioremap(OMAP_UART1_BASE, 0x16);
		if (!info->uart_base)
			goto cleanup;
		break;
	case 2:
		irq = INT_UART2;
		info->uart_ck = clk_get(NULL, "uart2_ck");
		/* FIXME: Use platform_get_resource for the port */
		info->uart_base = ioremap(OMAP_UART2_BASE, 0x16);
		if (!info->uart_base)
			goto cleanup;
		break;
	case 3:
		irq = INT_UART3;
		info->uart_ck = clk_get(NULL, "uart3_ck");
		/* FIXME: Use platform_get_resource for the port */
		info->uart_base = ioremap(OMAP_UART3_BASE, 0x16);
		if (!info->uart_base)
			goto cleanup;
		break;
	default:
		printk(KERN_ERR "No uart defined\n");
		goto cleanup;
	}

	info->irq = irq;
	err = request_irq(irq, brf6150_interrupt, 0, "brf6150", (void *)info);
	if (err < 0) {
		printk(KERN_ERR "brf6150: unable to get IRQ %d\n", irq);
		goto cleanup;
	}

	err = request_irq(OMAP_GPIO_IRQ(info->btinfo->host_wakeup_gpio),
			brf6150_wakeup_interrupt, 0, "brf6150_wkup", (void *)info);
	if (err < 0) {
		printk(KERN_ERR "brf6150: unable to get wakeup IRQ %d\n",
				OMAP_GPIO_IRQ(info->btinfo->host_wakeup_gpio));
		free_irq(irq, (void *)info);
		goto cleanup;
	}

	/* Register with LDM */
	if (platform_device_register(&brf6150_device)) {
		printk(KERN_ERR "failed to register brf6150 device\n");
		err = -ENODEV;
		goto cleanup_irq;
	}
	/* Register the driver with LDM */
	if (driver_register(&brf6150_driver)) {
		printk(KERN_WARNING "failed to register brf6150 driver\n");
		platform_device_unregister(&brf6150_device);
		err = -ENODEV;
		goto cleanup_irq;
	}

	if (brf6150_register_hdev(info) < 0) {
		printk(KERN_WARNING "failed to register brf6150 hci device\n");
		platform_device_unregister(&brf6150_device);
		driver_unregister(&brf6150_driver);
		goto cleanup_irq;
	}

	exit_info = info;
	return 0;

cleanup_irq:
	free_irq(irq, (void *)info);
	free_irq(OMAP_GPIO_IRQ(info->btinfo->host_wakeup_gpio), (void *)info);
cleanup:
	omap_free_gpio(info->btinfo->reset_gpio);
	omap_free_gpio(info->btinfo->bt_wakeup_gpio);
	omap_free_gpio(info->btinfo->host_wakeup_gpio);
	kfree(info);

	return err;
}
Esempio n. 23
0
static int __init
snd_bebob_init(void)
{
	return driver_register(&bebob_driver.driver);
}
Esempio n. 24
0
/* sa11x0_pcmcia_init()
 * ^^^^^^^^^^^^^^^^^^^^
 *
 * This routine performs low-level PCMCIA initialization and then
 * registers this socket driver with Card Services.
 *
 * Returns: 0 on success, -ve error code on failure
 */
static int __init sa11x0_pcmcia_init(void)
{
	return driver_register(&sa11x0_pcmcia_driver);
}
Esempio n. 25
0
static int __init init_nsc(void)
{
	int rc = 0;
	int lo, hi, err;
	int nscAddrBase = TPM_ADDR;
	struct tpm_chip *chip;
	unsigned long base;

	/* verify that it is a National part (SID) */
	if (tpm_read_index(TPM_ADDR, NSC_SID_INDEX) != 0xEF) {
		nscAddrBase = (tpm_read_index(TPM_SUPERIO_ADDR, 0x2C)<<8)|
			(tpm_read_index(TPM_SUPERIO_ADDR, 0x2B)&0xFE);
		if (tpm_read_index(nscAddrBase, NSC_SID_INDEX) != 0xF6)
			return -ENODEV;
	}

	err = driver_register(&nsc_drv);
	if (err)
		return err;

	hi = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_HI);
	lo = tpm_read_index(nscAddrBase, TPM_NSC_BASE0_LO);
	base = (hi<<8) | lo;

	/* enable the DPM module */
	tpm_write_index(nscAddrBase, NSC_LDC_INDEX, 0x01);

	pdev = kzalloc(sizeof(struct platform_device), GFP_KERNEL);
	if (!pdev) {
		rc = -ENOMEM;
		goto err_unreg_drv;
	}

	pdev->name = "tpm_nscl0";
	pdev->id = -1;
	pdev->num_resources = 0;
	pdev->dev.release = tpm_nsc_remove;
	pdev->dev.driver = &nsc_drv;

	if ((rc = platform_device_register(pdev)) < 0)
		goto err_free_dev;

	if (request_region(base, 2, "tpm_nsc0") == NULL ) {
		rc = -EBUSY;
		goto err_unreg_dev;
	}

	if (!(chip = tpm_register_hardware(&pdev->dev, &tpm_nsc))) {
		rc = -ENODEV;
		goto err_rel_reg;
	}

	dev_dbg(&pdev->dev, "NSC TPM detected\n");
	dev_dbg(&pdev->dev,
		"NSC LDN 0x%x, SID 0x%x, SRID 0x%x\n",
		tpm_read_index(nscAddrBase,0x07), tpm_read_index(nscAddrBase,0x20),
		tpm_read_index(nscAddrBase,0x27));
	dev_dbg(&pdev->dev,
		"NSC SIOCF1 0x%x SIOCF5 0x%x SIOCF6 0x%x SIOCF8 0x%x\n",
		tpm_read_index(nscAddrBase,0x21), tpm_read_index(nscAddrBase,0x25),
		tpm_read_index(nscAddrBase,0x26), tpm_read_index(nscAddrBase,0x28));
	dev_dbg(&pdev->dev, "NSC IO Base0 0x%x\n",
		(tpm_read_index(nscAddrBase,0x60) << 8) | tpm_read_index(nscAddrBase,0x61));
	dev_dbg(&pdev->dev, "NSC IO Base1 0x%x\n",
		(tpm_read_index(nscAddrBase,0x62) << 8) | tpm_read_index(nscAddrBase,0x63));
	dev_dbg(&pdev->dev, "NSC Interrupt number and wakeup 0x%x\n",
		tpm_read_index(nscAddrBase,0x70));
	dev_dbg(&pdev->dev, "NSC IRQ type select 0x%x\n",
		tpm_read_index(nscAddrBase,0x71));
	dev_dbg(&pdev->dev,
		"NSC DMA channel select0 0x%x, select1 0x%x\n",
		tpm_read_index(nscAddrBase,0x74), tpm_read_index(nscAddrBase,0x75));
	dev_dbg(&pdev->dev,
		"NSC Config "
		"0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
		tpm_read_index(nscAddrBase,0xF0), tpm_read_index(nscAddrBase,0xF1),
		tpm_read_index(nscAddrBase,0xF2), tpm_read_index(nscAddrBase,0xF3),
		tpm_read_index(nscAddrBase,0xF4), tpm_read_index(nscAddrBase,0xF5),
		tpm_read_index(nscAddrBase,0xF6), tpm_read_index(nscAddrBase,0xF7),
		tpm_read_index(nscAddrBase,0xF8), tpm_read_index(nscAddrBase,0xF9));

	dev_info(&pdev->dev,
		 "NSC TPM revision %d\n",
		 tpm_read_index(nscAddrBase, 0x27) & 0x1F);

	chip->vendor.base = base;

	return 0;

err_rel_reg:
	release_region(base, 2);
err_unreg_dev:
	platform_device_unregister(pdev);
err_free_dev:
	kfree(pdev);
err_unreg_drv:
	driver_unregister(&nsc_drv);
	return rc;
}
Esempio n. 26
0
static int __init ltc3577_init(void)
{
    return driver_register( &ltc3577_driver.plat_driver );
}
Esempio n. 27
0
int __init gfar_mdio_init(void)
{
	return driver_register(&gianfar_mdio_driver);
}
Esempio n. 28
0
static int __init generic_onenand_init(void)
{
	return driver_register(&generic_onenand_driver);
}
Esempio n. 29
0
File: bus.c Progetto: cilynx/dd-wrt
/**
 *	mmc_register_driver - register a media driver
 *	@drv: MMC media driver
 */
int mmc_register_driver(struct mmc_driver *drv)
{
	drv->drv.bus = &mmc_bus_type;
	return driver_register(&drv->drv);
}
Esempio n. 30
0
File: bus.c Progetto: Abioy/kasan
/**
 *	mmc_register_driver - register a media driver
 *	@drv: MMC media driver
 */
int mmc_register_driver(struct device_driver *drv)
{
	drv->bus = &mmc_bus_type;
	return driver_register(drv);
}