summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/udc-core.c
AgeCommit message (Collapse)AuthorFilesLines
2012-02-28usb: gadget: add generic map/unmap request utilitiesFelipe Balbi1-0/+52
such utilities are currently duplicated on all UDC drivers basically with the same structure. Let's group all implementations into one generic implementation and get rid of that duplication. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-12-12usb: gadget: replace usb_gadget::is_dualspeed with max_speedMichal Nazarewicz1-6/+20
This commit replaces usb_gadget's is_dualspeed field with a max_speed field. [ balbi@ti.com : Fixed DWC3 driver ] Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-11-14usb: gadget: core: allow everybody to read sysfs attributesFelipe Balbi1-2/+2
Those are simply giving information about the current state of the UDC, nothing really fancy. We can let everybody read those. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-14usb: gadget: core: fix bug when removing gadget driversFelipe Balbi1-2/+2
usb_gadget_disconnect() is responsible of removing data pullups. Before doing that we must, first, tell gadget driver we're disconnecting (by calling disconnect method on gadget driver structure), unbind the gadget driver and stop the controller. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-14usb: gadget: udc-core: fix bug on soft_connect and srp interfacesFelipe Balbi1-1/+1
We should not be using dev_get_drvdata() because we never call dev_set_drvdata(). Let's use container_of() as all other sysfs attributes. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-26usb: gadget: udc-core: fix bug on soft_connect interfaceFelipe Balbi1-1/+1
We should not be using dev_get_drvdata() because we never call dev_set_drvdata(). Let's use container_of() as all other sysfs attributes. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-18usb: Provide usb_speed_string() functionMichal Nazarewicz1-17/+2
In a few places in the kernel, the code prints a human-readable USB device speed (eg. "high speed"). This involves a switch statement sometimes wrapped around in ({ ... }) block leading to code repetition. To mitigate this issue, this commit introduces usb_speed_string() function, which returns a human-readable name of provided speed. It also changes a few places switch was used to use this new function. This changes a bit the way the speed is printed in few instances at the same time standardising it. Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01usb: gadget: udc-core: wire up sysfs filesSebastian Andrzej Siewior1-5/+4
This was somehow forgotten. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-01usb: gadget: udc-core: add "new-style" registration interfaceSebastian Andrzej Siewior1-4/+71
udc_start() should only trigger the internal state machine and make minimal house keeping. Before that call udc-core calls the bind() callback and after the callback the pullup(). udc_stop() is simillar, udc-core calls pullup(), unbind() and finally udc_stop(). Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28usb: gadget: introduce UDC ClassFelipe Balbi1-0/+418
this class will be used to abstract away several of the duplicated operations scattered among the USB gadget controller drivers. Later, we can add an atomic notifier to tell interested drivers about what's happening with the controller. Notifications such as suspend, resume, enumerated, etc. will be useful, at a minimum, for implementing usb charger detection. As part of the converting process usb_gadget_probe_driver() is no longer part of each udc but pushed into the ->stap() callback. The same for his couterpart. The core is currently set explicit to 'n'. It will be changed to 'y' once all users are converted since it provides functions which clash with other drivers. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>