zoukankan      html  css  js  c++  java
  • soccamera 1

    分host,sensor层次的驱动,soc-camera为枢纽,同时也是和用户交互的接口;soc_camera_probe这个函数什么调用的呢?

    先利用

    ret = driver_register(&ic_drv);//这里现在soc_camera_bus_type总线下注册一个驱动device_driver。

    而在soc_camera_host_register--->scan_add_host-->device_register(&icd->dev);//这里开始在soc_camera_bus_type 总线上注册设备,

                                                                                                                               // 这个时候soc_camera_probe 函数会调用

    static struct bus_type soc_camera_bus_type = {//这个总线没有match函数,bus_for_each_drv(dev->bus, NULL, dev, __device_attach);     

                                                                                //      __device_attach这个函数一定会执行
     .name  = "soc-camera",
     .probe  = soc_camera_probe,
     .remove  = soc_camera_remove,
     .suspend = soc_camera_suspend,
     .resume  = soc_camera_resume,
    };

    static struct device_driver ic_drv = {//这个驱动没有probe函数,所以会执行总线的probe函数

                                                            //if (dev->bus->probe) { ret = dev->bus->probe (dev);  ..........
     .name = "camera",
     .bus = &soc_camera_bus_type,
     .owner = THIS_MODULE,
    };

    只有soc_camera_probe函数被调用了,才能创建senesor侧驱动的i2c_client的I2c设备

  • 相关阅读:
    Nagios利用NSClient++监控Windows主机
    Nagios监控Windows的网卡流量
    Nagios 监控Windows服务器(详细篇)
    ODB学习笔记之基础环境搭建
    用Kindle阅读PDF最简单的3个方法!
    RocketMQ吐血总结
    RocketMQ使用
    掌握 analyze API,一举搞定 Elasticsearch 分词难题
    ElasticSearch5.3安装IK分词器并验证
    Kibana server is not ready yet出现的原因
  • 原文地址:https://www.cnblogs.com/wangxianzhen/p/3016493.html
Copyright © 2011-2022 走看看