alistair23-linux/drivers/staging/greybus/module.h
Viresh Kumar c9d9d0d443 greybus: interface: Fetch interface id instead of module id during setup
There can be more than one interface on a module and we need to know the
interface for which the event has occurred.

But at the same time we may not need the module id at all. During initial phase
when AP is probed, the AP will receive the unique Endo id which shall be enough
to draw relationships between interface and module ids.

Code for that isn't available today and so lets create another routine to get
module id (which needs to be fixed separately), which will simply return
interface id passed to it.

Now that we have interface id, update rest of the code to use it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2015-04-05 18:04:38 +02:00

30 lines
626 B
C

/*
* Greybus module code
*
* Copyright 2014 Google Inc.
*
* Released under the GPLv2 only.
*/
#ifndef __MODULE_H
#define __MODULE_H
/* Greybus "public" definitions" */
struct gb_module {
struct device dev;
u8 module_id; /* Physical location within the Endo */
u16 refcount;
};
#define to_gb_module(d) container_of(d, struct gb_module, dev)
struct greybus_host_device;
/* Greybus "private" definitions */
struct gb_module *gb_module_find_or_create(struct greybus_host_device *hd,
u8 module_id);
void gb_module_remove(struct gb_module *module);
u8 get_module_id(u8 interface_id);
#endif /* __MODULE_H */