当前位置: 首页 > news >正文

自己做游戏网站装修设计公司logo

自己做游戏网站,装修设计公司logo,美食网站建设的必要性,织梦网站更改网站的导航Core层中有两个重要函数 mmc_alloc_host 用于构造host#xff0c;前面已经学习过#xff0c;这里不再阐述#xff1b;另一个就是 mmc_add_host,用于注册host 前面探测函数s3cmci_probe#xff0c;现在就来回顾一下这个函数的作用。先简要的概括一下这个函数的功能#xff…  Core层中有两个重要函数 mmc_alloc_host 用于构造host前面已经学习过这里不再阐述另一个就是 mmc_add_host,用于注册host 前面探测函数s3cmci_probe现在就来回顾一下这个函数的作用。先简要的概括一下这个函数的功能 1、s3cmci_probe 最重要的作用是host 的注册那么首先必须构造出一个host这个host就是通过s3cmci_alloc_host函数来构造出来的它是一个struct s3cmci_host类型的结构体。同时也通过mmc_alloc_host函数构造了一个struct mmc_host的结构体变量mmc。 2、初始化host的时钟设置host的gpio等等其他一些“乱七八糟”的参数初始化前面分析过。 3、通过s3cmci_add_host函数来注册host。 下面是这个函数的详细分析 mmc_add_host [core/host.c] [cpp] view plaincopy /**   *  mmc_add_host - initialise host hardware   *  host: mmc host   *   *  Register the host with the driver model. The host must be   *  prepared to start servicing requests before this function   *  completes.   */   int mmc_add_host(struct mmc_host *host)   {       int err;          WARN_ON((host-caps  MMC_CAP_SDIO_IRQ)            !host-ops-enable_sdio_irq);          err  device_add(host-class_dev);       if (err)           return err;          led_trigger_register_simple(dev_name(host-class_dev), host-led);      #ifdef CONFIG_DEBUG_FS       mmc_add_host_debugfs(host);   #endif       mmc_host_clk_sysfs_init(host);          mmc_start_host(host);       register_pm_notifier(host-pm_notify);          return 0;   }   我们看一下mmc_add_host这个函数它的功能就是通过device_add函数将设备注册进linux设备模型最终的结果就是在sys/bus/platform/devices目录下能见到s3c-sdhci.1,s3c-sdhci.2,s3c-sdhci.3设备节点。 重点是mmc_start_host(host);这也是core层的函数具体的方法如下 mmc_start_host  [core/core.c] [cpp] view plaincopy void mmc_start_host(struct mmc_host *host)   {       host-f_init  max(freqs[0], host-f_min);       host-rescan_disable  0;       if (host-caps2  MMC_CAP2_NO_PRESCAN_POWERUP)           mmc_power_off(host);       else           mmc_power_up(host, host-ocr_avail);       _mmc_detect_change(host, 0, false);   }   首先来看一下mmc_power_off内容如下 [core/core.c] [cpp] view plaincopy void mmc_power_off(struct mmc_host *host)   {       if (host-ios.power_mode  MMC_POWER_OFF)           return;          mmc_host_clk_hold(host);          host-ios.clock  0;       host-ios.vdd  0;          if (!mmc_host_is_spi(host)) {           host-ios.bus_mode  MMC_BUSMODE_OPENDRAIN;           host-ios.chip_select  MMC_CS_DONTCARE;       }       host-ios.power_mode  MMC_POWER_OFF;       host-ios.bus_width  MMC_BUS_WIDTH_1;       host-ios.timing  MMC_TIMING_LEGACY;       mmc_set_ios(host);          /*       * Some configurations, such as the 802.11 SDIO card in the OLPC       * XO-1.5, require a short delay after poweroff before the card       * can be successfully turned on again.       */       mmc_delay(1);          mmc_host_clk_release(host);   }   关心最多的就是host-iOS当中的内容前段的赋值真正作用在硬件上是调用host层向上提供的struct mmc_host_ops接口。这里18行实际上就是完成了这个工作。 回到mmc_start_hostmmc_detect_change(host, 0) 看名字就知道是用来检测SD卡的内容如下 mmc_detect_change(host, 0) [core/core.c] [cpp] view plaincopy static void _mmc_detect_change(struct mmc_host *host, unsigned long delay,                   bool cd_irq)   {   #ifdef CONFIG_MMC_DEBUG       unsigned long flags;       spin_lock_irqsave(host-lock, flags);       WARN_ON(host-removed);       spin_unlock_irqrestore(host-lock, flags);   #endif          /*       * If the device is configured as wakeup, we prevent a new sleep for       * 5 s to give provision for user space to consume the event.       */       if (cd_irq  !(host-caps  MMC_CAP_NEEDS_POLL)            device_can_wakeup(mmc_dev(host)))           pm_wakeup_event(mmc_dev(host), 5000);          host-detect_change  1;       mmc_schedule_delayed_work(host-detect, delay);   }   除了20行说了句人话其他的百分之九十九的都是废话。曾几何时我们说过内核有个延时工作队列没错就是他了。当然这可不是随便拿来玩的与之对应的初始化前面已经说过即INIT_DELAYED_WORK(host-detect, mmc_rescan);好了20 行作用的结果估计大家都能猜到了就是延时delay 时间后就会去调用mmc_rescan了。前面我们传递的delay0那么这里就没有延时了既然驱动都等不及要rescan了我们也就不再卖关子了直接mmc_rescan。它的功能就是扫描所插入的卡 这就回到了Linux SD卡驱动开发(三) —— SD 卡驱动分析CORE篇 了
http://www.yutouwan.com/news/35294/

相关文章:

  • 聊城网站建设设计简易手机网站开发
  • 找做cad彩拼的网站网站建设管理考核办法
  • 网站做加QQ群链接易记域名网站大全
  • 秦皇岛网站建设找汉狮网站建设的点子
  • 网站开发 相册wordpress优惠券发放插件
  • 织梦协会网站模板外贸网站建设 杭州
  • wap网站源码下载广州市招投标网站
  • 商洛网站建设公司电话wordpress直接购买
  • 中邦建设工程有限公司官方网站上海莱布拉网站建设
  • php学多久可以做网站网站推广做百度还是360
  • 山东农业大学学风建设专题网站中英版网站怎么做
  • wordpress建企业网站设置简述企业建设网站的必要性
  • 网站小程序开发公司家装公司加盟哪个公司好
  • 安徽 建设 招聘信息网站西安计算机培训机构
  • 佛山外贸网站建设资讯wordpress留言板自定义
  • 网站申请注册 免备案深圳网站建设公司哪家
  • 网络设计涉及到的核心标准是正规网站优化推广
  • 邹城市网站建设自己架设网站备案
  • 国外 上海网站建设甘肃建设厅网站
  • 网站标题格式做类似58同城大型网站
  • 公司网站备案流程二维码生成器app下载安卓版
  • 哪家网站建设公司比较好恶意镜像网站程序
  • 比价网站源码整站程序wordpress去掉工具栏
  • wordpress直播网站主题购买空间网站哪个好
  • 国外搜索引擎网站用美图秀秀做网站图片
  • win7建网站教程专业零基础网站建设教学服务
  • wordpress 调用略缩图seod的中文意思
  • 网站建设和运维深圳威豹押运公司官网
  • 邯郸哪儿做网站好城乡建设网站宁德
  • 网站阿里云备案要多久聚名网域名综合查询