0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef CTRESOURCE_H
0016 #define CTRESOURCE_H
0017
0018 #include <linux/types.h>
0019
0020 enum RSCTYP {
0021 SRC,
0022 SRCIMP,
0023 AMIXER,
0024 SUM,
0025 DAIO,
0026 NUM_RSCTYP
0027 };
0028
0029 struct rsc_ops;
0030
0031 struct rsc {
0032 u32 idx:12;
0033 u32 type:4;
0034 u32 conj:12;
0035 u32 msr:4;
0036 void *ctrl_blk;
0037 struct hw *hw;
0038 const struct rsc_ops *ops;
0039 };
0040
0041 struct rsc_ops {
0042 void (*master)(struct rsc *rsc);
0043 void (*next_conj)(struct rsc *rsc);
0044 int (*index)(const struct rsc *rsc);
0045
0046 int (*output_slot)(const struct rsc *rsc);
0047 };
0048
0049 int
0050 rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, struct hw *hw);
0051 int rsc_uninit(struct rsc *rsc);
0052
0053 struct rsc_mgr {
0054 enum RSCTYP type;
0055 unsigned int amount;
0056 unsigned int avail;
0057 unsigned char *rscs;
0058 void *ctrl_blk;
0059 struct hw *hw;
0060 };
0061
0062
0063 int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type,
0064 unsigned int amount, struct hw *hw);
0065 int rsc_mgr_uninit(struct rsc_mgr *mgr);
0066 int mgr_get_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int *ridx);
0067 int mgr_put_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int idx);
0068
0069 #endif