• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ driver_register函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中driver_register函数的典型用法代码示例。如果您正苦于以下问题:C++ driver_register函数的具体用法?C++ driver_register怎么用?C++ driver_register使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了driver_register函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: snd_tscm_init

static int __init snd_tscm_init(void)
{
	return driver_register(&tscm_driver.driver);
}
开发者ID:ReneNyffenegger,项目名称:linux,代码行数:4,代码来源:tascam.c


示例2: ide_gd_init

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);
}
开发者ID:embest-tech,项目名称:rowboat-kernel,代码行数:5,代码来源:ide-gd.c


示例3: s3c24xx_serial_init

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);
}
开发者ID:QiuLihua83,项目名称:linux-2.6.10,代码行数:6,代码来源:s3c2410.c


示例4: register_rpmsg_driver

/**
 * 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);
}
开发者ID:SovanKundu,项目名称:linux-xlnx,代码行数:11,代码来源:virtio_rpmsg_bus.c


示例5: fsl_i2c_init

static int __init fsl_i2c_init(void)
{
	return driver_register(&fsl_i2c_driver);
}
开发者ID:Dronevery,项目名称:JetsonTK1-kernel,代码行数:4,代码来源:i2c-mpc.c


示例6: sunxi_rsb_driver_register

/**
 * 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);
}
开发者ID:0-T-0,项目名称:ps4-linux,代码行数:12,代码来源:sunxi-rsb.c


示例7: pxa2xx_ac97_init

static int __init pxa2xx_ac97_init(void)
{
	return driver_register(&pxa2xx_ac97_driver);
}
开发者ID:GodFox,项目名称:magx_kernel_xpixl,代码行数:4,代码来源:pxa2xx-ac97.c


示例8: mcp_driver_register

int mcp_driver_register(struct mcp_driver *mcpdrv)
{
	mcpdrv->drv.bus = &mcp_bus_type;
	return driver_register(&mcpdrv->drv);
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:5,代码来源:mcp-core.c


示例9: nvec_register_driver

int nvec_register_driver(struct nvec_driver *drv)
{
	drv->driver.name = drv->name;
	drv->driver.bus = &nvec_bus_type;
	return driver_register(&drv->driver);
}
开发者ID:0x0f,项目名称:adam-kernel,代码行数:6,代码来源:nvec_user.c


示例10: htif_register_driver

int htif_register_driver(struct htif_driver *drv)
{
	drv->driver.bus = &htif_bus_type;
	return driver_register(&drv->driver);
}
开发者ID:arunthomas,项目名称:riscv-linux,代码行数:5,代码来源:htif-drv.c


示例11: init_tcic

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;
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:tew632-brp-svn,代码行数:101,代码来源:tcic.c


示例12: snd_oxfw_init

static int __init snd_oxfw_init(void)
{
	return driver_register(&oxfw_driver.driver);
}
开发者ID:383530895,项目名称:linux,代码行数:4,代码来源:oxfw.c


示例13: h5400_ohci_init

static int __init
h5400_ohci_init (void)
{
	return driver_register (&h5400_usb_device_driver);
}
开发者ID:ManiacTwister,项目名称:linux-hnd,代码行数:5,代码来源:h5400_wifi.c


示例14: ucb1400_ts_init

static int __init ucb1400_ts_init(void)
{
	return driver_register(&ucb1400_ts_driver);
}
开发者ID:LouZiffer,项目名称:m900_kernel_cupcake-SDX,代码行数:4,代码来源:ucb1400_ts.c


示例15: lm_driver_register

int lm_driver_register(struct lm_driver *drv)
{
	drv->drv.bus = &lm_bustype;
	return driver_register(&drv->drv);
}
开发者ID:laitianli,项目名称:loongson-linux-2.6.36-3_mips,代码行数:5,代码来源:lm.c


示例16: ide_gd_init

static int __init ide_gd_init(void)
{
    ;
    return driver_register(&ide_gd_driver.gen_driver);
}
开发者ID:rrowicki,项目名称:Chrono_Kernel-1,代码行数:5,代码来源:ide-gd.c


示例17: ixp4xx_flash_init

static int __init ixp4xx_flash_init(void)
{
	return driver_register(&ixp4xx_flash_driver);
}
开发者ID:iPodLinux,项目名称:linux-2.6.7-ipod,代码行数:4,代码来源:ixp4xx.c


示例18: __vlynq_register_driver

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);
}
开发者ID:020gzh,项目名称:linux,代码行数:6,代码来源:vlynq.c


示例19: brf6150_init


//.........这里部分代码省略.........
		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;
}
开发者ID:artisdom,项目名称:brf6150,代码行数:101,代码来源:brf6150.c


示例20: snd_bebob_init

static int __init
snd_bebob_init(void)
{
	return driver_register(&bebob_driver.driver);
}
开发者ID:Anjali05,项目名称:linux,代码行数:5,代码来源:bebob.c



注:本文中的driver_register函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ driver_remove_file函数代码示例发布时间:2022-05-30
下一篇:
C++ driver_of函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap