]>
Commit | Line | Data |
---|---|---|
8c12cde3 | 1 | /* |
1db0a5ff | 2 | * Greybus bundles |
8c12cde3 AE |
3 | * |
4 | * Copyright 2014 Google Inc. | |
a46e9671 | 5 | * Copyright 2014 Linaro Ltd. |
8c12cde3 AE |
6 | * |
7 | * Released under the GPLv2 only. | |
8 | */ | |
9 | ||
1db0a5ff GKH |
10 | #ifndef __BUNDLE_H |
11 | #define __BUNDLE_H | |
8c12cde3 AE |
12 | |
13 | #include <linux/list.h> | |
14 | ||
1db0a5ff GKH |
15 | /* Greybus "public" definitions" */ |
16 | struct gb_bundle { | |
f0f61b90 | 17 | struct device dev; |
4ab9b3c2 | 18 | struct gb_interface *intf; |
63cc932b | 19 | u8 id; |
88e6d37c | 20 | u8 class; |
1a4c013a | 21 | u8 device_id; |
748e1230 | 22 | struct list_head connections; |
75052a55 | 23 | u8 *state; |
8c12cde3 | 24 | |
1db0a5ff | 25 | struct list_head links; /* interface->bundles */ |
8c12cde3 | 26 | }; |
1db0a5ff | 27 | #define to_gb_bundle(d) container_of(d, struct gb_bundle, dev) |
8c12cde3 | 28 | |
1b6ea0db GKH |
29 | #define GB_DEVICE_ID_BAD 0xff |
30 | ||
1db0a5ff | 31 | /* Greybus "private" definitions" */ |
7c183f70 | 32 | struct gb_bundle *gb_bundle_create(struct gb_interface *intf, u8 bundle_id, |
88e6d37c | 33 | u8 class); |
4ab9b3c2 | 34 | void gb_bundle_destroy(struct gb_interface *intf); |
bb97ea81 VK |
35 | int gb_bundle_init(struct gb_bundle *bundle, u8 device_id); |
36 | int gb_bundles_init(struct gb_interface *intf, u8 device_id); | |
8c12cde3 | 37 | |
4ab9b3c2 | 38 | struct gb_bundle *gb_bundle_find(struct gb_interface *intf, u8 bundle_id); |
fb69cb50 | 39 | void gb_bundle_bind_protocols(void); |
1a4c013a | 40 | |
9f5f30e7 VK |
41 | const struct greybus_bundle_id * |
42 | gb_bundle_match_id(struct gb_bundle *bundle, | |
43 | const struct greybus_bundle_id *id); | |
44 | ||
1db0a5ff | 45 | #endif /* __BUNDLE_H */ |