Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Greybus Module code
0004  *
0005  * Copyright 2016 Google Inc.
0006  * Copyright 2016 Linaro Ltd.
0007  */
0008 
0009 #ifndef __MODULE_H
0010 #define __MODULE_H
0011 
0012 #include <linux/types.h>
0013 #include <linux/device.h>
0014 
0015 struct gb_module {
0016     struct device dev;
0017     struct gb_host_device *hd;
0018 
0019     struct list_head hd_node;
0020 
0021     u8 module_id;
0022     size_t num_interfaces;
0023 
0024     bool disconnected;
0025 
0026     struct gb_interface *interfaces[];
0027 };
0028 #define to_gb_module(d) container_of(d, struct gb_module, dev)
0029 
0030 struct gb_module *gb_module_create(struct gb_host_device *hd, u8 module_id,
0031                    size_t num_interfaces);
0032 int gb_module_add(struct gb_module *module);
0033 void gb_module_del(struct gb_module *module);
0034 void gb_module_put(struct gb_module *module);
0035 
0036 #endif /* __MODULE_H */