2014-10-01 20:54:12 -06:00
|
|
|
/*
|
2014-12-12 15:10:17 -07:00
|
|
|
* Greybus bundles
|
2014-10-01 20:54:12 -06:00
|
|
|
*
|
|
|
|
* Copyright 2014 Google Inc.
|
2014-12-12 11:08:42 -07:00
|
|
|
* Copyright 2014 Linaro Ltd.
|
2014-10-01 20:54:12 -06:00
|
|
|
*
|
|
|
|
* Released under the GPLv2 only.
|
|
|
|
*/
|
|
|
|
|
2014-12-12 15:10:17 -07:00
|
|
|
#ifndef __BUNDLE_H
|
|
|
|
#define __BUNDLE_H
|
2014-10-01 20:54:12 -06:00
|
|
|
|
|
|
|
#include <linux/list.h>
|
|
|
|
|
2014-12-12 15:10:17 -07:00
|
|
|
/* Greybus "public" definitions" */
|
|
|
|
struct gb_bundle {
|
2014-10-24 03:34:46 -06:00
|
|
|
struct device dev;
|
2014-12-19 15:56:31 -07:00
|
|
|
struct gb_interface *intf;
|
2016-01-19 04:51:21 -07:00
|
|
|
|
2014-10-02 11:30:02 -06:00
|
|
|
u8 id;
|
2015-04-06 04:19:36 -06:00
|
|
|
u8 class;
|
2016-01-19 04:51:21 -07:00
|
|
|
u8 class_major;
|
|
|
|
u8 class_minor;
|
|
|
|
|
2016-01-21 09:34:09 -07:00
|
|
|
size_t num_cports;
|
|
|
|
struct greybus_descriptor_cport *cport_desc;
|
|
|
|
|
2014-10-03 13:14:22 -06:00
|
|
|
struct list_head connections;
|
2015-04-13 11:48:37 -06:00
|
|
|
u8 *state;
|
2014-10-01 20:54:12 -06:00
|
|
|
|
2014-12-12 15:10:17 -07:00
|
|
|
struct list_head links; /* interface->bundles */
|
2015-10-16 17:54:00 -06:00
|
|
|
void *private;
|
2014-10-01 20:54:12 -06:00
|
|
|
};
|
2014-12-12 15:10:17 -07:00
|
|
|
#define to_gb_bundle(d) container_of(d, struct gb_bundle, dev)
|
2014-10-01 20:54:12 -06:00
|
|
|
|
2014-12-24 14:01:39 -07:00
|
|
|
#define GB_DEVICE_ID_BAD 0xff
|
|
|
|
|
2014-12-12 15:10:17 -07:00
|
|
|
/* Greybus "private" definitions" */
|
2015-04-01 09:02:00 -06:00
|
|
|
struct gb_bundle *gb_bundle_create(struct gb_interface *intf, u8 bundle_id,
|
2015-04-06 04:19:36 -06:00
|
|
|
u8 class);
|
2015-12-07 07:05:43 -07:00
|
|
|
int gb_bundle_add(struct gb_bundle *bundle);
|
2015-06-12 09:21:11 -06:00
|
|
|
void gb_bundle_destroy(struct gb_bundle *bundle);
|
2014-10-01 20:54:12 -06:00
|
|
|
|
2014-12-12 15:10:17 -07:00
|
|
|
#endif /* __BUNDLE_H */
|