[ifxmips]
[openwrt/svn-archive/archive.git] / package / lqtapi / src / mps / vmmc-alm.h
1 #ifndef __VMMC_ALM_H__
2 #define __VMMC_ALM_H__
3
4 #include "vmmc-module.h"
5
6 struct vmmc;
7 enum vmmc_alm_state {
8 VMMC_ALM_STATE_OFF = 0 << 16,
9 VMMC_ALM_STATE_ONHOOK = 1 << 16,
10 VMMC_ALM_STATE_RING = 3 << 16,
11 VMMC_ALM_STATE_ACTIVE = 2 << 16,
12 };
13
14 struct vmmc_alm {
15 struct vmmc *vmmc;
16 unsigned int id;
17
18 enum vmmc_alm_state state;
19
20 struct vmmc_module module;
21
22 uint32_t cmd_cache[3];
23 };
24
25 struct vmmc_alm_coef {
26 struct list_head list;
27 unsigned int offset;
28 size_t len;
29 uint32_t data[0];
30 };
31
32 int vmmc_alm_init(struct vmmc_alm *alm, struct vmmc *vmmc, unsigned int id);
33
34 int vmmc_alm_set_state(struct vmmc_alm *alm, enum vmmc_alm_state state);
35 enum vmmc_alm_state vmmc_alm_get_state(struct vmmc_alm *alm);
36
37 int vmcc_alm_set_coefficents(struct vmmc_alm *alm,
38 const struct vmmc_alm_coef *coef_list);
39
40 void vmmc_alm_hook_event_handler(struct vmmc *vmmc, uint32_t event, uint32_t data);
41
42 #endif