4 * Copyright 2014 Google Inc.
5 * Copyright 2014 Linaro Ltd.
7 * Released under the GPLv2 only.
13 #include <linux/list.h>
15 #define BUNDLE_ID_NONE U8_MAX
17 /* Greybus "public" definitions" */
20 struct gb_interface *intf;
28 struct greybus_descriptor_cport *cport_desc;
30 struct list_head connections;
33 struct list_head links; /* interface->bundles */
35 #define to_gb_bundle(d) container_of(d, struct gb_bundle, dev)
37 /* Greybus "private" definitions" */
38 struct gb_bundle *gb_bundle_create(struct gb_interface *intf, u8 bundle_id,
40 int gb_bundle_add(struct gb_bundle *bundle);
41 void gb_bundle_destroy(struct gb_bundle *bundle);
43 /* Bundle Runtime PM wrappers */
45 static inline int gb_pm_runtime_get_sync(struct gb_bundle *bundle)
49 retval = pm_runtime_get_sync(&bundle->dev);
52 "pm_runtime_get_sync failed: %d\n", retval);
53 pm_runtime_put_noidle(&bundle->dev);
60 static inline int gb_pm_runtime_put_autosuspend(struct gb_bundle *bundle)
64 pm_runtime_mark_last_busy(&bundle->dev);
65 retval = pm_runtime_put_autosuspend(&bundle->dev);
70 static inline void gb_pm_runtime_get_noresume(struct gb_bundle *bundle)
72 pm_runtime_get_noresume(&bundle->dev);
75 static inline void gb_pm_runtime_put_noidle(struct gb_bundle *bundle)
77 pm_runtime_put_noidle(&bundle->dev);
81 static inline int gb_pm_runtime_get_sync(struct gb_bundle *bundle)
83 static inline int gb_pm_runtime_put_autosuspend(struct gb_bundle *bundle)
86 static inline void gb_pm_runtime_get_noresume(struct gb_bundle *bundle) {}
87 static inline void gb_pm_runtime_put_noidle(struct gb_bundle *bundle) {}
90 #endif /* __BUNDLE_H */