讓linux2.6.24內核在開發板支持usb鼠標

今天下午,對以前移植的linux2.6.24內核不能檢測USB鼠標進行了修改menuconfig,新內核的USB鼠標在內核drivers/hid/usbhid目錄下,文件名:usbmouse.c,如果你需要對鼠標驅動修改就看這個文件,我的開發板暫時不需要對鼠標驅動定製特別的操作,於是在保證2410配置文件默認的情況下,make menuconfig然後選擇 Device Drivers -->進入 選中HID Devices  ---> 進入 USB HID Boot Protocol drivers  --->  看到 USB HIDBP Mouse (simple Boot) support,選中它,如果沒有出現該項說明你在上邊的步驟中選中了其他多餘項,可以根據打開的kconfig文件中看到,注意紅色部分:
 
menu "USB HID Boot Protocol drivers"
 depends on USB!=n && USB_HID!=y
config USB_KBD
 tristate "USB HIDBP Keyboard (simple Boot) support"
 depends on USB && INPUT
 ---help---
   Say Y here only if you are absolutely sure that you don't want
   to use the generic HID driver for your USB keyboard and prefer
   to use the keyboard in its limited Boot Protocol mode instead.
   This is almost certainly not what you want.  This is mostly
   useful for embedded applications or simple keyboards.
   To compile this driver as a module, choose M here: the
   module will be called usbkbd.
   If even remotely unsure, say N.
config USB_MOUSE
 tristate "USB HIDBP Mouse (simple Boot) support"
 depends on USB && INPUT
 ---help---
   Say Y here only if you are absolutely sure that you don't want
   to use the generic HID driver for your USB mouse and prefer
   to use the mouse in its limited Boot Protocol mode instead.
   This is almost certainly not what you want.  This is mostly
   useful for embedded applications or simple mice.
   To compile this driver as a module, choose M here: the
   module will be called usbmouse.
   If even remotely unsure, say N.
endmenu
 
選中以後,make zImage好了,燒錄開發板,重啓,可以看到檢測到鼠標驅動了,原來的報出的錯誤沒有了,但是第二天我發現USB鼠標沒有在/dev目錄下,所以我重新把Device Drivers -->進入 選中HID Devices  ---> 進入後,將USB的選項調整成這樣,
  │ │          *** USB Input Devices ***                                  │ │  
  │ │    <*>   USB Human Interface Device (full HID) support              │ │  
  │ │    [ ]     Enable support for iBook/PowerBook/MacBook/MacBookPro spe│ │  
  │ │    [ ]     Force feedback support (EXPERIMENTAL)                    │ │  
  │ │    [*]     /dev/hiddev raw HID device support       
 
因爲選中了USB Human Interface Device (full HID) support這一項, 所以USB_MOUSE的選項被關閉了,我同時選中了對[*]     /dev/hiddev raw HID device support 的項,編譯時可以看到:
。。。。。。
  CC      drivers/hid/hid-core.o
  LD      drivers/hid/hid.o
  CC      drivers/hid/usbhid/hid-core.o
  CC      drivers/hid/usbhid/hiddev.o
  LD      drivers/hid/usbhid/usbhid.o
  LD      drivers/hid/usbhid/built-in.o
。。。。。。
 
燒錄,重啓開發板:
 
。。。。。。
 
usb 1-1: new low speed USB device using s3c2410-ohci and address 2
usb 1-1: configuration #1 chosen from 1 choice
usbcore: registered new interface driver hiddev
input: USB Mouse as /class/input/input0
input: USB HID v1.10 Mouse [USB Mouse] on usb-s3c24xx-1
usbcore: registered new interface driver usbhid
drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
 
 
。。。。。。
 
手動創建節點mknod mouse c 13 32,測試鼠標cat mouse,移動鼠標有數據打印出來。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章