Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185253
b: refs/heads/master
c: e9a2017
h: refs/heads/master
i:
  185251: d8abda0
v: v3
  • Loading branch information
Felipe Balbi authored and Greg Kroah-Hartman committed Mar 2, 2010
1 parent 72d67c6 commit e6da348
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8bc1d21776bb012e41ed062c6d842cfe7c82998a
refs/heads/master: e9a20171dfa0aa134d2211126d1310f2daea52cf
25 changes: 25 additions & 0 deletions trunk/include/linux/usb/otg.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#ifndef __LINUX_USB_OTG_H
#define __LINUX_USB_OTG_H

#include <linux/notifier.h>

/* OTG defines lots of enumeration states before device reset */
enum usb_otg_state {
OTG_STATE_UNDEFINED = 0,
Expand All @@ -33,6 +35,14 @@ enum usb_otg_state {
OTG_STATE_A_VBUS_ERR,
};

enum usb_xceiv_events {
USB_EVENT_NONE, /* no events or cable disconnected */
USB_EVENT_VBUS, /* vbus valid event */
USB_EVENT_ID, /* id was grounded */
USB_EVENT_CHARGER, /* usb dedicated charger */
USB_EVENT_ENUMERATED, /* gadget driver enumerated */
};

#define USB_OTG_PULLUP_ID (1 << 0)
#define USB_OTG_PULLDOWN_DP (1 << 1)
#define USB_OTG_PULLDOWN_DM (1 << 2)
Expand Down Expand Up @@ -70,6 +80,9 @@ struct otg_transceiver {
struct otg_io_access_ops *io_ops;
void __iomem *io_priv;

/* for notification of usb_xceiv_events */
struct blocking_notifier_head notifier;

/* to pass extra port status to the root hub */
u16 port_status;
u16 port_change;
Expand Down Expand Up @@ -203,6 +216,18 @@ otg_start_srp(struct otg_transceiver *otg)
return otg->start_srp(otg);
}

/* notifiers */
static inline int
otg_register_notifier(struct otg_transceiver *otg, struct notifier_block *nb)
{
return blocking_notifier_chain_register(&otg->notifier, nb);
}

static inline void
otg_unregister_notifier(struct otg_transceiver *otg, struct notifier_block *nb)
{
blocking_notifier_chain_unregister(&otg->notifier, nb);
}

/* for OTG controller drivers (and maybe other stuff) */
extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num);
Expand Down

0 comments on commit e6da348

Please sign in to comment.