1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Greybus Interface Block code
5 * Copyright 2014 Google Inc.
6 * Copyright 2014 Linaro Ltd.
12 #include <linux/types.h>
13 #include <linux/device.h>
15 enum gb_interface_type
{
16 GB_INTERFACE_TYPE_INVALID
= 0,
17 GB_INTERFACE_TYPE_UNKNOWN
,
18 GB_INTERFACE_TYPE_DUMMY
,
19 GB_INTERFACE_TYPE_UNIPRO
,
20 GB_INTERFACE_TYPE_GREYBUS
,
23 #define GB_INTERFACE_QUIRK_NO_CPORT_FEATURES BIT(0)
24 #define GB_INTERFACE_QUIRK_NO_INIT_STATUS BIT(1)
25 #define GB_INTERFACE_QUIRK_NO_GMP_IDS BIT(2)
26 #define GB_INTERFACE_QUIRK_FORCED_DISABLE BIT(3)
27 #define GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH BIT(4)
28 #define GB_INTERFACE_QUIRK_NO_BUNDLE_ACTIVATE BIT(5)
29 #define GB_INTERFACE_QUIRK_NO_PM BIT(6)
33 struct gb_control
*control
;
35 struct list_head bundles
;
36 struct list_head module_node
;
37 struct list_head manifest_descs
;
38 u8 interface_id
; /* Physical location within the Endo */
40 u8 features
; /* Feature flags set in the manifest */
42 enum gb_interface_type type
;
44 u32 ddbl1_manufacturer_id
;
50 struct gb_host_device
*hd
;
51 struct gb_module
*module
;
66 struct work_struct mode_switch_work
;
67 struct completion mode_switch_completion
;
69 #define to_gb_interface(d) container_of(d, struct gb_interface, dev)
71 struct gb_interface
*gb_interface_create(struct gb_module
*module
,
73 int gb_interface_activate(struct gb_interface
*intf
);
74 void gb_interface_deactivate(struct gb_interface
*intf
);
75 int gb_interface_enable(struct gb_interface
*intf
);
76 void gb_interface_disable(struct gb_interface
*intf
);
77 int gb_interface_add(struct gb_interface
*intf
);
78 void gb_interface_del(struct gb_interface
*intf
);
79 void gb_interface_put(struct gb_interface
*intf
);
80 void gb_interface_mailbox_event(struct gb_interface
*intf
, u16 result
,
83 int gb_interface_request_mode_switch(struct gb_interface
*intf
);
85 #endif /* __INTERFACE_H */