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

网站管理系统推荐网站做留言板怎么清空源码

网站管理系统推荐,网站做留言板怎么清空源码,网站建设与维护试题a卷,用手机制作动画的appCore层中有两个重要函数 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.zqtcl.cn/news/138007/

相关文章:

  • 农产品网站建设及优化项目商务网站建设 视频
  • 北京兼职做网站建设百度app平台
  • 网站建设头部代码网站怎么做咨询
  • 网站运营 网站建设北京公司网站制作要多少钱
  • 郑州看妇科最好的医院是哪里南宁百度seo软件
  • 深圳市住房与建设局实名制网站手机网站打不开被拦截怎么办
  • 公司做网站的价格几千元wordpress 修改页脚
  • 专业网站建设公司在线咨询宁波网站推广公司价格
  • 网站搭建系统都有哪些丽水网站开发
  • 网站设计包含哪些技术外行怎么做网站
  • 网站建设运营知识推广软文平台
  • 营销型网站建设用途网站 文件夹结构
  • 制作网站建设策划方案cosy主题wordpress
  • 网站建设服务联享科技net和cn哪个做网站好
  • 深圳网站制作公司哪家好艺考培训学校
  • 潍坊网站的公司电话html网站开发基础
  • 网站模板样式做地图特效的网站
  • 商标查询官方网站有没有免费找客户的软件
  • 网站开发及服务合同行业网站名称
  • 网站建设费包括什么建筑设计领域
  • 网站建设 信科网络建行网站会员注册用户名
  • 网站建设的什么是开发实施注意什么网站开发实用技术pdf
  • 网站设计的资质叫什么贵阳网站建设咨询
  • 郑州哪家公司做网站怎么做自己的销售网站
  • 北大青鸟教网站开发吗中国电信 网站备案
  • 网站目录结构图wordpress ftp连接不上
  • 使用php做的网站有哪些网站备案密码重置申请表
  • php网站开发好找工作吗一叶子电子商务网站建设策划书
  • 运营好还是网站开发好购买域名后怎样建公司官网
  • 优秀设计网站推荐晋江市住房和城乡建设局网站