Alex Elder | 8c12cde | 2014-10-01 21:54:12 -0500 | [diff] [blame] | 1 | /* |
Greg Kroah-Hartman | 1db0a5f | 2014-12-12 17:10:17 -0500 | [diff] [blame] | 2 | * Greybus bundles |
Alex Elder | 8c12cde | 2014-10-01 21:54:12 -0500 | [diff] [blame] | 3 | * |
4 | * Copyright 2014 Google Inc. | ||||
Alex Elder | a46e967 | 2014-12-12 12:08:42 -0600 | [diff] [blame] | 5 | * Copyright 2014 Linaro Ltd. |
Alex Elder | 8c12cde | 2014-10-01 21:54:12 -0500 | [diff] [blame] | 6 | * |
7 | * Released under the GPLv2 only. | ||||
8 | */ | ||||
9 | |||||
Greg Kroah-Hartman | 1db0a5f | 2014-12-12 17:10:17 -0500 | [diff] [blame] | 10 | #ifndef __BUNDLE_H |
11 | #define __BUNDLE_H | ||||
Alex Elder | 8c12cde | 2014-10-01 21:54:12 -0500 | [diff] [blame] | 12 | |
13 | #include <linux/list.h> | ||||
14 | |||||
Greg Kroah-Hartman | 1db0a5f | 2014-12-12 17:10:17 -0500 | [diff] [blame] | 15 | /* Greybus "public" definitions" */ |
16 | struct gb_bundle { | ||||
Greg Kroah-Hartman | f0f61b9 | 2014-10-24 17:34:46 +0800 | [diff] [blame] | 17 | struct device dev; |
Greg Kroah-Hartman | 4ab9b3c | 2014-12-19 14:56:31 -0800 | [diff] [blame] | 18 | struct gb_interface *intf; |
Johan Hovold | b807aa7 | 2016-01-19 12:51:21 +0100 | [diff] [blame] | 19 | |
Alex Elder | 63cc932 | 2014-10-02 12:30:02 -0500 | [diff] [blame] | 20 | u8 id; |
Viresh Kumar | 88e6d37 | 2015-04-06 15:49:36 +0530 | [diff] [blame] | 21 | u8 class; |
Johan Hovold | b807aa7 | 2016-01-19 12:51:21 +0100 | [diff] [blame] | 22 | u8 class_major; |
23 | u8 class_minor; | ||||
24 | |||||
Johan Hovold | 98fdf5a | 2016-01-21 17:34:09 +0100 | [diff] [blame] | 25 | size_t num_cports; |
26 | struct greybus_descriptor_cport *cport_desc; | ||||
27 | |||||
Alex Elder | 748e123 | 2014-10-03 14:14:22 -0500 | [diff] [blame] | 28 | struct list_head connections; |
Greg Kroah-Hartman | 75052a5 | 2015-04-13 19:48:37 +0200 | [diff] [blame] | 29 | u8 *state; |
Alex Elder | 8c12cde | 2014-10-01 21:54:12 -0500 | [diff] [blame] | 30 | |
Greg Kroah-Hartman | 1db0a5f | 2014-12-12 17:10:17 -0500 | [diff] [blame] | 31 | struct list_head links; /* interface->bundles */ |
Alex Elder | 8c12cde | 2014-10-01 21:54:12 -0500 | [diff] [blame] | 32 | }; |
Greg Kroah-Hartman | 1db0a5f | 2014-12-12 17:10:17 -0500 | [diff] [blame] | 33 | #define to_gb_bundle(d) container_of(d, struct gb_bundle, dev) |
Alex Elder | 8c12cde | 2014-10-01 21:54:12 -0500 | [diff] [blame] | 34 | |
Greg Kroah-Hartman | 1b6ea0d | 2014-12-24 13:01:39 -0800 | [diff] [blame] | 35 | #define GB_DEVICE_ID_BAD 0xff |
36 | |||||
Greg Kroah-Hartman | 1db0a5f | 2014-12-12 17:10:17 -0500 | [diff] [blame] | 37 | /* Greybus "private" definitions" */ |
Viresh Kumar | 7c183f7 | 2015-04-01 20:32:00 +0530 | [diff] [blame] | 38 | struct gb_bundle *gb_bundle_create(struct gb_interface *intf, u8 bundle_id, |
Viresh Kumar | 88e6d37 | 2015-04-06 15:49:36 +0530 | [diff] [blame] | 39 | u8 class); |
Johan Hovold | a7e36d0 | 2015-12-07 15:05:43 +0100 | [diff] [blame] | 40 | int gb_bundle_add(struct gb_bundle *bundle); |
Alex Elder | fe53b45 | 2015-06-12 10:21:11 -0500 | [diff] [blame] | 41 | void gb_bundle_destroy(struct gb_bundle *bundle); |
Alex Elder | 8c12cde | 2014-10-01 21:54:12 -0500 | [diff] [blame] | 42 | |
Greg Kroah-Hartman | 1db0a5f | 2014-12-12 17:10:17 -0500 | [diff] [blame] | 43 | #endif /* __BUNDLE_H */ |