2019-08-25 08:54:21 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2014-10-02 06:54:11 +04:00
|
|
|
/*
|
2014-12-12 01:10:56 +03:00
|
|
|
* Greybus Interface Block code
|
2014-10-02 06:54:11 +04:00
|
|
|
*
|
|
|
|
* Copyright 2014 Google Inc.
|
2014-12-12 21:08:42 +03:00
|
|
|
* Copyright 2014 Linaro Ltd.
|
2014-10-02 06:54:11 +04:00
|
|
|
*/
|
|
|
|
|
2014-12-20 01:56:30 +03:00
|
|
|
#ifndef __INTERFACE_H
|
|
|
|
#define __INTERFACE_H
|
2014-10-02 06:54:11 +04:00
|
|
|
|
staging: greybus: add missing includes
Before moving greybus core out of staging and moving header files to
include/linux some greybus header files were missing the necessary
includes. This would trigger compilation faillures with some example
errors logged bellow for with CONFIG_KERNEL_HEADER_TEST=y.
So, add the necessary headers to compile clean before relocating the
header files.
./include/linux/greybus/hd.h:23:50: error: unknown type name 'u16'
int (*cport_disable)(struct gb_host_device *hd, u16 cport_id); ^~~
./include/linux/greybus/greybus_protocols.h:1314:2: error: unknown type name '__u8'
__u8 data[0];
^~~~
./include/linux/greybus/hd.h:24:52: error: unknown type name 'u16'
int (*cport_connected)(struct gb_host_device *hd, u16 cport_id); ^~~
./include/linux/greybus/hd.h:25:48: error: unknown type name 'u16'
int (*cport_flush)(struct gb_host_device *hd, u16 cport_id); ^~~
./include/linux/greybus/hd.h:26:51: error: unknown type name 'u16'
int (*cport_shutdown)(struct gb_host_device *hd, u16 cport_id, ^~~
./include/linux/greybus/hd.h:27:5: error: unknown type name 'u8'
u8 phase, unsigned int timeout);
^~
./include/linux/greybus/hd.h:28:50: error: unknown type name 'u16'
int (*cport_quiesce)(struct gb_host_device *hd, u16 cport_id, ^~~
./include/linux/greybus/hd.h:29:5: error: unknown type name 'size_t'
size_t peer_space, unsigned int timeout);
^~~~~~
./include/linux/greybus/hd.h:29:5: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
./include/linux/greybus/hd.h:1:1:
+#include <stddef.h>
/* SPDX-License-Identifier: GPL-2.0 */
./include/linux/greybus/hd.h:29:5:
size_t peer_space, unsigned int timeout);
^~~~~~
./include/linux/greybus/hd.h:30:48: error: unknown type name 'u16'
int (*cport_clear)(struct gb_host_device *hd, u16 cport_id); ^~~
./include/linux/greybus/hd.h:32:49: error: unknown type name 'u16'
int (*message_send)(struct gb_host_device *hd, u16 dest_cport_id, ^~~
./include/linux/greybus/hd.h:33:32: error: unknown type name 'gfp_t'
struct gb_message *message, gfp_t gfp_mask); ^~~~~
./include/linux/greybus/hd.h:35:55: error: unknown type name 'u16'
int (*latency_tag_enable)(struct gb_host_device *hd, u16 cport_id);
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Gao Xiang <hsiangkao@aol.com>
Signed-off-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Link: https://lore.kernel.org/r/20190827155302.25704-1-rui.silva@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-27 18:53:02 +03:00
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/device.h>
|
|
|
|
|
2016-07-20 17:40:20 +03:00
|
|
|
enum gb_interface_type {
|
|
|
|
GB_INTERFACE_TYPE_INVALID = 0,
|
|
|
|
GB_INTERFACE_TYPE_UNKNOWN,
|
|
|
|
GB_INTERFACE_TYPE_DUMMY,
|
|
|
|
GB_INTERFACE_TYPE_UNIPRO,
|
|
|
|
GB_INTERFACE_TYPE_GREYBUS,
|
|
|
|
};
|
|
|
|
|
2016-03-30 01:56:03 +03:00
|
|
|
#define GB_INTERFACE_QUIRK_NO_CPORT_FEATURES BIT(0)
|
2016-05-09 15:40:10 +03:00
|
|
|
#define GB_INTERFACE_QUIRK_NO_INIT_STATUS BIT(1)
|
2016-07-28 12:40:53 +03:00
|
|
|
#define GB_INTERFACE_QUIRK_NO_GMP_IDS BIT(2)
|
2016-05-27 18:26:24 +03:00
|
|
|
#define GB_INTERFACE_QUIRK_FORCED_DISABLE BIT(3)
|
2016-05-27 18:26:40 +03:00
|
|
|
#define GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH BIT(4)
|
2016-07-26 23:41:03 +03:00
|
|
|
#define GB_INTERFACE_QUIRK_NO_BUNDLE_ACTIVATE BIT(5)
|
2016-07-26 23:41:04 +03:00
|
|
|
#define GB_INTERFACE_QUIRK_NO_PM BIT(6)
|
2016-03-30 01:56:03 +03:00
|
|
|
|
2014-12-20 01:56:31 +03:00
|
|
|
struct gb_interface {
|
2014-10-02 06:54:11 +04:00
|
|
|
struct device dev;
|
2015-06-22 14:12:26 +03:00
|
|
|
struct gb_control *control;
|
2014-10-02 06:54:11 +04:00
|
|
|
|
2014-12-20 01:56:29 +03:00
|
|
|
struct list_head bundles;
|
2016-04-23 19:47:24 +03:00
|
|
|
struct list_head module_node;
|
2014-12-24 02:16:50 +03:00
|
|
|
struct list_head manifest_descs;
|
2014-12-22 01:10:26 +03:00
|
|
|
u8 interface_id; /* Physical location within the Endo */
|
2016-03-30 01:56:06 +03:00
|
|
|
u8 device_id;
|
2016-05-15 21:37:49 +03:00
|
|
|
u8 features; /* Feature flags set in the manifest */
|
2016-07-20 17:40:20 +03:00
|
|
|
|
|
|
|
enum gb_interface_type type;
|
2014-10-02 06:54:11 +04:00
|
|
|
|
2015-12-22 19:34:33 +03:00
|
|
|
u32 ddbl1_manufacturer_id;
|
|
|
|
u32 ddbl1_product_id;
|
2015-11-25 17:58:56 +03:00
|
|
|
u32 vendor_id;
|
|
|
|
u32 product_id;
|
2015-12-28 09:29:00 +03:00
|
|
|
u64 serial_number;
|
2015-08-12 06:49:31 +03:00
|
|
|
|
2015-11-03 20:03:23 +03:00
|
|
|
struct gb_host_device *hd;
|
2016-04-23 19:47:24 +03:00
|
|
|
struct gb_module *module;
|
2015-10-07 22:40:24 +03:00
|
|
|
|
2016-03-30 01:56:03 +03:00
|
|
|
unsigned long quirks;
|
|
|
|
|
2016-04-23 19:47:25 +03:00
|
|
|
struct mutex mutex;
|
|
|
|
|
2015-12-15 17:28:57 +03:00
|
|
|
bool disconnected;
|
2016-05-27 18:26:40 +03:00
|
|
|
|
2016-04-23 19:47:25 +03:00
|
|
|
bool ejected;
|
2016-07-20 17:40:24 +03:00
|
|
|
bool removed;
|
2016-04-23 19:47:26 +03:00
|
|
|
bool active;
|
2016-04-13 20:19:06 +03:00
|
|
|
bool enabled;
|
2016-05-27 18:26:40 +03:00
|
|
|
bool mode_switch;
|
2016-07-20 17:40:21 +03:00
|
|
|
bool dme_read;
|
2016-05-27 18:26:40 +03:00
|
|
|
|
|
|
|
struct work_struct mode_switch_work;
|
|
|
|
struct completion mode_switch_completion;
|
2014-10-02 06:54:11 +04:00
|
|
|
};
|
2014-12-20 01:56:31 +03:00
|
|
|
#define to_gb_interface(d) container_of(d, struct gb_interface, dev)
|
2014-10-02 06:54:11 +04:00
|
|
|
|
2016-04-23 19:47:24 +03:00
|
|
|
struct gb_interface *gb_interface_create(struct gb_module *module,
|
2015-06-22 14:12:27 +03:00
|
|
|
u8 interface_id);
|
2016-03-30 01:56:04 +03:00
|
|
|
int gb_interface_activate(struct gb_interface *intf);
|
|
|
|
void gb_interface_deactivate(struct gb_interface *intf);
|
2016-03-09 14:20:42 +03:00
|
|
|
int gb_interface_enable(struct gb_interface *intf);
|
2016-03-09 14:20:43 +03:00
|
|
|
void gb_interface_disable(struct gb_interface *intf);
|
2016-03-09 14:20:36 +03:00
|
|
|
int gb_interface_add(struct gb_interface *intf);
|
2016-04-23 19:47:24 +03:00
|
|
|
void gb_interface_del(struct gb_interface *intf);
|
|
|
|
void gb_interface_put(struct gb_interface *intf);
|
2016-05-27 18:26:40 +03:00
|
|
|
void gb_interface_mailbox_event(struct gb_interface *intf, u16 result,
|
|
|
|
u32 mailbox);
|
|
|
|
|
|
|
|
int gb_interface_request_mode_switch(struct gb_interface *intf);
|
2014-12-20 01:56:35 +03:00
|
|
|
|
2014-12-20 01:56:30 +03:00
|
|
|
#endif /* __INTERFACE_H */
|