Adding HID gadget support (g_hid)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Adding HID gadget support (g_hid)

5,778 次查看
wayne_ng
Contributor I

Hi

 

I am trying to set my board to a USB device to replicate a keyboard, when I build g_hid and try to modprobe it I get the following error

 

modprobe: can't load module g_hid (kernel/drivers/usb/gadget/g_hid.ko): No such device

 

I came across this forum post which indicates a similar issue, but as you can see it does not elaborate on the solution I was hoping that someone here might understand where I must make the neccesary edits to the source for g_hid driver to work.

 

I have tried pasting the example from the kernel documentation for USB HID gadgets into arch/arm/mach-mx5/devices/usb.c but it had no affect.

 

Thanks

 

W

标记 (1)
0 项奖励
回复
5 回复数

2,884 次查看
walterbmarvin
Contributor I



Wayne said:

Just for the record, I solved this problem, turned out my dev board did not support this functionality out of the box, I created a patch to add the support, now my PC can see the dev board as a keyboard.
OK Could you detail your solution?
0 项奖励
回复

2,884 次查看
walterbmarvin
Contributor I



Wayne said:

Just for the record, I solved this problem, turned out my dev board did not support this functionality out of the box, I created a patch to add the support, now my PC can see the dev board as a keyboard.
0 项奖励
回复

2,884 次查看
Abhi1z
Contributor I

Can you please provide me a detail that how could you create a patch and what it having. Awaiting for your prompt reply.

Thanks,

-Abhi

0 项奖励
回复

2,884 次查看
myke_predko
Senior Contributor III

Hi Wayne,

 

I'm interested in setting up my application as a HID device as well, when it is plugged into a PC.  Could you please provide pointers to either examples or list the steps that you worked through to get a HID device application running?  I am using an i.MX233 with the Linux 2.6.31 Kernel. 

 

I'm not sure what you mean by "arch/arm/mach-mx5/devices/usb.c" - where can I find this example program?  I can find other examples like https://www.kernel.org/doc/Documentation/usb/gadget_hid.txt but they require g_hid.h (as well as other includes & libraries) which are not in the

 

It looks like you need to Include HID support in the kernel build - I don't see this in ltib.  I have tried building with both the "USB" and "HID" options but the necessary USB files do not seem to appear. 

 

Any pointers or idea would be greatly appreciated.

 

Thanx!

 

mkye

0 项奖励
回复

2,884 次查看
wayne_ng
Contributor I
Just for the record, I solved this problem, turned out my dev board did not support this functionality out of the box, I created a patch to add the support, now my PC can see the dev board as a keyboard.
0 项奖励
回复