Hi, On Tue, Jan 15, 2013 at 04:09:42PM +0100, stl wrote: > Hello all, > I want to write a usb driver for our usb controller. > I aim to use it as "device-side" driver, so if I well understood > as a "gadget driver". > Is "gadget driver" really what I need? you need to write a "UDC driver" just like musb, dwc3, s3c_hsotg, omap_udc, etc. > I have dug into the code, and I really don't understand how the > probe() function is called? it depends on the underlying bus, if you're using the platform_bus_type, probe will be called when you have a platform_device and a platform_driver with the same name. > Because I read in the documentation that the probe function "is called > by the usb caore when it thinks it has a struct usb_interface that > this driver can handle". that's for the host side. > (Linux Device Driver 3rd edition) > However, the only way to tell the system that the usb port is > "attached" is to receive an interrupt. > So the "attached" interrupt ISR needs to tell the system that > something is attached to the system. > But what is the generic core function to do this? > Am I entirely wrong? you just mixed a few concepts, that's all ;-) Try to figure out how to write a platform_driver and a platform_device, there are countless examples in the kernel ;-) -- balbi
Attachment:
signature.asc
Description: Digital signature