高通平台USB host協議分析 之 一

來源:互聯網
上載者:User
先看一下核心對USB的配置CONFIG_USB=yCONFIG_USB_ANNOUNCE_NEW_DEVICES=yCONFIG_USB_SUSPEND=yCONFIG_USB_EHCI_HCD=yCONFIG_USB_EHCI_EHSET=yCONFIG_USB_EHCI_ROOT_HUB_TT=y# CONFIG_USB_EHCI_TT_NEWSCHED is not setCONFIG_USB_EHCI_MSM_72K=yCONFIG_USB_ACM=yCONFIG_USB_STORAGE=yCONFIG_USB_STORAGE_DATAFAB=yCONFIG_USB_STORAGE_FREECOM=yCONFIG_USB_STORAGE_ISD200=yCONFIG_USB_STORAGE_USBAT=yCONFIG_USB_STORAGE_SDDR09=yCONFIG_USB_STORAGE_SDDR55=yCONFIG_USB_STORAGE_JUMPSHOT=yCONFIG_USB_STORAGE_ALAUDA=yCONFIG_USB_STORAGE_ONETOUCH=yCONFIG_USB_STORAGE_KARMA=yCONFIG_USB_STORAGE_CYPRESS_ATACB=yCONFIG_USB_EHSET_TEST_FIXTURE=yCONFIG_USB_GADGET=yCONFIG_USB_MSM_72K=yCONFIG_USB_G_ANDROID=y/kernel/driver/usb/host/Ehci-hcd.c#ifdef CONFIG_USB_EHCI_MSM_72K   //通過包含檔案的方式整合msm udc驅動的代碼#include "ehci-msm72k.c"#define PLATFORM_DRIVER_PRESENT#endif......static struct platform_driver *plat_drivers[]  = {#if defined(CONFIG_USB_EHCI_MSM_72K) || defined(CONFIG_USB_EHCI_MSM)     &ehci_msm_driver,#endif#ifdef CONFIG_USB_EHCI_MSM_HSIC     &ehci_msm_hsic_driver,#endif#ifdef CONFIG_USB_EHCI_MSM     &ehci_msm2_driver,#endif}核心的一種一項配置CONFIG_USB_EHCI_MSM_72K=y可以看出高通的USB驅動採用的是EHCI的主機控制權規格. EHCI相容OHCI和UHCIstatic int __init ehci_hcd_init(void){int i, retval = 0;if (usb_disabled())return -ENODEV;printk(KERN_INFO "%s: " DRIVER_DESC "\n", hcd_name);set_bit(USB_EHCI_LOADED, &usb_hcds_loaded);if (test_bit(USB_UHCI_LOADED, &usb_hcds_loaded) ||test_bit(USB_OHCI_LOADED, &usb_hcds_loaded))printk(KERN_WARNING "Warning! ehci_hcd should always be loaded"" before uhci_hcd and ohci_hcd, not after\n");pr_debug("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n", hcd_name, sizeof(struct ehci_qh), sizeof(struct ehci_qtd), sizeof(struct ehci_itd), sizeof(struct ehci_sitd));#ifdef DEBUGehci_debug_root = debugfs_create_dir("ehci", usb_debug_root);if (!ehci_debug_root) {retval = -ENOENT;goto err_debug;}#endiffor (i = 0; i < ARRAY_SIZE(plat_drivers); i++) {retval = platform_driver_register(plat_drivers[i]);  // 逐個註冊上面定義的plat_drivers【】數組if (retval) {while (--i >= 0)platform_driver_unregister(plat_drivers[i]);goto clean0;}}這是EHCI驅動的載入過程. 從此我們可以看出EHC的公用檔案如何和高通的UDC控制器驅動銜接並註冊的。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.