]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - drivers/staging/greybus/interface.h
staging: greybus: Remove redundant license text
[mirror_ubuntu-bionic-kernel.git] / drivers / staging / greybus / interface.h
CommitLineData
eb50fd3a 1// SPDX-License-Identifier: GPL-2.0
e1e9dbdd 2/*
4ec7b079 3 * Greybus Interface Block code
e1e9dbdd
AE
4 *
5 * Copyright 2014 Google Inc.
a46e9671 6 * Copyright 2014 Linaro Ltd.
e1e9dbdd
AE
7 */
8
a93938a2
GKH
9#ifndef __INTERFACE_H
10#define __INTERFACE_H
e1e9dbdd 11
a212b758
JH
12enum gb_interface_type {
13 GB_INTERFACE_TYPE_INVALID = 0,
14 GB_INTERFACE_TYPE_UNKNOWN,
15 GB_INTERFACE_TYPE_DUMMY,
16 GB_INTERFACE_TYPE_UNIPRO,
17 GB_INTERFACE_TYPE_GREYBUS,
18};
19
ec199ccd 20#define GB_INTERFACE_QUIRK_NO_CPORT_FEATURES BIT(0)
792db396 21#define GB_INTERFACE_QUIRK_NO_INIT_STATUS BIT(1)
23931ffb 22#define GB_INTERFACE_QUIRK_NO_GMP_IDS BIT(2)
d9fa3494 23#define GB_INTERFACE_QUIRK_FORCED_DISABLE BIT(3)
55742d2a 24#define GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH BIT(4)
47cbaf5e 25#define GB_INTERFACE_QUIRK_NO_BUNDLE_ACTIVATE BIT(5)
0c543f9b 26#define GB_INTERFACE_QUIRK_NO_PM BIT(6)
ec199ccd 27
4ab9b3c2 28struct gb_interface {
e1e9dbdd 29 struct device dev;
cdee4f75 30 struct gb_control *control;
e1e9dbdd 31
e232b791 32 struct list_head bundles;
b15d97d7 33 struct list_head module_node;
86cad666 34 struct list_head manifest_descs;
df671553 35 u8 interface_id; /* Physical location within the Endo */
e9f2f688 36 u8 device_id;
8c81d460 37 u8 features; /* Feature flags set in the manifest */
a212b758
JH
38
39 enum gb_interface_type type;
e1e9dbdd 40
b32a5c53
VK
41 u32 ddbl1_manufacturer_id;
42 u32 ddbl1_product_id;
9f59263a
JH
43 u32 vendor_id;
44 u32 product_id;
57c6bcc6 45 u64 serial_number;
3944a454 46
2537636a 47 struct gb_host_device *hd;
b15d97d7 48 struct gb_module *module;
1575ef18 49
ec199ccd
JH
50 unsigned long quirks;
51
36602a29
JH
52 struct mutex mutex;
53
141af4f0 54 bool disconnected;
55742d2a 55
36602a29 56 bool ejected;
12169bc9 57 bool removed;
1e1565e5 58 bool active;
49605839 59 bool enabled;
55742d2a 60 bool mode_switch;
27b9e257 61 bool dme_read;
55742d2a
JH
62
63 struct work_struct mode_switch_work;
64 struct completion mode_switch_completion;
e1e9dbdd 65};
4ab9b3c2 66#define to_gb_interface(d) container_of(d, struct gb_interface, dev)
e1e9dbdd 67
b15d97d7 68struct gb_interface *gb_interface_create(struct gb_module *module,
6c68da26 69 u8 interface_id);
4d5f6218
JH
70int gb_interface_activate(struct gb_interface *intf);
71void gb_interface_deactivate(struct gb_interface *intf);
35580af0 72int gb_interface_enable(struct gb_interface *intf);
629c0d00 73void gb_interface_disable(struct gb_interface *intf);
7a137fb2 74int gb_interface_add(struct gb_interface *intf);
b15d97d7
JH
75void gb_interface_del(struct gb_interface *intf);
76void gb_interface_put(struct gb_interface *intf);
55742d2a
JH
77void gb_interface_mailbox_event(struct gb_interface *intf, u16 result,
78 u32 mailbox);
79
80int gb_interface_request_mode_switch(struct gb_interface *intf);
13e6aacf 81
a93938a2 82#endif /* __INTERFACE_H */