本文整理汇总了C++中spi_register_driver函数的典型用法代码示例。如果您正苦于以下问题:C++ spi_register_driver函数的具体用法?C++ spi_register_driver怎么用?C++ spi_register_driver使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了spi_register_driver函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}