alistair23-linux/drivers/staging/greybus/bundle.h
Johan Hovold a7e36d0eac greybus: bundle: separate bundle creation and registration
Separate bundle creation and registration.

Note that the bundle connections still needs to be initialised post
registration as protocol drivers create child devices to the bundle.

This will ultimately allow connection structures to be created while
parsing manifests, but the connections to not be enabled until a driver
is bound.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-12-08 15:56:38 -05:00

38 lines
781 B
C

/*
* Greybus bundles
*
* Copyright 2014 Google Inc.
* Copyright 2014 Linaro Ltd.
*
* Released under the GPLv2 only.
*/
#ifndef __BUNDLE_H
#define __BUNDLE_H
#include <linux/list.h>
/* Greybus "public" definitions" */
struct gb_bundle {
struct device dev;
struct gb_interface *intf;
u8 id;
u8 class;
struct list_head connections;
u8 *state;
struct list_head links; /* interface->bundles */
void *private;
};
#define to_gb_bundle(d) container_of(d, struct gb_bundle, dev)
#define GB_DEVICE_ID_BAD 0xff
/* Greybus "private" definitions" */
struct gb_bundle *gb_bundle_create(struct gb_interface *intf, u8 bundle_id,
u8 class);
int gb_bundle_add(struct gb_bundle *bundle);
void gb_bundle_destroy(struct gb_bundle *bundle);
#endif /* __BUNDLE_H */