2014-10-01 22:54:11 -04:00
|
|
|
/*
|
2014-12-11 17:10:56 -05:00
|
|
|
* Greybus Interface Block code
|
2014-10-01 22:54:11 -04:00
|
|
|
*
|
|
|
|
* Copyright 2014 Google Inc.
|
2014-12-12 13:08:42 -05:00
|
|
|
* Copyright 2014 Linaro Ltd.
|
2014-10-01 22:54:11 -04:00
|
|
|
*
|
|
|
|
* Released under the GPLv2 only.
|
|
|
|
*/
|
|
|
|
|
2014-12-19 17:56:30 -05:00
|
|
|
#ifndef __INTERFACE_H
|
|
|
|
#define __INTERFACE_H
|
2014-10-01 22:54:11 -04:00
|
|
|
|
2014-12-11 17:10:56 -05:00
|
|
|
/* Greybus "public" definitions" */
|
2014-12-19 17:56:31 -05:00
|
|
|
struct gb_interface {
|
2014-10-01 22:54:11 -04:00
|
|
|
struct device dev;
|
|
|
|
|
2014-12-19 17:56:29 -05:00
|
|
|
struct list_head bundles;
|
2014-10-01 22:54:11 -04:00
|
|
|
struct list_head links; /* greybus_host_device->modules */
|
|
|
|
u8 module_id; /* Physical location within the Endo */
|
|
|
|
|
2014-10-01 22:54:16 -04:00
|
|
|
/* Information taken from the manifest module descriptor */
|
|
|
|
u16 vendor;
|
|
|
|
u16 product;
|
|
|
|
char *vendor_string;
|
|
|
|
char *product_string;
|
2014-10-02 13:30:02 -04:00
|
|
|
u64 unique_id;
|
2014-10-01 22:54:16 -04:00
|
|
|
|
2014-10-01 22:54:11 -04:00
|
|
|
struct greybus_host_device *hd;
|
|
|
|
};
|
2014-12-19 17:56:31 -05:00
|
|
|
#define to_gb_interface(d) container_of(d, struct gb_interface, dev)
|
2014-10-01 22:54:11 -04:00
|
|
|
|
2014-12-19 17:56:31 -05:00
|
|
|
static inline void gb_interface_set_drvdata(struct gb_interface *intf,
|
|
|
|
void *data)
|
2014-10-01 22:54:11 -04:00
|
|
|
{
|
2014-12-19 17:56:31 -05:00
|
|
|
dev_set_drvdata(&intf->dev, data);
|
2014-10-01 22:54:11 -04:00
|
|
|
}
|
|
|
|
|
2014-12-19 17:56:31 -05:00
|
|
|
static inline void * gb_interface__get_drvdata(struct gb_interface *intf)
|
2014-10-01 22:54:11 -04:00
|
|
|
{
|
2014-12-19 17:56:31 -05:00
|
|
|
return dev_get_drvdata(&intf->dev);
|
2014-10-01 22:54:11 -04:00
|
|
|
}
|
|
|
|
|
2014-12-11 17:10:56 -05:00
|
|
|
/* Greybus "private" definitions */
|
2014-10-01 22:54:11 -04:00
|
|
|
|
2014-12-19 17:56:32 -05:00
|
|
|
const struct greybus_interface_id *
|
2014-12-19 17:56:31 -05:00
|
|
|
gb_interface_match_id(struct gb_interface *intf,
|
2014-12-19 17:56:32 -05:00
|
|
|
const struct greybus_interface_id *id);
|
2014-10-01 22:54:11 -04:00
|
|
|
|
2014-12-19 17:56:31 -05:00
|
|
|
struct gb_interface *gb_interface_find(struct greybus_host_device *hd,
|
|
|
|
u8 module_id);
|
2014-10-21 22:43:29 -04:00
|
|
|
|
2014-12-19 17:56:30 -05:00
|
|
|
#endif /* __INTERFACE_H */
|