diff options
author | John Crispin <john@openwrt.org> | 2010-11-03 19:12:34 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2010-11-03 19:12:34 +0000 |
commit | a8b2a07f375edefec242de9f20d4aefafa927517 (patch) | |
tree | d15f5bb696bfa9dfd9555788d411e0ba59b99a65 /package/lqtapi/src/mps/vmmc-module.h | |
parent | 72ae8452cda47d6e18e664097a4adbc0eee3fc7b (diff) | |
download | upstream-a8b2a07f375edefec242de9f20d4aefafa927517.tar.gz upstream-a8b2a07f375edefec242de9f20d4aefafa927517.tar.bz2 upstream-a8b2a07f375edefec242de9f20d4aefafa927517.zip |
* adds a rewrite of the tapi drivers + sip app. this is the result of lars' gsoc 2010 project, Thanks !
SVN-Revision: 23840
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 |