summaryrefslogtreecommitdiff
path: root/include/linux/usb/otg_id.h
diff options
context:
space:
mode:
authorDima Zavin <dima@android.com>2011-09-09 09:25:05 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:39:04 -0800
commitec2e6c72e4557774ee6913f5c4bb560236f56015 (patch)
treebbe10893bfe071ce7bed39f1e56b94930792869a /include/linux/usb/otg_id.h
parent76a22ac439a4048bc6bd012253572bb571cc66d9 (diff)
usb: otg_id: add suspend/resume interface
It is possible that while one driver has already suspended, another driver calls otg_id_notify() because it has not yet been suspended. It would then be possible for the suspended driver's detect callback to be called. This is undesirable. Introduce new otg_id_suspend/otg_id_resume functions that keep a suspended count, and if a notification happens while someone is suspended, that notification is deferred until all the drivers are resumed. If the notification happens before the last driver is suspended, that suspend will be aborted and once the final driver resumes through otg_id_resume, the notification will be delivered. Change-Id: I32fd32bec65e366e5f97a25c15255d94773b85b3 Signed-off-by: Dima Zavin <dima@android.com>
Diffstat (limited to 'include/linux/usb/otg_id.h')
-rw-r--r--include/linux/usb/otg_id.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/usb/otg_id.h b/include/linux/usb/otg_id.h
index 46a44637c117..f9f5189a73b7 100644
--- a/include/linux/usb/otg_id.h
+++ b/include/linux/usb/otg_id.h
@@ -52,5 +52,7 @@ int otg_id_register_notifier(struct otg_id_notifier_block *otg_id_nb);
void otg_id_unregister_notifier(struct otg_id_notifier_block *otg_id_nb);
void otg_id_notify(void);
+int otg_id_suspend(void);
+void otg_id_resume(void);
#endif /* __LINUX_USB_OTG_ID_H */