summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/interface.h
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-04-23 18:47:24 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2016-04-25 11:08:30 -0700
commitb15d97d77017dc168c74c5e9aacfe14ff74dcbe9 (patch)
tree4fe55aad777a3d5614cb4e61e0bf54a7fe63b5aa /drivers/staging/greybus/interface.h
parent844fcbfeb6491d95b7e19b4705f9eb576a210536 (diff)
greybus: core: add module abstraction
Add Greybus module abstraction that will be used to implement controlled module removal (eject) and represent module geometry. Greybus module devices correspond to physical modules and have one or more interfaces. Modules have an id that is identical to the id of their primary interface, which in turn is the interface with lowest numbered id. The module name is constructed from the bus and module id: <bus_id>-<module_id> Interfaces, bundles, and control devices are consequently renamed as <bus_id>-<module_id>.<interface_id> <bus_id>-<module_id>.<interface_id>.<bundle_id> <bus_id>-<module_id>.<interface_id>.ctrl As before, interface ids (and therefore in a sense now also module ids) correspond to physical interface positions on the frame. Modules have the following attributes: module_id num_interfaces where module_id is the id of the module and num_interface the number of interfaces the module has. Note that until SVC module-size detection has been implemented, all interfaces are considered to be part of 1x2 modules. Specifically, the two interfaces of a 2x2 module will be presented as two 1x2 modules for now. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/interface.h')
-rw-r--r--drivers/staging/greybus/interface.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/staging/greybus/interface.h b/drivers/staging/greybus/interface.h
index 63ba696c14a5..9185c7f1bd32 100644
--- a/drivers/staging/greybus/interface.h
+++ b/drivers/staging/greybus/interface.h
@@ -20,7 +20,7 @@ struct gb_interface {
struct gb_control *control;
struct list_head bundles;
- struct list_head links; /* gb_host_device->interfaces */
+ struct list_head module_node;
struct list_head manifest_descs;
u8 interface_id; /* Physical location within the Endo */
u8 device_id;
@@ -35,6 +35,7 @@ struct gb_interface {
u16 version_minor;
struct gb_host_device *hd;
+ struct gb_module *module;
unsigned long quirks;
@@ -46,13 +47,14 @@ struct gb_interface {
struct gb_interface *gb_interface_find(struct gb_host_device *hd,
u8 interface_id);
-struct gb_interface *gb_interface_create(struct gb_host_device *hd,
+struct gb_interface *gb_interface_create(struct gb_module *module,
u8 interface_id);
int gb_interface_activate(struct gb_interface *intf);
void gb_interface_deactivate(struct gb_interface *intf);
int gb_interface_enable(struct gb_interface *intf);
void gb_interface_disable(struct gb_interface *intf);
int gb_interface_add(struct gb_interface *intf);
-void gb_interface_remove(struct gb_interface *intf);
+void gb_interface_del(struct gb_interface *intf);
+void gb_interface_put(struct gb_interface *intf);
#endif /* __INTERFACE_H */