]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - drivers/staging/greybus/bundle.h
a9cd7c241d78d5609c7423492c2894dec135fbda
1 // SPDX-License-Identifier: GPL-2.0
5 * Copyright 2014 Google Inc.
6 * Copyright 2014 Linaro Ltd.
8 * Released under the GPLv2 only.
14 #include <linux/list.h>
16 #define BUNDLE_ID_NONE U8_MAX
18 /* Greybus "public" definitions" */
21 struct gb_interface
*intf
;
29 struct greybus_descriptor_cport
*cport_desc
;
31 struct list_head connections
;
34 struct list_head links
; /* interface->bundles */
36 #define to_gb_bundle(d) container_of(d, struct gb_bundle, dev)
38 /* Greybus "private" definitions" */
39 struct gb_bundle
*gb_bundle_create(struct gb_interface
*intf
, u8 bundle_id
,
41 int gb_bundle_add(struct gb_bundle
*bundle
);
42 void gb_bundle_destroy(struct gb_bundle
*bundle
);
44 /* Bundle Runtime PM wrappers */
46 static inline int gb_pm_runtime_get_sync(struct gb_bundle
*bundle
)
50 retval
= pm_runtime_get_sync(&bundle
->dev
);
53 "pm_runtime_get_sync failed: %d\n", retval
);
54 pm_runtime_put_noidle(&bundle
->dev
);
61 static inline int gb_pm_runtime_put_autosuspend(struct gb_bundle
*bundle
)
65 pm_runtime_mark_last_busy(&bundle
->dev
);
66 retval
= pm_runtime_put_autosuspend(&bundle
->dev
);
71 static inline void gb_pm_runtime_get_noresume(struct gb_bundle
*bundle
)
73 pm_runtime_get_noresume(&bundle
->dev
);
76 static inline void gb_pm_runtime_put_noidle(struct gb_bundle
*bundle
)
78 pm_runtime_put_noidle(&bundle
->dev
);
82 static inline int gb_pm_runtime_get_sync(struct gb_bundle
*bundle
)
84 static inline int gb_pm_runtime_put_autosuspend(struct gb_bundle
*bundle
)
87 static inline void gb_pm_runtime_get_noresume(struct gb_bundle
*bundle
) {}
88 static inline void gb_pm_runtime_put_noidle(struct gb_bundle
*bundle
) {}
91 #endif /* __BUNDLE_H */