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
|
|
|
|
2016-03-29 18:56:03 -04:00
|
|
|
#define GB_INTERFACE_QUIRK_NO_CPORT_FEATURES BIT(0)
|
|
|
|
#define GB_INTERFACE_QUIRK_NO_INTERFACE_VERSION BIT(1)
|
2016-03-29 18:56:09 -04:00
|
|
|
#define GB_INTERFACE_QUIRK_NO_INIT_STATUS BIT(2)
|
2016-03-29 18:56:10 -04:00
|
|
|
#define GB_INTERFACE_QUIRK_NO_ARA_IDS BIT(3)
|
2016-03-29 18:56:03 -04:00
|
|
|
|
2014-12-19 17:56:31 -05:00
|
|
|
struct gb_interface {
|
2014-10-01 22:54:11 -04:00
|
|
|
struct device dev;
|
2015-06-22 07:12:26 -04:00
|
|
|
struct gb_control *control;
|
2014-10-01 22:54:11 -04:00
|
|
|
|
2014-12-19 17:56:29 -05:00
|
|
|
struct list_head bundles;
|
2016-04-23 12:47:24 -04:00
|
|
|
struct list_head module_node;
|
2014-12-23 18:16:50 -05:00
|
|
|
struct list_head manifest_descs;
|
2014-12-21 17:10:26 -05:00
|
|
|
u8 interface_id; /* Physical location within the Endo */
|
2016-03-29 18:56:06 -04:00
|
|
|
u8 device_id;
|
2014-10-01 22:54:11 -04:00
|
|
|
|
2015-12-22 11:34:33 -05:00
|
|
|
u32 ddbl1_manufacturer_id;
|
|
|
|
u32 ddbl1_product_id;
|
2015-11-25 09:58:56 -05:00
|
|
|
u32 vendor_id;
|
|
|
|
u32 product_id;
|
2015-12-28 01:29:00 -05:00
|
|
|
u64 serial_number;
|
2015-08-11 23:49:31 -04:00
|
|
|
|
2015-12-28 01:29:01 -05:00
|
|
|
u16 version_major;
|
|
|
|
u16 version_minor;
|
|
|
|
|
2015-11-03 12:03:23 -05:00
|
|
|
struct gb_host_device *hd;
|
2016-04-23 12:47:24 -04:00
|
|
|
struct gb_module *module;
|
2015-10-07 15:40:24 -04:00
|
|
|
|
2016-03-29 18:56:03 -04:00
|
|
|
unsigned long quirks;
|
|
|
|
|
2015-12-15 09:28:57 -05:00
|
|
|
bool disconnected;
|
2016-04-13 13:19:06 -04:00
|
|
|
bool enabled;
|
2014-10-01 22:54:11 -04:00
|
|
|
};
|
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
|
|
|
|
2015-11-03 12:03:23 -05:00
|
|
|
struct gb_interface *gb_interface_find(struct gb_host_device *hd,
|
2015-04-01 11:01:58 -04:00
|
|
|
u8 interface_id);
|
2014-10-21 22:43:29 -04:00
|
|
|
|
2016-04-23 12:47:24 -04:00
|
|
|
struct gb_interface *gb_interface_create(struct gb_module *module,
|
2015-06-22 07:12:27 -04:00
|
|
|
u8 interface_id);
|
2016-03-29 18:56:04 -04:00
|
|
|
int gb_interface_activate(struct gb_interface *intf);
|
|
|
|
void gb_interface_deactivate(struct gb_interface *intf);
|
2016-03-09 06:20:42 -05:00
|
|
|
int gb_interface_enable(struct gb_interface *intf);
|
2016-03-09 06:20:43 -05:00
|
|
|
void gb_interface_disable(struct gb_interface *intf);
|
2016-03-09 06:20:36 -05:00
|
|
|
int gb_interface_add(struct gb_interface *intf);
|
2016-04-23 12:47:24 -04:00
|
|
|
void gb_interface_del(struct gb_interface *intf);
|
|
|
|
void gb_interface_put(struct gb_interface *intf);
|
2014-12-19 17:56:35 -05:00
|
|
|
|
2014-12-19 17:56:30 -05:00
|
|
|
#endif /* __INTERFACE_H */
|