diff options
author | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-11-03 19:12:34 +0000 |
---|---|---|
committer | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-11-03 19:12:34 +0000 |
commit | 6ea7ec75d2fe0dd52bc3e86135412bfc92c3158c (patch) | |
tree | 1b900bd32ce90c62703905c460db950c7c2ba9ec /package/lqtapi/src/mps/vmmc-module.h | |
parent | 74f6f2f5a244b9ba7aec5d7114fe763f8c20e96c (diff) |
[ifxmips]
* adds a rewrite of the tapi drivers + sip app. this is the result of lars' gsoc 2010 project, Thanks !
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23840 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/lqtapi/src/mps/vmmc-module.h')
-rw-r--r-- | package/lqtapi/src/mps/vmmc-module.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/package/lqtapi/src/mps/vmmc-module.h b/package/lqtapi/src/mps/vmmc-module.h new file mode 100644 index 0000000000..b598d0dcd9 --- /dev/null +++ b/package/lqtapi/src/mps/vmmc-module.h @@ -0,0 +1,64 @@ +#ifndef __VMMC_MODULE_H__ +#define __VMMC_MODULE_H__ + +#include <linux/list.h> +#include <linux/kernel.h> +#include <linux/tapi/tapi.h> + +struct vmmc_module; + +struct vmmc_module_ops { + int (*sync)(struct vmmc_module *); + int (*enable)(struct vmmc_module *, bool enable); +}; + +struct vmmc_module +{ + unsigned int id; + + size_t num_pins; + unsigned int *pins; + + const struct vmmc_module_ops *ops; + + unsigned long flags; +#define VMMC_MODULE_FLAG_PIN_USED(x) (x) +#define VMMC_MODULE_FLAG_MODIFIED 31 + struct mutex lock; + struct list_head head; + + unsigned int refcount; +}; + +int vmmc_module_init(struct vmmc_module *module, size_t num_pins, + const struct vmmc_module_ops *ops); +int vmmc_module_sync(struct vmmc_module *module); + +struct vmmc_link { + struct vmmc_module *modules[2]; + unsigned int pins[2]; +}; + +struct vmmc_endpoint { + struct tapi_endpoint ep; + struct vmmc_module *module; +}; + +void vmmc_link_enable(struct vmmc_link *link); +void vmmc_link_disable(struct vmmc_link *link); +unsigned int vmmc_link_init(struct vmmc_link *link, + struct vmmc_module *a, struct vmmc_module *b); +void vmmc_link_put(struct vmmc_link *link); + +int vmmc_module_get_pin(struct vmmc_module *module); +void vmmc_module_put_pin(struct vmmc_module *module, unsigned int pin); +void vmmc_module_set_pin_input(struct vmmc_module *module, unsigned int pin, + struct vmmc_module *input); + + +static inline struct vmmc_module *tapi_endpoint_to_vmmc_module(struct tapi_endpoint *ep) +{ + return tapi_endpoint_get_data(ep); +} + +#endif |