~ # usb 3-1: new low speed USB device using ohci_hcd and address 2
usb 3-1: configuration #1 chosen from 1 choice
generic-usb: probe of 0003:04B4:BCA1.0001 failed with error -22
接著在drivers/base/dd.c的really_probe()發現這段code:
probe_failed:
devres_release_all(dev);
driver_sysfs_remove(dev);
dev->driver = NULL;
if (ret != -ENODEV && ret != -ENXIO) {
/* driver matched but the probe failed */
printk(KERN_WARNING
"%s: probe of %s failed with error %d\n",
drv->name, dev_name(dev), ret);
}
再試試看在really_probe()的一開頭加上dump_stack();得到:
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
[
可以判斷出來這就是hid的driver找不到的問題。接著我把bca1,也就是barcode device ID拿來grep。
果然在"hid/hid-ids.h:#define USB_DEVICE_ID_CYPRESS_BARCODE_3 0xbca1"找到define。接著在把USB_DEVICE_ID_CYPRESS_BARCODE_3拿來grep。找到
hid/hid-core.c: { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_3) },
hid/hid-cypress.c: { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_3),
再注意把menuconfig裡面的Device Drivers --->[*] HID Devices --->Special HID drivers ---><*> Cypress打開。
還要注意一下git diff v2.6.32 v2.6.38 drivers/hid/Kconfig
git diff v2.6.32 v2.6.38 drivers/hid/Makefile
git diff v2.6.32 v2.6.38 drivers/hid/hid-cypress.c
看起來cypress都沒什大的變動,所以可以不用修改直接上沒問題。
重新開機後load進新的kernel就可以抓到了。
input: Guest Barcode Reader as /devices/pci0000:00/0000:00:08.1/usb3/3-1/3-1:1.0/input/input0
cypress 0003:04B4:BCA1.0001: input: USB HID v1.00 Keyboard [Guest Barcode Reader] on usb-0000:00:08.1-1/input0
0 意見:
Post a Comment