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;
|
2014-10-02 11:30:02 -06:00
|
|
|
u8 id;
|
2015-04-06 04:19:36 -06:00
|
|
|
u8 class;
|
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 */
|
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-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-19 15:56:31 -07:00
|
|
|
struct gb_bundle *gb_bundle_find(struct gb_interface *intf, u8 bundle_id);
|
2014-12-23 16:16:53 -07:00
|
|
|
void gb_bundle_bind_protocols(void);
|
2014-10-21 20:43:30 -06:00
|
|
|
|
2015-04-01 09:02:04 -06:00
|
|
|
const struct greybus_bundle_id *
|
|
|
|
gb_bundle_match_id(struct gb_bundle *bundle,
|
|
|
|
const struct greybus_bundle_id *id);
|
|
|
|
|
2014-12-12 15:10:17 -07:00
|
|
|
#endif /* __BUNDLE_H */
|