summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPatrick Mochel <mochel@osdl.org>2003-09-02 19:09:33 -0700
committerPatrick Mochel <mochel@osdl.org>2003-09-02 19:09:33 -0700
commit5c0cb1ca95bd45b65e04ec46fae13b1a36fa52be (patch)
treec6d82746cf073d8049568bb8e4ab8a71a70c1317 /include
parent32a06967e145fe7c0744391d0ff444a840a55230 (diff)
parent06cdb4a96337e96b1e81600d098efd1f36aedd0c (diff)
Merge osdl.org:/home/mochel/src/kernel/linux-2.5-virgin
into osdl.org:/home/mochel/src/kernel/linux-2.5-core
Diffstat (limited to 'include')
-rw-r--r--include/linux/usb.h5
-rw-r--r--include/linux/usb_gadget.h22
-rw-r--r--include/linux/videodev.h6
3 files changed, 27 insertions, 6 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index df3ba0f3b90e..471c37f5188b 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -410,6 +410,8 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, size_t size)
* the "usbfs" filesystem. This lets devices provide ways to
* expose information to user space regardless of where they
* do (or don't) show up otherwise in the filesystem.
+ * @suspend: Called when the device is going to be suspended by the system.
+ * @resume: Called when the device is being resumed by the system.
* @id_table: USB drivers use ID table to support hotplugging.
* Export this with MODULE_DEVICE_TABLE(usb,...). This must be set
* or your driver's probe function will never get called.
@@ -445,6 +447,9 @@ struct usb_driver {
int (*ioctl) (struct usb_interface *intf, unsigned int code, void *buf);
+ int (*suspend) (struct usb_interface *intf, u32 state);
+ int (*resume) (struct usb_interface *intf);
+
const struct usb_device_id *id_table;
struct device_driver driver;
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h
index a603cbde201e..c98a95dbe250 100644
--- a/include/linux/usb_gadget.h
+++ b/include/linux/usb_gadget.h
@@ -313,8 +313,8 @@ usb_ep_free_buffer (struct usb_ep *ep, void *buf, dma_addr_t dma, unsigned len)
* arranges to poll once per interval, and the gadget driver usually will
* have queued some data to transfer at that time.
*
- * Returns zero, or a negative error code. Endpoints that are not enabled,
- * or which are enabled but halted, report errors; errors will also be
+ * Returns zero, or a negative error code. Endpoints that are not enabled
+ * report errors; errors will also be
* reported when the usb peripheral is disconnected.
*/
static inline int
@@ -352,6 +352,11 @@ static inline int usb_ep_dequeue (struct usb_ep *ep, struct usb_request *req)
* clears this feature; drivers may need to empty the endpoint's request
* queue first, to make sure no inappropriate transfers happen.
*
+ * Note that while an endpoint CLEAR_FEATURE will be invisible to the
+ * gadget driver, a SET_INTERFACE will not be. To reset endpoints for the
+ * current altsetting, see usb_ep_clear_halt(). When switching altsettings,
+ * it's simplest to use usb_ep_enable() or usb_ep_disable() for the endpoints.
+ *
* Returns zero, or a negative error code. On success, this call sets
* underlying hardware state that blocks data transfers.
*/
@@ -365,12 +370,14 @@ usb_ep_set_halt (struct usb_ep *ep)
* usb_ep_clear_halt - clears endpoint halt, and resets toggle
* @ep:the bulk or interrupt endpoint being reset
*
- * use this when responding to the standard usb "set interface" request,
+ * Use this when responding to the standard usb "set interface" request,
* for endpoints that aren't reconfigured, after clearing any other state
* in the endpoint's i/o queue.
*
- * returns zero, or a negative error code. on success, this call clears
+ * Returns zero, or a negative error code. On success, this call clears
* the underlying hardware state reflecting endpoint halt and data toggle.
+ * Note that some hardware can't support this request (like pxa2xx_udc),
+ * and accordingly can't correctly implement interface altsettings.
*/
static inline int
usb_ep_clear_halt (struct usb_ep *ep)
@@ -562,7 +569,8 @@ usb_gadget_clear_selfpowered (struct usb_gadget *gadget)
* queues a response to ep0, or returns negative to stall.
* @disconnect: Invoked after all transfers have been stopped,
* when the host is disconnected. May be called in_interrupt; this
- * may not sleep.
+ * may not sleep. Some devices can't detect disconnect, so this might
+ * not be called except as part of controller shutdown.
* @unbind: Invoked when the driver is unbound from a gadget,
* usually from rmmod (after a disconnect is reported).
* Called in a context that permits sleeping.
@@ -603,7 +611,9 @@ usb_gadget_clear_selfpowered (struct usb_gadget *gadget)
* not provide those callbacks. However, some may need to change modes
* when the host is not longer directing those activities. For example,
* local controls (buttons, dials, etc) may need to be re-enabled since
- * the (remote) host can't do that any longer.
+ * the (remote) host can't do that any longer; or an error state might
+ * be cleared, to make the device behave identically whether or not
+ * power is maintained.
*/
struct usb_gadget_driver {
char *function;
diff --git a/include/linux/videodev.h b/include/linux/videodev.h
index 9e7dacaff115..8abbd9e9e596 100644
--- a/include/linux/videodev.h
+++ b/include/linux/videodev.h
@@ -63,6 +63,12 @@ video_device_create_file(struct video_device *vfd,
{
class_device_create_file(&vfd->class_dev, attr);
}
+static inline void
+video_device_remove_file(struct video_device *vfd,
+ struct class_device_attribute *attr)
+{
+ class_device_remove_file(&vfd->class_dev, attr);
+}
/* helper functions to alloc / release struct video_device, the
later can be used for video_device->release() */