1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Greybus Module code
4 *
5 * Copyright 2016 Google Inc.
6 * Copyright 2016 Linaro Ltd.
7 */
8
9#ifndef __MODULE_H
10#define __MODULE_H
11
12#include <linux/types.h>
13#include <linux/device.h>
14
15struct gb_module {
16 struct device dev;
17 struct gb_host_device *hd;
18
19 struct list_head hd_node;
20
21 u8 module_id;
22 size_t num_interfaces;
23
24 bool disconnected;
25
26 struct gb_interface *interfaces[];
27};
28#define to_gb_module(d) container_of(d, struct gb_module, dev)
29
30struct gb_module *gb_module_create(struct gb_host_device *hd, u8 module_id,
31 size_t num_interfaces);
32int gb_module_add(struct gb_module *module);
33void gb_module_del(struct gb_module *module);
34void gb_module_put(struct gb_module *module);
35
36#endif /* __MODULE_H */
37

source code of linux/include/linux/greybus/module.h