only support EABI on ARM targets
[openwrt.git] / package / lqtapi / src / mps / vmmc-module.h
1 #ifndef __VMMC_MODULE_H__
2 #define __VMMC_MODULE_H__
3
4 #include <linux/list.h>
5 #include <linux/kernel.h>
6 #include <linux/tapi/tapi.h>
7
8 struct vmmc_module;
9
10 struct vmmc_module_ops {
11 int (*sync)(struct vmmc_module *);
12 int (*enable)(struct vmmc_module *, bool enable);
13 };
14
15 struct vmmc_module
16 {
17 unsigned int id;
18
19 size_t num_pins;
20 unsigned int *pins;
21
22 const struct vmmc_module_ops *ops;
23
24 unsigned long flags;
25 #define VMMC_MODULE_FLAG_PIN_USED(x) (x)
26 #define VMMC_MODULE_FLAG_MODIFIED 31
27 struct mutex lock;
28 struct list_head head;
29
30 unsigned int refcount;
31 };
32
33 int vmmc_module_init(struct vmmc_module *module, size_t num_pins,
34 const struct vmmc_module_ops *ops);
35 int vmmc_module_sync(struct vmmc_module *module);
36
37 struct vmmc_link {
38 struct vmmc_module *modules[2];
39 unsigned int pins[2];
40 };
41
42 struct vmmc_endpoint {
43 struct tapi_endpoint ep;
44 struct vmmc_module *module;
45 };
46
47 void vmmc_link_enable(struct vmmc_link *link);
48 void vmmc_link_disable(struct vmmc_link *link);
49 unsigned int vmmc_link_init(struct vmmc_link *link,
50 struct vmmc_module *a, struct vmmc_module *b);
51 void vmmc_link_put(struct vmmc_link *link);
52
53 int vmmc_module_get_pin(struct vmmc_module *module);
54 void vmmc_module_put_pin(struct vmmc_module *module, unsigned int pin);
55 void vmmc_module_set_pin_input(struct vmmc_module *module, unsigned int pin,
56 struct vmmc_module *input);
57
58
59 static inline struct vmmc_module *tapi_endpoint_to_vmmc_module(struct tapi_endpoint *ep)
60 {
61 return tapi_endpoint_get_data(ep);
62 }
63
64 #endif
This page took 0.045052 seconds and 5 git commands to generate.