Adding HID gadget support (g_hid)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Adding HID gadget support (g_hid)

5,001 Views
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

Tags (1)
0 Kudos
5 Replies

2,107 Views
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 Kudos

2,107 Views
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 Kudos

2,107 Views
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 Kudos

2,107 Views
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 Kudos

2,107 Views
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 Kudos