本文整理汇总了C++中spi_register_driver函数的典型用法代码示例。如果您正苦于以下问题:C++ spi_register_driver函数的具体用法?C++ spi_register_driver怎么用?C++ spi_register_driver使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了spi_register_driver函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: da9052_spi_init
static int __init da9052_spi_init(void)
{
int ret;
ret = spi_register_driver(&da9052_spi_driver);
if (ret != 0) {
pr_err("Failed to register DA9052 SPI driver, %d\n", ret);
return ret;
}
return 0;
}
开发者ID:020gzh,项目名称:linux,代码行数:12,代码来源:da9052-spi.c
示例2: ad1836_init
static int __init ad1836_init(void)
{
int ret;
ret = spi_register_driver(&ad1836_spi_driver);
if (ret != 0) {
printk(KERN_ERR "Failed to register ad1836 SPI driver: %d\n",
ret);
}
return ret;
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:12,代码来源:ad1836.c
示例3: wm831x_spi_init
static int __init wm831x_spi_init(void)
{
int ret;
ret = spi_register_driver(&wm8310_spi_driver);
if (ret != 0)
pr_err("Failed to register WM8310 SPI driver: %d\n", ret);
ret = spi_register_driver(&wm8311_spi_driver);
if (ret != 0)
pr_err("Failed to register WM8311 SPI driver: %d\n", ret);
ret = spi_register_driver(&wm8312_spi_driver);
if (ret != 0)
pr_err("Failed to register WM8312 SPI driver: %d\n", ret);
ret = spi_register_driver(&wm8320_spi_driver);
if (ret != 0)
pr_err("Failed to register WM8320 SPI driver: %d\n", ret);
ret = spi_register_driver(&wm8321_spi_driver);
if (ret != 0)
pr_err("Failed to register WM8321 SPI driver: %d\n", ret);
ret = spi_register_driver(&wm8325_spi_driver);
if (ret != 0)
pr_err("Failed to register WM8325 SPI driver: %d\n", ret);
return 0;
}
开发者ID:AndrewDB,项目名称:rk3066-kernel,代码行数:30,代码来源:wm831x-spi-a22.c
示例4: wm8770_modinit
static int __init wm8770_modinit(void)
{
int ret = 0;
#if defined(CONFIG_SPI_MASTER)
ret = spi_register_driver(&wm8770_spi_driver);
if (ret) {
printk(KERN_ERR "Failed to register wm8770 SPI driver: %d\n",
ret);
}
#endif
return ret;
}
开发者ID:mb3dot,项目名称:community-b3-kernel,代码行数:13,代码来源:wm8770.c
示例5: memlcd_spi_init
static int __init memlcd_spi_init(void)
{
int ret;
ret = spi_register_driver(&memlcd_spi_driver);
if (ret < 0) {
printk(KERN_ERR "Failed to register memlcdfb-spi driver: %d", ret);
goto out;
}
out:
return ret;
}
开发者ID:MinimumLaw,项目名称:memlcdfb,代码行数:13,代码来源:memlcd_spi.c
示例6: p54spi_init
static int __init p54spi_init(void)
{
int ret;
ret = spi_register_driver(&p54spi_driver);
if (ret < 0) {
printk(KERN_ERR "failed to register SPI driver: %d", ret);
goto out;
}
out:
return ret;
}
开发者ID:Atrix-Dev-Team,项目名称:kernel-MB860,代码行数:13,代码来源:p54spi.c
示例7: serial_m3110_init
int __init serial_m3110_init(void)
{
int ret = 0;
ret = uart_register_driver(&serial_m3110_reg);
if (ret)
return ret;
ret = spi_register_driver(&uart_max3110_driver);
if (ret)
uart_unregister_driver(&serial_m3110_reg);
return ret;
}
开发者ID:mcr,项目名称:linux-2.6,代码行数:14,代码来源:mrst_max3110.c
示例8: msm_eeprom_init_module
static int __init msm_eeprom_init_module(void)
{
int rc = 0, spi_rc = 0;
CDBG("%s E\n", __func__);
rc = platform_driver_probe(&msm_eeprom_platform_driver, msm_eeprom_platform_probe);
CDBG("%s:%d platform rc %d\n", __func__, __LINE__, rc);
spi_rc = spi_register_driver(&msm_eeprom_spi_driver);
rc = i2c_add_driver(&msm_eeprom_i2c_driver);
if (rc < 0 && spi_rc < 0)
pr_err("%s:%d probe failed\n", __func__, __LINE__);
return rc;
}
开发者ID:GalaxyTab4,项目名称:android_kernel_samsung_matissewifi.bak,代码行数:15,代码来源:msm_eeprom.c
示例9: bp_spi_add_driver
int bp_spi_add_driver(int (*callback)(void))
{
int status = 0;
callback_func = callback;
status = spi_register_driver(&bp_spi_driver);
if(status == SPI_OK)
{
DEBUGONDISPLAY(MODE_PHY_DEBUG,printk("[SPI] init success\n"));
}
else
{
printk("[SPI] init fail\n");
}
return status;
}
开发者ID:LAPIS-Lazurite,项目名称:LazuritePiGateway,代码行数:16,代码来源:spi-bp3596.c
示例10: adav80x_init
static int __init adav80x_init(void)
{
int ret = 0;
#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
ret = i2c_add_driver(&adav80x_i2c_driver);
if (ret)
return ret;
#endif
#if defined(CONFIG_SPI_MASTER)
ret = spi_register_driver(&adav80x_spi_driver);
#endif
return ret;
}
开发者ID:AICP,项目名称:kernel_moto_shamu,代码行数:16,代码来源:adav80x.c
示例11: mif_err
struct link_device *spi_create_link_device(struct platform_device *pdev)
{
int ret;
struct modem_data *pdata = pdev->dev.platform_data;
struct link_device *ld;
mif_err("&&** spi create link device \n");
if (!pdata) {
mif_err("modem_data is null\n");
return NULL;
}
spi_boot_id = kzalloc(sizeof(struct spi_boot_link_device), GFP_KERNEL);
if (!spi_boot_id) {
mif_err("allocation fail for spi_boot_id\n");
return NULL;
}
INIT_LIST_HEAD(&spi_boot_id->ld.list);
ld = &spi_boot_id->ld;
ld->name = "spi_boot";
ld->init_comm = spi_boot_init;
ld->terminate_comm = spi_boot_terminate;
ld->send = spi_boot_send;
//ld->com_state = COM_NONE;
ret = spi_register_driver(&spi_boot_driver);
if (ret) {
mif_err("spi_register_driver() fail(%d)\n", ret);
goto err;
}
skb_queue_head_init(&spi_boot_id->tx_q);
mif_info("success\n");
return ld;
err:
kfree(spi_boot_id);
return NULL;
}
开发者ID:friedrich420,项目名称:S6_AEL_Kernel_Multivariant_LL-5.1.1,代码行数:46,代码来源:link_device_spi.c
示例12: spi_aic3254_init
static int __init spi_aic3254_init(void)
{
int ret = 0;
struct ecodec_aic3254_state *codec_drv = &codec_clk;
pr_aud_info("%s\n", __func__);
mutex_init(&lock);
ret = spi_register_driver(&spi_aic3254);
if (ret < 0) {
pr_aud_err("%s:failed to register spi driver(%d)\n", __func__, ret);
return ret;
}
ret = misc_register(&aic3254_misc);
if (ret < 0) {
pr_aud_err("%s:failed to register misc device\n", __func__);
spi_unregister_driver(&spi_aic3254);
return ret;
}
#if defined(CONFIG_ARCH_MSM7X30)
codec_drv->rx_mclk = clk_get(NULL, "mi2s_codec_rx_m_clk");
if (IS_ERR(codec_drv->rx_mclk)) {
pr_aud_err("%s:failed to get mi2s mclk\n", __func__);
misc_deregister(&aic3254_misc);
spi_unregister_driver(&spi_aic3254);
return -ENODEV;
}
codec_drv->rx_sclk = clk_get(NULL, "mi2s_codec_rx_s_clk");
if (IS_ERR(codec_drv->rx_sclk)) {
pr_aud_err("%s:failed to get mi2s sclk\n", __func__);
misc_deregister(&aic3254_misc);
spi_unregister_driver(&spi_aic3254);
clk_put(codec_drv->rx_mclk);
return -ENODEV;
}
#endif
pm_qos_add_request(&codec_drv->pm_qos_req, PM_QOS_CPU_DMA_LATENCY,
PM_QOS_DEFAULT_VALUE);
wake_lock_init(&codec_drv->wakelock, WAKE_LOCK_SUSPEND,
"aic3254_suspend_lock");
return 0;
}
开发者ID:jekapaty,项目名称:SebastianFM-kernel,代码行数:46,代码来源:spi_aic3254.c
示例13: nxtts_init_spi
static int __init nxtts_init_spi(void)
{
int error;
nxtts_ctl.tx_buff = kzalloc(SPI_BUFF_SIZE, GFP_KERNEL | GFP_DMA);
if (!nxtts_ctl.tx_buff) {
error = -ENOMEM;
goto nxtts_init_error;
}
nxtts_ctl.rx_buff = kzalloc(SPI_BUFF_SIZE, GFP_KERNEL | GFP_DMA);
if (!nxtts_ctl.rx_buff) {
error = -ENOMEM;
goto nxtts_init_error;
}
error = spi_register_driver(&nxtts_driver);
if (error < 0) {
printk(KERN_ALERT "spi_register_driver() failed %d\n", error);
return error;
}
error = add_nxtts_device_to_bus();
if (error < 0) {
printk(KERN_ALERT "add_nxtts_to_bus() failed\n");
spi_unregister_driver(&nxtts_driver);
return error;
}
return 0;
nxtts_init_error:
if (nxtts_ctl.tx_buff) {
kfree(nxtts_ctl.tx_buff);
nxtts_ctl.tx_buff = 0;
}
if (nxtts_ctl.rx_buff) {
kfree(nxtts_ctl.rx_buff);
nxtts_ctl.rx_buff = 0;
}
return error;
}
开发者ID:ModularRoboticsLab,项目名称:GumstixNXT,代码行数:45,代码来源:nxtts.c
示例14: cc2520_plat_spi_init
int cc2520_plat_spi_init()
{
int result;
result = cc2520_spi_add_to_bus();
if (result < 0)
goto error;
result = spi_register_driver(&cc2520_spi_driver);
if (result < 0)
goto error;
return 0;
error:
spi_unregister_driver(&cc2520_spi_driver);
return result;
}
开发者ID:zhaoruibing,项目名称:linux-cc2520-driver,代码行数:18,代码来源:platform.c
示例15: pcd8544_init_spi
static int __init pcd8544_init_spi(void)
{
int error;
error = spi_register_driver(&pcd8544_driver);
if (error < 0) {
printk(KERN_ALERT "spi_register_driver() failed %d\n", error);
return error; }
error = add_pcd8544_device_to_bus();
if (error < 0) {
printk(KERN_ALERT "add_pcd8544_to_bus() failed\n");
spi_unregister_driver(&pcd8544_driver);
return error;
}
return 0;
}
开发者ID:contactless,项目名称:pcd8544,代码行数:18,代码来源:pcd8544.c
示例16: spi_eeprom_read
int __init spi_eeprom_read(int busid, int chipid, int address,
unsigned char *buf, int len)
{
int ret;
struct read_param param = {
.busid = busid,
.chipid = chipid,
.address = address,
.buf = buf,
.len = len
};
read_param = ¶m;
ret = spi_register_driver(&early_seeprom_driver);
if (!ret)
spi_unregister_driver(&early_seeprom_driver);
return ret;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:18,代码来源:spi_eeprom.c
示例17: mcp3901_init
static int __init mcp3901_init(void)
{
int ret;
ret = spi_register_driver(&mcp3901_driver);
if(ret)
goto error;
ret = mcp3901_hotplug();
if(ret)
goto error;
return 0;
error:
return ret;
}
开发者ID:abdulmajeed90,项目名称:mcp3901,代码行数:18,代码来源:mcp3901.c
示例18: linux_spi_init
int linux_spi_init(void* vp){
int ret = 1;
static int called = 0;
if(called == 0){
called++;
if(&atwilc_bus == NULL){
PRINT_ER("atwilc_bus address is NULL\n");
}
ret = spi_register_driver(&atwilc_bus);
}
/* change return value to match ATWILC interface */
(ret<0)? (ret = 0):(ret = 1);
return ret;
}
开发者ID:globalgang,项目名称:driver,代码行数:18,代码来源:linux_wlan_spi.c
示例19: adg739_init
static int __init adg739_init(void)
{
//выделение памяти для структуры состояния драйвера
adg739_status = kzalloc(sizeof(struct adg739_data), GFP_KERNEL);
if (!adg739_status)
{
return (-ENOMEM);
}
//получение идентификатора для устройства
if(alloc_chrdev_region(&dev_adg739, 0, 1, device_name))
{
printk(KERN_ALERT "The request_mem_region function failed\n");
return (1);
}
//регистрация символьного устройства
cdev_init(&cdev_adg739, &adg739_fops);
cdev_adg739.owner = THIS_MODULE;
if (cdev_add(&cdev_adg739, dev_adg739, 1))
{
unregister_chrdev_region(dev_adg739, 1);
printk(KERN_ERR "The cdev_add function failed\n");
return(1);
}
//регистрация класса устройств
devclass = class_create( THIS_MODULE, DEV_CLASS_MUL); //создание класса
if (IS_ERR(devclass))
{
printk(KERN_ERR "The class_create function failed\n");
unregister_chrdev_region(dev_adg739, 1);
return (PTR_ERR(devclass));
}
//регистрация spi драйвера
if (spi_register_driver(&spi_adg739_driver))
{
printk(KERN_ERR "The spi_register_driver function failed\n");
unregister_chrdev_region(dev_adg739, 1);
class_destroy(devclass);
return (1);
}
return (0);
}
开发者ID:korrav,项目名称:adg739_driver,代码行数:44,代码来源:adg739.c
示例20: spi_aic3254_init
static int __init spi_aic3254_init(void)
{
int ret = 0;
struct ecodec_aic3254_state *codec_drv = &codec_clk;
pr_aud_info("%s\n", __func__);
mutex_init(&lock);
ret = spi_register_driver(&spi_aic3254);
if (ret < 0) {
pr_aud_err("%s:failed to register spi driver(%d)\n", __func__, ret);
return ret;
}
ret = misc_register(&aic3254_misc);
if (ret < 0) {
pr_aud_err("%s:failed to register misc device\n", __func__);
spi_unregister_driver(&spi_aic3254);
return ret;
}
#if defined(CONFIG_ARCH_MSM7X30)
codec_drv->rx_mclk = clk_get(NULL, "mi2s_codec_rx_m_clk");
if (IS_ERR(codec_drv->rx_mclk)) {
pr_aud_err("%s:failed to get mi2s mclk\n", __func__);
misc_deregister(&aic3254_misc);
spi_unregister_driver(&spi_aic3254);
return -ENODEV;
}
codec_drv->rx_sclk = clk_get(NULL, "mi2s_codec_rx_s_clk");
if (IS_ERR(codec_drv->rx_sclk)) {
pr_aud_err("%s:failed to get mi2s sclk\n", __func__);
misc_deregister(&aic3254_misc);
spi_unregister_driver(&spi_aic3254);
clk_put(codec_drv->rx_mclk);
return -ENODEV;
}
#endif
wake_lock_init(&codec_drv->idlelock, WAKE_LOCK_IDLE,
"aic3254_lock");
return 0;
}
开发者ID:LeeDroid-,项目名称:Flyer-2.6.35-HC-MR,代码行数:44,代码来源:spi_aic3254.c
注:本文中的spi_register_driver函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论